cancel
Showing results for 
Search instead for 
Did you mean: 

Hi Experts, a question about smartform? thanks in advance!

Former Member
0 Kudos

Hi Experts,

I am working on a smartform, and in the main window there is a table to loop the product hierarchy and in the table there are two nodes, one is table line to displayt the product hierarchy text and after the table line it is a loop node which loops the materials that belong to the product hierarchy, but I have two requirements now, (1)if the product hierarchy is the last row of the page it need to be displayed on the first row of the next page in the main window, at the same time (2) if the first row of the main window on the pages except the first page(the first row in the main window on the first page must be product hierarchy text, this is for sure) is material(not the product hierarchy) the first row of the main window on this page should be the product hierarchy to which the material belongs, can anyone tell me how to solve this? thanks in advance!

Kind regards

Dawson

Accepted Solutions (0)

Answers (2)

Answers (2)

Former Member
0 Kudos

Hi,

(1)if the product hierarchy is the last row of the page it need to be displayed on the first row of the next page in the main window

first u describe the no of lines in ur internal table & create a COMMAND 'Go to New page'.

Now U decalre a variable for counter & a Flag variable to set the flag as 'X' when it reaches the last line of the table.

In loop put a counter variable, increase the counter for every row printing, when it reaches the last line of the tabel make the Flag variable as 'X' & call the COMMAND 'Go to New page', give Flag = 'X' in Condition tab of the COMMAND..

eg:

data : gv_counter type i,

gv_lines type i,

gv_flag.

decribe table itab lines gv_lines.

LOOP at itab.

gv_counter = gv_counter + 1.

IF gv_counter = gv_lines.

gv_flag = 'X'.

endif.

Here create a COMMAND, 'Go to New page' and give condition as gv_flag = 'X'.

endloop.

(2) if the first row of the main window on the pages except the first page(the first row in the main window on the first page must be product hierarchy text, this is for sure) is material

create a ALTRNATIVE in flow logic, it will generate two lights (TRUE, FALSE).

'&SFSY-PAGE&' Smartform variable will give u the current page, so use this and print Product Hierachy in first page & Material in next pages.

eg:

&SFSY-PAGE& = 1. --->Put this in Genreal Attributes of the ALTERNATIVE

TRUE

&product_hierarchy&

FALSE

&Material&

Hope it solves ur 2 problems....

Former Member
0 Kudos

Hi,

You can use page protection for this..

Just take a variable and pass the product hierarchy into it when ever it changes then give a condition to print it in the next page.

Check this link for page protection

[Page Protection in smartforms|https://wiki.sdn.sap.com/wiki/x/dAHDB]

or

In the table node you have an option in tab output there is a check box called page protection just check that check box..

Regards

Sarves