Dynamically read fields, fieldnames and fieldcontents

FIELD-SYMBOLS:
<fieldname> TYPE ANY, "Name of field
<line> TYPE ANY, "Line structure for table
<fieldvalue> TYPE ANY. "Value of field

DATA: l_shorttext LIKE dd03m-ddtext.

DATA: wa_dd03l LIKE dd03l.


SELECT * FROM dd03l INTO wa_dd03l

WHERE tabname = 'ZHR_INTER_PA1_DL'.
* Assign name of field
ASSIGN COMPONENT 2 OF STRUCTURE wa_dd03l TO <fieldname>.

* Assign structure for internal table
ASSIGN wa_pa1_delta TO <line>.

* Assign field value from structure
ASSIGN COMPONENT <fieldname> OF STRUCTURE <line> TO <fieldvalue>.

* Find DD text for field
SELECT SINGLE ddtext
FROM dd03m
INTO l_shorttext
WHERE tabname = 'ZHR_INTER_PA1_DL' AND
fieldname = <fieldname> AND
ddlanguage = 'EN'.


WRITE: / <fieldname>, l_shorttext, ' : ', <fieldvalue>.




ENDSELECT.

Converted from CHM to HTML with chm2web Standard 2.7 (unicode)