‎2007 Jan 31 4:21 AM
Hi all,
Iam using the goods mvt bapi 'BAPI_GOODSMVT_CREATE' for goods reciept. I get a information message when posting the document directly from migo. But do not get any information message while using the bapi. The return table is empty. Can any tell me how to get the information messages.
Thanks,
Rajesh.
Message was edited by:
Rajesh Kumar
‎2007 Jan 31 4:26 AM
Rajesh,
For FM 'BAPI_GOODSMVT_CREATE' when there is some error in the BAPI it populates the return table. If it executed successfully the return table is blanck but you get the generated document no in parameter 'materialdocument'. Please check the below code it will give you more idea....
CALL FUNCTION 'BAPI_GOODSMVT_CREATE'
EXPORTING
goodsmvt_header = l_goodsmvt_header
goodsmvt_code = l_goodsmvt_code
IMPORTING
goodsmvt_headret = l_goodsmvt_headret
materialdocument = ch_matdoc
MATDOCUMENTYEAR =
TABLES
goodsmvt_item = l_goodsmvt_itemtab
goodsmvt_serialnumber = l_goodsmvt_serialnumbertab
return = l_returntab.
LOOP AT l_returntab INTO l_return.
IF l_return-type = 'E' OR l_return-type = 'A'.
MESSAGE ID l_return-id TYPE 'I' NUMBER l_return-number
WITH l_return-message_v1 l_return-message_v2
l_return-message_v3 l_return-message_v4.
Error -> Raise Action stopped and don't save notification!!
RAISE action_stopped.
EXIT.
ENDIF.
ENDLOOP.
MESSAGE s027(zz) WITH ch_matdoc 'document created'.
‎2007 Jan 31 4:29 AM
it will return Material Document Number and Year , u have get it frm import params of that BAPI.
<b> call function 'BAPI_GOODSMVT_CREATE'
exporting
goodsmvt_header = l_gheader
goodsmvt_code = '05'
importing
goodsmvt_headret = l_goodsmvt_headret
materialdocument = l_materialdocument
matdocumentyear = l_matdocumentyear
tables
goodsmvt_item = i_gitem
return = i_return.
if i_return[] is initial.
commit work and wait.
call function 'DEQUEUE_ALL'.
if sy-subrc = 0.
write: l_materialdocument.
endif.</b>
Regards
Prabhu
‎2007 Jan 31 4:39 AM
Hi,
while doing a goods reciept using migo i get a warning message. Iam able to post. But in bapi, where can i get the same warning message..
is it possible.
Thanks,
Rajesh.
‎2007 Jan 31 4:51 AM
No Rajesh,
As I said, you get return messages only if the BAPI fails... that is either E or A type.
Susanth