SAP Function Modules

MC_POPUP_TO_MARK_FIELDS SAP Function module







MC_POPUP_TO_MARK_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 MC_POPUP_TO_MARK_FIELDS into the relevant SAP transaction such as SE37 or SE80.

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


Pattern for FM MC_POPUP_TO_MARK_FIELDS - MC POPUP TO MARK FIELDS





CALL FUNCTION 'MC_POPUP_TO_MARK_FIELDS' "
  EXPORTING
*   i_fields_marked = SPACE     " sy-datar      Flag for initial selection of all fields
*   i_field_number_max =        " sy-tabix      Max. number of chosen fields
*   i_field_number_min = 1      " sy-tabix      Min. number of chosen fields
*   i_mark_by_table = SPACE     " sy-datar      Flag for selecting fields from T_FIELDS_MARKED
    i_object_name_plural =      "               Name of table fields in plural
    i_object_name_singular =    "               Name of table fields in singular
*   i_popup_length =            " sy-curow      Length of the popup (optional)
*   i_popup_title = SPACE       "               Dialog box title
*   i_textline = SPACE          "               Text which is displayed via the fields, if necessary
*   i_text_length = 20          " sy-cucol      Length in which the field text is to be displayed
*   i_icontext =                " rseu1-icon_text
*   i_iconinfo =                " rseu1-icon_info
  IMPORTING
    e_marked =                  " sy-datar      Flag for selected fields in T_MARKED_FIELDS
  TABLES
    t_fields =                  " mcs01         Fields which can be marked
    t_marked_fields =           " mcs01         Fields which were selected or are preselected
  EXCEPTIONS
    UNVALID_TEXT_LENGTH = 1     "
    .  "  MC_POPUP_TO_MARK_FIELDS

ABAP code example for Function Module MC_POPUP_TO_MARK_FIELDS





The ABAP code below is a full code listing to execute function module MC_POPUP_TO_MARK_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_marked  TYPE SY-DATAR ,
it_t_fields  TYPE STANDARD TABLE OF MCS01,"TABLES PARAM
wa_t_fields  LIKE LINE OF it_t_fields ,
it_t_marked_fields  TYPE STANDARD TABLE OF MCS01,"TABLES PARAM
wa_t_marked_fields  LIKE LINE OF it_t_marked_fields .

DATA(ld_i_fields_marked) = 'some text here'.
DATA(ld_i_field_number_max) = '123 '.
DATA(ld_i_field_number_min) = '123 '.
DATA(ld_i_mark_by_table) = 'some text here'.
DATA(ld_i_object_name_plural) = 'some text here'.
DATA(ld_i_object_name_singular) = 'some text here'.
DATA(ld_i_popup_length) = '123 '.
DATA(ld_i_popup_title) = 'some text here'.
DATA(ld_i_textline) = 'some text here'.
DATA(ld_i_text_length) = '123 '.

DATA(ld_i_icontext) = some text here

DATA(ld_i_iconinfo) = some text here

"populate fields of struture and append to itab
append wa_t_fields to it_t_fields.

"populate fields of struture and append to itab
append wa_t_marked_fields to it_t_marked_fields. . CALL FUNCTION 'MC_POPUP_TO_MARK_FIELDS' EXPORTING * i_fields_marked = ld_i_fields_marked * i_field_number_max = ld_i_field_number_max * i_field_number_min = ld_i_field_number_min * i_mark_by_table = ld_i_mark_by_table i_object_name_plural = ld_i_object_name_plural i_object_name_singular = ld_i_object_name_singular * i_popup_length = ld_i_popup_length * i_popup_title = ld_i_popup_title * i_textline = ld_i_textline * i_text_length = ld_i_text_length * i_icontext = ld_i_icontext * i_iconinfo = ld_i_iconinfo IMPORTING e_marked = ld_e_marked TABLES t_fields = it_t_fields t_marked_fields = it_t_marked_fields EXCEPTIONS UNVALID_TEXT_LENGTH = 1 . " MC_POPUP_TO_MARK_FIELDS
IF SY-SUBRC EQ 0. "All OK ELSEIF SY-SUBRC EQ 1. "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_marked  TYPE SY-DATAR ,
ld_i_fields_marked  TYPE SY-DATAR ,
it_t_fields  TYPE STANDARD TABLE OF MCS01 ,
wa_t_fields  LIKE LINE OF it_t_fields,
ld_i_field_number_max  TYPE SY-TABIX ,
it_t_marked_fields  TYPE STANDARD TABLE OF MCS01 ,
wa_t_marked_fields  LIKE LINE OF it_t_marked_fields,
ld_i_field_number_min  TYPE SY-TABIX ,
ld_i_mark_by_table  TYPE SY-DATAR ,
ld_i_object_name_plural  TYPE STRING ,
ld_i_object_name_singular  TYPE STRING ,
ld_i_popup_length  TYPE SY-CUROW ,
ld_i_popup_title  TYPE STRING ,
ld_i_textline  TYPE STRING ,
ld_i_text_length  TYPE SY-CUCOL ,
ld_i_icontext  TYPE RSEU1-ICON_TEXT ,
ld_i_iconinfo  TYPE RSEU1-ICON_INFO .

ld_i_fields_marked = 'some text here'.

"populate fields of struture and append to itab
append wa_t_fields to it_t_fields.
ld_i_field_number_max = '123 '.

"populate fields of struture and append to itab
append wa_t_marked_fields to it_t_marked_fields.
ld_i_field_number_min = '123 '.
ld_i_mark_by_table = 'some text here'.
ld_i_object_name_plural = 'some text here'.
ld_i_object_name_singular = 'some text here'.
ld_i_popup_length = '123 '.
ld_i_popup_title = 'some text here'.
ld_i_textline = 'some text here'.
ld_i_text_length = '123 '.

ld_i_icontext = some text here

ld_i_iconinfo = some text here

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 MC_POPUP_TO_MARK_FIELDS or its description.