2011 Oct 01 4:11 AM
How do I trigger a Subroutine ( It creates a new ticket/insurance claim number/Invoice number) only when print command is given and not when print preview is given so that un-necessarily new ticket/claim/invoice NUMBERS are not generated?
How do I trigger a Subroutine ( It creates a new ticket/insurance claim number/Invoice number) only when print command is given and not when print preview is given so that un-necessarily new ticket/claim/invoice NUMBERS are not generated?
2011 Oct 01 6:20 AM
Hi,
So it is a script or the smartform ?
In the sap script you can call the perform as shown below
You could make a condition to call the below subroutine in sap script window editor.
Example: if sy-ucomm = 'PRINT '.
perform TABLES fp_it_intab STRUCTURE itcsy
fp_it_outtab STRUCTURE itcsy.
.....
.....
Endform.
Please let me know if you want the fuction code for print command.
Edited by: Ashwin Kumar Chitram on Oct 1, 2011 7:21 AM
2011 Oct 01 7:50 AM
Hi,
Are your commands PRINT and PRINT PREVIEW, buttons / check boxes / radio buttons ?
* For Radio Buttons and Check Boxes.
IF p_prntpr = 'X'.
PERFORM print_preview.
ELSEIF p_print = 'X'.
PERFORM print.
ENDIF.
* For Buttons.
CASE sy-ucomm.
WHEN 'PRINT_PR'.
PERFORM print_preview.
WHEN 'PRINT'.
PERFORM print.
ENDCASE.
Regards,
Danish.
2011 Oct 01 8:37 AM
Actually what I'm doing is there is a screen where you need to enter few values and press F8 for processing then the pop-up where we need to give the printer name etc comes up, in this pop-up in bottom right corner we have few buttons "PRINT", "PRINT-PREVIEW" etc. So If I press the "PRINT PREVIEW" button my sub-routine should NOT get executed. If I press the "PRINT" button my subroutine should get executed. Is there a solution for this situation?
2011 Oct 02 9:37 AM
A method you can adopt is to put a code line inside the smartform in such a way that :
Check for JOB_OUTPUT_OPTIONS-TDPREVIEW ;
if TDPREVIEW is 'X'. "X if Print preview is selected
"do ur coding here.
else .
"execute alternate code..."
I hope this will meet ur requirement...
2011 Oct 02 9:58 AM
My form is a Adobe form output. How will the solution change now. The adobe form has been designed in SFP and is being called from Module pool program. The input is given in the screen and F8 is used to process and then the PRINT pop-up comes up for the printer name etc. here if PRINT PREVIEW is selected my subroutine should not get process and if PRINT is selected my sub-routine shouls get processed.
2011 Oct 17 6:16 AM
I have found out the way to capture the sy-ucomm value given back from default print dialogue pop-up. After the functional module 'FP JOB OPEN' is called the default print dialogue box will appear, you might select "print" or "print preview", after either of this is selected and before the adobe form is called" check for sy-ucomm value, and trigger your sub-routine accordingly.
| User | Count |
|---|---|
| 3 | |
| 2 | |
| 2 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |