on 08-09-2011 3:57 PM
Hi Gurus
Is there any way to save a smartform output as a file (preferably pdf) from the print preview screen?
The customer wants to save the file from that screen itself and want to avoid multiple steps.
To Add on to it, I am using HRFORMS. That means, I would not be able to write any code in the driver program as it is system generated on each server whenever you activate the HRFORMS.
Hence, although I know about the function module "HR_IT_DISPLAY_WITH_PDF" which can be used to convert the output of the smartforms to pdf in print preview, I cannot use it in the driver program as it is not editable.
Any suggestions/solutions would be appreciated.
Thanks
sapper.
Edited by: d sappanese on Aug 9, 2011 5:52 PM
Hi Sapper,
Did you try the PDF! function code? It has to be entered in the command field of the smart form print preview screen. It converts the smart form to PDF and displays it using the default PDF viewer, from there you can download the file (or print it).
Sandra
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Sandra.
Thanks and You are just awsome. I have been working with smartforms since so many years and did not know about this.
I achieved this in a different way. Enhanced a standard class and called the pdf prview FM to do this.
Now, I directly get the smartform print prview in adobe layout.
Thanks,
sapper.
Hi Sandra,
I have created a program with PO number as input and ib print preview screen I have entered PDF in but I am not able to save it. Could you help me.Any additonal settings to be done.
BR
Dep
Hi Sandra,
I missed the exclamation mark(!) now I am able to download!!.
Edited by: DeepakNandikanti on Aug 16, 2011 7:55 AM
Edited by: DeepakNandikanti on Aug 16, 2011 9:17 AM
Hi,
got it!!
BR
Dep
Edited by: DeepakNandikanti on Aug 16, 2011 9:20 AM
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
Refer to below smaple code :
call this FORM popup_save after you have called smartform output.
*&---------------------------------------------------------------------*
*& Form POPUP_SAVE
*&---------------------------------------------------------------------*
* text
*----------------------------------------------------------------------*
* --> p1 text
* <-- p2 text
*----------------------------------------------------------------------*
FORM popup_save .
CASE sy-ucomm.
WHEN 'SBAC'.
CALL FUNCTION 'POPUP_TO_CONFIRM'
EXPORTING
TITLEBAR = 'Title POPUP_TO_CONFIRM'
TEXT_QUESTION = 'Click Cancel to Exit'
TEXT_BUTTON_1 = 'OK'
ICON_BUTTON_1 = 'ICON_CHECKED'
TEXT_BUTTON_2 = 'CANCEL'
ICON_BUTTON_2 = 'ICON_CANCEL'
DISPLAY_CANCEL_BUTTON = ' '
POPUP_TYPE = 'ICON_MESSAGE_ERROR'
IMPORTING
ANSWER = ANS.
IF ANS = 2.
LEAVE PROGRAM.
ELSE.
* Write your program to download to PDF.
ENDIF.
WHEN 'SEXI'.
CALL FUNCTION 'POPUP_TO_CONFIRM'
EXPORTING
TITLEBAR = 'Title POPUP_TO_CONFIRM'
TEXT_QUESTION = 'Click Cancel to Exit'
TEXT_BUTTON_1 = 'OK'
ICON_BUTTON_1 = 'ICON_CHECKED'
TEXT_BUTTON_2 = 'CANCEL'
ICON_BUTTON_2 = 'ICON_CANCEL'
DISPLAY_CANCEL_BUTTON = ' '
POPUP_TYPE = 'ICON_MESSAGE_ERROR'
IMPORTING
ANSWER = ANS.
IF ANS = 2.
LEAVE PROGRAM.
ELSE.
* Write your program to download to PDF.
WHEN 'SCAN'.
CALL FUNCTION 'POPUP_TO_CONFIRM'
EXPORTING
TITLEBAR = 'Title POPUP_TO_CONFIRM'
TEXT_QUESTION = 'Click Cancel to Exit'
TEXT_BUTTON_1 = 'OK'
ICON_BUTTON_1 = 'ICON_CHECKED'
TEXT_BUTTON_2 = 'CANCEL'
ICON_BUTTON_2 = 'ICON_CANCEL'
DISPLAY_CANCEL_BUTTON = ' '
POPUP_TYPE = 'ICON_MESSAGE_ERROR'
IMPORTING
ANSWER = ANS.
IF ANS = 2.
LEAVE PROGRAM.
ELSE.
* Write your program to download to PDF.
WHEN OTHERS.
ENDCASE.
ENDFORM. " POPUP_SAVE
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
In smartforms > under Global Definitions > Form Rotuines Just copy paste below code.
I hevent tried below code you just give a try you never know you might get a solution.
*&---------------------------------------------------------------------*
*& Form POPUP_SAVE
*&---------------------------------------------------------------------*
* text
*----------------------------------------------------------------------*
* --> p1 text
* <-- p2 text
*----------------------------------------------------------------------*
FORM popup_save .
DATA ans type c. " Important
* Put a BREAK_POINT here to see whether control comes here
CASE sy-ucomm.
WHEN 'SBAC'.
CALL FUNCTION 'POPUP_TO_CONFIRM'
EXPORTING
TITLEBAR = 'Title POPUP_TO_CONFIRM'
TEXT_QUESTION = 'Click Cancel to Exit'
TEXT_BUTTON_1 = 'OK'
ICON_BUTTON_1 = 'ICON_CHECKED'
TEXT_BUTTON_2 = 'CANCEL'
ICON_BUTTON_2 = 'ICON_CANCEL'
DISPLAY_CANCEL_BUTTON = ' '
POPUP_TYPE = 'ICON_MESSAGE_ERROR'
IMPORTING
ANSWER = ANS.
IF ANS = 2.
LEAVE PROGRAM.
ELSE.
* Write your program to download to PDF.
ENDIF.
WHEN 'SEXI'.
CALL FUNCTION 'POPUP_TO_CONFIRM'
EXPORTING
TITLEBAR = 'Title POPUP_TO_CONFIRM'
TEXT_QUESTION = 'Click Cancel to Exit'
TEXT_BUTTON_1 = 'OK'
ICON_BUTTON_1 = 'ICON_CHECKED'
TEXT_BUTTON_2 = 'CANCEL'
ICON_BUTTON_2 = 'ICON_CANCEL'
DISPLAY_CANCEL_BUTTON = ' '
POPUP_TYPE = 'ICON_MESSAGE_ERROR'
IMPORTING
ANSWER = ANS.
IF ANS = 2.
LEAVE PROGRAM.
ELSE.
* Write your program to download to PDF.
ENDIF.
WHEN 'SCAN'.
CALL FUNCTION 'POPUP_TO_CONFIRM'
EXPORTING
TITLEBAR = 'Title POPUP_TO_CONFIRM'
TEXT_QUESTION = 'Click Cancel to Exit'
TEXT_BUTTON_1 = 'OK'
ICON_BUTTON_1 = 'ICON_CHECKED'
TEXT_BUTTON_2 = 'CANCEL'
ICON_BUTTON_2 = 'ICON_CANCEL'
DISPLAY_CANCEL_BUTTON = ' '
POPUP_TYPE = 'ICON_MESSAGE_ERROR'
IMPORTING
ANSWER = ANS.
IF ANS = 2.
LEAVE PROGRAM.
ELSE.
* Write your program to download to PDF.
ENDIF.
WHEN OTHERS.
ENDCASE.
ENDFORM. " POPUP_SAVE
BR
Dep
Hi,
What you could do is when you review the smartform and click on back or exit or cancel button call a 'POP UP' with information to 'save the smartform as PDF or not'.
So this way you can acheive your requirement.
BR
Dep
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
You can use report RSTXPDFT4 to convert the spool number to a PDF file.
Regards,
Aidan
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
you can use this code
data: wa_OTF_DATA TYPE TSFOTF.
CALL FUNCTION GV_FMNAME
EXPORTING
CONTROL_PARAMETERS = wa_CONTROL
OUTPUT_OPTIONS = wa_OUTOPTIONS
USER_SETTINGS = SPACE
GS_HEAD = wa_HEAD
GS_DATA = wa_FORM
GV_COMPANY = v_COMP_NAME
GV_CHECK = wa_QMEL-MAWERK
T_MOREDEF = v_MOREDEF
GV_LANGU = T_LANGU
IMPORTING
JOB_OUTPUT_INFO = wa_JOB_OUT.
IF SY-SUBRC = 0.
wa_OTF_DATA = wa_JOB_OUT-OTFDATA[].
CALL FUNCTION 'SSFCOMP_PDF_PREVIEW'
EXPORTING
I_OTF = wa_OTF_DATA[]
EXCEPTIONS
CONVERT_OTF_TO_PDF_ERROR = 1
CNTL_ERROR = 2
OTHERS = 3.
IF SY-SUBRC NE 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
ENDIF.
User | Count |
---|---|
87 | |
10 | |
10 | |
10 | |
7 | |
6 | |
6 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.