SAP Function Modules

MM_ARRANG_READ_KEY_FIELDS SAP Function module







MM_ARRANG_READ_KEY_FIELDS is a standard SAP function module available within R/3 SAP systems depending on your version and release level. Below is the pattern details for this FM showing its interface including any import and export parameters, exceptions etc as well as any documentation contributions (Comments) specific to the object.

See here to view full function module documentation and code listing, simply by entering the name MM_ARRANG_READ_KEY_FIELDS into the relevant SAP transaction such as SE37 or SE80.

Associated Function Group: WN45
Released Date: Not Released
Processing type: Normal fucntion module
Normal function module settings


Pattern for FM MM_ARRANG_READ_KEY_FIELDS - MM ARRANG READ KEY FIELDS





CALL FUNCTION 'MM_ARRANG_READ_KEY_FIELDS' "
  EXPORTING
*   i_kappl = 'M '              " tmab-kappl
    i_condense_type =           " tmab-condense_type
    i_naumf =                   " tmab-naumf
*   i_check =                   " c
  IMPORTING
    e_tmab =                    " tmab
    e_tmabcus1 =                " tmabcus1
* TABLES
*   t_fieldcat_charac =         " arrang_sort
*   t_fieldcat_figures =        " arrang_sort
*   t_fieldcat_key =            " arrang_sort
*   t_fieldlist =               " arrang_sort
*   t_condense_fields =         " arrang_sort
*   t_condense_fields_wo_key =   " arrang_sort
  EXCEPTIONS
    ERROR_READING_CUSTOMIZING = 1  "
    ERROR_READING_FIELD_INFO = 2  "
    ERROR_WHILE_CHECK = 3       "
    .  "  MM_ARRANG_READ_KEY_FIELDS

ABAP code example for Function Module MM_ARRANG_READ_KEY_FIELDS





The ABAP code below is a full code listing to execute function module MM_ARRANG_READ_KEY_FIELDS including all data declarations. The code uses the latest in-line data DECLARATION SYNTAX but I have included an ABAP code snippet at the end to show how declarations would look using the original method of declaring data variables up front. This will allow you to compare and fully understand the new inline method. Please note some of the newer syntax such as the @DATA is not available until a later 4.70 service pack (SP8).

DATA:
ld_e_tmab  TYPE TMAB ,
ld_e_tmabcus1  TYPE TMABCUS1 ,
it_t_fieldcat_charac  TYPE STANDARD TABLE OF ARRANG_SORT,"TABLES PARAM
wa_t_fieldcat_charac  LIKE LINE OF it_t_fieldcat_charac ,
it_t_fieldcat_figures  TYPE STANDARD TABLE OF ARRANG_SORT,"TABLES PARAM
wa_t_fieldcat_figures  LIKE LINE OF it_t_fieldcat_figures ,
it_t_fieldcat_key  TYPE STANDARD TABLE OF ARRANG_SORT,"TABLES PARAM
wa_t_fieldcat_key  LIKE LINE OF it_t_fieldcat_key ,
it_t_fieldlist  TYPE STANDARD TABLE OF ARRANG_SORT,"TABLES PARAM
wa_t_fieldlist  LIKE LINE OF it_t_fieldlist ,
it_t_condense_fields  TYPE STANDARD TABLE OF ARRANG_SORT,"TABLES PARAM
wa_t_condense_fields  LIKE LINE OF it_t_condense_fields ,
it_t_condense_fields_wo_key  TYPE STANDARD TABLE OF ARRANG_SORT,"TABLES PARAM
wa_t_condense_fields_wo_key  LIKE LINE OF it_t_condense_fields_wo_key .


SELECT single KAPPL
FROM TMAB
INTO @DATA(ld_i_kappl).


SELECT single CONDENSE_TYPE
FROM TMAB
INTO @DATA(ld_i_condense_type).


SELECT single NAUMF
FROM TMAB
INTO @DATA(ld_i_naumf).

DATA(ld_i_check) = 'Check type of data required'.

"populate fields of struture and append to itab
append wa_t_fieldcat_charac to it_t_fieldcat_charac.

"populate fields of struture and append to itab
append wa_t_fieldcat_figures to it_t_fieldcat_figures.

"populate fields of struture and append to itab
append wa_t_fieldcat_key to it_t_fieldcat_key.

"populate fields of struture and append to itab
append wa_t_fieldlist to it_t_fieldlist.

"populate fields of struture and append to itab
append wa_t_condense_fields to it_t_condense_fields.

"populate fields of struture and append to itab
append wa_t_condense_fields_wo_key to it_t_condense_fields_wo_key. . CALL FUNCTION 'MM_ARRANG_READ_KEY_FIELDS' EXPORTING * i_kappl = ld_i_kappl i_condense_type = ld_i_condense_type i_naumf = ld_i_naumf * i_check = ld_i_check IMPORTING e_tmab = ld_e_tmab e_tmabcus1 = ld_e_tmabcus1 * TABLES * t_fieldcat_charac = it_t_fieldcat_charac * t_fieldcat_figures = it_t_fieldcat_figures * t_fieldcat_key = it_t_fieldcat_key * t_fieldlist = it_t_fieldlist * t_condense_fields = it_t_condense_fields * t_condense_fields_wo_key = it_t_condense_fields_wo_key EXCEPTIONS ERROR_READING_CUSTOMIZING = 1 ERROR_READING_FIELD_INFO = 2 ERROR_WHILE_CHECK = 3 . " MM_ARRANG_READ_KEY_FIELDS
IF SY-SUBRC EQ 0. "All OK ELSEIF SY-SUBRC EQ 1. "Exception "Add code for exception here ELSEIF SY-SUBRC EQ 2. "Exception "Add code for exception here ELSEIF SY-SUBRC EQ 3. "Exception "Add code for exception here ENDIF.







ABAP code to compare 7.40 inline data declaration with original syntax

The below ABAP code uses the older none in-line data declarations. This allows you to see the coding differences/benefits of the later inline syntax. It may also be useful if you are using an older version of SAP as some of the newer syntax above, such as the @DATA is not available until 4.70 EHP 8.

DATA:
ld_e_tmab  TYPE TMAB ,
ld_i_kappl  TYPE TMAB-KAPPL ,
it_t_fieldcat_charac  TYPE STANDARD TABLE OF ARRANG_SORT ,
wa_t_fieldcat_charac  LIKE LINE OF it_t_fieldcat_charac,
ld_e_tmabcus1  TYPE TMABCUS1 ,
ld_i_condense_type  TYPE TMAB-CONDENSE_TYPE ,
it_t_fieldcat_figures  TYPE STANDARD TABLE OF ARRANG_SORT ,
wa_t_fieldcat_figures  LIKE LINE OF it_t_fieldcat_figures,
ld_i_naumf  TYPE TMAB-NAUMF ,
it_t_fieldcat_key  TYPE STANDARD TABLE OF ARRANG_SORT ,
wa_t_fieldcat_key  LIKE LINE OF it_t_fieldcat_key,
ld_i_check  TYPE C ,
it_t_fieldlist  TYPE STANDARD TABLE OF ARRANG_SORT ,
wa_t_fieldlist  LIKE LINE OF it_t_fieldlist,
it_t_condense_fields  TYPE STANDARD TABLE OF ARRANG_SORT ,
wa_t_condense_fields  LIKE LINE OF it_t_condense_fields,
it_t_condense_fields_wo_key  TYPE STANDARD TABLE OF ARRANG_SORT ,
wa_t_condense_fields_wo_key  LIKE LINE OF it_t_condense_fields_wo_key.


SELECT single KAPPL
FROM TMAB
INTO ld_i_kappl.


"populate fields of struture and append to itab
append wa_t_fieldcat_charac to it_t_fieldcat_charac.

SELECT single CONDENSE_TYPE
FROM TMAB
INTO ld_i_condense_type.


"populate fields of struture and append to itab
append wa_t_fieldcat_figures to it_t_fieldcat_figures.

SELECT single NAUMF
FROM TMAB
INTO ld_i_naumf.


"populate fields of struture and append to itab
append wa_t_fieldcat_key to it_t_fieldcat_key.
ld_i_check = 'Check type of data required'.

"populate fields of struture and append to itab
append wa_t_fieldlist to it_t_fieldlist.

"populate fields of struture and append to itab
append wa_t_condense_fields to it_t_condense_fields.

"populate fields of struture and append to itab
append wa_t_condense_fields_wo_key to it_t_condense_fields_wo_key.

Contribute (Add Comments)

Please help keep this info upto date and use the comments section below to add useful hints, tips and information specific to this SAP function. This will then be available for you and other users to easily find by simply searching on the object name MM_ARRANG_READ_KEY_FIELDS or its description.