2007 Nov 13 11:27 AM
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
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
2007 Nov 13 11:33 AM
Hi,
the input fields u cannot create dynamically.
can u explain ur requirement a little clearly.
rgds,
bharat.
2007 Nov 13 11:34 AM
the input field will be created. The problem is how to assign the value of the itab (internal table) to all the input field?
2007 Nov 13 12:00 PM
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.
2007 Nov 13 12:05 PM