Skip to Content
author's profile photo Former Member
Former Member

BAPI_SALESORDER_CHANGE Extensionin not working?

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.

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

4 Answers

  • author's profile photo Former Member
    Former Member
    Posted on Sep 12, 2007 at 06:10 AM
    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Sep 12, 2007 at 06:21 AM

    this code can update the field for VBAP,but can't update the field for VBAK.

    My requirement is update both VBAK and VBAP.

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Sep 12, 2007 at 06:38 AM

    Awaiting for your reply.

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Sep 12, 2007 at 07:25 AM

    hi Experts:

    I need your help.Don't skin a flint!

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.