Skip to Content
0
Former Member
Sep 12, 2007 at 06:08 AM

BAPI_SALESORDER_CHANGE Extensionin not working?

76 Views

Hi guys,

The issue here is I can't update the field ZZSGID for VBAK table.

Is there something missing for EXTENSIONIN that I've done?

need some help urgently!

below is the code:

PARAMETERS: P_VBELN TYPE VBAK-VBELN.

DATA: T_LINE LIKE BAPISDITM OCCURS 0 WITH HEADER LINE.

DATA: T_LINEX LIKE BAPISDITMX OCCURS 0 WITH HEADER LINE.

DATA: T_EXTEN LIKE BAPIPAREX OCCURS 0 WITH HEADER LINE.

DATA: T_RETURN LIKE BAPIRET2 OCCURS 0 WITH HEADER LINE.

DATA: BAPE_VBAP LIKE BAPE_VBAP.

DATA: BAPE_VBAPX LIKE BAPE_VBAPX.

DATA: ORDER_HEADERX LIKE BAPISDH1X.

DATA: BAPE_VBAK LIKE BAPE_VBAK.

DATA: BAPE_VBAKX LIKE BAPE_VBAKX.

DATA: W_RETURN LIKE BAPIRET2.

ORDER_HEADERX-UPDATEFLAG = 'U'.

T_LINE-ITM_NUMBER = '000010'.

APPEND T_LINE.

T_LINEX-ITM_NUMBER = '000010'.

T_LINEX-UPDATEFLAG = 'U'.

APPEND T_LINEX.

BAPE_VBAK-VBELN = P_VBELN.

BAPE_VBAK-ZZSGID = 'KELVIN'.

T_EXTEN-STRUCTURE = 'BAPE_VBAK'.

T_EXTEN+10 = BAPE_VBAK.

APPEND T_EXTEN.

BAPE_VBAKX-VBELN = P_VBELN.

BAPE_VBAKX-ZZSGID = 'X'.

T_EXTEN-STRUCTURE = 'BAPE_VBAKX'.

T_EXTEN+10 = BAPE_VBAKX.

APPEND T_EXTEN.

BAPE_VBAP-VBELN = P_VBELN.

BAPE_VBAP-POSNR = '000010'.

BAPE_VBAP-ZZSMC = 'A'.

T_EXTEN-STRUCTURE = 'BAPE_VBAP'.

T_EXTEN+30 = BAPE_VBAP.

APPEND T_EXTEN.

BAPE_VBAPX-VBELN = P_VBELN.

BAPE_VBAPX-POSNR = '000010'.

BAPE_VBAPX-ZZSMC = 'X'.

T_EXTEN-STRUCTURE = 'BAPE_VBAPX'.

T_EXTEN+30 = BAPE_VBAPX.

APPEND T_EXTEN.

CALL FUNCTION 'BAPI_SALESORDER_CHANGE'

EXPORTING

salesdocument = p_vbeln

order_header_inx = ORDER_HEADERX

tables

return = T_RETURN

ORDER_ITEM_IN = T_LINE

ORDER_ITEM_INX = T_LINEX

EXTENSIONIN = T_EXTEN.

call function 'BAPI_TRANSACTION_COMMIT'

  • EXPORTING

  • WAIT =

  • IMPORTING

  • RETURN =

.

CLEAR: W_RETURN.

LOOP AT T_RETURN INTO W_RETURN.

WRITE: W_RETURN-MESSAGE,/.

ENDLOOP.