Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

Clear Static Variable in FM 'BAPI_PRICES_CONDITIONS'

Former Member
0 Kudos

Hi,

I am using 'BAPI_PRICES_CONDITIONS' to upload pricing data. When calling the BAPI repeatedly with different condition types it is giving dump with message 'DATA_OFFSET_TOO_LARGE'. This dump is due to the static variable defined and used to calculate the offset to read data from one of the character fields in include LCND_PRICES_INBOUNDF0G, line number 83. The length of the field VAKEY is 100 characters. When the BAPI is called for the 4th time and tries to get the value based on offset it gives a dump as the value in offset is exceeding 100 characters.

pc_vakey_oldsv_offset_kfrst(1) = ls_konh_old-vakeysv_offset_kfrst(1). - Its giving dump when the value in static variable sv_offset_kfrst exceeds 100.

Is there any way to clear the static variables declared in standard BAPI through our program before calling it recursively?

Best Regards,

Janani

1 ACCEPTED SOLUTION

Former Member
0 Kudos

Hi Janani,

You can normally get around problems like this by calling the BAPI in a separate session.

e.g. 
call 'BAPI_PRICES_CONDITIONS'
          destination 'NONE   
 tables
      ti_bapicondct        = gt_bapicondct
      ti_bapicondhd        = gt_bapicondhd
      ti_bapicondit        = gt_bapicondit
      ti_bapicondqs        = gt_bapicondqs
      ti_bapicondvs        = gt_bapicondvs
      to_bapiret2          = gt_bapiret2
      to_bapiknumhs        = gt_bapiknumhs
      to_mem_initial       = gt_mem_initial
   exceptions
     update_error         = 1
     others               = 2.

As this BAPI isn't RFC enabled you would have to wrap it in a bespoke version. The bespoke version having exactly the same interface but with the RFC attributes set, the code would simply call the normal BAPI.

Hope this helps.

Darren

3 REPLIES 3

Former Member
0 Kudos

Hi Janani,

You can normally get around problems like this by calling the BAPI in a separate session.

e.g. 
call 'BAPI_PRICES_CONDITIONS'
          destination 'NONE   
 tables
      ti_bapicondct        = gt_bapicondct
      ti_bapicondhd        = gt_bapicondhd
      ti_bapicondit        = gt_bapicondit
      ti_bapicondqs        = gt_bapicondqs
      ti_bapicondvs        = gt_bapicondvs
      to_bapiret2          = gt_bapiret2
      to_bapiknumhs        = gt_bapiknumhs
      to_mem_initial       = gt_mem_initial
   exceptions
     update_error         = 1
     others               = 2.

As this BAPI isn't RFC enabled you would have to wrap it in a bespoke version. The bespoke version having exactly the same interface but with the RFC attributes set, the code would simply call the normal BAPI.

Hope this helps.

Darren

0 Kudos

thanks a lot,

it really helped, solve my problem..

Regards,

Janani

raymond_giuseppi
Active Contributor
0 Kudos

Look at Note 1667278 - Condition upload: DATA_OFFSET_TOO_LARGE which should correct the problem

You wrote

its giving dump when the value in static variable sv_offset_kfrst exceeds 100.

Note correction ,

Delete Block                                                                                       
    LOOP AT lt_t681e_fields INTO ls_t681e_fields. 

Insert Block                                                                                       
    CLEAR sv_offset_kfrst. 
    LOOP AT lt_t681e_fields INTO ls_t681e_fields.

When problems arise in a standard program or FM look at OSS notes. (Look also at Note 1135984 - Conditions cannot be created with BAPI_PRICES_CONDITIONS for information)

Regards,

Raymond