cancel
Showing results for 
Search instead for 
Did you mean: 

Different Smartforms printing using single driver program

Former Member
0 Kudos

Hi Friends,

I have created 5 diffrent smartforms and i should print all these smartforms using single driver program. Please help.

Regards,

pmchandan

Accepted Solutions (0)

Answers (3)

Answers (3)

Former Member
0 Kudos

Hi,

As per your requirement i have created code for calling two smartforms from a single driver program .You can modify this code.

&----


*& Report ZSMARTFORM *

*& *

&----


*& *

*& *

&----


REPORT zsmartform.

DATA:fnam TYPE rs38l_fnam,

fname TYPE rs38l_fnam.

SELECTION-SCREEN BEGIN OF BLOCK b1 WITH FRAME TITLE text-001.

PARAMETERS:test1 RADIOBUTTON GROUP g1,

test2 RADIOBUTTON GROUP g1.

SELECTION-SCREEN END OF BLOCK b1.

IF test1 = 'X'.

CALL FUNCTION 'SSF_FUNCTION_MODULE_NAME'

EXPORTING

formname = 'ZFORM'

IMPORTING

fm_name = fnam

  • 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.

CALL FUNCTION fnam.

ENDIF.

IF test2 = 'X'.

CALL FUNCTION 'SSF_FUNCTION_MODULE_NAME'

EXPORTING

formname = 'ZFORM2'

IMPORTING

fm_name = fname

  • 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.

CALL FUNCTION fname.

ENDIF.

Former Member
0 Kudos

Thread closed.

Thanks for the help

Neela

Edited by: pmchandan on Oct 7, 2011 2:01 PM

Former Member
0 Kudos

Hi,

Populate the formname into a variable based on different conditions. Then pass the variable to the fm.

If condition1.

wrk_form = 'Smartform1'.

else.

wrk_form = 'Smartform2'.

endif.

CALL FUNCTION 'SSF_FUNCTION_MODULE_NAME'

EXPORTING

formname = wrk_form "variable which stores the formname.

  • VARIANT = ' '

  • DIRECT_CALL = ' '

IMPORTING

fm_name = fm_name

EXCEPTIONS

no_form = 1

no_function_module = 2

OTHERS = 3

.

Thanks & Regards,

Neela M B

Former Member
0 Kudos

Hi Neela,

I need to print in a single shot.

Regards,

Chandan

Edited by: pmchandan on Oct 7, 2011 11:54 AM

Former Member
0 Kudos

Hi Chandan,

Instead of using 5 diffferent smartforms u can try using 5 different windows in a single smartform which would be much easier. Check

Thanks & Regards,

Neela M B

Former Member
0 Kudos

Hi Neela,

The smartform pages goes more than 40 pages . I cannot include all this using windows it wont fit.

Regards,

Chandan

Former Member
0 Kudos

Hi Chandan,

I dont think there is any page limit for smartforms. Please check

Thanks & Regards,

Neela M B.

Former Member
0 Kudos

Hi Neela,

Thanks for your reply .

I checked my requirement and each smartform should be developed separately and print using single driver program.

Regards,

pmchandan

Former Member
0 Kudos

Hi Chandan,

Use the function modules below to achieve ur requirement.

1.) SSF_OPEN

2.) SSF_CLOSE.

Thanks & Regards,

Neela M B

Former Member
0 Kudos

Hi Neela,

Thanks for your reply.

Can you please explain?

Regards,

pmchandan

Former Member
0 Kudos

Hi Chandan,

Check http://help.sap.com/saphelp_47x200/helpdata/en/64/bf2f12ed1711d4b655006094192fe3/frameset.htm and do some research.

gs_control_param-no_open = 'X'.

gs_control_param-no_close = 'X'.

CALL FUNCTION 'SSF_OPEN'

EXPORTING

control_parameters = gs_control_param..

CALL FUNCTION 'SSF_FUNCTION_MODULE_NAME'

EXPORTING

formname = lv_formname..

CALL FUNCTION lv_fm_name... " Do this for 5 outputs

CALL FUNCTION 'SSF_CLOSE'

Thanks & Regards,

Neela M B.

Edited by: Neela M B on Oct 7, 2011 4:54 PM