cancel
Showing results for 
Search instead for 
Did you mean: 

Smartform FM in Loop .. Endloop

Former Member
0 Kudos

Hello All,

I am am calling the smartform FM in a loop and endloop.. i know it will give a performance problem, but i have no option left.. so.. how to get a single spool for the output.. as if it is in loop .. endloop there will be one spool for each loop pass. i dont want that..

please help me with a solution for this

Th

Accepted Solutions (0)

Answers (6)

Answers (6)

Former Member
0 Kudos

There is a example program calling smartform in loop and also print in 1 spool.

Check this program in SE38 "SF_EXAMPLE_03".

Cheers!

Former Member
0 Kudos

thanks for your quick help

Former Member
0 Kudos

Dont pass anything.just call these function modules.

Former Member
0 Kudos

Hi,

Use function module SSF_OPEN before ur loop and after ur loop use SSF_CLOSE.

create a strucutr of type SSFCTRLOP.

fill it with SSFCTRLOP-NO_OPEN = 'X'.

SSFCTRLOP-NO_CLOSE = 'X'.

Pass it to the CONTROL_PARAMETERS of smartfrom of function module.

CONTROL_PARAMETERS = SSFCTRLOP.

it will generate the one spool request.

Former Member
0 Kudos

what are the parameters that we need to pass to the FM SSF_OPEN, SSF_CLOSE ?

Former Member
0 Kudos

Hi,

Can you do 2 step process

1) Unselect 'Output immediately' in user parameter, and check you issue solved.

2) If above step works, then find field in control parametrs and pass value as initial.

Thanks

Former Member
0 Kudos

Hi,

You have a field like new_spool_id ...

Set that to 'X' in the parameters.

You shall get a new spool for every call.

Thanks,

Bhupal

Former Member
0 Kudos

i dont want multiple spools... i want only one spool.. suppose i have looped the SF for 5 times then.. i have to get only one spool with all the five FORMS output in one spool

Former Member
0 Kudos

Clear the same parameter ... even if it is coming in different spools .. please contact your Basis person.

viquar_iqbal
Active Contributor
0 Kudos

Hi

Have a look at this wiki [smartform|http://www.sdn.sap.com/irj/scn/index?rid=/library/uuid/62ae7fcd-0b01-0010-3e9d-a54f26944450]

Hope this helps!!!

Former Member
0 Kudos

here is the way i am calling the samrtform in a loop.. see the code and let me know how i can generate the single spool for multiple outputs

loop at pi_fackop into pwa_fackop.

    • function to call SMARTFORM

CALL FUNCTION 'SSF_FUNCTION_MODULE_NAME'

EXPORTING

formname = cc_formname

IMPORTING

fm_name = l_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.

*Calling the smartform Function Module

break ramarajg.

CALL FUNCTION '/1BCDWB/SF00000156'

EXPORTING

  • ARCHIVE_INDEX =

  • ARCHIVE_INDEX_TAB =

  • ARCHIVE_PARAMETERS =

  • CONTROL_PARAMETERS =

  • MAIL_APPL_OBJ =

  • MAIL_RECIPIENT =

  • MAIL_SENDER =

  • OUTPUT_OPTIONS =

  • USER_SETTINGS = 'X'

wa_fackop = pwa_fackop

  • IMPORTING

  • DOCUMENT_OUTPUT_INFO =

  • JOB_OUTPUT_INFO =

  • JOB_OUTPUT_OPTIONS =

tables

i_facpos = pi_facpos1

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.

former_member217544
Active Contributor
0 Kudos

Hi Abaper,

Check these links. You need to use the parameter 'CONTROL_PARAMETERS' of your function module '/1BCDWB/SF00000156'

Also from SAp Help:

http://help.sap.com/saphelp_nw04/helpdata/en/64/bf2f12ed1711d4b655006094192fe3/frameset.htm


You use these parameters to include several forms into one print request. When calling the generated functions modules, set the parameters as follows:

1st call: NO_OPEN = SPACE. 
NO_CLOSE = 'X'. 
nth call: NO_OPEN = 'X'.
NO_CLOSE = 'X'. 
last call: NO_OPEN = 'X'. 
NO_CLOSE = SPACE .

Regards,

Swarna Munukoti

Edited by: Swarna Munukoti on Jan 4, 2010 10:06 AM

Former Member
0 Kudos

Hi ,

Check the parameters in the FM for the smartform .

Regards

Arun