Code: Alles auswählen.
types: Begin of ty_ausg,
posid type PRPS-POSID,
objnr type PRPS-OBJNR,
prart type PRPS-PRART,
stat type jest-stat,
END OF ty_ausg.
CONSTANTS : rbselected TYPE c LENGTH 1 VALUE 'X'.
data: t_ausg type TABLE OF ty_ausg WITH HEADER LINE, p_prart type prps-prart, wa_ausg type ty_ausg.
SELECTION-SCREEN BEGIN OF BLOCK para WITH FRAME TITLE text-001.
PARAMETERS: p_bukrs type bukrs.
SELECT-OPTIONS:
so_prart FOR p_prart.
SELECTION-SCREEN END OF BLOCK para.
SELECTION-SCREEN BEGIN OF BLOCK rbuttons WITH FRAME TITLE text-002.
SELECTION-SCREEN BEGIN OF LINE.
SELECTION-SCREEN POSITION 2.
PARAMETERS: rb1 RADIOBUTTON GROUP rb .
SELECTION-SCREEN COMMENT 5(30) text-003 .
SELECTION-SCREEN END OF LINE.
SELECTION-SCREEN BEGIN OF LINE.
SELECTION-SCREEN POSITION 2.
PARAMETERS: rb2 RADIOBUTTON GROUP rb.
SELECTION-SCREEN COMMENT 5(30) text-004.
SELECTION-SCREEN END OF LINE.
SELECTION-SCREEN END OF BLOCK rbuttons.
*&---------------------------------------------------------------------*
*& Applikationslogik
*&---------------------------------------------------------------------*
START-OF-SELECTION.
SELECT prps~posid prps~objnr prps~prart jest~stat
FROM PRPS join jest on prps~objnr = jest~objnr
into corresponding fields of t_ausg
WHERE prps~pbukr = p_bukrs
AND prps~prart in so_prart
.
Endselect.
LOOP AT t_ausg into wa_ausg.
WRITE:
/ wa_ausg-posid,
wa_ausg-objnr,
wa_ausg-prart,
wa_ausg-stat.
ENDLOOP.
END-OF-SELECTION.
Code: Alles auswählen.
INTO CORRESPONDING FIELDS OF TABLE.
In was kann ich die Daten den noch lesen? In eine Struktur?km216 hat geschrieben:Weil du keine Schleife mehr hast, wenn du alles in eine interne Tabelle liest.
Geht leider immer noch nicht. Er kommt nie bis zur Write Anweisung. Kann das mit START-OF-SELECTION und END-OF-SELECTION zusammenhängen?km216 hat geschrieben:Einfach das "Endselect" löschen.
Code: Alles auswählen.
CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
EXPORTING
I_STRUCTURE_NAME = 'ty_ausg'
TABLES
t_outtab = t_ausg
EXCEPTIONS
program_error = 1
OTHERS = 2.
Code: Alles auswählen.
TYPE-POOLS: slis.
DATA lt_fcat TYPE slis_t_fieldcat_alv.
CALL FUNCTION 'REUSE_ALV_FIELDCATALOG_MERGE'
EXPORTING
i_structure_name = 'TY_AUSG' ( selbe meldung auch mit t_ausg)
CHANGING
ct_fieldcat = lt_fcat.
CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
EXPORTING
i_structure_name = space
it_fieldcat = lt_fcat
TABLES
t_outtab = t_ausg
EXCEPTIONS
program_error = 1
OTHERS = 2.