12-06-2011 7:33 PM
Hi Expert,
I am suing BAPI BAPI_REPMANCONF1_CREATE_MTS.
I have given the input and i am not getting any errors.
i am getting the return value confirmation number also.
but if i check the material document number, material document number is not generated.
here my code.
LOOP AT IT_PLAF_STOCK_COPY.
x_bapi_rm_datgen-materialnr = it_plaf_stock_copy-matnr.
x_bapi_rm_datgen-prodplant = it_plaf_stock_copy-pwwrk.
x_bapi_rm_datgen-planplant = it_plaf_stock_copy-pwwrk.
x_bapi_rm_datgen-storageloc = it_plaf_stock_copy-lgort.
x_bapi_rm_datgen-prodversion = it_plaf_stock_copy-verid.
x_bapi_rm_datgen-postdate = p_budat.
x_bapi_rm_datgen-docdate = sy-datum.
x_bapi_rm_datgen-backflquant = it_plaf_stock_copy-gsmng.
x_bapi_rm_datgen-unitofmeasure = l1_meins.
x_BFLUSHFLAGS-BCKFLTYPE = 11.
x_BFLUSHFLAGS-COMPONENTS_TYPE = 1.
CALL FUNCTION 'BAPI_REPMANCONF1_CREATE_MTS'
EXPORTING
bflushflags = x_BFLUSHFLAGS
bflushdatagen = x_bapi_rm_datgen
BFLUSHDATAMTS = x_bflushdatamts
IMPORTING
CONFIRMATION = bfno
RETURN = e_ret.
if e_ret is initial.
CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'.
*EXPORTING
*wait = '1'.
endif.
ENDLOOP.
can any one please let me know what else parameter i need to pass to post the document.
12-06-2011 7:36 PM
Well, RETURN should never be empty; if it works, there should be some success messages. Have you debugged to see what's there?
Rob
12-07-2011 6:37 AM
I am getting success message as well as the confirmation number.
But if i check the material document number it is not generated material document number.
Can any one please tell whether i have missed any parameter or anything.
Thanks in advance.
Regards,
Zubera
12-07-2011 2:09 PM
if e_ret is initial. CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'. *EXPORTING *wait = '1'. endif. ENDLOOP.
You missed my point. Because you have success messages in RETURN,
if e_ret is initial.
fails and the COMMIT is not done.
Rob