10-06-2008 7:33 AM
Hi Experts,
I am using a BAPI which is giving me a return Internal table back loaded with the success, error and the warning messages. I would like to show those on my screen.
Can anyone tell me how to do it?.
Regards,
-=Soniya=-
10-06-2008 7:35 AM
You can simply write those msgs on screen after BAPI execution.
e.g. write 😕 t_return-message.
Or
You can create ALV report.
Regards,
Aparna
10-06-2008 7:35 AM
You can simply write those msgs on screen after BAPI execution.
e.g. write 😕 t_return-message.
Or
You can create ALV report.
Regards,
Aparna
10-06-2008 7:37 AM
Hi
Put the foll code:
Loop at it_ret into wa_ret.
write: / wa_ret-message. " you can add more fields also If u want.
Endloop.
Regards,
Vishwa.
10-06-2008 7:42 AM
Hi Soniya,
With this function, you can to get the message text.
CALL FUNCTION 'FORMAT_MESSAGE'
EXPORTING
ID = MSGID
LANG = SY-LANGU
NO = MSGNO
V1 = MSGV1
V2 = MSGV2
V3 = MSGV3
V4 = MSGV4
IMPORTING
MSG = V_MSG
EXCEPTIONS
NOT_FOUND = 1
OTHERS = 2
.
IF SY-SUBRC <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
Here, V_MSG has a length of 200 & is a character type variable.
Regards,
R.Nagarajan.
-
We can -
10-06-2008 7:45 AM
Hi,
We can show all mesages returned from BAPI in END-OF-SELECTION event.
Plz try this way:
*Internal table to hold messages from BAPI call
DATA: RETURN LIKE BAPIRET2 OCCURS 0 WITH HEADER LINE.
CALL FUNCTION 'BAPI_PO_CREATE1'
EXPORTING
POHEADER = HEADER
POHEADERX = HEADERX
* POADDRVENDOR =
* TESTRUN =
* IMPORTING
* EXPPURCHASEORDER =
* EXPHEADER =
* EXPPOEXPIMPHEADER =
TABLES
RETURN = RETURN
POITEM = ITEM
POITEMX = ITEMX.
*&---------------------------------------------------------------------*
*Confirm the document creation by calling database COMMIT
*&---------------------------------------------------------------------*
CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'
EXPORTING
WAIT = 'X'
* IMPORTING
* RETURN =
.
END-OF-SELECTION.
*&---------------------------------------------------------------------*
*Output the messages returned from BAPI call
*&---------------------------------------------------------------------*
LOOP AT RETURN.
WRITE / RETURN-MESSAGE.
ENDLOOP.
this will write data to screen.
thanx.
Edited by: Dhanashri Pawar on Oct 6, 2008 8:46 AM