Code: Alles auswählen.
**********************************************************************
* Erstellen der ITAB von 0er Infotyp
**********************************************************************
struktur_typ0 ?= cl_abap_tabledescr=>describe_by_name( 'ty_inputstruc0' ).
DATA(klasse0) = NEW zcl_fileconvert_to_sap(
iv_path = p_file0
iv_seperator = ';'
io_type_structure = struktur_typ0
iv_check_length = ''
).
DATA(it0) = klasse0->read_frontend( ).
DATA(data0) = klasse0->get_data( ).
ASSIGN data0->* TO FIELD-SYMBOL(<fs0>).
**********************************************************************
* Erstellen der ITAB von 1er Infotyp
**********************************************************************
struktur_typ1 ?= cl_abap_tabledescr=>describe_by_name( 'ty_inputstruc1' ).
DATA(klasse1) = NEW zcl_fileconvert_to_sap(
iv_path = p_file1
iv_seperator = ';'
io_type_structure = struktur_typ1
iv_check_length = ''
) .
DATA(it1) = klasse1->read_frontend( ).
DATA(data1) = klasse1->get_data( ).
ASSIGN data1->* TO FIELD-SYMBOL(<fs1>).
**********************************************************************
* Zusammenfügen zu einer Tabelle
**********************************************************************
Code: Alles auswählen.
DATA: inftype TYPE ztst_inftype,
ps0000 TYPE ps0000,
ps0001 TYPE ps0001.
inftype-ps0000 = ps0000.
inftype-ps0001 = ps0001.
Code: Alles auswählen.
DATA: inftype TYPE ztst_inftype,
pa0000 TYPE pa0000,
pa0001 TYPE pa0001.
MOVE-CORRESPONDING pa0000 TO inftype-ps0000.
MOVE-CORRESPONDING pa0001 TO inftype-ps0001.
Ich habe überhaupt keine Gruppen bzw includes. Meine Typen sehen so aus:Ich weiß jetzt nicht, wie deine Strukturen genau aussehen, aber mit "MOVE-CORRESPONDING" sollte es dann funktionieren (evtl. sogar ohne die Gruppen).
Code: Alles auswählen.
TYPES: BEGIN OF ty_inputstruc0,
pernr TYPE persno,
subty TYPE subty,
objps TYPE objps,
sprps TYPE sprps,
endda TYPE endda,
begda TYPE begda,
seqnr TYPE seqnr,
aedtm TYPE aedat,
uname TYPE aenam,
histo TYPE histo,
itxex TYPE itxex,
refex TYPE prfex,
ordex TYPE ordex,
itbld TYPE itbld,
preas TYPE preas,
flag1 TYPE nused,
flag2 TYPE nused,
flag3 TYPE nused,
flag4 TYPE nused,
rese1 TYPE nused2,
rese2 TYPE nused2,
grpvl TYPE pcce_gpval,
massn TYPE massn,
massg TYPE massg,
stat1 TYPE stat1,
stat2 TYPE stat2,
stat3 TYPE stat3,
END OF ty_inputstruc0,
BEGIN OF ty_inputstruc1,
pernr TYPE persno,
subty TYPE subty,
objps TYPE objps,
sprps TYPE sprps,
endda TYPE endda,
begda TYPE begda,
seqnr TYPE seqnr,
aedtm TYPE aedat,
uname TYPE aenam,
histo TYPE histo,
itxex TYPE itxex,
refex TYPE prfex,
ordex TYPE ordex,
itbld TYPE itbld,
preas TYPE preas,
flag1 TYPE nused,
flag2 TYPE nused,
flag3 TYPE nused,
flag4 TYPE nused,
rese1 TYPE nused2,
rese2 TYPE nused2,
grpvl TYPE pcce_gpval,
bukrs TYPE bukrs,
werks TYPE persa,
persg TYPE persg,
persk TYPE persk,
vdsk1 TYPE vdsk1,
gsber TYPE gsber,
btrtl TYPE btrtl,
juper TYPE juper,
abkrs TYPE abkrs,
ansvh TYPE ansvh,
kostl TYPE kostl,
orgeh TYPE orgeh,
plans TYPE plans,
stell TYPE stell,
mstbr TYPE mstbr,
sacha TYPE sacha,
sachp TYPE sachp,
sachz TYPE sachz,
sname TYPE smnam,
ename TYPE emnam,
otype TYPE otype,
sbmod TYPE sbmod,
kokrs TYPE kokrs,
fistl TYPE fistl,
geber TYPE bp_geber,
fkber TYPE fkber,
grant_nbr TYPE gm_grant_nbr,
sgmnt TYPE fb_segment,
budget_pd TYPE fm_budget_period,
END OF ty_inputstruc1.
Code: Alles auswählen.
DATA: t_table TYPE TABLE OF ty_tab,
bedingung TYPE string,
flag1 TYPE flag1,
flag2 TYPE flag1.
t_table1 = <fs1>.
t_table0 = <fs0>.
PROVIDE FIELDS * FROM t_table0
INTO ls_table0
VALID flag1
BOUNDS begda AND endda
FIELDS * FROM t_table1
INTO ls_table1
VALID flag2
BOUNDS begda AND endda
BETWEEN '20180101' AND '20181231'.
MOVE-CORRESPONDING t_table0 TO t_table.
MOVE-CORRESPONDING t_table1 TO t_table.
ENDPROVIDE.
Code: Alles auswählen.
LOOP AT t_table0 ASSIGNING FIELD-SYMBOL(<s_table0>) WHERE begda BETWEEN '20180101' AND '20181231'. "evtl. weitere Bedingungen
LOOP AT t_table1 ASSIGNING FIELD-SYMBOL(<s_table1>) WHERE pernr EQ <s_table0>-pernr. "evtl. weitere Bedingungen
MOVE-CORRESPONDING <s_table0> TO s_table.
MOVE-CORRESPONDING <s_table1> TO s_table.
APPEND s_table TO t_table.
ENDLOOP.
ENDLOOP.
Code: Alles auswählen.
LOOP AT t_table0 ASSIGNING FIELD-SYMBOL(<s_table0>) WHERE begda BETWEEN '20180101' AND '20181231'. "evtl. weitere Bedingungen
ASSIGN t_table1[ pernr = <s_table0>-pernr ] TO FIELD-SYMBOL(<s_table1>). "evtl. weitere Bedingungen
MOVE-CORRESPONDING <s_table0> TO s_table.
MOVE-CORRESPONDING <s_table1> TO s_table.
APPEND s_table TO t_table.
ENDLOOP.