Application Development and Automation 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: 
Read only

BAPI - BAPI_PR_CHANGE - not update proble

Former Member
0 Likes
1,316

Hi!

I'm trying to use BAPI_PR_CHANGE to change the value of a custom field added to EBAN table, with the CI_EBANDB structure.

When I try to change other value (for example in the PRITEM stucture) it's work fine, but for the custon fields it's not updating the new values.

Can you help me?

thanks.



  DATA: lt_bapimereqitemimp TYPE TABLE OF bapimereqitemimp ,
              llv_bapimereqitemimp LIKE bapimereqitemimp.

    lv_bapi_te_mereqitem-cod_presu = 'C123' .
    lv_bapi_te_mereqitem-ceco_ben = '0103476034' .
    lv_bapi_te_mereqitem-plazo = 12 .

    REFRESH  lt_extensionin.

    lv_extensionin-structure = 'BAPI_TE_MEREQITEM'.
    lv_extensionin-valuepart1 = lv_bapi_te_mereqitem .

    APPEND lv_extensionin TO lt_extensionin .

    CALL FUNCTION 'BAPI_PR_CHANGE'
      EXPORTING
        number                      = number
        prheader                    = lv_bapimereqheader
        prheaderx                   = lv_bapimereqheaderx
*        testrun                     = ' '
     IMPORTING
       prheaderexp                 = lt_prheaderexp
     TABLES
       return                      = return_tab
       pritem                      = lt_bapimereqitemimp
       pritemx                     = lt_bapimereqitemx
       pritemexp                   = lt_pritemexp
       pritemsource                = lt_pritemsource
       praccount                   = lt_praccount
       praccountproitsegment       = lt_praccountproitsegment
       praccountx                  = lt_praccountx
       praddrdelivery              = lt_praddrdelivery
       pritemtext                  = lt_pritemtext
       prheadertext                = lt_prheadertext
       extensionin                 = lt_extensionin
       extensionout                = lt_extensionout
       prversion                   = lt_prversion
       prversionx                  = lt_prversionx
       allversions                 = lt_allversions
              .

    CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'
        EXPORTING
          wait          = 'X'
*    IMPORTING
*      RETURN        =
                 .
*    lt_retun_change .
    COMMIT WORK AND WAIT .
   

1 REPLY 1
Read only

Former Member
0 Likes
716

I find the problem.

There is to populate a line of the 'extensionin' table with a new line with the structure 'BAPI_TE_MEREQITEMX' value

This is the new code that work for me:



    lv_extensionin-structure = 'BAPI_TE_MEREQITEM'.
    lv_extensionin-valuepart1 = lv_bapi_te_mereqitem .

    APPEND lv_extensionin TO lt_extensionin .

    lv_extensionin-structure = 'BAPI_TE_MEREQITEMX'.
    lv_extensionin-valuepart1 = '00010A020' .

    APPEND lv_extensionin TO lt_extensionin .