Code: Alles auswählen.
CALL METHOD grid->set_table_for_first_display
EXPORTING
* I_BUFFER_ACTIVE =
* I_CONSISTENCY_CHECK =
i_structure_name = 'P01CKA'
* IS_VARIANT =
* I_SAVE =
* I_DEFAULT = 'X'
is_layout = grid_layout
* IS_PRINT =
* IT_SPECIAL_GROUPS =
* IT_TOOLBAR_EXCLUDING =
* IT_HYPERLINK =
CHANGING
it_outtab = gt_p01cka
it_fieldcatalog = gt_fieldcat
* IT_SORT =
* IT_FILTER =
EXCEPTIONS
invalid_parameter_combination = 1
program_error = 2
too_many_lines = 3
OTHERS = 4 .
Code: Alles auswählen.
CALL METHOD grid->set_ready_for_input
EXPORTING
i_ready_for_input = 1.
Code: Alles auswählen.
Im Quelltext befindet sich die Abbruchstelle in Zeile 56
des (Include-)Programms "CL_GUI_ALV_GRID===============CM03E".
(bei Anwahl des Editors: 560) der ABAP-Source
"CL_GUI_ALV_GRID===============CM03E".
Ausschnitt Source-Code
000260 endif.
000270 *Ende Hinweis 320712
000280
000290 if m_edit_global eq '1'.
000300 ready_for_input = 1.
000310 elseif m_edit_global eq '0'.
000320 ready_for_input = 0.
000330 elseif m_edit eq 'X'.
000340 ready_for_input = 1.
000350 else.
000360 ready_for_input = 0.
000370 endif.
000380
000390 check ready_for_input eq 1.
000400
000410 if not i_row_id is initial and
000420 not is_col_id is initial and
000430 not m_cl_variant->ms_layout-stylefname is initial.
000440 *... Prüfen ob Grid auf ZELLENEBENE eingabebereit
000450 assign mt_outtab->* to <tab1>.
000460 if not sy-subrc is initial.
000470 message a534(0k).
000480 endif.
000490
000500 create data lp_wa like line of <tab1>.
000510 assign lp_wa->* to <ls_wa>.
000520
000530 read table <tab1> into <ls_wa> index i_row_id.
000540 assign component m_cl_variant->ms_layout-stylefname
000550 of structure <ls_wa> to <l_field>.
> read table <l_field> into ls_style
000570 with table key fieldname = is_col_id-fieldname.
000580 if sy-subrc eq 0.
000590 if ls_style-style o mc_style_enabled.
000600 ready_for_input = 1.
Code: Alles auswählen.
FORM prepare_field_catalog CHANGING pt_fieldcat TYPE lvc_t_fcat.
DATA: ls_fcat TYPE lvc_s_fcat.
CLEAR ls_fcat.
ls_fcat-fieldname = 'PERNR'.
ls_fcat-ref_table = 'P01CKA'.
ls_fcat-ref_field = 'PERNR'.
ls_fcat-coltext = 'Pernr.'.
APPEND ls_fcat TO pt_fieldcat.
ls_fcat-fieldname = 'HANSP'.
ls_fcat-ref_table = 'P01CKA'.
ls_fcat-ref_field = 'HANSP'.
ls_fcat-coltext = 'Anspruch'.
APPEND ls_fcat TO pt_fieldcat.
ls_fcat-fieldname = 'ENDDA'.
ls_fcat-ref_table = 'P01CKA'.
ls_fcat-ref_field = 'ENDDA'.
ls_fcat-coltext = 'Gült.ende'.
APPEND ls_fcat TO pt_fieldcat.
ls_fcat-fieldname = 'BEGDA'.
ls_fcat-ref_table = 'P01CKA'.
ls_fcat-ref_field = 'BEGDA'.
ls_fcat-coltext = 'Gült.beginn'.
APPEND ls_fcat TO pt_fieldcat.
ls_fcat-fieldname = 'LGART'.
ls_fcat-ref_table = 'P01CKA'.
ls_fcat-ref_field = 'LGART'.
ls_fcat-coltext = 'Lohnart'.
APPEND ls_fcat TO pt_fieldcat.
ls_fcat-fieldname = 'ANWRT'.
ls_fcat-ref_table = 'P01CKA'.
ls_fcat-ref_field = 'ANWRT'.
ls_fcat-coltext = 'Anwarts.'.
APPEND ls_fcat TO pt_fieldcat.
ls_fcat-fieldname = 'DKKAP'.
ls_fcat-ref_table = 'P01CKA'.
ls_fcat-ref_field = 'DKKAP'.
ls_fcat-coltext = 'Deckungskap.'.
APPEND ls_fcat TO pt_fieldcat.
ls_fcat-fieldname = 'WAERS'.
ls_fcat-ref_table = 'P01CKA'.
ls_fcat-ref_field = 'WAERS'.
ls_fcat-coltext = 'Währ.'.
APPEND ls_fcat TO pt_fieldcat.
ls_fcat-fieldname = 'EDDAT'.
ls_fcat-ref_table = 'P01CKA'.
ls_fcat-ref_field = 'EDDAT'.
ls_fcat-coltext = 'Einzahldat.'.
APPEND ls_fcat TO pt_fieldcat.
ls_fcat-fieldname = 'GREKA'.
ls_fcat-ref_table = 'P01CKA'.
ls_fcat-ref_field = 'GREKA'.
ls_fcat-coltext = 'Grund'.
APPEND ls_fcat TO pt_fieldcat.
ls_fcat-fieldname = 'RELRE'.
ls_fcat-ref_table = 'P01CKA'.
ls_fcat-ref_field = 'RELRE'.
ls_fcat-coltext = 'Rel. Rückerst.'.
APPEND ls_fcat TO pt_fieldcat.
ls_fcat-fieldname = 'RUECK'.
ls_fcat-ref_table = 'P01CKA'.
ls_fcat-ref_field = 'RUECK'.
ls_fcat-coltext = 'Kz. Rückerst.'.
APPEND ls_fcat TO pt_fieldcat.
ls_fcat-fieldname = 'BTZNR'.
ls_fcat-ref_table = 'P01CKA'.
ls_fcat-ref_field = 'BTZNR'.
ls_fcat-coltext = 'Zuordnung'.
APPEND ls_fcat TO pt_fieldcat.
ls_fcat-fieldname = 'RELRE'.
ls_fcat-ref_table = 'P01CKA'.
ls_fcat-ref_field = 'RELRE'.
ls_fcat-coltext = 'Besteuer.'.
APPEND ls_fcat TO pt_fieldcat.
ENDFORM. "prepare_field_catalog
was aber wiederum genau der Fehler sein könnte, da der ALV bei den Feldsymbolzugriffen möglicherweise davon ausgegangen ist, dass ein ASSIGN funktioniert, es aber nicht mehr geprüft hat, weil es durch dieses DoppelMoppel mehr Felder im Katalog als in der Struktur gibt...RiffRaff hat geschrieben:...
was mir aufgefallen wäre (funktioniert aber bei mir trotzdem)
i_structure_name = 'P01CKA'
CHANGING
it_fieldcatalog = gt_fieldcat
icg denk mal, mit i_structure_name sagt du dem ALV sozusagen 'bau dir deinen Feldkatalog selbst auf, und zwar so wie die TAbelle P01CKA aussieht'
Also - doppelt gemoppelt -
eine von den zwei Zeilen kannst du dir sparen
...
Code: Alles auswählen.
CALL METHOD grid->set_table_for_first_display
EXPORTING
* I_BUFFER_ACTIVE =
* I_CONSISTENCY_CHECK =
* i_structure_name = 'P01CKA'
* IS_VARIANT =
* I_SAVE =
* I_DEFAULT = 'X'
is_layout = grid_layout
* IS_PRINT =
* IT_SPECIAL_GROUPS =
* IT_TOOLBAR_EXCLUDING =
* IT_HYPERLINK =
CHANGING
it_outtab = gt_p01cka
it_fieldcatalog = gt_fieldcat
* IT_SORT =
* IT_FILTER =
EXCEPTIONS
invalid_parameter_combination = 1
program_error = 2
too_many_lines = 3
OTHERS = 4 .
Code: Alles auswählen.
grid_layout-stylefname = 'INPUT_STYLE'.
grid_layout-edit = 'X'.
Code: Alles auswählen.
grid_layout-stylefname = 'INPUT_STYLE'.
Code: Alles auswählen.
grid_layout-edit = 'X'.
Code: Alles auswählen.
ls_fcat-fieldname = 'ENDDA'.
ls_fcat-ref_table = 'P01CKA'.
ls_fcat-ref_field = 'ENDDA'.
ls_fcat-coltext = 'Gült.ende'.
ls_fcat-edit = 'X'.
APPEND ls_fcat TO gt_fieldcat.
CLEAR ls_fcat.