on 08-10-2009 12:13 PM
Hi Experts,
We have a requirement where in the output in ALV grid display should be downloaded to PDF format.
We came across two processes.
1. To download the output to Smartform and then convert to PDF format
2. To send the ALV output directly to spool and then convert it to PDF
Please let me know which of the above two gives better performance and also please guide me through the process.
HI Mallika,
Both the ways are feasible. For conversion of ALV to PDF,
1. Display ALV output as usual using factory method .
2. Create a Button 'Download to PDF' in the GUI status
3. Set the Sy-batch as 'X'.
4. Call the Factory method for list display
5. Catch the sy-spono
6. Use the FM CONVERT_ABAPSPOOLJOB_2_PDF to convert alv data to PDF.
7. Use the FM GUI_DOWNLOAD to dowload the above PDF file
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
refer the following code...
get the spool number
Declaration of local variables.
DATA:
LV_RQ2NAME LIKE TSP01-RQ2NAME.
CONCATENATE SY-REPID+0(8)
SY-UNAME+0(3)
INTO LV_RQ2NAME SEPARATED BY '_'.
Get the spool number.
SELECT * FROM TSP01 WHERE RQ2NAME = LV_RQ2NAME
ORDER BY RQCRETIME DESCENDING.
V_RQIDENT = TSP01-RQIDENT.
EXIT.
ENDSELECT.
IF SY-SUBRC NE 0.
CLEAR V_RQIDENT.
ENDIF
Hope this may help you..
Regards,
Dhanalakshmi L
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Mallika,
Both way it's possible but 2nd option is better.
You can much easily export spool to PDF.
Refer following link for code snippet :
https://wiki.sdn.sap.com/wiki/display/Snippets/BrowseandExportSpooltoPDFusing+ABAP
Hope this will solve your issue.
Regards,
Vivek
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
95 | |
11 | |
11 | |
10 | |
9 | |
7 | |
6 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.