cancel
Showing results for 
Search instead for 
Did you mean: 

Problem with smartform

Former Member
0 Kudos

I am passing the header and item data in two internal tables to the smartfrom interface under tables option, now i am not able to handle the header and as well as item data in the smartform, when ever i am trying to run the smartform it is displaying only one page output, even when i am having 3 hearder records in the internal table ( i need 3 pages to be printed) and also when there are more items for a particular header data then the content should be flowed to the next page, which now i am not able to control in the smartform. can any body tell me what exactly i need to follow to get a proper output

thanks in advance

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

copy the same page again to a new page..

and make page 2 as next page of page 1... and page2 as next page of page 2

Answers (2)

Answers (2)

Former Member
0 Kudos

thanks for the helpful replies

Sandra_Rossi
Active Contributor
0 Kudos

You marked this thread "answered". As requested per forum rules, could you please give a feedback? (in respect to all people who tried to help you, and for people who might seek for help)

THX A LOT

former_member217544
Active Contributor
0 Kudos

Hi,

Did you checked whether the next page option in the general attributes tab of the first page is defined properly(Is set to trigger the next page) ?

Regards,

Swarna Munukoti

Former Member
0 Kudos

i have designed the FORM on only one page, so when i chk that in box it is showing only first. and morevoer i am passing the item table to the main window table node

Edited by: ABAPER1234 on Dec 23, 2009 9:52 AM

anup_deshmukh4
Active Contributor
0 Kudos

You use a pagebrake command if you want .....Hope it helps

Former Member
0 Kudos

still not able to get a solution for this

former_member217544
Active Contributor
0 Kudos

Hi,

Did you Implemented the suggestion provided by Soumya? What problem you are facing after copying to second page?

Regards,

Swarna Munukoti

former_member212002
Active Contributor
0 Kudos

In Samrtforms, Normal Windows are not nested over pages.

I think in your case you are using normal windows. Declare your data inside the main window using tables and you will get the desired output.

Revert back, if you need any more clarifications.

Regards

Abhinab Mishra.

Former Member
0 Kudos

Yes i am using secondary windows to display the header data and the item data is passed in the main window under the tables node

former_member212002
Active Contributor
0 Kudos

Are you looping your internal table in the smartforms ??

I think you are not.

If your main windows, tables are inside a loop then definitely it will continue until the last record is printed.

Regards

Abhinab Mishra.

Former Member
0 Kudos

No i am not doing any loop on the on the internal table... the scenario is like this

i have a header table with 3 records and item with 10 records.. i am passing both of them to the function module ( fm_name) and then in the smartform i have to get 3 pages output. but right now i am getting only one page..

to display the header data i am using secondary windows and for displaying the item data i am using tables node in the main window ( in the data tab of the tables node i am giving it as loop it_item1 into wa_item1 ). before the header row of that table node i have created a table node and in that i am prearing the item table it_item..as

describe table i_hdr line h_lines.

if h_idx LE h_lines.

READ TABLE i_hdr into wa_hdr index h_idx.

if sy-subrc eq o.

loop at it_item into wa_item where belnr = wa_item-belnr.

move wa_item to wa_item1.

append wa_item1 to i_item1.

clear wa_item1.

endloop.

endif.

this is what i am doing it right now.. and at the last row in the footer of table node i have created a command node and in that i have selected the option go to page : first page.

please correct me if my approach is wrong

former_member212002
Active Contributor
0 Kudos

From your explanations, the picture that I gathered is that you are populating the item level internal table inside the table of main window.

And also you are looping that table node according to the item internal table which is being prepared inside the table.

I suggest you to populate the internal table in the Initialization tab of the smartform if you are using a local internal table that is being declared and populated inside the smartform.

If your internal table is from the print program then prepare the item level internal table before calling the FM for the smartform.

On What conditions you are having a dynamic page break ??

That is on what conditions the Conditions tab will be triggered ???

I think the page break may also creating a problem...

If this doesn't solve the problem then sendl me your smarform XML and i will try to have a look in my system.

Regards

Abhinab Mishra

former_member217544
Active Contributor
0 Kudos

Hi Abaper,

I think the problem is with the loop that you coded.

Check this one:


describe table i_hdr line h_lines.

if h_idx LE h_lines.

READ TABLE i_hdr into wa_hdr index h_idx.
if sy-subrc eq o.
loop at it_item into wa_item where belnr =  wa_hdr-belnr     "wa_item-belnr. change the where condition of loop
move wa_item to wa_item1.
append wa_item1 to i_item1.
clear wa_item1.
endloop.
endif.

Now try.

Also you gave condition h_idx is LE h_lines: That means teh code inside the if conition will execute only once irrespective of teh number of header records in i_hdr.

I guess your intention is to get all items for all header items.

if so use do enddo.


describe table i_hdr line h_lines.

do h_lines times.

READ TABLE i_hdr into wa_hdr index h_idx.
if sy-subrc eq o.
loop at it_item into wa_item where belnr =  wa_hdr-belnr     "wa_item-belnr. change the where condition of loop
move wa_item to wa_item1.
append wa_item1 to i_item1. " Now i_item1 contains all the lien iems of all header records
clear wa_item1.
endloop.
enddo.

Regards,

Swarna Munukoti.

Edited by: Swarna Munukoti on Dec 23, 2009 8:16 AM