Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

Status of Print using smartforms

Former Member
0 Kudos

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.

12 REPLIES 12

Former Member
0 Kudos

Hi Kumar, So, I think you can make a control with a table Z* saving the code of order.

0 Kudos

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

0 Kudos

Hi Ashok,

Suppressing the dialog box is better option.

Regards

Sreekanth

SandySingh
Active Contributor
0 Kudos

MMake use of  parameter SFSY-COPYCOUNT = 1 In the print program

regards

sandy

0 Kudos

Hi Sandy,

Thanks for the reply.

Can you please elaborate  it a bit. What happen if i hard code it.

Regards,

Ashok.

0 Kudos

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

VenkatRamesh_V
Active Contributor
0 Kudos

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.

Former Member
0 Kudos

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.

0 Kudos

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.

0 Kudos

Hi Ashok,

Then how do u going to handle PDF preview or PDF!?

Why don't u restrict preview once after print.

Regards

Sreekanth  

0 Kudos

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.

0 Kudos

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.