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

WFMC_MESSAGE_SINGLE sample example to trigger print from SAP

Pavan_Golesar
Active Participant
8,272

Hello Guru.

Today I need to came across a requirement to trigger print from SAP: WFMC_MESSAGE_SINGLE.

Although I am not sure whether the mentioned function module is the correct one to suffice my requirement.

Did anyone came across similar requirement or can share sample source code the use of this FM.

Regards,

Pavan G

1 ACCEPTED SOLUTION
Read only

nabheetscn
SAP Champion
SAP Champion
0 Likes
5,169

Just do a simple where used list for this FM and you will get the sample code.

Nabheet

Just do a simple where used list for this FM and you will get the sample code.

Nabheet

6 REPLIES 6
Read only

nabheetscn
SAP Champion
SAP Champion
0 Likes
5,170

Just do a simple where used list for this FM and you will get the sample code.

Nabheet

Read only

0 Likes
5,169

After Where-used list .. still I found no success...

Read only

Read only

0 Likes
5,169

Sample code also

LOOP AT xitem.

       IF xitem-vstat = '0'.

         CLEAR: flag, tmp_ebelp.

         MOVE-CORRESPONDING xitem TO nast.

         IF xitem-kappl EQ 'EL' AND xitem-objky+10(5) NE '00000'.

           tmp_ebelp = xitem-objky+10(5).

           PERFORM position_sperren USING

                                    xitem-ebeln

                                    tmp_ebelp

                                    flag.

         ELSE.

           PERFORM beleg_sperren USING xitem-ebeln flag.

         ENDIF.

         IF NOT flag IS INITIAL. CONTINUE. ENDIF.

*       PERFORM EINZELNACHRICHT(RSNAST00) USING SUBRC.      " 361179

         CALL FUNCTION 'WFMC_MESSAGE_SINGLE'                 " 361179

           EXPORTING                                         " 361179

             pi_nast        = nast                           " 361179

           IMPORTING                                         " 361179

             pe_rcode       = subrc.                         " 361179

         IF xitem-kappl EQ 'EL' AND xitem-objky+10(5) NE '00000'. "455903

           tmp_ebelp = xitem-objky+10(5).

           PERFORM position_entsperren USING

                                    xitem-ebeln

                                    tmp_ebelp.

         ELSE.

           PERFORM beleg_entsperren USING xitem-ebeln.

         ENDIF.

       ENDIF.

       COMMIT WORK.         

Read only

5,169

Thanks nabheet but I had to finally handcode.

Regards,

PavanG.

Read only

Pratyay_Das
Newcomer
0 Likes
5,169

I have used this function module WFMC_MESSAGE_SINGLE to trigger print output as well as email (external send). First you need to fill up the NAST structure based on your requirement and then pass it to the FM.