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

RFC function module

Former Member
0 Likes
1,118

Hi Experts,

I am calling a RFC Function Module inside an Update task function module in a delivery user exit.

In case the processing in the RFC FM fails, I need to display an information message to the user.

How do I handle displaying information message to the user inside an RFC FM?

I tried using simple informaton message inside the RFC FM , but this statement does not display a message to the user.

Thanks

10 REPLIES 10
Read only

SuhaSaha
Product and Topic Expert
Product and Topic Expert
0 Likes
1,040

Hello,

I tried using simple informaton message inside the RFC FM , but this statement does not display a message to the user.

It is not possible to do raise a message in an RFC FM & notify the user. Instead you can pass the message to a RETURN structure (something similar to BAPIRET).

In case the processing in the RFC FM fails, I need to display an information message to the user.

Based on the messages in the RETURN structure (as mentioned above) you can code for further actions.

BR,

Suahs

Read only

Former Member
0 Likes
1,040

Hi,

Information message will not work inside the RFC function module or normal function module. So the code for calling information message has to be written inside the USER-EXIT program.

In your case, process the RFC function module and return the information message using structure called BAPIRET2. Then using these return message, write the MESSAGE statement in the INCLUDE program of your user-exit.

---

Prem

Read only

Former Member
0 Likes
1,040

I tried to pass the message by appending into the ineternal table of type BAPIRET2, but my RFC FM is being called in a separate task inside an Update task FM.

How do I handle this one.

Read only

Former Member
0 Likes
1,040

Hi,

Best way is raise excepstion and handel it.

Read only

Former Member
0 Likes
1,040

Hi

When you are using the update task you can pass the message to the user. Only way is to abort the process by triggering a message of type 'A'.

Regards

Ranganath

Read only

Former Member
0 Likes
1,040

My problem is that, the RFC FM is being called from an Update task FM.

Thus I cannot use "raising exception" option.

Read only

0 Likes
1,040

Hi,

Use the following FM to populate the Information message..

CALL FUNCTION 'POPUP_TO_CONFIRM'

EXPORTING

titlebar = 'Title'

text_question = 'Question ???'

text_button_1 = 'YES'

icon_button_1 = 'ICON_OKAY'

text_button_2 = 'NO'

icon_button_2 = 'ICON_CANCEL'

default_button = '1'

display_cancel_button = space

IMPORTING

answer = v_ans

EXCEPTIONS

text_not_found = 1

OTHERS = 2.

Read only

0 Likes
1,040

Hi

As mentioned in my previous post, you can inform user by raising a "Abort" message, which is the only way you can terminate your update task FM. You can get more information about this from SAP Help as well.

Regards

Ranganath

Read only

Former Member
0 Likes
1,040

Using Abort message in the update task FM, terminates it. But the same message is not displayed to the user.

Read only

0 Likes
1,040

Yes, Abort message will terminate the FM call. You cannot give a message to the user in Update task, as this is similar to a background job. Other option would be to give a log or send a message to Business Workplace of the user by a express message something like those sorts.

Regards

Ranganath