cancel
Showing results for 
Search instead for 
Did you mean: 

how to print last page in smartforms

Former Member
0 Kudos

Hi,

In my smartform i have 3 pages (FIRST, NEXT & LAST). FIRST contains some header detail and items. NEXT contains rest of items and this page would be repeatable if more item comes. now after NEXT i want to print LAST page. How to achieve this. PLease let me know. I looked into forum but haven't get exact answer so far.

Rgds

Accepted Solutions (0)

Answers (3)

Answers (3)

Former Member
0 Kudos

Hello,

According to your scenario you are having 4 orders and each order has to print seperately with the last page .right?

The best soln would be,

1) create another internal table same as the one you have and delete adjacent duplicates using order, so you will have 2 internal table one with 4 orders (it-1)and other with all the items(it-2).

2) In the driver program ,

CALL FUNCTION 'SSF_FUNCTION_MODULE_NAME'

control-no_open = 'X'.

control-no_close = 'X'.

output-tdnewid = 'X'.

PERFORM ssf_open.

CALL FUNCTION 'SSF_OPEN'

EXPORTING

  • ARCHIVE_PARAMETERS =

  • user_settings = ' '

  • MAIL_SENDER =

  • MAIL_RECIPIENT =

  • MAIL_APPL_OBJ =

output_options = output

control_parameters = control

  • IMPORTING

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

LOOP AT it-1.

CALL FUNCTION l_fm_name

endloop.

CALL FUNCTION 'SSF_CLOSE'.

2) In the smartform

FIRST -> next page -> NEXT

Beneath the main window -> Table, put Command - Goto new page as LAST.

NEXT -> next page -> NEXT

LAST -> Next page -> Blank

I hope this will work as I have done a similiar dev.

Regards,

Radhakrishnan

Former Member
0 Kudos

HI friends try this it works!!!!!!!!

1.In the first page add a command node in the main window, add it as the last node of the main window.

2.In the command node select the check box (go to new page) and specify the third page in the drop down menu.

3.Now in the last page (3rd page) add your terms and conditions as text element in the main window, and  select the check box in condition tab ' only on page' and also select the last page name from the drop down box.

4. In the condition tab of main window of 3rd page select select the check box ' only on page' and also select the last page name from the drop down box.

5.now copy the text element of the main window of the last page(terms and condition) and paste it below the command node of first page.

6.Do the same done on first page in second page also.

Former Member
0 Kudos

you do not put the command line in the table node. You need to put it in the main window at the very end.

Right click on Main Window - Choose Create - Flow Logic - Command. Make sure you drag it to the very bottom of the main window. Check Go to New Page and select your last page.

This should solve your problem.

Former Member
0 Kudos

Hi,

in the main window after the table node create the command node

in the command node next page as your last page

in the last page - next page will be blank

Hope u resolve u r issue

Let me know if u have any concerns....

Regards,

Lokesh

Former Member
0 Kudos

Hello Lokesh,

Thanks for your reply. Here is what i have done and what im getting. Please take a look:

i) I have 4 orders in my itab. 001(3 items), 002(2 items), 003(30 items) & 004(4 items).

ii) In table node (data tab) i checked (chk box) the 'at end of sort' event which created a subnode under main area of table node.

iii) for this event node i have created a command node by saying 'go to next page as last page which i believe means once order gets change it will trigger last page for previous order. I have sorted my itab. Here comes my issue as after printing 3 items of ordr 001 it is not printing Last page but triggering Next page with Ordr 002.

iv) For last page i kept next page as First page so that after printing Last page for order 001 it will trigger First page for order

002.

Please advise or let me know if i can make it more clear.

Rgds

Sudhanshu