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: 

Extension BAPI_SALESORDER_CHANGE not working

former_member635273
Participant
955

I face problem with extension bapi_salerorder_change not work, this my code

salesdocument = '1001000576'.
order_header_inx-updateflag = 'U'.

"for exttenstion fields
gs_bape_vbak-vbeln = '1001000576'.
gs_bape_vbak-zzvalidfrom = '20201230'.

gs_extensionin-structure = 'BAPE_VBAK'.
gs_extensionin-valuepart1 = gs_bape_vbak.
APPEND gs_extensionin TO extensionin.

gs_bape_vbakx-zzvalidfrom = 'X'.

gs_extensionin-structure = 'BAPE_VBAKX'.
gs_extensionin-valuepart1 = gs_bape_vbakx.
APPEND gs_extensionin TO extensionin.

CALL FUNCTION 'BAPI_SALESORDER_CHANGE'
EXPORTING
salesdocument = salesdocument
* ORDER_HEADER_IN =
order_header_inx = order_header_inx
* SIMULATION =
* BEHAVE_WHEN_ERROR = ' '
* INT_NUMBER_ASSIGNMENT = ' '
* LOGIC_SWITCH =
* NO_STATUS_BUF_INIT = ' '
TABLES
return = return
extensionin = extensionin.

IF sy-subrc = 0.
CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'
EXPORTING
wait = 'X'.
ENDIF.

I already chek the return value, there is no error and success. but my sales document does not change .

Thanks in advance.

4 REPLIES 4

thkolz
Contributor
0 Kudos
812

Maybe you need to add the following:

gs_bape_vbakx-vbeln         = '1001000576'.

thkolz
Contributor
0 Kudos
812

Additionally, it's always good to fill the extension like that:

      DATA:
        s_extension TYPE bapiparex,
        v_value     TYPE c LENGTH 960.

      CALL METHOD cl_abap_container_utilities=>fill_container_c
        EXPORTING
          im_value               = gs_bape_vbak
       IMPORTING
          ex_container           = v_value
        EXCEPTIONS
          illegal_parameter_type = 1
          OTHERS                 = 2.

      s_extension-valuepart1 = v_value(240).
      s_extension-valuepart2 = v_value+240(240).
      s_extension-valuepart3 = v_value+480(240).
      s_extension-valuepart4 = v_value+720(240).
      APPEND s_extension TO et_extension.

0 Kudos
812

Hi c12b61ded10b4e18beae75c3b6218d2c , I have tried to add gs_bape_vbakx-vbeln = '1001000576' and fill extension like you recommend but still not work.

this return value

field of zzvalidfrom still not changes.

raymond_giuseppi
Active Contributor
0 Kudos
812

Look at answers of exact same question such as BAPI_SALESORDER_CHANGE - Extension Not Working - In App Extensibility