04-19-2006 3:07 PM
Can anyone please give me sample code to fill the BAPI
return parameter. I am using BAPIRET2.
I am using like this:-
CLEAR ls_return.
CALL FUNCTION 'BALW_BAPIRETURN_GET2'
EXPORTING
type = 'E'
cl = SY-MSGID
number = SY-MSGNO
par1 = 'NO DATA FOUND'
par2 = sy-msgv2
par3 = sy-msgv3
par4 = sy-msgv4
LOG_NO = ' '
LOG_MSG_NO = ' '
PARAMETER = ' '
ROW = 0
FIELD = ' '
IMPORTING
return = ls_return
.
APPEND ls_return TO return.
EXIT.
Just i want error type and error message
04-19-2006 3:12 PM
Hi Christopher,
Are you building a custom BAPI?
If you are calling an existing bapi, then you don't need to fill it.
The bapi fills it and returns you the messages.
If you still want to fill it,
You can directly fill the values in th structure:
TYPE = s/w/a/e etc
ID = sy-msgid
NUMBER = sy-msgnr
MESSAGE =
LOG_NO
LOG_MSG_NO
MESSAGE_V1 = sy-msgv1
MESSAGE_V2= sy-msgv2
MESSAGE_V3= sy-msgv3
MESSAGE_V4= sy-msgv4
etc.
Regards,
Ravi
04-19-2006 3:17 PM
yes..i m building custom bapi
If there is an error..it should directly exit go to the BAPI return parameter?
04-19-2006 3:19 PM
if any error occurs fill BAPIRET2 with the message and then exit from BAPI.
Regards
vijay
04-19-2006 3:20 PM
HI Christopher,
Check any existing bapi and see how they are filling.
Sample code:
msgv1 = customerno.
CALL FUNCTION 'BALW_BAPIRETURN_GET1'
EXPORTING
type = 'E'
cl = 'FN'
number = 502
par1 = msgv1
IMPORTING
bapireturn = return.
EXIT.
REgards,
Ravi