2015 Mar 30 6:08 AM
Hi All,
I am using BAPI_SALESORDER_CHANGE in my Z program and it is throwing an error 'Enter Document Number' but I am passing document number as Input.
E |V1 |045 |Enter the document number
I have debugged and found out that VBAK-VBELN is getting cleared in the below code:
SALES_DOCUMENT_READ in lines 60 and 61:
60 VBAK-VBELN = DOCUMENT_NUMBER
61 PERFORM BELEG_LESEN(SAPMV45A)
Error will come from below part:
if vbak-vbeln is initial.
message e045.
endif.
Kindly help me in solving the above issue.
Thanks,
Waseem
2015 Mar 30 6:40 AM
Hi Waseem,
As mentioned in below SNOTE, call FM SD_SALES_DOCUMENT_INIT before BAPI_SALESORDER_CHANGE.
CALL FUNCTION 'SD_SALES_DOCUMENT_INIT'
EXPORTING
SIMULATION_MODE_BAPI = 'X'.Please go through below SNOTE to fix the issue.