Floorplan Manager Codebeispiele (ABAP): Unterschied zwischen den Versionen

Aus MattWiki
(Die Seite wurde neu angelegt: „=== IF_FPM_GUIBB_LIST->GET_DEFINITION === Signatur der Methode: EO_FIELD_CATALOG - Enthält Feldkatalog in Form eines Strukturtyps, der alle Komponenten umf…“)
 
Keine Bearbeitungszusammenfassung
Zeile 1: Zeile 1:
=== IF_FPM_GUIBB_LIST->GET_DEFINITION ===
== IF_FPM_GUIBB_LIST ==
 
=== GET_DEFINITION - Grundform ===


Signatur der Methode:
Signatur der Methode:
Zeile 7: Zeile 9:
  ET_ACTION_DEFINITION - Liste mit möglichen Aktionen
  ET_ACTION_DEFINITION - Liste mit möglichen Aktionen


Beispielhafte Befüllung der Description-Tabelle für Form-GUIBB mit dem Ziel, Warnungen im FLUID-Designer zu vermeiden:
<syntaxhighlight lang="abap">
  METHOD if_fpm_guibb_form~get_definition.
    DATA: ...
    CLEAR:...
    ...
    ...
    ...
    " Definition of field catalog
    eo_field_catalog ?= cl_abap_structdescr=>describe_by_name( p_name = 'Z_S_SELECTION' ).
    " Build list of field descriptions for FPM containing mostly only field names
    " in order to prevent warnings in FPM designer
    APPEND VALUE fpmgb_s_formfield_descr( name = 'FISCYEAR' ) TO et_field_description.
    APPEND VALUE fpmgb_s_formfield_descr( name = 'ZDOMUSER' ) TO et_field_description.
    APPEND VALUE fpmgb_s_formfield_descr( name = 'ZDOMUSERNAME' ) TO et_field_description.
  ENDMETHOD.
</syntaxhighlight>
=== GET_DEFINITION - Mit Button und Read-Only-Spalten ===


<syntaxhighlight lang="abap">
<syntaxhighlight lang="abap">
Zeile 30: Zeile 58:
   endmethod.
   endmethod.
</syntaxhighlight>
</syntaxhighlight>
=== GET_DEFINITION - Custom-Spaltenüberschriften ===
Zusätzlich: Felder mit individuellen Spaltenüberschriften sowie Editierbarkeit-Kennzeichen und Darstellung als Checkbox.
<syntaxhighlight lang="abap">
  METHOD if_fpm_guibb_list~get_definition.
    DATA: ...
    CLEAR:...
    ...
    ...
    ...
    " Definition of field catalog
    eo_field_catalog ?= cl_abap_structdescr=>describe_by_name( p_name = 'Z_TT_LIST' ).
    " Build list of field descriptions for FPM containing mostly only field names
    " in order to prevent warnings in FPM designer
    APPEND VALUE fpmgb_s_listfield_descr( name = 'ROW' technical_field = abap_true ) TO et_field_description.
    APPEND VALUE fpmgb_s_listfield_descr( name = 'ZKSTL_K' ) TO et_field_description.
    APPEND VALUE fpmgb_s_listfield_descr( name = 'ZKSTL_T' ) TO et_field_description.
    APPEND VALUE fpmgb_s_listfield_descr( name = 'ZKRS_K' ) TO et_field_description.
    APPEND VALUE fpmgb_s_listfield_descr( name = 'ZKRS_T' ) TO et_field_description.
    APPEND VALUE fpmgb_s_listfield_descr( name = 'ZBEM' ) TO et_field_description.
    APPEND VALUE fpmgb_s_listfield_descr( name = 'APPROVED' header_label = TEXT-001 ) TO et_field_description.
    APPEND VALUE fpmgb_s_listfield_descr( name = 'REJECTED' header_label = TEXT-002 ) TO et_field_description.
  ENDMETHOD.
</syntaxhighlight>


[[Category:ABAP]]
[[Category:ABAP]]

Version vom 24. Juli 2019, 15:09 Uhr

IF_FPM_GUIBB_LIST

GET_DEFINITION - Grundform

Signatur der Methode:

EO_FIELD_CATALOG - Enthält Feldkatalog in Form eines Strukturtyps, der alle Komponenten umfasst, die als Felder im Formular verwendet werden können
ET_FIELD_DESCRIPTION - Liste mit Feldbeschreibungen und beschreibenden Informationen zu den einzelnen Feldern
ET_ACTION_DEFINITION - Liste mit möglichen Aktionen

Beispielhafte Befüllung der Description-Tabelle für Form-GUIBB mit dem Ziel, Warnungen im FLUID-Designer zu vermeiden:

  METHOD if_fpm_guibb_form~get_definition.

    DATA: ...

    CLEAR:...
 
    ...
    ...
    ...

    " Definition of field catalog
    eo_field_catalog ?= cl_abap_structdescr=>describe_by_name( p_name = 'Z_S_SELECTION' ).


    " Build list of field descriptions for FPM containing mostly only field names
    " in order to prevent warnings in FPM designer
    APPEND VALUE fpmgb_s_formfield_descr( name = 'FISCYEAR' ) TO et_field_description.
    APPEND VALUE fpmgb_s_formfield_descr( name = 'ZDOMUSER' ) TO et_field_description.
    APPEND VALUE fpmgb_s_formfield_descr( name = 'ZDOMUSERNAME' ) TO et_field_description.
  ENDMETHOD.

GET_DEFINITION - Mit Button und Read-Only-Spalten

  method IF_FPM_GUIBB_LIST~GET_DEFINITION.

    DATA: lt_field_cat   TYPE ztt_list,
          ls_field_descr TYPE LINE OF fpmgb_t_listfield_descr,
          ls_action_def  type line of fpmgb_t_actiondef.

    eo_field_catalog ?= cl_abap_tabledescr=>describe_by_data( lt_field_cat ).

    ls_field_descr-name = 'LFDNR'.
    ls_field_descr-read_only = abap_true.
    ls_field_descr-condense = 'X'.
    APPEND ls_field_descr TO et_field_description.

    ls_action_def-id = 'SAVEBUTTON'.
    ls_action_def-text = text-001.
    ls_action_def-tooltip = text-001.
    ls_action_def-imagesrc = 'ICON_SYSTEM_SAVE'.
    ls_action_def-enabled = abap_true.
    APPEND ls_action_def TO et_action_definition.
  endmethod.


GET_DEFINITION - Custom-Spaltenüberschriften

Zusätzlich: Felder mit individuellen Spaltenüberschriften sowie Editierbarkeit-Kennzeichen und Darstellung als Checkbox.

  METHOD if_fpm_guibb_list~get_definition.

    DATA: ...

    CLEAR:...
 
    ...
    ...
    ...

    " Definition of field catalog
    eo_field_catalog ?= cl_abap_structdescr=>describe_by_name( p_name = 'Z_TT_LIST' ).


    " Build list of field descriptions for FPM containing mostly only field names
    " in order to prevent warnings in FPM designer

    APPEND VALUE fpmgb_s_listfield_descr( name = 'ROW' technical_field = abap_true ) TO et_field_description.
    APPEND VALUE fpmgb_s_listfield_descr( name = 'ZKSTL_K' ) TO et_field_description.
    APPEND VALUE fpmgb_s_listfield_descr( name = 'ZKSTL_T' ) TO et_field_description.
    APPEND VALUE fpmgb_s_listfield_descr( name = 'ZKRS_K' ) TO et_field_description.
    APPEND VALUE fpmgb_s_listfield_descr( name = 'ZKRS_T' ) TO et_field_description.
    APPEND VALUE fpmgb_s_listfield_descr( name = 'ZBEM' ) TO et_field_description.
    APPEND VALUE fpmgb_s_listfield_descr( name = 'APPROVED' header_label = TEXT-001 ) TO et_field_description.
    APPEND VALUE fpmgb_s_listfield_descr( name = 'REJECTED' header_label = TEXT-002 ) TO et_field_description.
  ENDMETHOD.