cancel
Showing results for 
Search instead for 
Did you mean: 

text node query

Former Member
0 Kudos

hello gurus.

Im developing forms using smartforms. Now I encounter a problem and here it is.

is there a possible way to execute command lines on the text node? For example,

if sy-index = 1.

&wa_eban_info-banfn&

endif.

If there is a possible way, how to do it gurus?Please explain.

thanks a lot. Rewards awaits.

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi ..you can do this...

Since the no of rows are fixed you can use a template instead of a table.

In case the data of your text is of dynamic length..u can use a table. But in the data section of the table(uder the LOOP section) do not check the "internal table " option.

Instead define 10 rows of same line type in the main area of the table. And maually populate each cell of the rows. This way..you will always get 10 rows.

Former Member
0 Kudos

tnx. i got your point...

In order to produce 10 fixed rows, I created 10 rows in a table having the same line type. Then I populate every records on its corresponding to populate. But my problem is, how could i determine if the record that I am retrieving is the second record? or the thrid one? and so on till the tenth? For it to be placed on its corresponding row.

Any idea please?

Former Member
0 Kudos

suppose u have 10 rows...

initialize a global variable...

v_index = 0.

loop at i_tab.

v_index = v_index + 1.

1st row(condition = print only if v_index = 1).

2nd row (condition = print only if v_index = 2).

.

.

.

10th row (condition = print only if v_index = 10)

endloop.

put this condition in the condition tab of each row.. it will work..

Answers (3)

Answers (3)

Former Member
0 Kudos

Hi,

If you'r planning on displaying a fix number of rows in your table, try using :

Do n times.

End do.

Example if your table contain 5 rows, u can use the do-end do command as follow:

do 10 times.

read table [table] index sy-index.

if sy-subrc NE 0.

clear [table].

append [table].

endif.

enddo.

And your table will now have 10 rows with 5 of them are blanks.

Hope this help.

Tks & Rgds,

William Prawira

Former Member
0 Kudos

tnx for your reply.. I get your idea but i dont know how to execute it. I mean i dont know what to do first... May you please elaborate further or give me step by step procedure on how to arrive on the desired output...

tnx again.

Former Member
0 Kudos

Hi Levis ,

Please check out this link

http://www.saptechnical.com/Tutorials/Smartforms/Table/Create.htm

Best regards,

raam

Former Member
0 Kudos

tnx raam... the tutorial is helpful but it doe not solve my problem...

Former Member
0 Kudos

Create a condition on that text element. You would find it on the last tab on ur text element. Write ur if condition in there.

It should work.

Nayan

Former Member
0 Kudos

Hi,

u have CONDITION Tab in text element

there u can give some condition .

Field name   Relation       Comparision Value

Best regards,

raam

Former Member
0 Kudos

tnx... for your replies... i got it...

but my next problem is this....

on the form that i am developing, i need to show 10 rows of a table everytime it will be printed since the number of rows is fixed.

Let say, on my Select statement, it will only retrieve one (1) row. The form must display the data that was retrieved on the first row and the rest of the rows will still be shown... (from 2nd to 10th row)...

1. Now what should I do next to display 10 r0ws every page of the form?

2. How do I assign the data to be retrieved in ever it will be more than one record?

Example: 5 records... this records must occupy the first five rows...

Actually, I executed a loop but my problem is, in case the records to be retrieved is less than 10, let say 5 only,

my displayed items will be only five(5) wherein i need to display 10 rows (5 rows with records and 5 rows blank) since this is the fixed number of rows on every page....

I hope you will help me once more.... thanks...

Former Member
0 Kudos

Well when u create a table in a smartform, it would do the rest for you. So in case u have only 5 lines to display but u wanna display 10, i dnt think thats gonna be possible mate. Just try and c if nething cud be done.

Reward if useful.

Thanks

Nayan