‎2007 May 25 1:20 PM
I am trying to update material group in the sales order using BAPI "BAPI_SALESORDER_CHANGE".....
I am giving the following parameters but still i am not able to update....
Sales Doc No, Update flag as U, material no, item no, and the material group value to which it needs to be changed.
Even if i input the above parameters i am nt able to update material group....Its mentioned that key fields should be entered for changes so please help me if i need to input any more values.
Answers will be awarded...Thanks in advance
‎2007 May 25 1:22 PM
Hi,
Check this link,
https://forums.sdn.sap.com/click.jspa?searchID=2805623&messageID=2822667
thanks,
Reward if helpful.
‎2007 May 25 1:21 PM
Hello,
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,
Deepu.K
‎2007 May 25 1:22 PM
Hi,
Check this link,
https://forums.sdn.sap.com/click.jspa?searchID=2805623&messageID=2822667
thanks,
Reward if helpful.