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

Message handling in remote enabled function module .

Former Member
0 Likes
932


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.

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
701

Hi Prakrita,

Try with:

   message w001(va) WITH a DISPLAY LIKE 'W'.

Thanks,

Sachin

3 REPLIES 3
Read only

nabheetscn
SAP Champion
SAP Champion
0 Likes
701

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

Read only

Former Member
0 Likes
702

Hi Prakrita,

Try with:

   message w001(va) WITH a DISPLAY LIKE 'W'.

Thanks,

Sachin

Read only

0 Likes
701


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.