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

FMFR_CREATE_FROM_DATA error control

Former Member
0 Likes
2,083

Hello all,

I use this function in a loop and i process some records with this fm from my internal table. But when a record is wrong, It gives type 'E' error and stops program. I want to process all lines of my records without stopping and after that i will show them in alv with the errors if they have. In exceptions part of this FM, i used : ERROR_MESSAGE = 1 and it helped me to continue processing but i cant collect error messages. How can i collect the error messages for this FM?

I tried to use MESSAGES_INITIALIZE and MESSAGES_GIVE but i coulnd succeed.

Anyone has ideas? maybe i used these fm's wrong.

4 REPLIES 4
Read only

Former Member
0 Likes
1,436

Hi,

It is having 3 exceptions and also there no specific text for these. You have to manage based on the exception no.

http://help-abap.blogspot.com/2008/10/function-module-exception-handling.html

http://www.sapgeek.net/2011/03/abap-programming-exception-handling/

Once you get the error, don't message statement capture the error details to your Work area and modify the ALV ITAB.

If you display the message using message details and message type as 'E' it will stop further processing.

Shiva

Read only

0 Likes
1,436

Hello,

I dont think it is about the exceptions part. The FM is giving the error with type 'E' message inside the FM.

I even cant debug till the end of this FM. the message appears on the screen and bapi stops and also my loop stops.

In the exceptions part: if i write message_error = 1. the error message doesnt appear and bapi finishes with sy-subrc = 1.

But in this case i cant read the message text.

Read only

Former Member
0 Likes
1,436

I am having a similiar issue. Using MESSAGES_INITIALIZE suppresses a message like FICUSTOM175 thrown as a warning; but message FH004 thrown as an error still halts processing.

Read only

Former Member
0 Likes
1,436

Create a Z copy of FMFR_CREATE_FROM_DATA, RFC enable the FM and then call it using destination of your local/own logical system. This will complete the call to the FM and return the error in the system variables.