Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

Bapi - Return Information messages

Former Member
0 Likes
1,736

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

4 REPLIES 4
Read only

Former Member
0 Likes
682

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'.

Read only

Former Member
0 Likes
682

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

Read only

Former Member
0 Likes
682

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.

Read only

0 Likes
682

No Rajesh,

As I said, you get return messages only if the BAPI fails... that is either E or A type.

Susanth