cancel
Showing results for 
Search instead for 
Did you mean: 

how to print page dynamically in smartforms

Former Member
0 Kudos

Hi All,

Please help on below case...

1. I have developed a smartform which has 5 pages in total . Through driver program passing 4 internal tables...

first page - will print all times... - consuming first internal table data

second page - need to print dynamic - consuming data from second int table

third page - need to print dynamic - consuming data from second int table

fourth page - need to print dynamic - consuming data from thrid int table

fifth page - need to print dynamic - consume data from fourth int table

dynamic condition is determined in driver program ... but how to implement dynamic determination in smartforms..

sometimes ...based on data ...we need to print first page , and fifth page only ...

as of now all 5 pages are printing ...

Expect the advise from expertist...

Thanks and Regard

Ramasi

Edited by: ramasi on Sep 1, 2011 11:29 AM

Accepted Solutions (0)

Answers (2)

Answers (2)

Former Member
0 Kudos

Hello,

Plz use this code, may be it will help you as given below:

CALL FUNCTION 'READ_TEXT'

EXPORTING

id = '0001'

language = sy-langu

name = v_name

object = 'VBBP'

TABLES

lines = dt_lines

EXCEPTIONS

id = 1

language = 2

name = 3

not_found = 4

object = 5

reference_check = 6

wrong_access_to_archive = 7

OTHERS = 8.

IF sy-subrc <> 0.

  • MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO

  • WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.

ELSE.

But kindly note that plz don't use the exception (code) for the purpose, May be thi will hlp you for the purpose.

Thanks & Regards,

Akg

Former Member
0 Kudos

Hi ,

Thanks for your reply ...

My question is how to print back up pages ( totally contains 5 pages including main page) dynamically in smartforms...

Based on element catgeory I am passing gloabl variables as an interface from driver program to smartforms ..

but how do I control printing pages based on that interface parameters...

hope u got my question..

Appreciate your reply,.

Thanks

Ramasi.

Former Member
0 Kudos

Hello,

Please resize your setting for the smartforms page and also may decrease the size of yr template size in smartforms. I hhope,this will help you.

Thanks & Regards,

Akg

Former Member
0 Kudos

Thanks for your reply ,

but could not get you reply in conjunction with my req..

I am passing parameters( element category which is beingh determined in my driver pgm) to the smartrforms..

say for example gv_secondpage , gv_thirdpage, gv_fourthpage & gv_fifthpage ..

IN driver program determination logic of ele category ... for example gv_thirdpage = X ....

GV_fourthpage and gv_fifthpage are NOT equal to X...

in that case my req is ...only first page( print in all cases , so no need to determine for to print 1st page) and third page ..

but now all first page plus remaining four pages are being printed , though fourth and fifth page does not have any data to print , but still prints static data ...in those pages which is not good ..

Appreciate your help on my req..

Thanks

Ramasi//

Former Member
0 Kudos

well you should first make some pseudo code, where you write down, what page has to trigger when and why.

Then you should try to port this into conditions.

Based on these you can then process the correct pages in your smartform using a condition node and control nodes.

Former Member
0 Kudos

Hi ,

Thanks for your reply,

I had set up global variable where we set which page to be printed indriver program ..

for example : gv_third = 'X'.

and rest all gv_second , gv_fourth and gv_fifth are all not set ..

It means I need first page and third page to be printed ... anyway first page will print ...but how to say third page to be printed..

though ABAPer for few years I am not expert in smartforms ...

Pls advise...

Thanks

ramasi

Former Member
0 Kudos

create a command node.

On the tab "general Attributes" check the checkbox in the top left corner "goto new page" in the popupdropdown box right beneath it, you can tell him to what page he actually should switch.

Former Member
0 Kudos

Thanks for your reply ....

In that case , it will print only one additional page ...in case if i want to print two pages...

for example .....

In driver program ...based on element cataoegory.... third and fourth page has to be printed in addition to main /first page..

how do I control that ...

..do i have to create command node at each page ... or only at main/first page wityh five command node for each page...

Appreciate your reply ...

Thanks and regards

Ramasi..

Former Member
0 Kudos

Well, you have some possibilities.

You could either have those command nodes on every page, and decide from page to page where to jump to next.

Or you could make use of the "following page" function. Every page has a sucessor page you can define.

On this page then again you can decide via condition if there is something to print or not.

Former Member
0 Kudos

Hi,

Thanks for your reply,

I am having main window in the first page ...rest of the pages are having only secondary windows.. does that matter for command node to be added....?

Because ... seems to be only first page what ever conditional variable we passed... it works... rest of the pages does not..

I tried this below way as well..

except first page , in rest of the pages i have added a command node at window where we have looping the table ..but it does not work...

Appreciate your reply...

Thanks

ramasi

raviahuja
Contributor
0 Kudos

Hi,

It is advised that Main Window to continue on all pages except if you need to print hard coded things on pages. I would suggest you that create 5 pages with main window in each. Now write below logic in Main window of 1st page:

Print 1st internal table.

Check if Second internal table contains any entries and if yes, use command prompt to go to second page. (I'm not sure, if you will always have many entries to fill both second and third page).

Similarly check if Third internal table contains any entries and if yes, use command prompt to go to 4th page.

and same with fourth internal table.

Thanks.

Ravi

Former Member
0 Kudos

Hi ,

Thanks ,

But I am getting an error as standard exceptions been raised from standard .when I changed & execute after changed back up pages frm secondary window to main window..

Appreciate your reply...

Thanks

Ramasi