07-09-2008 4:26 AM
Hi all,
I am calling 'BAPI_GOODSMVT_CREATE' from a program to create goods receipt with purchase order. Eventhough i am successfully creating the Goods Receipt , i am unable to display the error messages if Goods Receipt is not created.
Please help me on displaying the error messages by specifying procedure and coding ?
Thanks,
Vamshi.
07-09-2008 4:37 AM
Hi
CALL FUNCTION 'BAPI_GOODSMVT_CREATE'
EXPORTING
goodsmvt_header =
goodsmvt_code =
TESTRUN = ' '
IMPORTING
GOODSMVT_HEADRET =
MATERIALDOCUMENT =
MATDOCUMENTYEAR =
tables
goodsmvt_item =
GOODSMVT_SERIALNUMBER =
return =
In return table you will get all the errors which thrown by this BAPI. you can go in debug mode and check for the error msg.
Regards
Sowmya
Edited by: Sowmya Sahadevan on Jul 9, 2008 5:38 AM
07-09-2008 4:31 AM
Error and Success messages are returned in interface Table "RETURN" of FM ..BAPI_GOODSMVT_CREATE ....
You can loop on this table and write "MESSAGE" variable
Edited by: Sunil Kokane on Jul 9, 2008 9:05 AM
07-09-2008 4:37 AM
Hi
CALL FUNCTION 'BAPI_GOODSMVT_CREATE'
EXPORTING
goodsmvt_header =
goodsmvt_code =
TESTRUN = ' '
IMPORTING
GOODSMVT_HEADRET =
MATERIALDOCUMENT =
MATDOCUMENTYEAR =
tables
goodsmvt_item =
GOODSMVT_SERIALNUMBER =
return =
In return table you will get all the errors which thrown by this BAPI. you can go in debug mode and check for the error msg.
Regards
Sowmya
Edited by: Sowmya Sahadevan on Jul 9, 2008 5:38 AM
07-09-2008 4:40 AM
Hi sunil and sowmya,
Thanks for the quick reply.
I too know that error messages are in RETURN table . I passed IT_RETURN table to it.
But i don't how to retrieve error messages from this .
So, please provide sample code to display error records from RETURN table?
Thanks,
Vamshi.
07-09-2008 4:43 AM
Messages is formatted in MTEXT
data : MTEXT(255) type c.
if not t_return is initial.
message id t_return-id
type t_return-type
number t_return-number
INTO mtext
with t_return-message_v1
t_return-message_v2
t_return-message_v3
t_return-message_v4.
write : mtext
endif.
07-09-2008 7:16 AM
Hi sunil,
Thanks for the reply and it is very helpful.
Now i got the procedure .
Thanks,
Vamshi.
07-09-2008 7:21 AM
Hi,
.
.
DATA: LT_RETUTN TYPE TABLE OF BAPIRET2.
.
.
CALL FUNCTION 'BAPI_GOODSMVT_CREATE'
EXPORTING
goodsmvt_header =
goodsmvt_code =
TESTRUN = ' '
IMPORTING
GOODSMVT_HEADRET =
MATERIALDOCUMENT =
MATDOCUMENTYEAR =
TABLES
goodsmvt_item =
GOODSMVT_SERIALNUMBER =
return = lt_return.
.
ASSIGN OTHER PARAMETERS
You will get the message details in the lt_return internal table. Kindly refer the structure BAPIRET2 for the field details.
Hope, this will help you. Kindly reply if you need more details.
Reward, if it is useful ...
Regards,
SK.