cancel
Showing results for 
Search instead for 
Did you mean: 

how can i repeatedly printing a page in smart form?

Former Member
0 Kudos

i hav two pages in a smartform and

i want to repeat these two pages based on customer no:

how it is possible?

Accepted Solutions (0)

Answers (4)

Answers (4)

Former Member
0 Kudos

Hi

You can use break point incase you create multiple pages in smart forms but for your requirement i understood u need different pages for different customers i.e one single form prints for different customers this is called dynamically while you loop (in print program) it as i showed in that example.

But why do you need a command or page break here.

Once you call your smart form this way independently it prints for all the customers your loop executes in print program and for each customer each page is displayed. No need for your smart form to hold pages. The print prgram will take care.

Reward Points If helpful.

Swetha.

Former Member
0 Kudos

hi swetha

i couldn't get ur Function module logic.

pls tell me about the parameters and loop.

where i can write the loop?

Former Member
0 Kudos

See first tell me anywhere in your program is there Function module:SSF_FUNCTION_MODULE_NAME ?????

Former Member
0 Kudos

hi swetha

in the End-of-selection event............

pls give the full function module with parameters definition....

and the loop

Former Member
0 Kudos

Follow This

Initially :

data: v_function type rs38l_fnam ,

wa_otf type ssfcrescl ,

i_otfdata type table of itcoo ,

i_otfdata2 type table of itcoo ,

v_function type rs38l_fnam.

1. CALL FUNCTION 'SSF_FUNCTION_MODULE_NAME'

EXPORTING

FORMNAME = ''

  • VARIANT = ' '

  • DIRECT_CALL = ' '

IMPORTING

FM_NAME = v_FUNCTION

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.

2. *-- managing print parameters for the PDF output

wa_param-langu = sy-langu.

wa_param-no_dialog = 'X'.

wa_param-getotf = 'X'.

CALL FUNCTION v_FUNCTION

EXPORTING

  • ARCHIVE_INDEX =

  • ARCHIVE_INDEX_TAB =

  • ARCHIVE_PARAMETERS =

CONTROL_PARAMETERS = wa_param

  • MAIL_APPL_OBJ =

  • MAIL_RECIPIENT =

  • MAIL_SENDER =

  • OUTPUT_OPTIONS =

USER_SETTINGS = 'X'

IMPORTING

  • DOCUMENT_OUTPUT_INFO =

JOB_OUTPUT_INFO = wa_otf

  • JOB_OUTPUT_OPTIONS =

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.

refresh i_otfdata.

3. Here do this

i_otfdata = wa_otf-otfdata.

loop at i_otfdata into wa_otfdata.

append wa_otfdata to i_otfdata2.

clear wa_otfdata.

endloop.

This all to be done after your end of selection event.

4.call function 'SSFCOMP_PDF_PREVIEW'

EXPORTING

i_otf = i_otfdata2

EXCEPTIONS

CONVERT_OTF_TO_PDF_ERROR = 1

CNTL_ERROR = 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.

Former Member
0 Kudos

hi swetha

in tis case, where u r passing the internal table that contains the line items?

Former Member
0 Kudos

after each customer put a forceful page break..use the command node

Former Member
0 Kudos

pls tell me how can i do the page break?

Former Member
0 Kudos

Hi,

You have to create a command to put a page break.

In command node check the "go to new page" and subsequently enter the page name to which you want to break.

Regards,

Shaheen.

Former Member
0 Kudos

Hi

You can do this by keeping one single smart form common and your print program loop around this form to print it for any number of customers.

In smartform dynamically pass your customer number.

Swetha

Edited by: Swetha on Jun 26, 2008 6:03 PM

Former Member
0 Kudos

but i want each customer in a new page

Former Member
0 Kudos

This will exactly print different customers in different pages. the trick is here u maintain single smart form and make it print in your print program for different customers

there was similar kind of requirement for me i did it in same way.

Former Member
0 Kudos

sorry i didn't get u.

pls, tell me the solution in detail..............pls.............

Former Member
0 Kudos

Hi

Good morning!!

You must be using pdf output in order to print the output for 1 customer.

And there you must be passing OTF table. There you loop around the OTF internal table and append it into another inertnal table.

example:

data: v_function type rs38l_fnam ,

wa_otf type ssfcrescl ,

i_otfdata type table of itcoo ,

i_otfdata2 type table of itcoo .

CALL FUNCTION 'SSF_FUNCTION_MODULE_NAME'

EXPORTING

FORMNAME = 'Form Name'

IMPORTING

FM_NAME = v_FUNCTION

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 v_FUNCTION

EXPORTING

CONTROL_PARAMETERS = wa_param

OUTPUT_OPTIONS = wa_options

USER_SETTINGS = 'X'

IMPORTING

JOB_OUTPUT_INFO = wa_otf

TABLES

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.

i_otfdata[] = wa_otf-otfdata[].

loop at i_otfdata into wa_otfdata.

append wa_otfdata to i_otfdata2.

clear wa_otfdata.

endloop.

If you look at the otf table iam looping it where this contains your pdf form with 1 customer when iam appending it the form is being printed for those many customers in individual pages.

Revert if you have doubts.

Have a nice day!

Swetha.

Former Member
0 Kudos

not getting ur requirement mate!!!!!!! pls elaborate

Former Member
0 Kudos

ie, if i hav 3 customers, it should print the details 3 times in new pages based on the customer