Quantcast
Channel: SCN : Unanswered Discussions - ABAP Testing and Troubleshooting
Viewing all 430 articles
Browse latest View live

Issue in Smartform

$
0
0

Just think that i take two values in two different line in sequence up and down in smrtform.

and i want that when first  value absent then second value take place and there is no gap at upper side. how to do just give some solution.   

Thanks in  advance


How to delete lock entries generated by the function module "BAPI_OBJCL_CHANGE"

$
0
0

Hi experts,

 

I'm now trying to make an add-on program

which updates material master information by the background job.

 

To update the "Classification" view of material master,

the program calls the function module "BAPI_OBJCL_CHANGE".

If the "RETURN" information is valid,

then the program calls "BAPI_TRANSACTION_COMMIT" (with the "wait" parameter 'X').

 

Contrary to my intention,

lock entries generated by the function module "BAPI_OBJCL_CHANGE" remains after "BAPI_TRANSACTION_COMMIT".

As a result, the material updated remains locked until the add-on processing ends.

 

To shoot this trouble, I read some SCN discussions below:

 

<<lock unlock record>>

⇒ As I wrote above, I checked the parameter for "BAPI_TRANSACTION_COMMIT".

 

<<BAPI_OBJCL_CHANGE Lock Error !>>

⇒ I cannot call the function module "BAPI_OBJCL_CHANGE" with "IN UPDATE TASK" option

because of "BAPI_OBJCL_CHANGE" attributes.

("BAPI_OBJCL_CHANGE" is not a "Update Module".)

 

How can I delete lock entries generated by the function module "BAPI_OBJCL_CHANGE" ?

 

Thanks in advance.

Tom

Invalidate buffer for specific table in ABAP

$
0
0

Hello,

 

we have a small table which continuously being read and seldom modified. Based on this assumptions we would like to fully buffer this table, using the standard SAP buffering.

 

Our problem comes with the synchronization mechanism. In this case the changes must be propagated to all instances immediately and not with the regular interval defined in rdisp/bufreftime. So once the change is done, the buffer for that table must be invalidated.

 

Since I know from where is this table modified, I would like to know if there is an ABAP FM or mechanism to trigger the invalidation of an specific table buffer. I have found FM SBUF_GENERIC_RESET, but I would appreciate any previous experience with this, or any other module, to perform this task.

 

Many thanks in advance.

 

Javier

Format excel file when it is downloaded

$
0
0

How to format excel file when it downloaded from SAP table

Exchange rate decimal places with 10 digits instead of the existing 5 digits

$
0
0

Hi,

 

We need to increase the exchange rate decimal places with 10 digits instead of the existing 5 digits.

 

For example, In AS400 the local currency value is given as 49978 (USD) and the exchange rate is @ 3.6735063451.

 

According to AS400, multiplying the foreign currency value with 10 decimal place value will give the below  value

 

ð  49978 * 3.6735063451 =  183594.50

 

 

According to SAP Standard, multiplying the foreign currency value with rounded off  5 decimal place value will give the below  value

 

ð  49978 * 3.67351 =  183594.683

 

Kindly let us know how to solve this issue.

 

Regards

 

Rajesh

How to protect PDF in ABAP ?

$
0
0

Hi All,

             Please let me know, how to protect PDF document using ABAP coding.

 

 

 

 

 

 

 

Regards,

Santhosh

Automatically Send email after Creating Invoice from VF01

$
0
0

Hello All,

Can any body has any idea how to generate pdf of invoice after user click on save of VF01 transaction.I create a Zdriver program and  create a new output type with medium 5 i.e for sending outside from sap, in my case the Driver program also not trigger i check in Debugg mode also.

I search and also found some use full link but still struggling to achieve it.Any idea

 

Thanks

Sam

BW End Routine Lookup Optimization

$
0
0

Dear SCNers,

 

I need some help with optimization of this code for a BW end routine. The Code is correct but the full load is going over 3 days now and still going on.

 

The code reads the DSO and populates internal tables with  CO document number, Fiscal year period, a custom fiscal year period and a Quantity which is summed .  In the look up I would like to stamp the fiscal year and Quantity if Docuement number and Fiscal year match.

 

I would appreciate any help. Thanks.

 

*Definition of Internal Tables


DATA: BEGIN OF I_S_COEPR,

Quantity type /BIC/OIZPRHRS,

     CO_DOC_NO type /BI0/OICO_DOC_NO,

     REF_DOC_NO type /BI0/OIREF_DOC_NO,

     fiscper type /BI0/OIFISCPER,

END OF I_S_COEPR.


DATA: i_t_coepr like table of I_S_COEPR.

 

 

*Then I have the end routine to read from internal tables

SELECT co_doc_no

            fiscper

            /bic/zaccfpper

       SUM( quantity ) as quantity

       INTO CORRESPONDING FIELDS OF TABLE i_t_coepr

       FROM /bic/azskfwbs00

       GROUP BY co_doc_no fiscper /bic/zaccfpper.

     IF sy-subrc EQ 0.

       SORT i_t_coepr BY co_doc_no.

     ENDIF.


* looping through result packages to assign the values if the conditions are met. I already tried using read table but it did not work

* read table i_t_COEPR into I_S_COEPR with key

*       CO_DOC_NO = <RESULT_FIELDS>-CO_DOC_NO FISCPER =

*       <RESULT_FIELDS>-FISCPER.

* this did not work so had to have additional loop


loop at RESULT_PACKAGE ASSIGNING <RESULT_FIELDS>.

      LOOP AT i_t_COEPR into I_S_COEPR

      Where

CO_DOC_NO = <RESULT_FIELDS>-CO_DOC_NO and

        fiscper = <RESULT_FIELDS>-FISCPER.

        if sy-subrc eq 0.

         <RESULT_FIELDS>-/bic/zFISCPER = I_S_COEPR-FISCPER.

         <RESULT_FIELDS>-/BIC/zprhrs = I_S_COEPR-Quantity.

         endif.

 

         ENDLOOP.

     endloop.



How to copy data to Internal table

$
0
0

Hi ABAP gurus,

 

I am new to ABAP programming. I am trying the copy data from a database Z table to an internal table. For the purpose I wrote the following code.

 

types: begin of t1,       "declaring the type of line.
employee
like zemployees_src-employee,
surname
like zemployees_src-surname,
forename
like zemployees_src-forename,
title like zemployees_src-title,
dob
like zemployees_src-dob,
end of t1.

types itab type standard table of t1.     "declaring the internal table type

data itab1 type itab.   "declaring the actual internal table
data wa_itab1 type t1.  "declaring the work area

select employee surname forename title dob from zemployees_src into wa_itab1.   "puting data into internal table through work area
append wa_itab1 to itab1.
endselect.

loop at itab1.
write / itab1.
endloop.


It is throwing the following error.

error.jpg


Please help me to resolve the problem and where I am making the mistake.

MESSAGE_TYPE_X abap error while creating an user in new client

$
0
0

Error analysis

 

Short text of error message

No active plan version exists

 

     Long text of error message

 

     Diagnosis

          You must set an active plan version for this application

Procedure

          Set the active plan version in Customizing of Organizational Management or in Workflow in the step Set active plan version.

 

          Technical information about the message

 

               Message class........ "5W"

               Number...................  300

               Variable 1................  " "

               Variable 2................  " "

               Variable 3................  " "

               Variable 4................  " "

 

Please help me to resolve this ABAP runtime error.

 

Thank you.

Inbound Processing

$
0
0

Hi Experts,

 

  We have the Special user id specifically
created to receive emails.

 

The requirement is to send Notification mail to the emails
received after few verifications.

 

We have assigned the Z class in SO50 for this recipient
address.

 

And this Z class uses the interface IF_INBOUND_EXIT_BCS .

    

However, when an email is received in SOIN , this class is not getting triggered.

 

But, When I manually resend the mail in SOIN , I get the debugger
triggered and the class is getting called.

 

I placed a sample code to update a custom table through the
class.

 

And this works fine when the mail is resent.

Could anyone please help on this ?

 

Ideally the class should be triggered as and when an email
receives the inbox.

 

Thanks,

Theyana

Ecatt related issue

$
0
0


Hi All,

 

I am facing one issue with eCATT automation.

can we pass combination of 'hard coded value' & 'value from some local variable' to the some specific position  to a textbox togather?

Detail are as given blowe->

I recorder certain t-code using SAPGUI, and i entered few value in a 'multipul line text box'

 

for example this is the data which i have entered

'

*************************

material name -> '****'

*************************

quantity -2

type- raw

 

*************************

End detail

*************************

'

which is comming properly in a 'Value-> Text 'section of the structure editor of the eCATT command.

 

Now when ever i executes this script  'multipul line text box' filled up with the same value, which is completly fine.

But in above given value i want to update material name value also which will come from some Import ecatt varible and may change also evrytime.

For exampel , in below example i am passing valie as Furniture which will come from varilable.

'

*************************

material name -> Furniture

*************************

quantity -2

type- raw

 

*************************

End detail

*************************

'

 

I could have done some concatination operations but it can not be done as i can not pass complet value using eCATT parameters.

In my example

'

*************************

material name -> '****'

*************************

quantity -2

type- raw

 

*************************

End detail

*************************

'

this complete structure kind of value should be hardcoded  but material name value (dipicted as  **** )sould come from Variable.

 

Could anyone tell me how it can be done or is it possible also or not?

Kindly have  a look.

ST12 ABAP trace TYPE DB vs DB->

$
0
0

Hi All,

 

A lot of times I have noticed that on my ST12 ABAP trace there are two types of DB calls. One represented as "DB" and other as "DB->".

 

Per my understanding:

 

"DB" represents database calls where data was picked from the db buffer

 

"DB->" represents database calls where a table was hit to get the required data.

 

Can anyone help explain the difference between the two? And correct me if my understanding is wrong. Also help share a list of Types and meaning of each.

 

Regards,

Anuj Kumar

Temporary STMS configuration

$
0
0

Hi Experts,

 

STMS is already configured in our landscape (DEV->QAS->PRD) by default, now we need a transport route to be enabled between DEV and sandbox system for temporary purpose. I have configured that route too, but when we release any TR request from the source system (DEV) and keeping the target as sandbox system , the TR moves to QAS(by default)

 

Kindly help me out to move the TR. We are not allowed to move in OS level too.

 

Thanks,

Preetha

How to delete lock entries generated by the function module "BAPI_OBJCL_CHANGE"

$
0
0

Hi experts,

 

I'm now trying to make an add-on program

which updates material master information by the background job.

 

To update the "Classification" view of material master,

the program calls the function module "BAPI_OBJCL_CHANGE".

If the "RETURN" information is valid,

then the program calls "BAPI_TRANSACTION_COMMIT" (with the "wait" parameter 'X').

 

Contrary to my intention,

lock entries generated by the function module "BAPI_OBJCL_CHANGE" remains after "BAPI_TRANSACTION_COMMIT".

As a result, the material updated remains locked until the add-on processing ends.

 

To shoot this trouble, I read some SCN discussions below:

 

<<lock unlock record>>

⇒ As I wrote above, I checked the parameter for "BAPI_TRANSACTION_COMMIT".

 

<<BAPI_OBJCL_CHANGE Lock Error !>>

⇒ I cannot call the function module "BAPI_OBJCL_CHANGE" with "IN UPDATE TASK" option

because of "BAPI_OBJCL_CHANGE" attributes.

("BAPI_OBJCL_CHANGE" is not a "Update Module".)

 

How can I delete lock entries generated by the function module "BAPI_OBJCL_CHANGE" ?

 

Thanks in advance.

Tom


eCATT- : Issue with GETGUI

$
0
0

Hi All,

As per the requirement I need to GETGUI below given data which is in the single large size textbox and then need to
validate it using CHEVAR.

 

BKPF-BLART <> 'UE' AND

BKPF-BLART <> 'UN' AND

BKPF-BLART <> 'SB' AND

BKPF-BLART <> 'SK' AND

BKPF-BLART <> 'DA' AND

BKPF-BLART <> 'DB' AND

BKPF-XREF2_HD = '' '

 

I am able to do GETGUI successfully, complete data is getting displayed in the expected value section of command interface in structure
editor.

But while executing when I am trying to pass captured data (from screen) to local variable, Local variable is containing value ‘STR-DATA-01’, hence I am not able to validate the real data at all. Here real data exist inside ‘STR-DATA-01’ .

is there any way to access data from ‘STR-DATA-01’??

Or anyone could tell me how above mentioned issue can be resolved?

 

Screen shot has been attached to get the clear understanding of the issue.

Thanx & Regard,

Ashish

eCATT- : Issue with CHEVAR comparision

$
0
0

Hi All,

As per the requirement I need to GETGUI below given data and then need to validate it using CHEVAR.

 

'BKPF-BLART <> 'UE' AND

BKPF-BLART <> 'UN' AND

BKPF-BLART’

 

As per the requirement, only below given part of data needs to be validated.

 

‘BKPF-BLART <> 'UE' AND

BKPF-BLART <> 'UN' AND’

 

Hence I have captured the complete data using GETGUI from screen and
then trimmed it to the required length and save to the local variable ‘V_PREREQUISITE_006’.

 

One Import variable ‘I_PREREQUISITE_006’ was having the data against which validation needs to be done.

Then I used CHEVAR command to validate it.

 

CHEVAR( V_PREREQUISITE_006 = I_PREREQUISITE_006 ).

Here CHEVAR is falling as data stored in local variable has one extra space at the end which is not there in Import parameter value.

 

But both variables has the same length 46 CHAR and complete string length also is 46 CHAR 

Hence there is no question of extra space in local variable.

 

But when I am opening failed CHEVAR log there we can see 1 extra space at the end.

Could anyone tell how to resolve it?

Screen shot has been attached to get the clear understanding of the issue.

 

Thanx & Regard,

Ashish

How to avoid data selection inside the loop?

$
0
0

Hello Experts,

 

I am working on one performance item and I have already applied some changes to the original version.

 

Now, If I compare my new program with old program, I have good improvement in performance. I am checking if I can do anything on statements that are top on the below list. I think 40% for Modify statement is acceptable after my research (Below run is updating around 20M records which is real time volume for this application).

 

perf.png

 

As we can see 34% of run time to going for one SELECT query on custom table. Take a look at below high level flow of my program to understand above select query.

 

1. Select data from ZABC

2. Select data from Variant Table (Var1, Var2, Var3 etc.., 12 in real time)

3. Loop Variant Table

4. Select data from X, Y, Z table for Var<n>.

5. Populate final internal table from ZABC, X, Y and Z table

6. Modify ZTABLE with Final Internal table data

7. End Loop on Variant Table

 

As described in the flow of the program, ZABC table data is common for all the variants and need not to fetch multiple times. Hence I am doing it only once in my program. Below is that select query:

 

select rrcty ryear rbukrs racct rcntr sum( amt1) as amt1  "Like I have 32 amount fields in original query           from zabc            into table i_zabc            where ryear in r_year    " Two records in ranges with I and EQ            and rvers = '001'            and rrcty in r_rrcty        "Three records in ranges with I and EQ            and rldnr = 'DT'            group by rrcty ryear rbukrs racct rcntr            order by rrcty ryear rbukrs racct rcntr.

ZABC table is again having huge volume of data and we are fetching millions of records with above query. That is primary reason to take long time. May be that is okay as I am already using Indexes of this table. But, I am not comfortable with it as it can reach max. memory point and through run time error. Fetch Cursor is one reliable option that I can see here, but with that, I should move ZABC selection inside the variant loop which can cause fetching ZABC data 12 times (Let me know If I am missing anything here).


Now, third statement in my trace results, with 10% of overall time is this:

 

loop at i_abc assigning <fs_abc>. 

... 

loop at i_table assigning <fs_table> where low <= <fs_abc>-racct and high >= <fs_abc>-racct. 

... 

endloop. 

...

endloop. 

6 million executions with this complex WHERE condition is causing this statement to get 3rd position in trace results. I tried below two options which are, I think, taking even more time - (I am still monitoring these options)

1) Removed WHERE condition on LOW, HIGH and applied filter inside the loop.

2) Removed WHERE condition on HIGH only and applied filter inside the loop.

 

Any suggestions on how to proceed with ZABC selection and I_TABLE loop.

 

Let me know if you have any questions on above compose.

Error Handling in ABAP

$
0
0


Hello,

 

Is anyone has any doucment or guidelines for error handling in ABAP.

 

Basically we are looking for error handling mechanisma for mulitple scenario like forground, background ,  ALE/IDOc etc.

 

Thnx in advace for help

 

 

Regards,

Archana Raje.

Runtime Errors MOVE_TO_LIT_NOTALLOWED_NODATA

$
0
0

I am getting this error when i perform sum in ALV on particular field.

 

Runtime Errors        MOVE_TO_LIT_NOTALLOWED_NODATA                                               

Date and Time          08.05.2014 04:40:38                                                         

                                                                                                   

 

Short text                                                                                       
    Error at assignment: Overwritten protected field.                                           

 

What happened?                                                                                   
    Error in the ABAP Application Program                                                       
   
    The current ABAP program "SAPLKKBL" had to be terminated because it has                     
    come across a statement that unfortunately cannot be executed.                               


What can you do?                                                                                 
    Note down which actions and inputs caused the error.                                         
   
   
    To process the problem further, contact you SAP system                                       
    administrator.                                                                               
   
    Using Transaction ST22 for ABAP Dump Analysis, you can look                                 
    at and manage termination messages, and you can also                                         
    keep them for a long time.                                                                   

 

 

Error analysis                                                                                   
    A new value is to be assigned to the field "<L_UNIT>", although this field is               
    entirely or partly protected against changes.                                               
   
    The following are protected against changes:                                                 
    - Character literals or numeric literals                                                     
    - Constants (CONSTANTS)                                                                     
    - Parameters of the category IMPORTING REFERENCE for functions and                           
    methods                                                                                     
    - Untyped field symbols not yet assigned a field using ASSIGN                               
    - TABLES parameters if the actual parameter is protected against changes                     
    - USING reference parameters and CHANGING parameters for FORMs, if the                       
    actual parameter is protected against changes and                                           
    - Accesses using field symbols if the field assigned using ASSIGN is                         
    protected (or partially protected, e.g. key components of an internal                       
    table with the type SORTED or HASHED TABLE) against changes                                 
    - Accesses using references, if the field bound to the reference is                         
    protected (or partially protected) against changes                                           
    - External write accesses to READ-ONLY attributes,                                           
    - Content of a shared object area instance accessed using a shared lock                     
    (ATTACH_FOR_READ).     
Source Code Extract                                                                             
Line SourceCde                                                                                 
2975*        IF LS_FIELDCAT-NO_OUT NE 'X'.                                                     
2976*          LFLG_SHOW = 'X'.                                                               
2977*          EXIT.                                                                           
2978*        ENDIF.                                                                           
2979*      ENDIF.                                                                             
2980*    ENDLOOP.                                                                             
2981                                                                                           
2982*  Wenn die Einheit gleichzeitig das aktuelle                                             
2983*  Zwischensummenkriterium ist                                                           
2984    if ls_dep_field-s_dep_fieldcat-fieldname =          "INS K_SUBTOTEH                   
2985                      rs_sort-fieldname. "INS K_SUBTOTEH                                   
2986*    in einer Split-Zeile nie die Einheit ausgeben,                                       
2987*    da diese in der aktuellen Zwischensumme immer                                       
2988*    homogen sein muß und deshalb schon in der ersten                                     
2989*    Zeile ausgegeben wurde                                                               
2990      if vflg_splitline = 'X'.        "INS K_SUBTOTEH                                     
2991        clear lflg_show.              "INS K_SUBTOTEH                                     
2992*    in der ersten Zeile immer die Einheit ausgeben,                                     
2993*    da diese Zwischensummenkrit. ist und deshalb                                         
2994*    auch erscheinen muß, falls keine Kennzahl diese                                     
2995*    referenziert                                                                         
2996      else.                            "INS K_SUBTOTEH                                     
2997        lflg_show = 'X'.              "INS K_SUBTOTEH                                     
2998      endif.                          "INS K_SUBTOTEH                                     
2999    endif.                            "INS K_SUBTOTEH                                     
3000                                                                                           
3001    if lflg_show is initial.                                                               
3002*    assign component <ls_dep_field>-s_dep_fieldcat-fieldname                             
3003      assign component ls_dep_field-s_dep_fieldcat-fieldname                               
3004            of structure t_outtab to <l_unit>.                                           
>>>>>      clear <l_unit>.                                                                     
3006    endif.                                                                                 
3007  endloop.                                                                                 
3008                                                                                           
3009endform.                              " SPLIT_LINE_CHECK                                 
3010*&---------------------------------------------------------------------*                   
3011*&      Form  SUM_EXPA_SINGLE_NEW                                                         
3012*&---------------------------------------------------------------------*                   
3013*      text                                                                               
3014*----------------------------------------------------------------------*                   
3015*      -->P_LFLG_KOMP  text                                                               
3016*      -->P_L_SUBRC  text                                                                 
3017*----------------------------------------------------------------------*                   
3018form sum_expa_single_new using rflg_komp type c                                           
3019                              r_subrc like sy-subrc.                                     
3020                                                                                           
3021  data: ls_levels type kkblo_sort_extend.                                                 
3022  data: ls_groups type kkblo_grouplevels.                                                 
3023  data: ls_groups_static type kkblo_grouplevels.                                           
3024  data: l_subrc like sy-subrc.
Viewing all 430 articles
Browse latest View live


<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>