cancel
Showing results for 
Search instead for 
Did you mean: 

Single page-Multiple line items

Former Member
0 Kudos

hi all

In smartform i am not able to print priview the Single docu and corresponding line item in a single page.

DOcument no: 1112

have 10 line items, in print preview only 9 line item displayed in the first page

the 10 th line item diplayed in on next page with next document number

In command I have specified Goto new page(check box) and specify the condition

In coding

flag = 0.

on CHANGE OF wa_so-doc_number.

flag = 1.

ENDon.

how to display the doc no and corresponding line item in a single page?

Thanks

Accepted Solutions (1)

Accepted Solutions (1)

alex_m
Active Contributor
0 Kudos

For each document you need to call the smartform. Whats your requirement and what document you are printing?.

Former Member
0 Kudos

hi

In my program i am sending the internal table(with some calculations) to smart form,

In smartform i have to print the all document number(vbeln) in internal table ,

i have 100 doc number and each having multiple line item ,

My requirement is each documnet number diapalyed in a * seperate single page* with its correponding line items

i am using LOOP , COMMAND and CODE

In code i have specified

flag = 0.

on CHANGE OF wa_so-doc_number.

flag = 1.

ENDon.

but i am not preprle getting the document numbers in a single page and it's corresponding line item.....

Thanks

Former Member
0 Kudos

Hi,

You have a condition tab in the command window when you are printing it you need to check it with another variable.

and give a command tab whcih will take you to the new page.

Check this wiki for the [NEW_PAGE Triggering|http://wiki.sdn.sap.com/wiki/x/dAHDB]

In this wiki a new page will be triggered for the every new Carrid in the same way you ca print for new document number

Regards

Sarves

alex_m
Active Contributor
0 Kudos

Why dont you loop into that internal table in program and call smartform for each document. Thats the better approach I believe, if not you end up with some complicated scenario. If no way you need to look at the CONDITION or COMMANDS in smartforms.

Former Member
0 Kudos

hi Alax

Have u any sample code (or links ) for alling the smartform in driver program eithin the loop?

hi sana swaliha

In that wiki they have a single value but here i am having multiple document number...

CALL FUNCTION 'SSF_FUNCTION_MODULE_NAME'

EXPORTING

formname = 'Zformname'

  • VARIANT = ' '

  • DIRECT_CALL = ' '

IMPORTING

fm_name = fm_name

.

CALL FUNCTION '/1BCDWB/SF00000385'

  • EXPORTING

  • ARCHIVE_INDEX =

  • ARCHIVE_INDEX_TAB =

  • ARCHIVE_PARAMETERS =

  • CONTROL_PARAMETERS =

  • MAIL_APPL_OBJ =

  • MAIL_RECIPIENT =

  • MAIL_SENDER =

  • OUTPUT_OPTIONS =

  • USER_SETTINGS = 'X'

  • IMPORTING

  • DOCUMENT_OUTPUT_INFO =

  • JOB_OUTPUT_INFO =

  • JOB_OUTPUT_OPTIONS =

TABLES

lt_so = it_final

Here how to call the smartformt for the corresponding Document number?

Tanks

Edited by: dharma raj on Jul 14, 2009 5:06 PM

Edited by: dharma raj on Jul 14, 2009 5:12 PM

Former Member
0 Kudos

Hi,

You can handle this in the smartform itself

Under the Main window create a flow logic LOOP (This will have all unique doc numbers)

Under the loop create the TABLE node (This table will hold all doc numbers along with line items)

After this there will be command note for breaking to new page. Once all line items of one document is displayed new page will be triggered

Regards

Former Member
0 Kudos

For calling the smartform inside a loop, loop on the final table then do the following steps:

Instead of passing only the internal table, pass the document number in the Exporting parameters of the Function module.

And in the smartform just loop on the internal table with Where condition ( Show only those records which are equal to the Imported document number).

Also put the loop inside a Folder so that all the line items would occur on the same page.

Former Member
0 Kudos

hi Rajvansh Ravi

I have followed u r way only

In command i am using

On change of new document number

flag = '1'

I have mention this condition(flag = 1 new page) in COMMAND but I am not getting perfect output.....

Thanks

Former Member
0 Kudos

"Not getting perfect output" what would you think when computer prompts you with such a non-saying error message?

Former Member
0 Kudos

hi

I am not getting error any message

my req is

in page 1

Docu no 100

line item 1

line item 2

line item 3

Page 2

Docu no 101

line item 1

line item 2

line item 3

Page3

Docu no 103

line item 1

line item 2

line item 3

But i am getting

Docu no 100

line item 1

line item 2

line item 3

Docu no 101

line item 1

Page 2

Docu no 101

line item 2

line item 3

Docu no 103

line item 1

Page3

Docu no 103

line item 2

line item 3

My requirement is While in loop if the new document number then new page will be triggered and for theat docu number's corresponding line item displayed same page..?

Former Member
0 Kudos

looks like you have you new page condition on item level, tho on header level would be better.

Former Member
0 Kudos

Try using the Page-protection for the line items.

Answers (2)

Answers (2)

Former Member
0 Kudos

I have add flage statement 'X' in final internal table

In driver program

loop at itab

on change of Document number.

itab-flag = 'x'

modify table itab transporting flag.

endloop.

In smartform in conditon i have mentioned itab-flag = 'X' new page will be display the new doc number and it's corresponding line item.

Thanks to all for reply

Former Member
0 Kudos

Hi Dharam,

Even I think Alexendar is right. You wont have to print one smart form for 100 document number, rather one form for each document no and if this is the case then its better to call smart form for each document no separately rather passing all document numbers together.

Regards,

Sana.