‎2013 Dec 22 3:48 PM
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
‎2013 Dec 23 10:13 AM
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
‎2013 Dec 23 2:24 PM
Hi Anil,
First of all thanx for ur reply....
Where will i get the objky for a shipment no of vt03n in sap?
‎2013 Dec 24 4:42 AM
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
‎2013 Dec 23 8:38 PM
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.