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

Put value into internal table field

Former Member
0 Likes
561

Hello Gurus,

I have one field which I stored into one variable through cncatenate statment in variable VAR1.

and I have another variable VAR2 have some amount.

now I want to put this amount to the field which is present into the VAR1.

ex: VAR1 = 't_display-co1'

VAR2 = 200

now I wnat to put this 200 into t_display-co1

o/p t_display-co1 = 200.

How should I do this?

Please Help.....



       CONCATENATE 'w_display-' col_name into var1.
       ASSIGN VAR1 to <fs>.
         

Thanks in adv.

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
534

Check this sample


data: begin of t_display,
      col1(10) type c,
      end of t_display.

FIELD-SYMBOLS: <fs> type any.

data: var2 type i,
      var1 type string.

var2 = 200.

var1 = 't_display-col1'.

assign (var1) to <fs> CASTING TYPE c.
if sy-subrc = 0.
  <fs> = var2.
endif.

Vikranth

2 REPLIES 2
Read only

Former Member
0 Likes
535

Check this sample


data: begin of t_display,
      col1(10) type c,
      end of t_display.

FIELD-SYMBOLS: <fs> type any.

data: var2 type i,
      var1 type string.

var2 = 200.

var1 = 't_display-col1'.

assign (var1) to <fs> CASTING TYPE c.
if sy-subrc = 0.
  <fs> = var2.
endif.

Vikranth

Read only

Former Member
0 Likes
534

Thanks Vickrant

You have solved my prob.

Thanks you for your Help.