Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

smartform output issue

Former Member
0 Likes
994

Hi,

one of smartform output conatanis 10 customer address.

when i click on print button it will print first customer address.

when i click on second time it will print second customer address.

i want to get the print for all customers at a time.

where can i change the code means smartform or printprogram.

Regards,

Suresh

3 REPLIES 3
Read only

Former Member
0 Likes
672

Hi Suresh,

Its simple now its generating individual Spool requests. Just make only one spool request.

here is a sample code for that..

DATA:

W_INPUT TYPE SSFCOMPIN,

W_CONTROL TYPE SSFCTRLOP.

W_INPUT-DIALOG = 'X'.

CALL FUNCTION 'SSFCOMP_OPEN'

EXPORTING

INPUT = W_INPUT

EXCEPTIONS

ERROR = 1.

LOOP AT IT_FINAL INTO WA_FINAL.

W_CONTROL-NO_OPEN = 'X'.

W_CONTROL-NO_CLOSE = 'X'.

CALL FUNCTION FNAME

EXPORTING

CONTROL_PARAMETERS = W_CONTROL

GV_MATNR = WA_FINAL-MATNR.

ENDLOOP.

CALL FUNCTION 'SSFCOMP_CLOSE'

EXCEPTIONS

ERROR = 1.

Thanks & regards,

Dileep .C

Thanks.

Read only

Former Member
0 Likes
672

Hi Suresh

Go for below approach

1) Use below parameters of structure SSFCTRLOP

NO_OPEN, NO_CLOSE: These two flags prevent the print request from being closed after accepting the output of the Smart Form and allows you to include all other form output into this print request. The value should be like the following:

1st call:

NO_OPEN = SPACE.

NO_CLOSE = 'X'.

nth call:

NO_OPEN = 'X'.

NO_CLOSE = 'X'.

last call:

NO_OPEN = 'X'.

NO_CLOSE = SPACE

2.SSFCOMPOP: Structure for the output option.

TDNEWID: A flag indicating whether a new request is created.

4) Define one data wa_print_control referencing the structure SSFCTRLOP, and define another data variable wa_output_option referencing the structure SSFCOMPOP in the top include file of this report.

5) Clear the above two work areas before the print loop happens on the internal table that contains the selected invoice headers.

6) Initialize these two work areas with the values which would not change during the print loop as the following code fragment:

wa_print_control-no_dialog = ' '. u201DShow print setting dialog

wa_print_control-preview = 'X'. u201DEnable print preview

wa_output_option-TDNEWID = 'X'. u201CNew spool request.

7) In the loop at the internal table which holds the selected invoice headers, set blank value to of the field wa_print_control-NO_OPEN and set u2018Xu2019 to the field wa_print_control-NO_CLOSE for the first loop at the AT FIRST event because it will be the first call to the function module of the smartform. The code is bellow:

print_control-no_open = ' '.

print_control-no_close = 'X'.

😎 Set blank value to the field wa_print_control-NO_CLOSE to close the spool request for the last loop at the AT LAST event.

wa_print_control-NO_CLOSE = u2018 u2018

9) Call the function module generated by the Form Design by passing the print control work area and output area.

Thanks

Lavanya

Read only

Former Member
0 Likes
672

hi,

you will have to change in the logic..

take a internal table fill all the address in it..

make a loop in this table and print all the address on the smart form.

hope this helps

regards

Ritesh Jha