Application Development 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: 

Smart Forms - problem

Former Member
0 Kudos

Hello All

Ok now in my first smartforms , on my output currently if i have 6 records that should print on the document , it is printing 6 groups of 6. so it is repeating the 6 line items 6 times.

Problem 2. in my info area which is my header info. i have the fields referenced just like the line items. for example &itab2-kunnr& but it tells me that it has no defined value.

any ideas, would be greatly apprectiated.

thanks scott

1 ACCEPTED SOLUTION

former_member188419
Participant
0 Kudos

Hi Scott,

If your table has 6 records, is it printing it 66 times? If 10, 1010 times. If you use loop, it will print all the records. If you want only last one, they don't use the loop. If you think there is something wrong with the form, please download the smartform(once you get in the form, Utilities->Download form) and mail XML file to hari.nalluri@Intelligroup.com. I will see if there is any proble.

Regards

Hari

7 REPLIES 7

Former Member
0 Kudos

Hi Scott,

1. Define a structure of the same structure as the

internal table.

loop on your internal table into this structure and then display the structure fields.

2. Step 1 applies for your problem 2. &itab2-kunnr& too...

Try out...

Regards

Raj

0 Kudos

Hello Raj,

so i do this in smartforms ? i would define the structure in the global def global data. like i could do this "itab3 type zprice_agreement(my structure)..

or could i to itab3 type itab2, since i just created it from the zprice_agreement.

Now where would i loop on this in my template where i want this data to create my header ??

this is a little confusing i am trying to read and do at the same time.

let me know what you think i need to do .

thanks scott

0 Kudos

hi Scott,

I am not sure if I got your question correctly. If you want to display contents of an internal table, You try to use the TABLE construct rather than Template. Using table you can display any no of lines. With template, if internal table is going to have say more than 6 rows tomorrow, then you need to change the form. When you create table, you will have DATA TAB where you can specify your internal table and header line( This header line can be declared in global data or the same name as internal table name can be used). Then in table, create a table line with the columns you want to display(this can be done using TABLE SECTIOn). Then in the table line, create text elements and try to display the table field you want to displayed.

If you still want to go with template, then before you display each line create a "Program LInes" construct. Read your internal table into work area using the index. For ex, before display first row, in the program lines put the follwong line of code - "read table itab3 index 1". Before displaying second line, "read table itab3 index 2".

Let me know if you want more details.

Good luck

Hari

0 Kudos

Hey Hari,

ok i fixed the problem on getting the header info, what i did was just take the values from itab1 andit worked. Now i have to figure out why i am getting the looping problem. like i mentioned before if i have 6 records it writes them out 6 times if i have 10 rec it writes them out 10 times. so somehow my loop structure must not be correct.

thanks scott

former_member188419
Participant
0 Kudos

Hi Scott,

If your table has 6 records, is it printing it 66 times? If 10, 1010 times. If you use loop, it will print all the records. If you want only last one, they don't use the loop. If you think there is something wrong with the form, please download the smartform(once you get in the form, Utilities->Download form) and mail XML file to hari.nalluri@Intelligroup.com. I will see if there is any proble.

Regards

Hari

0 Kudos

Hey Hari,

that is very nice of you thanks.. but i found out what i was doing at the time .. i had the loop inside of another loop and that is why i had that problem.

thanks scott

0 Kudos

Hari, i sent you an email to your intelligroup acct.

scott