Code: Alles auswählen.
Report YEGR_TEST_TEST.
*&--------------------------------------------------------------------*
*& Form Test
*&--------------------------------------------------------------------*
* text
*---------------------------------------------------------------------*
* -->EP_TABLE text
* -->ITAB_TEST text
*---------------------------------------------------------------------*
Form Test using ep_table type ref to data changing itab_test type
standard table.
Write: / 'Es funzt immer noch.'.
FIELD-SYMBOLS: <wa_it1> TYPE standard table,
<wa_it> type any.
*
ASSIGN ep_table->* TO <wa_it1>.
*
* assign itab_test to <wa_it1>.
DATA: NEW_LINE type ref to data.
*
create data NEW_LINE like line of <wa_it1>.
*
**** A field-symbol to access that work area
assign NEW_LINE->* to <wa_it>.
EXEC SQL.
OPEN CURSOR c
SELECT
HOB_KH_IK as Ik, count(*) as ANZAHL,
AVG(ENTL_DATUM - HOB_AUFN_DAT) AS VWD,
SUM(KOSTEN_GESAMT/100) as KOSTEN
FROM BUSI.BW02_K_FALL
GROUP BY HOB_KH_IK
ENDEXEC.
DO.
EXEC SQL.
fetch next c into structure :<wa_it>.
ENDEXEC.
IF sy-subrc <> 0.
EXIT.
ENDIF.
append <wa_it> to itab_test.
ENDDO.
EXEC SQL.
close c
ENDEXEC.
write: / 'OK ?'.
endform.
Code: Alles auswählen.
PERFORMING loop using <wa_it> changing itab_test
Code: Alles auswählen.
Report YEGR_TEST_TEST.
*&--------------------------------------------------------------------*
*& Form Test
*&--------------------------------------------------------------------*
* text
*---------------------------------------------------------------------*
* -->EP_TABLE text
* -->ITAB_TEST text
*---------------------------------------------------------------------*
Form Test using ep_table type ref to data changing itab_test type
standard table.
Write: / 'Es funzt immer noch.'.
FIELD-SYMBOLS: <wa_it1> TYPE standard table,
<wa_it> type any.
*
ASSIGN ep_table->* TO <wa_it1>.
*
* assign itab_test to <wa_it1>.
DATA: NEW_LINE type ref to data.
* c type cursor.
*
create data NEW_LINE like line of <wa_it1>.
*
**** A field-symbol to access that work area
assign NEW_LINE->* to <wa_it>.
*PERFORMING loop using <wa_it> changing itab_test
EXEC SQL.
open c for
SELECT
HOB_KH_IK as Ik, count(*) as ANZAHL,
AVG(ENTL_DATUM - HOB_AUFN_DAT) AS VWD,
SUM(KOSTEN_GESAMT/100) as KOSTEN
FROM BUSI.BW02_K_FALL
GROUP BY HOB_KH_IK
ENDEXEC.
DO.
EXEC SQL.
fetch next c into :<wa_it>
ENDEXEC.
IF sy-subrc <> 0.
EXIT.
ENDIF.
append <wa_it> to itab_test.
ENDDO.
EXEC SQL.
close c
ENDEXEC.
write: / 'OK ?'.
endform.
Wenn ich mir die Hilfe zu EXEC SQL anschaue wird dort in der Cursor-Verarbeitung immer mit einzelnen Data-Feldern gearbeitet, nie mit Strukturen.frisbee hat geschrieben:HAAALLOOOO sonst keiner da mit einer Idee??????????????