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

Catching Error while calling FM (RFC Enabled)

Former Member
0 Likes
2,336

Hi all,

1. In a loop on RFCDES table

im calling a Function Module

passing different RFC Destinations.

2. In any of the loop pass, if any

error comes, there is a short dump.

3. How to avoid this short dump

and continue the loop till end

using try,catch etc ?

Regards,

Amit M.

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
1,029

Hi,

1. The FM is TH_USER_LIST

2. It does not have any EXCEPTIONS

3. I m calling it thru RFC

(using destination keyword)

4. At that time it gives error.

How to solve/catch it so that short dump

does not come.

Regards,

Amit M.

5 REPLIES 5
Read only

athavanraja
Active Contributor
0 Likes
1,029

are these exception raised by the called FM's

did you handle the sy-subrc after calling these FMs

Regards

Raja

Read only

Former Member
0 Likes
1,029

i think u have commented the exceptions.

Please uncomment them. if you need explicit handling u can do that also.

if the FM is custom defined. then you have to add the error table in the tables. col. so that if any error comes you have to handle it explicitly.

hope my answers will help u.

Read only

Former Member
0 Likes
1,030

Hi,

1. The FM is TH_USER_LIST

2. It does not have any EXCEPTIONS

3. I m calling it thru RFC

(using destination keyword)

4. At that time it gives error.

How to solve/catch it so that short dump

does not come.

Regards,

Amit M.

Read only

0 Likes
1,029

http://help.sap.com/saphelp_nw04/helpdata/en/13/90a594a1ab0841bbb731bdec1a7fd7/content.htm - check this link for handling exception when calling RFCs

call the function like below

data: list like UINFO occurs 0 with header line .

CALL FUNCTION 'TH_USER_LIST' destination <dest>

TABLES

list = list

exceptions

communication_failure = 1

system_failure = 2 .

if sy-subrc ne 0 .

  • handle error here

endif .

Regards

Raja

Read only

Former Member
0 Likes
1,029

Thanks durairaj. Points awarded!