Printing Attachments Of Work Order Via IW32

...Previous

5.       MODULE F_USER_COMMAND_0900_AFTER_LOOP witll check the sy-ucomm and print the attachments.

For printing the attahcments, we need to read the contents of the attachment using FM ‘SO_DOCUMENT_READ_API1' into internal table.

We need to pass the unique identification number for the attachment (I_WORK-INSTID_B) to the FM and fetch the contents of the attachment into internal table ‘I_TAB_OBJCONTX’.

6.       We are using class ‘CL_GUI_FRONTEND_SERVICES’ to get the attachment path and to print them.

So , we need to call METHOD ‘CL_GUI_FRONTEND_SERVICES=>GET_SAPGUI_WORKDIR’ to fetch the path/name of the attachment.

If attachment is of URL type, then this FM will give us the full path of the attachment else if attachment is of external type, then name of the attachment will be fetched.

After that we need to download it on the local system using FM ‘GUI_DOWNLOAD’.

Then print the attachment using method ‘CL_GUI_FRONTEND_SERVICES=>EXECUTE’ with document path and ‘Print’ command.  

The selected attachments will be printed.

Demo of printing attachments via IW32:

Now, let’s see how enhancement tab displays the attachment details.

1.             Go to IW32. Open work order having attachments.

2.             Go to enhancement tab, it will display attachment list.

3.             Select the attachment and press ‘Print’ button.

4.             It will display message at the bottom after download is completed.

5.             Once downloading of the attachment is done, attachment is opened for printing and once printed it is closed.

6.             So, the required attachments are printed.

Please send us your feedback/suggestions at webmaster@SAPTechnical.COM 

HomeContribute About Us Privacy Terms Of Use • Disclaimer • SafeCompanies: Advertise on SAPTechnical.COM | Post JobContact Us  

Graphic Design by Round the Bend Wizards

footer image footer image