Skip to Content
-1

Collect the messages after a FM execution

May 15 at 03:36 AM

58

avatar image
Former Member

Hi Gurus,

I have a scenario here regarding the use of FM 'HU_PACKING_CREATE'.....

The FM returns sy-subrc = 0 and also IMPORTING parameter et_messages returns the message HU successfully created. At the same time, there is another process (background steps) that creates the HU asynchronously....

That causes further issue when the HU is created with packaging material non-serialized (we are expecting serialized packaging material) - and the message not returned to the caller FM.

Question: Is there a way to capture the messages (in the asynchronous steps) back into the caller FM?

Regards,

HanYean

10 |10000 characters needed characters left characters exceeded
* Please Login or Register to Answer, Follow or Comment.

3 Answers

avatar image
Former Member May 15 at 04:09 AM
1

Not sure about capturing the messages into caller FM. But you may check Application logging?

https://wiki.scn.sap.com/wiki/display/ABAP/Application+Log+Methodology+in+SAP

Show 1 Share
10 |10000 characters needed characters left characters exceeded
Former Member

Hi Povignesh,

Unfortunately, the requirement is to capture the data and back into the caller program before proceed to perform further actions on the HU itself.

0
Matthew Billingham
May 15 at 05:29 AM
0

Have you considered using the parallel processing techniques of CALL FUNCTION ... STARTING NEW TASK ... CALLING get_messages ON END OF TASK, where get_messages is a method in your class that collects the messages from the function module?

Show 2 Share
10 |10000 characters needed characters left characters exceeded
Former Member

Hi Matthew,

Unfortunately, the standard FM is not set for remote call enabled. Hitting abap dump with that in the system

0

That's easy deal with. Create your own Z function module that is RFC enabled (you might have to adjust some parameters), then call HU_PACKING_CREATE from that.

0
Rob Postema May 16 at 12:33 PM
0

can't you use something like this?

* Read GT_MSG which is filled in LFRE_MD_DIF_OUTF01 (FM: FRE_MD_DIF_SEND)

* and add entries to our cta_msg.

    FIELD-SYMBOLS: <gt_msg> TYPE tt_msg.

    ASSIGN ('(SAPLFRE_MD_DIF_OUT)GT_MSG[]') TO <gt_msg>. 
Share
10 |10000 characters needed characters left characters exceeded