2007 Jan 12 6:03 AM
hi i am using the following code for BAPI to change the SO but this is not working
i want to change the Reason of Rejection field in the SO.
kindly check the below code.
the return messages shows the SO is changed but its not doing that..
REPORT zbapi NO STANDARD PAGE HEADING LINE-SIZE 255.
DATA wa LIKE bapisdh1x.
DATA i_item LIKE bapisditm OCCURS 0 WITH HEADER LINE.
DATA i_item_x LIKE bapisditmx OCCURS 0 WITH HEADER LINE.
DATA i_return LIKE bapiret2 OCCURS 0 WITH HEADER LINE.
BREAK-POINT.
wa-updateflag = 'U'.
i_item-itm_number = '000030'.
i_item-reason_rej = 'A5'.
APPEND i_item.
i_item_x-itm_number = '000030'.
i_item_x-updateflag = 'U'.
i_item_x-reason_rej = 'X'.
APPEND i_item_x.
*
CALL FUNCTION 'BAPI_SALESORDER_CHANGE'
EXPORTING
salesdocument = '0205000665'
* ORDER_HEADER_IN =
order_header_inx = wa
* SIMULATION =
* BEHAVE_WHEN_ERROR = ' '
* INT_NUMBER_ASSIGNMENT = ' '
* LOGIC_SWITCH =
TABLES
return = i_return
order_item_in = i_item
order_item_inx = i_item_x
* PARTNERS =
* PARTNERCHANGES =
* PARTNERADDRESSES =
* ORDER_CFGS_REF =
* ORDER_CFGS_INST =
* ORDER_CFGS_PART_OF =
* ORDER_CFGS_VALUE =
* ORDER_CFGS_BLOB =
* ORDER_CFGS_VK =
* ORDER_CFGS_REFINST =
* SCHEDULE_LINES =
* SCHEDULE_LINESX =
* ORDER_TEXT =
* ORDER_KEYS =
* CONDITIONS_IN =
* CONDITIONS_INX =
* EXTENSIONIN =
.
CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'
* EXPORTING
* WAIT =
* IMPORTING
* RETURN =
.abhishek
Message was edited by:
Abhishek Suppal
2007 Jan 12 6:07 AM
Hi,
Your code looks good..Try add one zero in front of the order number
salesdocument = '<b>0205000665</b>'
Thanks,
Naren
hi i am using the following code for BAPI to change the SO but this is not working
i want to change the Reason of Rejection field in the SO.
kindly check the below code.
the return messages shows the SO is changed but its not doing that..
REPORT zbapi NO STANDARD PAGE HEADING LINE-SIZE 255.
DATA wa LIKE bapisdh1x.
DATA i_item LIKE bapisditm OCCURS 0 WITH HEADER LINE.
DATA i_item_x LIKE bapisditmx OCCURS 0 WITH HEADER LINE.
DATA i_return LIKE bapiret2 OCCURS 0 WITH HEADER LINE.
BREAK-POINT.
wa-updateflag = 'U'.
i_item-itm_number = '000030'.
i_item-reason_rej = 'A5'.
APPEND i_item.
i_item_x-itm_number = '000030'.
i_item_x-updateflag = 'U'.
i_item_x-reason_rej = 'X'.
APPEND i_item_x.
*
CALL FUNCTION 'BAPI_SALESORDER_CHANGE'
EXPORTING
salesdocument = '0205000665'
* ORDER_HEADER_IN =
order_header_inx = wa
* SIMULATION =
* BEHAVE_WHEN_ERROR = ' '
* INT_NUMBER_ASSIGNMENT = ' '
* LOGIC_SWITCH =
TABLES
return = i_return
order_item_in = i_item
order_item_inx = i_item_x
* PARTNERS =
* PARTNERCHANGES =
* PARTNERADDRESSES =
* ORDER_CFGS_REF =
* ORDER_CFGS_INST =
* ORDER_CFGS_PART_OF =
* ORDER_CFGS_VALUE =
* ORDER_CFGS_BLOB =
* ORDER_CFGS_VK =
* ORDER_CFGS_REFINST =
* SCHEDULE_LINES =
* SCHEDULE_LINESX =
* ORDER_TEXT =
* ORDER_KEYS =
* CONDITIONS_IN =
* CONDITIONS_INX =
* EXTENSIONIN =
.
CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'
* EXPORTING
* WAIT =
* IMPORTING
* RETURN =
.abhishek
Message was edited by:
Abhishek Suppal
2007 Jan 12 6:05 AM
Hi,
Instead of giving the SO number in a string, store it in a variable and try passing it to the FM.
Is there any preceding zeroes in the SO number?
Regards
Subramanian
2007 Jan 12 6:07 AM
Hi,
Your code looks good..Try add one zero in front of the order number
salesdocument = '<b>0205000665</b>'
Thanks,
Naren
2007 Jan 12 6:09 AM
Are you getting any error message in the return table?
Thanks & Regards,
Govind.
| User | Count |
|---|---|
| 6 | |
| 2 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |