2014 Feb 27 5:25 PM
i have written the below code to update order reason using bapi.
it doesn't work.
can u tell the modifications that are required.
DATA:TBX type TABLE OF BAPISDH1X WITH HEADER LINE.
DATA:TB type TABLE OF BAPISDH1 WITH HEADER LINE.
PARAMETERS p_vbeln type bapivbeln-vbeln .
DATA:RETURN LIKE BAPIRET2 OCCURS 0 WITH HEADER LINE.
TB-ord_reason = 'P04'.
APPEND tb.
TBX-ord_reason = 'X'.
TBX-UPDATEFLAG = 'U'.
append tbx.
CALL FUNCTION 'BAPI_SALESORDER_CHANGE'
EXPORTING
SALESDOCUMENT = p_vbeln
ORDER_HEADER_IN = TB
ORDER_HEADER_INX = TBX
TABLES
RETURN = RETURN.
CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'
EXPORTING
WAIT = 'X'.
COMMIT WORK.
the error message returned by the bapi is "sales document type ywt not found".
2014 Feb 27 5:27 PM
the error message returned by the bapi is "sales document type ywt is not defined".
2014 Feb 27 5:39 PM
Hello,
Check TVAK table whether 'YWT' document type exists for not? For that you can go to Tcode OVAZ.
Thanks & Regards,
Abhijit