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: 

Assign dynamic value to input field

Former Member
0 Kudos

Hi all

i gt problem in dynamic assign a value to the input field base on the value in my internal table. How can i do it

Example:

my internal table contain 5 value :

abc

def

ghi

lmn

xyz

my input field:

txt1(20) type c

txt2 (20) type c

txt3 (20) type c

txt4 (20) type c

txt5 (20) type c

outcome result:

txt1 = abc

txt2 = def

txt3 = ghi

txt4 = lmn

txt5 = xyz

4 REPLIES 4

Former Member
0 Kudos

Hi,

the input fields u cannot create dynamically.

can u explain ur requirement a little clearly.

rgds,

bharat.

0 Kudos

the input field will be created. The problem is how to assign the value of the itab (internal table) to all the input field?

0 Kudos

Hi,

try like this.

PARAMETERS:txt1(10),txt2(10),txt3(10),

txt4(10),txt5(10).

data:BEGIN OF itab OCCURS 0,

val(10),

end of itab.

data:index(2).

INITIALIZATION.

itab-val = 'abc'."filling internal table

APPEND itab.

itab-val = 'def'.

APPEND itab.

itab-val = 'ghi'.

APPEND itab.

itab-val = 'lmn'.

APPEND itab.

itab-val = 'xyz'.

APPEND itab."filling internal table

LOOP AT itab.

index = sy-tabix.

CASE index.

WHEN 1.

txt1 = itab-val.

WHEN 2.

txt2 = itab-val.

WHEN 3.

txt3 = itab-val.

WHEN 4.

txt4 = itab-val.

WHEN 5.

txt5 = itab-val.

ENDCASE.

ENDLOOP.

rgds,

bharat.

0 Kudos

great u solve my problem....

many many many thank!!!!