2014 Apr 09 10:06 AM
Hello experts ,
I am creating a remote enabled function module which must return a warning message based on certain condition . Inorder to meet the requirement I have added this line in the Fm's source code :
" Message Wxx(message class) with a ."
But when I am trying to use it , the above given message is dispalyed as an error message . Could you please let me know where am I going wrong . TIA.
Regards,
Prakrita Kapoor.
2014 Apr 09 10:14 AM
Hi Prakrita,
Try with:
message w001(va) WITH a DISPLAY LIKE 'W'.
Thanks,
Sachin
2014 Apr 09 10:10 AM
Hi Pratika
Rather than throwing such messages it is better if you have a RETURN structure in TABLES parameter and fill it. Check standard SAP BAPI's.
Nabheet
2014 Apr 09 10:14 AM
Hi Prakrita,
Try with:
message w001(va) WITH a DISPLAY LIKE 'W'.
Thanks,
Sachin
2014 Apr 09 10:30 AM
Hi Prakrita,
Try building below code within the RFC after you have added return structure in your RFC parameters.
IF sy-subrc NE 0.
CLEAR message.
message-msgty = 'E'.
message-msgid = 'ZMI'.
message-msgno = '001'.
message-msgv1 = ID.
PERFORM return_message USING message
CHANGING return.
Endif.
form return_message USING VALUE(P_MESSAGE) LIKE MESSAGE
CHANGING P_RETURN LIKE BAPIRETURN.
CHECK NOT MESSAGE IS INITIAL.
CALL FUNCTION 'BALW_BAPIRETURN_GET'
EXPORTING
TYPE = P_MESSAGE-MSGTY
CL = P_MESSAGE-MSGID
NUMBER = P_MESSAGE-MSGNO
PAR1 = P_MESSAGE-MSGV1
PAR2 = P_MESSAGE-MSGV2
PAR3 = P_MESSAGE-MSGV3
PAR4 = P_MESSAGE-MSGV4
IMPORTING
BAPIRETURN = P_RETURN
EXCEPTIONS
OTHERS = 1.
endform.