Showing posts with label Smartforms Page number Specific to po's or other's. Show all posts
Showing posts with label Smartforms Page number Specific to po's or other's. Show all posts

20/03/2014

Smartforms Page number Specific to po's or other's

This is code to resolve the page number issue on evey page with specific date example
1st po contain 3 pages - 1/3, 2/3 , 3/3.
2nd po contain 2 pages - 1/2 , 2/2.
like that only u have to use sfsy-pages / sfsy-formpage in smartform where you want to print .

DATA : control_parameters TYPE ssfctrlop,
       wa_job_output_info TYPE ssfcrescl,
       ssfcompin TYPE ssfcompin,
       ssfcompop TYPE  ssfcompop.


  ssfcompin-dialog = 'X'.
CALL FUNCTION 'SSF_OPEN'
* EXPORTING
*   ARCHIVE_PARAMETERS       =
*   USER_SETTINGS            = 'X'
*   MAIL_SENDER              =
*   MAIL_RECIPIENT           =
*   MAIL_APPL_OBJ            =
*   OUTPUT_OPTIONS           =
*   CONTROL_PARAMETERS       =
* IMPORTING
*   JOB_OUTPUT_OPTIONS       = control_parameters
* 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.
control_parameters-no_open = 'X'.
control_parameters-no_close = 'X'.

CALL FUNCTION 'SSF_FUNCTION_MODULE_NAME'
*    
      EXPORTING
        FORMNAME = SMARTFORM NAME
      IMPORTING
        FM_NAME  = PR_FM_NAME.
loop ur data


    CALL FUNCTION PR_FM_NAME
      EXPORTING
      control_parameters  = control_parameters
       output_options     = ssfcompop
      
      TABLES Which you want to print .
refresh the table aftr pass.
endloop
     
CALL FUNCTION 'SSF_CLOSE'
IMPORTING
 job_output_info = wa_job_output_info
 EXCEPTIONS
 formatting_error = 1
 internal_error = 2
 send_error = 3
 OTHERS = 4.
IF sy-subrc <> 0.
* MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
* WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
 ENDIF.