Hallo Leute,
vielen Dank nochmal für eure Antworten.
Ich glaube ich werde die Interne Tabelle wie ich Sie gemacht habe so stehen lassen
Beim nächsten Programm werde ich auf jedefall die neue Methode verwenden.
Ich habe jetzt die WHERE bedingung eingefügt.
ich habe das Programm ausgeführt jedoch tut sich nicht viel ich bekommen links unten folgende Meldung
S:Z4:000
Meldungsnr. Z4000
Was fehlt hier noch?
Es sieht jetz wie folgt aus :
REPORT zzke24.
TABLES: ce11000.
SELECT-OPTIONS: paledger FOR ce11000-paledger,
s_perio FOR ce11000-perio,
s_bukrs FOR ce11000-bukrs.
DATA: BEGIN OF itab1 OCCURS 100,
rec_waers LIKE zzke24-rec_waers,
paledger LIKE zzke24-paledger,
vrgar LIKE zzke24-vrgar,
perio LIKE zzke24-perio,
belnr LIKE zzke24-belnr,
hzdat LIKE zzke24-hzdat,
kndnr LIKE zzke24-kndnr,
rbeln LIKE zzke24-rbeln,
rposn LIKE zzke24-rposn,
usnam LIKE zzke24-usnam,
bukrs LIKE zzke24-bukrs,
frwae LIKE zzke24-frwae,
prctr LIKE zzke24-prctr,
vv126 LIKE zzke24-vv126,
vv125 LIKE zzke24-vv125,
absmg_me LIKE zzke24-absmg_me,
vv121 LIKE zzke24-vv121,
vv122 LIKE zzke24-vv122,
vv010 LIKE zzke24-vv010,
vv030 LIKE zzke24-vv030,
vv020 LIKE zzke24-vv020,
vv050 LIKE zzke24-vv050,
vv040 LIKE zzke24-vv040,
prodh LIKE zzke24-prodh,
absmg LIKE zzke24-absmg.
DATA : END OF itab1.
TYPE-POOLS: slis.
*--- Types ------------------------------------------------------------*
TYPES: t_output LIKE zzke24.
*--- ALV Definitions --------------------------------------------------*
DATA g_save TYPE c VALUE 'A'. " save option
DATA g_variant LIKE disvariant. " Daten für die Variante
DATA g_fieldcat TYPE slis_t_fieldcat_alv. " Feldkatalog
DATA: g_events TYPE slis_t_event,
g_sp_group TYPE slis_t_sp_group_alv,
g_layout TYPE slis_layout_alv,
g_list_top_of_page TYPE slis_t_listheader.
DATA: e_status TYPE slis_formname VALUE 'STANDARD_ER01',
e_user_command TYPE slis_formname VALUE 'USER_COMMAND',
er_list_top_of_page TYPE slis_t_listheader,
er_layout TYPE slis_layout_alv,
er_sp_group TYPE slis_t_sp_group_alv,
er_events TYPE slis_t_event.
*--- Constants --------------------------------------------------------*
CONSTANTS:
er_formname_top_of_page TYPE slis_formname VALUE 'TOP_OF_PAGE'.
*--- Internal Tables --------------------------------------------------*
DATA: i_output TYPE t_output OCCURS 100,
wa_output LIKE LINE OF i_output.
START-OF-SELECTION.
PERFORM get_data.
DESCRIBE TABLE i_output.
IF sy-tfill = 0.
MESSAGE s000(z4) WITH TEXT-900.
ELSE.
PERFORM output_data.
ENDIF.
FORM get_data.
SELECT *
INTO CORRESPONDING FIELDS OF itab1
FROM ce11000
WHERE paledger IN paledger
AND perio IN s_perio
AND bukrs IN s_bukrs.
ENDSELECT.
loop at itab1.
wa_output = itab1.
append wa_output to i_output.
endloop.
ENDFORM.
*&---------------------------------------------------------------------*
*& Form output_data
*&---------------------------------------------------------------------*
FORM output_data.
*--- Variantedaten fuellen
CLEAR g_variant.
g_variant-report = 'ZZKE24'.
g_variant-username = sy-uname.
*--- Events, Sp.-Gruppen, Layout fuellen
PERFORM eventtab_build USING er_events[].
PERFORM sp_group_build USING er_sp_group[].
PERFORM layout_build USING er_layout.
*--- Feldkatalog fuellen
CALL FUNCTION 'SD_GET_FIELDCATALOG_OF_TABLE'
EXPORTING
i_table_name = 'ZZKE24'
TABLES
t_input_fieldcat = g_fieldcat.
*--- List-Viewer aufrufen
CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
EXPORTING
i_interface_check = ' '
i_bypassing_buffer = 'X'
i_buffer_active = ' '
i_callback_program = 'ZZKE24'
i_callback_pf_status_set = e_status
i_callback_user_command = e_user_command
i_callback_top_of_page = ' '
i_callback_html_top_of_page = ' '
i_callback_html_end_of_list = ' '
i_structure_name = 'ZZKE24'
i_background_id = 'ALV_BACKGROUND'
* i_grid_title = 'Titel 1'
* I_GRID_SETTINGS =
is_layout = er_layout
it_fieldcat = g_fieldcat[]
* it_excluding =
it_special_groups = er_sp_group[]
* IT_SORT =
* IT_FILTER =
* IS_SEL_HIDE =
i_default = 'X'
i_save = g_save
is_variant = g_variant
it_events = er_events[]
* IT_EVENT_EXIT =
* IS_PRINT =
* IS_REPREP_ID =
* I_SCREEN_START_COLUMN = 0
* I_SCREEN_START_LINE = 0
* I_SCREEN_END_COLUMN = 0
* I_SCREEN_END_LINE = 0
* IT_ALV_GRAPHICS =
* IT_ADD_FIELDCAT =
* IT_HYPERLINK =
* IMPORTING
* E_EXIT_CAUSED_BY_CALLER =
* ES_EXIT_CAUSED_BY_USER =
TABLES
t_outtab = i_output
EXCEPTIONS
program_error = 1
OTHERS = 2.
IF sy-subrc <> 0.
* MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
* WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
ENDFORM. " output_data
*&---------------------------------------------------------------------*
*& Form eventtab_build
*&---------------------------------------------------------------------*
FORM eventtab_build USING u_er_events TYPE slis_t_event.
DATA: ls_event TYPE slis_alv_event.
CALL FUNCTION 'REUSE_ALV_EVENTS_GET'
EXPORTING
i_list_type = 0
IMPORTING
et_events = u_er_events.
READ TABLE u_er_events WITH KEY name = slis_ev_top_of_page
INTO ls_event.
IF sy-subrc = 0.
MOVE er_formname_top_of_page TO ls_event-form.
APPEND ls_event TO u_er_events.
ENDIF.
READ TABLE u_er_events WITH KEY name = slis_ev_user_command
INTO ls_event.
IF sy-subrc = 0.
MOVE e_user_command TO ls_event-form.
APPEND ls_event TO u_er_events.
ENDIF.
READ TABLE u_er_events WITH KEY name = slis_ev_pf_status_set
INTO ls_event.
IF sy-subrc = 0.
MOVE e_status TO ls_event-form.
APPEND ls_event TO u_er_events.
ENDIF.
ENDFORM. " eventtab_build
*&---------------------------------------------------------------------*
*& Form sp_group_build
*&---------------------------------------------------------------------*
FORM sp_group_build USING u_er_sp_group TYPE slis_t_sp_group_alv.
DATA: ls_sp_group TYPE slis_sp_group_alv.
CLEAR: ls_sp_group, u_er_sp_group.
REFRESH: u_er_sp_group.
ls_sp_group-sp_group = 'A'.
ls_sp_group-text = TEXT-s06.
APPEND ls_sp_group TO u_er_sp_group.
ENDFORM. " sp_group_build
*&---------------------------------------------------------------------*
*& Form layout_build
*&---------------------------------------------------------------------*
FORM layout_build USING u_er_layout TYPE slis_layout_alv.
CLEAR: u_er_layout.
* u_er_layout-box_fieldname = 'SELK'. " Checkbox
u_er_layout-get_selinfos = 'X'.
* U_ER_LAYOUT-F2CODE = 'FEHL' . " Doppelklickfunktion
u_er_layout-confirmation_prompt = 'X'. "Sicherheitsabfrage
u_er_layout-key_hotspot = 'X'. "Schlüssel als Hotspot
u_er_layout-info_fieldname = 'COL'. "Zeilenfarbe
ENDFORM. " layout_build
*&---------------------------------------------------------------------*
*& Form user_command
*&---------------------------------------------------------------------*
FORM user_command USING r_ucomm LIKE sy-ucomm
rs_selfield TYPE slis_selfield.
CHECK r_ucomm = '&IC1'. "nur bei PICK
*---
CLEAR: wa_output.
READ TABLE i_output INTO wa_output INDEX rs_selfield-tabindex.
CHECK sy-subrc = 0.
ENDFORM. "user_command
*---------------------------------------------------------------------*
* FORM TOP_OF_PAGE *
*---------------------------------------------------------------------*
* Ereigniss TOP_OF_PAGE *
* event TOP_OF_PAGE
*---------------------------------------------------------------------*
FORM top_of_page.
*
DATA: ls_line TYPE slis_listheader.
* report-header: Typ H
CLEAR: ls_line, er_list_top_of_page.
REFRESH: er_list_top_of_page.
ls_line-typ = 'H'.
ls_line-info = TEXT-001.
APPEND ls_line TO er_list_top_of_page.
CALL FUNCTION 'REUSE_ALV_COMMENTARY_WRITE'
EXPORTING
it_list_commentary = er_list_top_of_page.
ENDFORM. "top_of_page
*---------------------------------------------------------------------*
* FORM STANDARD_ER01 *
*---------------------------------------------------------------------*
* ........ *
*---------------------------------------------------------------------*
FORM standard_er01 USING extab TYPE slis_t_extab.
DELETE extab WHERE fcode = '&RNT_PREV'.
DELETE extab WHERE fcode = '&LFO'.
DELETE extab WHERE fcode = '&NFO'.
SET PF-STATUS 'ALVLIST' EXCLUDING extab.
ENDFORM. "standard_er01