cancel
Showing results for 
Search instead for 
Did you mean: 

SMARTFORM Table stopping after 1 line on second page

Former Member
0 Kudos

Hi. I created a smartform with a table in the main window, and it was working fine no matter how big the table got, it would grow over many pages. I got up to 300 pages as a test and it was all fine.

Then suddenly it has stopped working, it will now only print 1 line on a second page and stops there, even though there is a lot more data and it should carry onto 3 or 4 pages.

I have tried making the table and the main window bigger and smaller but it still stops after 1 line on the second page.

Does anyone have any idea what is wrong?

Thanks a lot for your help.

Regards,

Dave.

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi,

Please check the data tab in the table. there give row from 1 to 999999.

Thanks,

Suma.

Answers (5)

Answers (5)

Former Member
0 Kudos

Hi David,

This is caused by program line which placed in Page element, when there are more than one page output, code in the program line will be executed times. It's Inconsistent. hope useful to you.

Regards,

Jie

Former Member
0 Kudos

Hi,

Please check while looping the internal table in the table node are you using any thing in the WHERE clause.

If so then for the rest of the rows not selected for display the condition is becoming false.

Regards,

Ram

Former Member
0 Kudos

Hi. No, there is no where clause. I only move from 1 table to another becuase I want to do a few calculations and change some of the field contents.

In the program that calls the smartform I need to get the table back with the original data unchanged, so I put a new internal table in the smartform then loop every record into it but change a bit of the contents.

I have debugged it and it definitly has every record from the original table in the new table, yet if the code is in a secondary window I lose everything after 1 line on page 2, no matter how many records are in the table.

I think I might put it down to it being a "feature". At least I have found a way round it.

Thanks a lot everyone for your help.

Regards,

Dave.

Former Member
0 Kudos

Hello David,

1. Put a break point in INITIALIZATION and check the internal table whether number of records are ok or not.

2. check whether there is any condition in the tables or Loop column.

check the same for second page.

Please revert back incase things are ok and still not working.

Please copy paste your initialization part code that would be helpful.

Best Regards,

Suvendu

Former Member
0 Kudos

Hi. I put a break point in my program lines and there are definitly the right number of lines in the internal tables, yet only the first 32 are printing, which is 1 page plus 1 line.

I have no initialization code, it is all in a program lines insert in the window.

It works fine if the code is in the main window, but if the code is in the secondary window it only prints 1 line on page 2 then stops.

I have moved the sequence of the windows around and now everything is fine, there are no warnings even, but it is still very strange that it would stop at 1 page plus 1 line when the code is in the different window, what difference should it make?

The code is very basic, please see below.

Regards,

Dave.

DATA: l_mod TYPE ekpo-netpr.

l_items[] = i_tab_item[].

LOOP AT l_items INTO wa_items.

  • calc totals

wa_net_total = wa_net_total + wa_items-item_amount.

wa_tax_total = wa_tax_total + wa_items-tax_amount.

wa_gross_total = wa_gross_total + wa_items-item_amount + wa_items-tax_amount.

  • calc net unit cost and store in item amount

wa_items-item_amount = wa_items-item_amount / wa_items-quantity.

  • get item desc

SELECT SINGLE txz01

FROM ekpo

INTO wa_items-item_text

WHERE ebeln = wa_items-po_number

AND ebelp = wa_items-po_item.

IF sy-subrc NE 0 OR wa_items-item_text IS INITIAL.

wa_items-item_text = 'Not available'.

ENDIF.

WRITE: wa_items-gross_amount TO wa_items-total_c DECIMALS 2,

wa_items-item_amount TO wa_items-net_c DECIMALS 2,

wa_items-tax_amount TO wa_items-tax_c DECIMALS 2.

  • calc qty

l_mod = wa_items-quantity MOD 1.

IF l_mod EQ 0.

WRITE wa_items-quantity TO wa_items-quantity_c DECIMALS 0.

ELSE.

WRITE wa_items-quantity TO wa_items-quantity_c.

ENDIF.

CONDENSE: wa_items-total_c, wa_items-net_c, wa_items-tax_c, wa_items-quantity_c.

MODIFY l_items FROM wa_items.

ENDLOOP.

WRITE: wa_net_total TO wa_net_total_c DECIMALS 2,

wa_tax_total TO wa_tax_total_c DECIMALS 2,

wa_gross_total TO wa_gross_total_c DECIMALS 2.

CONDENSE: wa_net_total_c, wa_tax_total_c, wa_gross_total_c.

Former Member
0 Kudos

Hello David,

Even I created a same test case and same thing happened in my demo server.

We can't just loop around Variable Window or any other window. Loop is always

done around Main Window. Even if we loop around other windows apart from main window

it is only going to get called once.

So, we need to loop around only across Main Window.

Hope this solves your issue.

Cheers,

Suvendu

Former Member
0 Kudos

Hi. My actual loop round an internal table to output the smartform table is in the main window. It is just a bit of code that moves data into the internal table that I tried to put in the secondary window. The secondary window appears above the main window so I thought it best to put the code here initially.

The code fully executes, I have debugged it and in my test the internal table starts with 0 values and 48 are put into it in the secondary window, but then the same internal table is output in the main window only 31 values appear.

As I say it is all working now as I have moved the code to the main window and changed the sequence of the windows so the secondary is after the main, but if the code is executed and 48 values go into the table, why are 31 appearing, it seems very strange.

Regards,

Dave.

Former Member
0 Kudos

Hi,

also check the conditions tab on table .

Thanks,

Suma.

Former Member
0 Kudos

Hi. I had already checked this, and it made no difference.

I have just managed to get it working, but it is still a bit strange.

I was moving the data from 1 internal table to another in the program lines of a secondary window, then used the second internal table to loop into the form table. I also used the same program lines to calculate some data for the secondary window.

I changed the secondary window to a late window and moved the program lines into the main window and it started showing all the table lines. I now get a warning every time stating that some of the values in my late window are not populated, even though they are and it shows fine.

I could split the program lines out and put basically the same code in the late window as well as the main window, but that does not seem right, there should be a better way of doing this.

Does anyone have any ideas?

Regards,

Dave.

Former Member
0 Kudos

By the way I have checked and there are no restrictions on any of the elements, and I have not restricted the number of lines that it will loop into.

Thanks,

Dave.