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

SMARTFORMS, any questions

Former Member
0 Likes
1,149

Hi all,

i must create a smartforms for my customer.

Quickly he want to select 1..N employee(s) in ALV grid, and when he click on one button, smartforms is launched, but my customer want to print every forms in one time, i.e each form comes following the other, in fact in a pool.

Any ideas ?

Regards,

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
1,126

Ok, i must pass employees code in table and in smartforms, for each employee i must get data. But i heard that this method is low compared to the method to pass all data in table ?

Regards,

Hi all,

i must create a smartforms for my customer.

Quickly he want to select 1..N employee(s) in ALV grid, and when he click on one button, smartforms is launched, but my customer want to print every forms in one time, i.e each form comes following the other, in fact in a pool.

Any ideas ?

Regards,

9 REPLIES 9
Read only

Former Member
0 Likes
1,126

up

Read only

Former Member
0 Likes
1,126

Hi,

Have the smartform developed, to which you pass all the selected employees in a internal table...

Loop on this internal table and display the relevant data for each employee... so, if 5 employees are selected(lets say its 2 pages for each employee), you get data for each employee one after other (in total 10 pages)

Regards,

Raj

Read only

Former Member
0 Likes
1,126

Hi,

Once user selects the customer which he want to print trap all the customer details in Internal table & then pass this internal table data to smart forms and also write the logic in smartforms layout that for each new customer trigger new page . with this you can print all the customer at once.

check any of the SAP created smartforms example :LB_BIL_INVOICE base on this you can write your logic.

Hope this will help you.

Thanks

Rajeev

Read only

Former Member
0 Likes
1,127

Ok, i must pass employees code in table and in smartforms, for each employee i must get data. But i heard that this method is low compared to the method to pass all data in table ?

Regards,

Read only

0 Likes
1,126

I don't understand. Well, i pass table with all employees but how can i do for each employee to print a form ? if i loop on table how to create rupture when employee change ?

Read only

0 Likes
1,126

Is not better to use import parameter of the generated function module: CONTROL_PARAMETERS ?? Particularly NO_OPEN and NO_CLOSE parameters ?

Read only

0 Likes
1,126

Hi ,

In you program you can control While calling the form.

Please call smartform between Loop at end loop of your internal table.

Call you smart form in the loop.

Please make sure Dialog will be open once means program will ask for O/P device for Once.

Need help let me know. I have developed a form for HR records for employees and if user selects 'N' no.of enmloyees but form prints all in one shot. But printer will be asked only once and if you run this in back groud it will check user default printer.

Hope this will help.

Read only

0 Likes
1,126

Thanks so much Lanka,

you save me i will not hesitate to ask for your assistance.

Regards.

Read only

0 Likes
1,126

Hi,

print forms in one spool work good, thank so much but i've a little problem. I want to suppress all output dialog windows, when user click on button i want directly to preview forms.

I've a internal table with employee number and i do that (simplified version) :

LOOP AT it_pernr_to_print INTO wa_simple.

PERFORM prepare_data.

PERFORM transfer_data_to_smartforms.

ENDLOOP.

FORM transfer_data_to_smartforms USING p_index

CALL FUNCTION 'SSF_FUNCTION_MODULE_NAME'

EXPORTING

formname = 'ZHR_PRF_SHEET'

  • VARIANT = ' '

  • DIRECT_CALL = ' '

IMPORTING

fm_name = fm_name

EXCEPTIONS

no_form = 1

no_function_module = 2

OTHERS = 3.

IF p_index EQ 1. " First call

ctrl_param-no_open = space.

ctrl_param-no_close = 'X'.

ctrl_param-NO_dialog = 'X'.

output_param-TDDEST = 'PRINTER'.

ELSEIF is_last EQ 'X'. " Last call

ctrl_param-no_open = 'X'.

ctrl_param-no_close = space.

ctrl_param-NO_dialog = 'X'.

output_param-TDDEST = 'PRINTER'.

ELSE.

ctrl_param-no_open = 'X'. " Nth call

ctrl_param-no_close = 'X'.

ctrl_param-NO_dialog = 'X'.

output_param-TDDEST = 'PRINTER'.

ENDIF.

CALL FUNCTION fm_name

EXPORTING

CONTROL_PARAMETERS = ctrl_param

OUTPUT_OPTIONS = output_param

personal_data = prfl_0002

since_data = since_data

init_edu_level = 'TEST'

init_edu_spe = 'TEST'

TABLES

it_language = it_lang

it_training_group = it_training

it_opc = it_opc

it_prc = it_prc

it_last_dev = it_last_dev.

ENDFORM.

With this code, output dialog always display.

Regards,