Skip to Content

Regarding disabling print button

Hi experts,

I have one report program, it calls one smartforms. Actually i want disable the print button on menu, i am calling the smartforms using SSF_FUNCTION_MODULE_NAME.

It may be basic question but now only i am facing this problem, please help me . i also attached screen shot for where i can diable that button.

Is there any coding needed in se38?  or anyother have to do?

Regards,

Linganathan.K

print11.GIF (35.3 kB)
Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

3 Answers

  • avatar image
    Former Member
    Jul 30, 2012 at 08:06 AM

    Make OUPUT_OPTIONS-TDNOPRINT = 'X' in the FM which calls the smartform.

    Add comment
    10|10000 characters needed characters exceeded

    • Hiii Linganathan ,

                                 i was busy in my work ..... So for your requirement their is only possibility is implicit enhancement in standard program  SAPLSTXBW just check below code and do in your system definitely gui status print button will be disable when you see your print preview 😊 

      include - LSTXBWFCC

      line no -109  perform exclude using: 'Z+', 'Z-'. else part

      just apply below code 😊


      form exclude using fcode like sy-ucomm.
         data exists type boolean.
         loop at excludes where ucomm = fcode.
           exists = c_true.
           exit. "already in the table
         endloop.
         if exists = c_false.
           excludes = fcode. append excludes.
         endif.
      """""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""$"$\SE:(1) Form EXCLUDE, End                                                                                                                                 A
      *$*$-Start: (1)---------------------------------------------------------------------------------$*$*
      ENHANCEMENT 1  ZHIDE_PRINT.    "active version
      IF sy-cprog = 'ZMYPROG'.              " here you specify your tcode or program name
        * BREAK-POINT.
      excludes = 'SPRI'. append excludes.
      ENDIF.

      ENDENHANCEMENT.
      *$*$-End:   (1)---------------------------------------------------------------------------------$*$*
      endform.                   " EXCLUDE

  • Aug 01, 2012 at 06:48 AM

    Please Can anyone Help me for my query. I will be grateful to u people.

    Thanks and Regards,

    Linganathan.K

    Add comment
    10|10000 characters needed characters exceeded

    • Former Member Linganathan K

      Have you tried my suggestion? 😊

      AFAIK by selecting PREVIEW radiobutton will also disable that print button located in tool bar.

      My suggestion is just ONE of the other way you're requesting. πŸ˜‰

      -Jake

  • Sep 02, 2014 at 05:47 PM

    Hi,

    The only reasonable way I can think of boils down to following:

    1) calling the print options dialog (using FM SSFCOMP_SHOW_DIALOG) in application rather than letting Smartform Composer handle it internally;

    2) after options dialog setting CONTROL_PARAMETERS-NO_DIALOG = 'X' and, if the user has choosen preview, OUTPUT_OPTIONS-TDNOPRINT = 'X'


    I have thrown together quick example based on SF_EXAMPLE_01 (do use SAPBC_DATA_GENERATOR to generate the test data or logic will not work!!!):

    REPORT SF_EXAMPLE_01.


    DATA: GS_SSFCOMPIN TYPE SSFCOMPIN .

    DATA: GS_OUTPUT_OPTIONS TYPE SSFCOMPOP.

    DATA: GS_CONTROL_PARAMETERS TYPE SSFCTRLOP .


    DATA: CARR_ID TYPE SBOOK-CARRID,

          FM_NAME TYPE RS38L_FNAM.

    PARAMETER:      P_CUSTID TYPE SCUSTOM-ID DEFAULT 1.

    SELECT-OPTIONS: S_CARRID FOR CARR_ID     DEFAULT 'LH' TO 'LH'.

    PARAMETER:      P_FORM   TYPE TDSFNAME   DEFAULT 'SF_EXAMPLE_01'.

    DATA: CUSTOMER    TYPE SCUSTOM,

          BOOKINGS    TYPE TY_BOOKINGS,

          CONNECTIONS TYPE TY_CONNECTIONS.


    START-OF-SELECTION .


      CALL FUNCTION 'SSFCOMP_SHOW_DIALOG'

        EXPORTING

          INPUT             = GS_SSFCOMPIN

          OK_BUTTON         = SPACE

        IMPORTING

    *     ARCHIVE_PARAMETERS =

          OUTPUT_OPTIONS    = GS_OUTPUT_OPTIONS

          CONTROL_PARAMETERS = GS_CONTROL_PARAMETERS

        EXCEPTIONS

          ERROR             = 1

          OTHERS            = 2.

      IF SY-SUBRC <> 0.

        MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO

                   WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.

      ELSE .

        GS_CONTROL_PARAMETERS-NO_DIALOG = 'X' .

        IF GS_CONTROL_PARAMETERS-PREVIEW = 'X' .

          GS_OUTPUT_OPTIONS-TDNOPRINT = 'X' .

        ENDIF .

      ENDIF.

    * get data

      SELECT SINGLE * FROM SCUSTOM INTO CUSTOMER WHERE ID = P_CUSTID.

      CHECK SY-SUBRC = 0.

      SELECT * FROM SBOOK INTO TABLE BOOKINGS

               WHERE CUSTOMID = P_CUSTID

               AND   CARRID   IN S_CARRID

               ORDER BY PRIMARY KEY.

      SELECT * FROM SPFLI INTO TABLE CONNECTIONS

               FOR ALL ENTRIES IN BOOKINGS

               WHERE CARRID = BOOKINGS-CARRID

               AND   CONNID = BOOKINGS-CONNID

               ORDER BY PRIMARY KEY.


    * print data

      CALL FUNCTION 'SSF_FUNCTION_MODULE_NAME'

        EXPORTING

          FORMNAME          = P_FORM

        IMPORTING

          FM_NAME           = FM_NAME

        EXCEPTIONS

          NO_FORM           = 1

          NO_FUNCTION_MODULE = 2

          OTHERS            = 3.


      IF SY-SUBRC <> 0.

    *   error handling

        MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO

                WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.

      ENDIF.


    * now call the generated function module

      CALL FUNCTION FM_NAME

        EXPORTING

          CONTROL_PARAMETERS = GS_CONTROL_PARAMETERS

          OUTPUT_OPTIONS    = GS_OUTPUT_OPTIONS

          USER_SETTINGS     = SPACE

          CUSTOMER          = CUSTOMER

          BOOKINGS          = BOOKINGS

          CONNECTIONS       = CONNECTIONS

        EXCEPTIONS

          FORMATTING_ERROR  = 1

          INTERNAL_ERROR    = 2

          SEND_ERROR        = 3

          USER_CANCELED     = 4

          OTHERS            = 5.


      IF SY-SUBRC <> 0.

    *   error handling

        MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO

                WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.

      ENDIF.

    Do not forget to take ARCHIVE_PARAMETERS along; I have left it out because it's quick example for print button 😊

    cheers

    Janis

    Add comment
    10|10000 characters needed characters exceeded