Application Development 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: 

How to manage message errors of function FMFR_CREATE_FROM_DATA.

0 Kudos

Hello SDN partners.

I'm programing a RFC function that uses FMFR_CREATE_FROM_DATA to create commitment funds ( trx FMZ1). That function when makes data validations gives an error message type and consecuently it finish the execution of my RFC, without using exceptions.

How can i manage or capture that message error to execute the RFC function?.

Thanks

Greetings

Edison Alcaide.

Sap-Abap Consultant

1 ACCEPTED SOLUTION

Former Member
0 Kudos

Hi,

Create one more parameter in TABLES tab in your RFC function module

appned the exceptions from FMFR_CREATE_FROM_DATA to that table.

after finishing your RFC loop through that internal table ans display it in a report

Regards

Krishna

10 REPLIES 10

Former Member
0 Kudos

Hi,

Create one more parameter in TABLES tab in your RFC function module

appned the exceptions from FMFR_CREATE_FROM_DATA to that table.

after finishing your RFC loop through that internal table ans display it in a report

Regards

Krishna

0 Kudos

Hello Krishna

Thanks for answering but the problem is that exceptions from FMFR_CREATE_FROM_DATA are not launched after the call. It just give me a message error at status bar. In debugginf mode i found that message comes from a validation subrutine that doesn't uses exception raising.

I wonder if it's possible to catch that message before ?.

Thanks again.

Edison

0 Kudos

Hello Edison,

Have you solved you problem with FMFR_CREATE_FROM_DATA showing message without return? Could you please share the solution?

Thank you in advance!

Kirill

Edited by: Kirill Trunov on Jul 21, 2009 6:17 PM

0 Kudos

Hello Kirill

I solved the problem, it wasn't very easy because i have to debug a lot to find how the function sends the message. I remember that it uses an internal table for messages and then uses a function to send the message out.

To capture that message before i proceed this way.

First Initialize the message capture with MESSAGES_INITIALIZE function with this parameters at program beginning, to avoid showing the messages on screen:

CALL FUNCTION 'MESSAGES_INITIALIZE'

EXPORTING

collect_and_send = ' '

RESET = 'X'

line_from = ' '

line_to = ' '

i_store_duplicates = 'X'

i_no_duplicate_count = 500

check_on_commit = 'X'

i_allow_foreign_reset = 'X'

i_reset_line = 'X'

EXCEPTIONS

log_not_active = 1

wrong_identification = 2

OTHERS = 3.

Next call the function FMFR_CREATE_FROM_DATA and if sy-subrc ne 0 call the function MESSAGE GIVE and store the result on internal table.

CALL FUNCTION 'MESSAGES_GIVE'

TABLES

t_mesg = l_t_msg

EXCEPTIONS

OTHERS = 1.

Then you can print the table as log.

If you have something familiar let me now.

Thanks a lot, greetings

Edison

0 Kudos

Hello Edison,

Just tried you code. It works!

Thank you a lot!

Regards,

Kirill

Edited by: Kirill Trunov on Jul 22, 2009 8:46 AM

0 Kudos

Edison,

Thanks for your response. We are using FMFR_CREATE_FROM_DATA, and were encountering situations where postings were returning with errors that were only applicable to previous postings. By including a call to MESSAGES_INITIALIZE at the top of our module, and simply passing RESET = 'X', we were able to resolve the issue.

Zac

0 Kudos

Hi Zac,

In one of our requirement, We are trying to use this

CALL FUNCTION 'MESSAGES_INITIALIZE' to capture the error messages from function module FMFR_CREATE_FROM_DATA.

But we couldn't succeed.Can you please explain in detail how to use these MESSAGES_INITIALIZE and MESSAGES_GIVE function modules.Are there any Parameters values that need to be passed?

Thanks

Lokesh

0 Kudos

Hi Kirill,

In one of our requirement, We are trying to use this

CALL FUNCTION 'MESSAGES_INITIALIZE' to capture the error messages from function module FMFR_CREATE_FROM_DATA.

But we couldn't succeed.Can you please explain in detail how to use these MESSAGES_INITIALIZE and MESSAGES_GIVE function modules.Are there any Parameters values that need to be passed?

Thanks

Lokesh

Edited by: Lokesh Reddy on Apr 30, 2010 4:19 AM

0 Kudos

Just disable all exceptions in the function module in the source code and add the generic statement "error_message = 1".

Ofcourse you now need to handle messages after execution of the function module - messages will not be shown on screen anymore,

So the code should look like this:

CALL FUNCTION 'FMFR_CREATE_FROM_DATA'

EXPORTING

i_flg_checkonly = space

i_flg_commit = 'X'

TABLES

t_posdata = pr_posdata

CHANGING

c_f_headdata = pr_head_data

EXCEPTIONS

  • doctype_not_allowed = 1

  • error_occured = 2

  • OTHERS = 3.

error_message = 1.

0 Kudos

Thanks Guss. Just did as you mentioned in your last post and it worked. Thanks to all once again.