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

Mail triggering facility

Former Member
0 Likes
839

Hi Guys,

Can anyone please help me out?

I have a requirement which is bothering me in certain steps.

The requirement is as follows.

I have to develop a background program which will have certain checks based on the T CODE vt02n of SD.

If the program passes for every check there will be a mailing functionality which will attach a PDF and mail it to the concerned persons.

Now the mailing functionality is not a big deal.The one which is bothering me is retrieving the PDF for a special shipment NO during run time of the program.

Please give me your views how i can achieve a PDF in run time of my program through the T CODE vt03n

Thanx in advance

4 REPLIES 4
Read only

former_member202771
Contributor
0 Likes
683

Hi Rahul,

Firstly find that special shipment number and then

SELECT *

       FROM nast INTO TABLE gint_nast WHERE objky EQ p_docno.

                                     

DELETE ADJACENT DUPLICATES FROM gint_nast COMPARING kschl.


***Then create a spool for this entry. once spool is created, converting it into PDF and sending it as an attachment will be easier.

***Steps for spool creation:

*******Pass NAST entry and create a spool request using RSNAST00

IF gws_nast-vstat = gc_1.

     gws_nast-erdat = sy-datum.

     gws_nast-eruhr = sy-uzeit.

     gws_nast-usnam = sy-uname.

     gws_nast-manue = gc_x.

     gws_nast-vstat = 0.

     CLEAR gws_nast-datvr.

     CLEAR gws_nast-uhrvr.

     CLEAR gws_nast-cmfpnr.

   ENDIF.

   MOVE gws_nast TO nast.

   PERFORM einzelnachricht_dialog IN PROGRAM rsnast00 USING sy-subrc.

   IF sy-subrc NE 0.

     PERFORM objekt_entsperren IN PROGRAM rsnast00.

     IF sy-subrc EQ 9.

       RAISE print_error_dial.

     ELSE.

       RAISE print_error.

     ENDIF.

   ENDIF.

   SET SCREEN 0.

   PERFORM objekt_entsperren IN PROGRAM rsnast00.


COMMIT WORK AND WAIT.


***we could see the spool created in SP01, which could be retrieved from TSP01 table.


Thanks,

Anil

Read only

0 Likes
683

Hi Anil,

First of all thanx for ur reply....

Where will i get the objky for a shipment no of vt03n in sap?

Read only

0 Likes
683

Hi Rahul,

The shipment number which we enter as input in VT03N is stored as NAST-OBJKY.
Single out the shipment number which we want to send as PDF and pass it to RSNAST00 program for creating a spool.

Once spool is generated, convert spool to PDF(CONVERT_OTFSPOOLJOB_2_PDF).

Then send it as mail to recipient.

Thanks,

Anil Supraj

Read only

Jelena_Perfiljeva
Active Contributor
0 Likes
683

Could you please elaborate on the business requirement? Why such program is needed? Looks to me this could be achieved simply by configuring output with a custom requirement (VOFM).

Emailing PDF as an attachment is a standard SD output feature. Requirements may be assigned to output type to check whether output needs to be issued or not.

P.S. You might want to change the post description to be more accurate, it is too generic otherwise.