Skip to Content
avatar image
Former Member

Clear Static Variable in FM 'BAPI_PRICES_CONDITIONS'

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

Add comment
10|10000 characters needed characters exceeded

  • Follow
  • Get RSS Feed

2 Answers

  • Best Answer
    avatar image
    Former Member
    Sep 23, 2008 at 04:43 PM

    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

    Add comment
    10|10000 characters needed characters exceeded

  • Apr 04, 2012 at 12:13 PM

    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

    Add comment
    10|10000 characters needed characters exceeded