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_SALESORDER_CHANGE

0 Likes
388

Hi,

i am getting probs with ....

data mapping for this BAPI FM...

1. I am not able upload the data into tables

plz help out

always throwing error messages

thanks.

Regards.

Hi,

i am getting probs with ....

data mapping for this BAPI FM...

1. I am not able upload the data into tables

plz help out

always throwing error messages

thanks.

Regards.

1 REPLY 1
Read only

Former Member
0 Likes
325

Hi Vishnu

You need to populate the field DLV_BLOCK and CUST_GROUP in ORDER_HEADER_IN and ORDER_HEADER_INX parameters.

Please try somethng like this.

DATA: LS_HEAD     TYPE BAPISDH1,
       LS_HEAD_X   TYPE BAPISDH1X,
       LT_MESSAGES LIKE BAPIRET2 OCCURS 5 WITH HEADER LINE.
 
 IF ACTIONCODE = 'AA'.
   MOVE SPACE TO LS_HEAD-DLV_BLOCK.
   MOVE 'AA'  TO LS_HEAD-CUST_GROUP.
   MOVE 'X'   TO LS_HEADX-DLV_BLOCK.
   MOVE 'X'   TO LS_HEADX-CUST_GROUP.
   MOVE 'U'   TO LS_HEADX-UPDATEFLAG.
 ELSEIF ACTIONCODE = 'AC'.
   MOVE SPACE TO LS_HEAD-DLV_BLOCK.
   MOVE 'AC'  TO LS_HEAD-CUST_GROUP.
   MOVE 'X'   TO LS_HEADX-DLV_BLOCK.
   MOVE 'X'   TO LS_HEADX-CUST_GROUP.
   MOVE 'U'   TO LS_HEADX-UPDATEFLAG.
 ELSE.
   ...
 ENDIF. 
 
 CALL FUNCTION 'BAPI_SALESORDER_CHANGE'
   EXPORTING
     SALESDOCUMENT       = LV_VBELN
     ORDER_HEADER_IN     = LS_HEAD
     ORDER_HEADER_INX    = LS_HEAD_X
   TABLES
     RETURN              = LT_MESSAGES.
 

...

Also please check this link for more sample codes.

http://sap4.com/wiki/index.php?title=BAPI_SALESORDER_CHANGE

Regards

Rk