cancel
Showing results for 
Search instead for 
Did you mean: 

SMARTFORM IN SEQUENCE

Former Member
0 Kudos

DEAR ALL,

               I have a requirement to make payslip for an employe and I have successfully done that but the problem is when i run the SM in print preview mode

nd i click on next page button payslip of next employee doesnt appear and i have to go back(F3) again and enter the local device to see the payslip of another employee.

What should I do so that all the smartforms should get printed at once and I can see them via pushing a button NEXT PAGE or LAST PAGE or PREVIOUS PAGE .

Thanx in ADVANCE.

Regards.

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hello, you can also see the thread.....

http://scn.sap.com/thread/1298603

Former Member
0 Kudos

i am passing data in two internal tables,

Do i have a to pass entire data in single internal table??

Answers (4)

Answers (4)

Former Member
0 Kudos

HELLO,

I M DONE WITH PAYSLIP,

THANKS FOR YOUR VALUEABLE SUGGESTIONS

REGARDS

meenakshi-btp
Explorer
0 Kudos

Hi All,

I need help with the mass printing of Payslip. I am calling the smart form FM in START OF SELECTION, in GET PERNR.. I have a work area which contains PERNR personal details and I have an internal table with the payroll details.

I ma facing issue with the mass printing, same as Girish mentioned in his post. I was to see payslips of all employees in a single print preview, but here I have to go back and next PERNR's payslip is displayed.

This is urgent.. Please suggest..!!

Florian
Active Contributor
0 Kudos

You just have to read through the content and perhaps search SCN. There are a lot of examples delivered:

Use ssf_open fm and ssf_close as mentioned above.

If you don't know how to use the SCN-Search, here you can learn more:

~Florian

Former Member
0 Kudos

Hi Gurav,

Employee list  in internal table.

data:  GV_SSFCTRLOP type SSFCTRLOP,

          

DATA: LV_VAR TYPE C DEFAULT VALUE 'X'.

Loop at IT_EMP into Wa_emp.

At Frist.

GV_SSFCTRLOP-NO_OPEN = 'X' .

GV_SSFCTRLOP-NO_CLOSE = ' '.

CLEAR : LV_VAR.

endat.

IF LV_VAR = 'X'.

GV_SSFCTRLOP-NO_OPEN = 'X' .

GV_SSFCTRLOP-NO_CLOSE = 'X '.

ENDIF.

At LAST.

GV_SSFCTRLOP-NO_OPEN = ' ' .

GV_SSFCTRLOP-NO_CLOSE = 'X '.

endat.

Call Smartform Function module Here.

IN THIS FUNCTION MODULE U PASS CONTROL PARMS.

clear: WA_emp.

LV_VAR = 'X'.

endloop.

Former Member
0 Kudos

do I have to pass this work area to smartform,,

and anything special in smartform,

i havent used any condition in smartform except the loop condition and that too without the where clause

Abhijit74
Active Contributor
0 Kudos

Hello,

You are adding control parameters not into internal tables . You are adding into the structures.

Thanks,

Abhijit

Former Member
0 Kudos

HELLO SIR,

YEAH I KNOW THAT,

WITH UR HELP I AM ABLE  TO GENERATE MASS PRINT BUT THE ISSUE IS THAT HOW SHOULD I PASS WORKAREA OF TABLE TO SMARTFORM AS IT IS GIVING ME ERROR THAT THE TYPE MISMATCH, BEACUSE THE VALUES OF THE WAORKAREA ARE BEING ASSIGNED TO TABLE

WHAT SHOULD I DO

REGARDS

Abhijit74
Active Contributor
0 Kudos

Hello,

These errors are  very basic .. Instead of asking check your declaration.

Thanks,

Abhijit

Abhijit74
Active Contributor
0 Kudos

Hello Gaurav,

Everytime you are executing your smartform it's generating a function module with all the details. So, It's not clear how you are inputing all employes inside the smartform.

It will be better if you call the smartform from a driver program through SSF_FUNCTION_MODULE_NAME and pass the device and employee table . Hopefully you will get your desire result.

* At the end of your program.


* Passing data to SMARTFORMS

call function 'SSF_FUNCTION_MODULE_NAME'
  exporting
    formname                 = 'ZSMARTFORM'
  IMPORTING
    FM_NAME                  = FM_NAME
  EXCEPTIONS
    NO_FORM                  = 1
    NO_FUNCTION_MODULE       = 2
    OTHERS                   = 3.

if sy-subrc <> 0.
   WRITE: / 'ERROR 1'.
endif.

call function FM_NAME
  TABLES
    GS_MKPF                    = INT_EMPLOYEE

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.

Thanks,

Abhijt

Former Member
0 Kudos

Dear Abijit,

I m calling smartform from driver program, still not working,

i m calling it before end of selection

here is code

Regards.

FORM SMARTFORM .

   "GETTING FUN MODULE NAME FROM SMARTFORM

   CALL FUNCTION 'SSF_FUNCTION_MODULE_NAME'

     EXPORTING

       formname = p_form

     IMPORTING

       fm_name  = fm_name.

   IF SY-SUBRC <> 0.

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

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

   ENDIF.

   "CALLING SMARTFORM

   CALL FUNCTION FM_NAME

     EXPORTING

       ITABH              = ITABH

       ITABB              = ITABB

       gd_attachment_name = gd_attachment_name

       RUNDATE            = RUNDATE.

   IF SY-SUBRC <> 0.

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

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

   ENDIF.

Former Member
0 Kudos

Hello,

you have to create a next page....put name as NEXT.

regards

Sabyasachi

Former Member
0 Kudos

hello,

if you use 2 internal table then use loop. for your help, i post my one code..follow it.

SELECT * from vbak into TABLE it_vbak WHERE VBELN EQ VBELN .

if sy-subrc EQ 0.

   select * from vbap INTO TABLE it_vbap FOR ALL ENTRIES IN it_vbak
   WHERE vbeln = it_vbak-vbeln.

endif.
*




CALL FUNCTION 'SSF_FUNCTION_MODULE_NAME'
   EXPORTING
     FORMNAME                 = 'ZSMARTFORM_IMP1'
*   VARIANT                  = ' '
*   DIRECT_CALL              = ' '
  IMPORTING
    FM_NAME                   = FM_NAME
* EXCEPTIONS
*   NO_FORM                  = 1
*   NO_FUNCTION_MODULE       = 2
*   OTHERS                   = 3
           .
IF SY-SUBRC <> 0.
* MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
*         WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.


loop at it_vbak into wa_vbak.

   refresh:it_vbak_temp,
           it_vbap_temp.

   it_vbak_temp[] = it_vbak[].
   it_vbap_temp[] = it_vbap[].

   DELETE it_vbak_temp WHERE vbeln NE wa_vbak-vbeln.
   DELETE it_vbap_temp WHERE vbeln NE wa_vbak-vbeln.




   CALL FUNCTION FM_NAME
  EXPORTING
*   ARCHIVE_INDEX              =
*   ARCHIVE_INDEX_TAB          =
*   ARCHIVE_PARAMETERS         =
    CONTROL_PARAMETERS         = CONTROL
*   MAIL_APPL_OBJ              =
*   MAIL_RECIPIENT             =
*   MAIL_SENDER                =
    OUTPUT_OPTIONS             = OUTPUT_OPTIONS
    USER_SETTINGS              = ' '
* IMPORTING
*   DOCUMENT_OUTPUT_INFO       =
*   JOB_OUTPUT_INFO            =
*   JOB_OUTPUT_OPTIONS         =
     TABLES
       VBAK                       = it_vbak_temp[]
       VBAP                       = it_vbap_temp[]
* 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.

endloop.
endform.

Thanks

Sabyasachi

Abhijit74
Active Contributor
0 Kudos

Hello,

Have you passed the control parameter in the function module. I could not see that you have populated any control parameter tables (SSFCTRLOP & ssfcompop) where you can pass the parameters like below.

  Pass the control parameters  and o/P options as :

DATA :  dl_cparam TYPE ssfctrlop,

              dl_ outop TYPE ssfcompop.

  dl_cparam-no_dialog = 'X'.

  dl_cparam-preview = 'X'.

  dl_cparam-device = 'PRINTER'.

  dl_outop-tdnewid = 'X'.

  dl_outop-tddest = 'LP01'.  " <--- printer

Thanks,

Abhijt

Former Member
0 Kudos

DEAR,

NO I HAVENT

REGARDS

Former Member
0 Kudos

Hello Gourav,

you follow my way of coding....the req was same as you  which i post here for your help......

Thanks

Former Member
0 Kudos

i AM PASSING TABLES THROUGH EXPORT,

dO IT HAS ANYTHING WITH IT ??

Former Member
0 Kudos

passing tables through TABLES parameter.......

Former Member
0 Kudos

DEAR KARFORMA,

NOW I PASSED MY INTERNAL TABLES THROUGH TABLES BUT STILL SAME PROBS.

REGARDS,

HERE IS MY CODE

   "GETTING FUN MODULE NAME FROM SMARTFORM

  CALL FUNCTION 'SSF_FUNCTION_MODULE_NAME'

    EXPORTING

      FORMNAME                 = p_form

*    VARIANT                  = ' '

*    DIRECT_CALL              = ' '

   IMPORTING

     FM_NAME                  = fm_name

   EXCEPTIONS

     NO_FORM                  = 1

     NO_FUNCTION_MODULE       = 2

     OTHERS                   = 3

            .

  IF SY-SUBRC <> 0.

* Implement suitable error handling here

  ENDIF.

   "CALLING SMARTFORM

  CALL FUNCTION FM_NAME

    EXPORTING

     CONTROL_PARAMETERS         = wa_ssfctrlop

     OUTPUT_OPTIONS             =  wa_output_options

     USER_SETTINGS              = 'X'

      RUNDATE                    = RUNDATE

      GD_ATTACHMENT_NAME         = GD_ATTACHMENT_NAME

   IMPORTING

     JOB_OUTPUT_INFO            = wa_job_output_infO

     JOB_OUTPUT_OPTIONS         = wa_job_output_options

     TABLES

      ITABH                      = ITABH

      ITABB                      = ITABB2

   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.

Former Member
0 Kudos

Hello Gourav,

can you tell me one thing why you use 2 internal tables here??

Thanks

Sabyasachi

Former Member
0 Kudos

ONE FOR MASTER DATA AND OTHER FOR EARNINGS AND DEDUCTIONS

Former Member
0 Kudos

hello,

i have already post a code as per your requirement.......follow this code and let me inform....

Reg

Sabyasachi

Former Member
0 Kudos

i am unable to understand ur code ....

regards

Former Member
0 Kudos

hey Sabyasachi,

i tried ur code ,

now i am using single table to pass values

still not working

regards

Former Member
0 Kudos

hello, can you post your driver program or mail me??

Former Member
0 Kudos

your email id ??

Former Member
0 Kudos

hello,

use ssf_open fm and ssf_close fm. after SSF_OPEN use call function fm_name. this fm_name will found in SSF_FUNCTION_MODULE_NAME........

reg

Sabyasachi