02-24-2015 12:17 PM
Hi,
I have a requirement to Print the Production order. Everything is Completed and working fine.
Now the user wants to Print the Production order only once , If he try to Print the same Production Order again it may not print it.
Thanks in Advance,
Regards,
Ashok.
02-24-2015 12:32 PM
Hi Kumar, So, I think you can make a control with a table Z* saving the code of order.
02-24-2015 12:45 PM
Hi Victor,
Actually i am fetching the data from AFKO Table . So i just append a field as Flag in the same table .
The req is If the User print the Production order let say 10000057 first time it will Print . But from next time onwards it may not give Print it. IF he takes the Print Preview there is no limit for it.
Thanks in Advance.
Regards,
Ashok
02-26-2015 5:43 AM
Hi Ashok,
Suppressing the dialog box is better option.
Regards
Sreekanth
02-24-2015 12:46 PM
MMake use of parameter SFSY-COPYCOUNT = 1 In the print program
regards
sandy
02-24-2015 12:54 PM
Hi Sandy,
Thanks for the reply.
Can you please elaborate it a bit. What happen if i hard code it.
Regards,
Ashok.
02-26-2015 5:52 AM
Hi Ashok,
To suppress the dialog box, use the below logic.
gwa_control_parameters TYPE ssfctrlop, "Form Control Parameters
gwa_outoptions TYPE ssfcompop, " Output Options
gwa_control_parameters-no_dialog = abap_true. "No Dailog Display
gwa_outoptions-tddest = gcon_device . "'LOCL' Device
gwa_outoptions-tdimmed = abap_true. " Print immeditly
Now pass gwa_control_parameters and gwa_outoptions into FM.
Regards
Sreekanth
02-24-2015 2:28 PM
Hi,
Try,
DATA ST_CTRL TYPE SSFCTRLOP.
IF afpo-field = 'X' " field already printed
ST_CTRL-PREVIEW = 'X'. " no print preview
ENDIF.
CALL FUNCTION 'SSF_FUNCTION_MODULE_NAME'
EXPORTING
FORMNAME = 'ZFI_CHQAD_NEW'
* VARIANT = ' '
* DIRECT_CALL = ' '
IMPORTING
FM_NAME = FM_NAME
EXCEPTIONS
NO_FORM = 1
NO_FUNCTION_MODULE = 2
OTHERS = 3 .
CALL FUNCTION FM_NAME
EXPORTING
* ARCHIVE_INDEX =
* ARCHIVE_INDEX_TAB =
* ARCHIVE_PARAMETERS =
CONTROL_PARAMETERS = ST_CTRL
vencust = vencust
* MAIL_APPL_OBJ =
* MAIL_RECIPIENT =
* MAIL_SENDER =
* OUTPUT_OPTIONS =
* USER_SETTINGS = 'X'
* IMPORTING
* DOCUMENT_OUTPUT_INFO =
* JOB_OUTPUT_INFO =
* JOB_OUTPUT_OPTIONS =
TABLES
IT_PAYR = IT_PAYR[]
EXCEPTIONS
FORMATTING_ERROR = 1
INTERNAL_ERROR = 2
SEND_ERROR = 3
USER_CANCELED = 4
OTHERS = 5.
IF SY-SUBRC <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
Hope it helpful,
Regards,
Venkat.
02-24-2015 2:48 PM
Hi,
An order is printed if it has system status 'PRT'.
With AUFK-OBJNR in abap function STATUS_READ you obtein order status.
I hope you help.
02-26-2015 5:22 AM
Dear All,
Thanks for the reply,
I gone throgh debugging and found the sollution as below
CALL FUNCTION 'SSF_FUNCTION_MODULE_NAME'
EXPORTING
FORMNAME = V_FORMNAM
IMPORTING
FM_NAME = V_FUNNAME
EXCEPTIONS
NO_FORM = 1
NO_FUNCTION_MODULE = 2
OTHERS = 3.
* CALL FUNCTION V_FUNNAME
* EXPORTING
* CONTROL_PARAMETERS = CONTROL_PARAMETERS
* OUTPUT_OPTIONS = OUTPUT_OPTIONS
* USER_SETTINGS = SPACE
* S_PO = S1.
CALL FUNCTION V_FUNNAME
EXPORTING
* ARCHIVE_INDEX =
* ARCHIVE_INDEX_TAB =
* ARCHIVE_PARAMETERS =
CONTROL_PARAMETERS = CONTROL_PARAMETERS
* MAIL_APPL_OBJ =
* MAIL_RECIPIENT =
* MAIL_SENDER =
OUTPUT_OPTIONS = OUTPUT_OPTIONS
USER_SETTINGS = SPACE
S_PO = S1
IMPORTING
DOCUMENT_OUTPUT_INFO = WA_DOC_OUT_INFO
JOB_OUTPUT_INFO = WA_JOB_OUT_INFO
JOB_OUTPUT_OPTIONS = WA_JOB_OUT_OPTIONS
* EXCEPTIONS
* FORMATTING_ERROR = 1
* INTERNAL_ERROR = 2
* SEND_ERROR = 3
* USER_CANCELED = 4
* OTHERS = 5
.
IF SY-SUBRC <> 0.
* Implement suitable error handling here
ENDIF.
IF WA_AFKO1-AUFNR EQ WA_AFKO-AUFNR.
IF WA_JOB_OUT_INFO-SPOOLIDS IS NOT INITIAL.
IF WA_AFKO-FLAG NE 'X'.
WA_AFKO1-FLAG = 'X'.
MODIFY AFKO FROM WA_AFKO1.
ELSE.
MESSAGE 'The given Production order Print out already taken' TYPE 'E'.
ENDIF.
ENDIF.
ENDIF.
But the Problem is When User choose the Print Preview Option . Please look into the below screen.
Now i am selecting Print Preview.After output . We have a option in menu bar as shown in the below screen.
It is allowing to take any no of Print outs.
How to disable this only for the Required Program/Smartform . Please Let me If any exit/badi for this.
Regards,
Ashok.
02-26-2015 5:59 AM
Hi Ashok,
Then how do u going to handle PDF preview or PDF!?
Why don't u restrict preview once after print.
Regards
Sreekanth
02-27-2015 4:06 AM
Hi All,
The Spool is generating in Windows System but it is not Generating in Obento Systems.
Do i need to do any settings ?
Thanks in Advance.
Regards,
Ashok.
02-28-2015 11:32 AM
Dear All,
Thanks for your support.
Its a gui Problem , in 7.2 11 version it is not generating the spool properly so i go for sap gui 7.3.
Everything is working fine ,
But the issue is that, in the Linux systems, there is one additional adobe toolbar under the SAP application toolbar which has the options to Save, Print, Zoom In, Zoom out and so on.
I would want to know if there is any option to hide/disable this adobe toolbar during the print preview of smartform.
please look into the below screen shot.
Please let me know if there is any way to solve this.
Thanks and Best regards,
Ashok.