cancel
Showing results for 
Search instead for 
Did you mean: 

Smartform

Former Member
0 Kudos

Hi,

I am facing a problem in smartform.

It requires to add a functionality of printing a document when we press BACK button Or F3 in a transaction.

Going back  should in fact print a document, which does not happened and needs to be corrected.

They had asked me to look into Fuction Module PM_NOTIFICATION_PRINT_CONTROL.

What i found through it is a Form(Get_Control_Parameter)  changing SSFCTRLOP(Smartform Control Structure) in while there is a field GETOTF(Return of OTF table. No printing, display, or faxing) in the smartform driver program.

Is this the item i required??

Can you help me in this issue.

How could i add this print a document while pressing BACK or F3 functionality.

Accepted Solutions (0)

Answers (1)

Answers (1)

Former Member
0 Kudos

Hi,

After debugging i found that program is not been able to access this function module.

In any of the condition program is not entering in the function module.

FORM FINAL_PRINT_CONTROL_F55.
  DATA: PM_DOC_TYP LIKE T390_O-PM_DOC_TYP.
  DATA: DEF_PRINT_LANGUAGE LIKE SYST-LANGU.

  DEF_PRINT_LANGUAGE =    SYST-LANGU.

  PM_DOC_TYP = VIQMEL-QMART.           " save Meldungsart for PRINT

  PERFORM READ_CATALOGUE_F55.          " Build IQKAT

  PERFORM READ_T399J_F10.

  PERFORM GET_PARTNER_INFO_F55.        " get partner details for print

  IF T399J-DIALOG_PRT = SPACE.         " Print in update task ???

    CALL FUNCTION 'PM_NOTIFICATION_PRINT_CONTROL' IN UPDATE TASK
      EXPORTING
        IVIQMEL        = VIQMEL
        RIWO1          = RIWO1
        QMNUM          = VIQMEL-QMNUM
        RIWO00         = RIWO00  "FOR STATUS INFO
        PRINT_LANGUAGE = DEF_PRINT_LANGUAGE
        RQM00          = RQM00
      TABLES
        IVIQMFE        = IVIQMFE
        IVIQMMA        = IVIQMMA
        IVIQMSM        = IVIQMSM
        IVIQMUR        = IVIQMUR
        IWORKPAPER     = IWORKPAPER
        IQKAT          = IQKAT
        IHPAD_TAB      = IHPAD_TAB.

*...         commit work will be issued in F00 later.
  ELSE.                                " dialog print
    CALL FUNCTION 'PM_NOTIFICATION_PRINT_CONTROL'  "not in update task
         EXPORTING
              IVIQMEL              = VIQMEL
              RIWO1                = RIWO1          " texts workarea
              QMNUM                = VIQMEL-QMNUM
              RIWO00               = RIWO00          "FOR STATUS INFO
              PRINT_LANGUAGE       = DEF_PRINT_LANGUAGE
              RQM00                = RQM00
         TABLES
              IVIQMFE              = IVIQMFE
              IVIQMMA              = IVIQMMA
              IVIQMSM              = IVIQMSM
              IVIQMUR              = IVIQMUR
              IWORKPAPER           = IWORKPAPER
              IQKAT                = IQKAT
              IHPAD_TAB            = IHPAD_TAB
         EXCEPTIONS
              NO_WORKPAPERS_PASSED = 01.

  ENDIF.

ENDFORM.  

Code in the FM

DESCRIBE TABLE IWORKPAPER LINES LAST_ENTRY.
  IF  LAST_ENTRY = 0.                  " but no papers passed,
    RAISE NO_WORKPAPERS_PASSED.        " what should be printed ?
  ENDIF.

*... " See LIPRTF02.
  PERFORM EXPORT_DATA  TABLES IVIQMFE
                              IVIQMMA
                              IVIQMSM
                              IVIQMUR
                              IQKAT
                              IHPAD_TAB
                              IAFVGD
                              IRESBD
                       USING  IVIQMEL
                              CAUFVD
                              RIWO1
                              RIWO00
                              RQM00.


*-> export order data as well?
  IF NOT IVIQMEL-AUFNR IS INITIAL.
    PERFORM EXPORT_ORDER_DATA_TO_MEM
                    TABLES  IAFVGD
                            IRIPW0
                            IRESBD
                            IAFFHD
                            OP_PRINT_TAB
                            KBEDP_TAB
                            O_IHPAD_TAB
                            IHSG_TAB
                            IHGNS_TAB
                    USING CAUFVD O_RIWO1 ILOA.
  ENDIF.

*... now to call the individual print Programs for each work paper.
  PERFORM PRINT_PAPERS
          TABLES IWORKPAPER
          USING  DEVICE
                 PRINT_LANGUAGE.

*-> set status for order and notification
  IF DEVICE <> DEVICE_SCREEN
     AND DEVICE <> DEVICE_PREVIEW.
    REFRESH OP_PRINT_TAB.         " no operation selection posible here
    PERFORM SET_PRINT_STATUS
            TABLES  IWORKPAPER
                    IAFVGD
                    IRESBD
                    OP_PRINT_TAB
            USING   CAUFVD
                    IVIQMEL.
  ENDIF.

ENDFUNCTION.

Can anyone please help me on this.