Quantcast
Channel: SCN: Message List
Viewing all articles
Browse latest Browse all 9129

Re: How to modify the component of table with No structure

$
0
0

Hi,

 

There are 2 ways, depending on your exact requirements.

 

If you have to update 1 component (or a few) and you know the name. Use field symbols.

 

LOOP AT <your_table> ASSIGNING FIELD-SYMBOL(<ls_xx>).
ASSIGN COMPONENT '<your component>' OF STRUCTURE <ls_xx> TO

          FIELD-SYMBOL(<lv_field>).
<lv_field>
= '<new value>'.
ENDLOOP.


You need to update a lot of fields and/or don’t know the component names on forehand. You need to do some dynamic programming using RTTS (Runtime Type Services ) or more specific RTTI(Runtime Type Identification). Use the Abap help (F1 somewhere in ABAP code) and look for RTTI. There are some examples.

 

Cheers,

Henk.


Viewing all articles
Browse latest Browse all 9129

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>