Skip to Content
avatar image
-1
Former Member

Collect the messages after a FM execution

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

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

3 Answers

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

    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

    Add comment
    10|10000 characters needed 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.

  • May 15 at 05:29 AM

    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?

    Add comment
    10|10000 characters needed characters exceeded

  • May 16 at 12:33 PM

    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>. 
    Add comment
    10|10000 characters needed characters exceeded