ich versuche gerade die Dynamische Programmierung mit Zuweisung von Fieldsymbols.
Es klappt habe nicht so wie ich mir das vorgestellt hatte.
Ich bekomme subrc '4' bei meinem Assign Component.
Kann mir jemand sagen was ich falsch machen ?
Danke.
Gruss
Anita57
data: parent(35) type c,
lt_parent(35) type c,
a type i.
field-symbols: <parent> type any,
<LT_PARENT> type Table.
DATA: ls_name TYPE zads_xml_resolve.
DATA: ls_schichtplan TYPE zads_schichtplan.
DATA: lt_schichtplan TYPE zads_schichtplan_t."SchichtplanDaten P
DATA: lt_personen TYPE zads_personen_t. "Betroffene Personen
DATA: ls_personen TYPE zads_personen.
DATA: lv_feld(30) TYPE c,
lv_erste_pernr(1) TYPE c. "Kennzeichen bei erste PErsonalnummer
LOOP AT lt_dom INTO ls_dom where name eq 'data'.
if ls_dom-parent is initial.
parent = 'P_GS_ZEIT_GESAMT'.
clear lt_parent.
assign parent to <parent>.
assign (lt_parent) to <lt_parent>.
else.
append <parent> to <lt_PARENT>.
READ TABLE lt_dom INDEX ls_dom-parent INTO ls_dom_parent.
parent+0(2) = 'LS_'.
parent+2(30) = ls_dom_parent-name.
lt_parent = parent.
lt_parent+0(2) = 'LT'.
assign parent to <parent>.
assign (lt_parent) to <lt_parent>.
endif.
* holen alle Children DAten zu dieser 'parent'.
loop at lt_dom_child into ls_dom_child
where parent = ls_dom-firstchild
and ( name <> '#text'
and name <> 'dataNode'
and name <> 'xfa' )
and nextsib ne '0'.
* Value für das FEld holen
READ TABLE lt_dom INDEX ls_dom_child-firstchild INTO ls_dom_2.
ASSIGN COMPONENT ls_dom_child-name
* of structure p_gs_zeit_gesamt to <lf_feld>.
OF STRUCTURE <parent> TO <lf_feld>.
Theory is when you know something, but it doesn't work.
Practice is when something works, but you don't know why.
Programmers combine theory and practice: Nothing works and they don't know why.