Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

SMARTFORMS Using tables

Former Member
0 Likes
1,059

Hello guys, i need some help with respect to, designing a smart-forms using tables pa0001, pa0002, pa0006, T527X. Where, i have to fetch a details from a mentioned tables, which will display the PERNR values in two different pages, where-in each page will display only 2 PERNR values, I,e., PERNR Number 1 and PERNR Number 2

Note: Fields from the Tables are:     

                                                    

Table
Field_name
PA0001ORGEH
PA0002

VORNA

NACHN

NATIO

PA0006

PERNR

BEGDA

ENDDA

T527XORGTX

AND THE OUT-PUT SHOULD LOOK LIKE AS BELOW

PAGE: 1

PERNR
VORNA
NACHN
NATIO
ORGEH
BEGDAENDDAORGTX
1XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
2XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

PAGE: 2

PERNR
VORNA
NACHN
NATIO
PERNR
BEGDAENDDAORGTX
3XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
4XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX


NOTE: 'X' some values

Message was edited by: Anand Maverick kindly, replay with a screen shots

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
1,007

create a program lines in main area of your table node.

here you have to write code:

g_counter = g_counter + 1.

abc = g_counter mod 2.

if abc = 0.

g_flag = 'X'.

else

clear g_flag.

g_flag = '  '.

endif.

you have to put g_flag and g_counter in output parameters of program lines.

define g_flag and g_counter in global definition part of smartform.

you have to create a command in main area of table node. select main area of table node and right click on it and create loop. here you have to put your final internal table. then right click on loop node and create command. in your program 8 cell present. right click on any of cell and create program lines. create 1st command, next create program lines. in command, 2 tabs present. general attributes tab-> you have to check go to new page and give next page name like NEXT.  in condition tab, put g_flag = 'X'. at last in next page, you have to copy main window node from page 1 .

i explained details and step by step.. follow it....hope your problem will be solve.........

Regards

Sabyasachi

Hello guys, i need some help with respect to, designing a smart-forms using tables pa0001, pa0002, pa0006, T527X. Where, i have to fetch a details from a mentioned tables, which will display the PERNR values in two different pages, where-in each page will display only 2 PERNR values, I,e., PERNR Number 1 and PERNR Number 2

Note: Fields from the Tables are:     

                                                    

Table
Field_name
PA0001ORGEH
PA0002

VORNA

NACHN

NATIO

PA0006

PERNR

BEGDA

ENDDA

T527XORGTX

AND THE OUT-PUT SHOULD LOOK LIKE AS BELOW

PAGE: 1

PERNR
VORNA
NACHN
NATIO
ORGEH
BEGDAENDDAORGTX
1XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
2XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

PAGE: 2

PERNR
VORNA
NACHN
NATIO
PERNR
BEGDAENDDAORGTX
3XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
4XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX


NOTE: 'X' some values

Message was edited by: Anand Maverick kindly, replay with a screen shots

5 REPLIES 5
Read only

Former Member
0 Likes
1,008

create a program lines in main area of your table node.

here you have to write code:

g_counter = g_counter + 1.

abc = g_counter mod 2.

if abc = 0.

g_flag = 'X'.

else

clear g_flag.

g_flag = '  '.

endif.

you have to put g_flag and g_counter in output parameters of program lines.

define g_flag and g_counter in global definition part of smartform.

you have to create a command in main area of table node. select main area of table node and right click on it and create loop. here you have to put your final internal table. then right click on loop node and create command. in your program 8 cell present. right click on any of cell and create program lines. create 1st command, next create program lines. in command, 2 tabs present. general attributes tab-> you have to check go to new page and give next page name like NEXT.  in condition tab, put g_flag = 'X'. at last in next page, you have to copy main window node from page 1 .

i explained details and step by step.. follow it....hope your problem will be solve.........

Regards

Sabyasachi

Read only

0 Likes
1,007

Hi Sabyasachi,

I also had similar type of requirement like this displaying one record in one page (multiple records in multiple pages).  For this I used the same concept as you said above,but in my case the data in second page is not getting populated. 

I have created smartform as below

PAGE1

mainwindow

code populating final table

created table

created loop with final internal table

created command line(had put the condition w_pgbrk_flg = 'X')

the rows to be be printed

Created PAGE2 and copied MAIN WINDOW of page1 to page2.

The number of pages are coming correct but the data is not getting populated from the second page.

Can you please help me out with this.what did i miss here.

Thanks in advance,

Kumar.

Read only

Former Member
0 Likes
1,007

You can create a command with condition to trigger a new page within loop.

Read only

Former Member
0 Likes
1,007

Hi,

1.Collect all the required data into an internal table and pass it to the smartform.

2.Create a table or a template inside the loop.

3.Create a variable and increment the counter in the beginning of every loop, create a command and check the box 'Go to Neew Page' and give the current page number.

In the condition tab give the condition as Counter variable = 2(The new page will be triggered whenever a count of 2 employees has been processed) and clear the counter variable.

Regards,

Swarna

Read only

0 Likes
1,007

Hi you can follow sathya's idea to implement your requirement that is the best procedure to achieve page break in smartform. i.e. Put a command to go to new page based on the temporary counter variable.

Regards,

Praveen