SAP Function Modules

MC_POPUP_TO_SELECT_FIELDS SAP Function module







MC_POPUP_TO_SELECT_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_SELECT_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_SELECT_FIELDS - MC POPUP TO SELECT FIELDS





CALL FUNCTION 'MC_POPUP_TO_SELECT_FIELDS' "
  EXPORTING
*   i_application = SPACE       " tmcap-mcapp   Appl. of the field catalog or evaluation structure
*   i_catalog_type = SPACE      " tfcg-fcart    Category of field catalog
*   i_column_width =            " sy-cucol      Column width for chosen fields
*   i_field_first = 1           " sy-tabix      Table index of the first field in popup
*   i_field_number_max = SPACE  " sy-tabix      Max. number of chosen fields
*   i_field_number_min = 1      " sy-tabix      Min. number of chosen fields
*   i_flg_check_planning = SPACE  "             Control indicator for the field validation
*   i_flg_length = SPACE        "
*   i_flg_format = SPACE        "
*   i_flg_sort = SPACE          "
*   i_flg_sort_down = SPACE     "
*   i_formname = SPACE          "               External routine which changes the field texts
*   i_library_name = SPACE      " t801k-lib     Name of the Report Writer library
*   i_line_size_max =           " sy-linsz      Width of output line
*   i_maxlen = 0                " mcs01-intlen  Maximum length of the fields in bytes
*   i_no_unit_fields = SPACE    "               Flag for displaying unit fields
*   i_object_name_plural = SPACE  "             Name of table fields in plural
*   i_object_name_plural_titlebar = SPACE  "    Name of the table fields in plural for title
*   i_object_name_singular = SPACE  "           Name of table fields in singular
*   i_popup_length = SPACE      " sy-curow      Length of the pop-up (optional)
*   i_popup_width = SPACE       " sy-cucol      Width of the popup (optional)
*   i_progname = SPACE          " sy-repid      Program for routine I_FORMNAME
*   i_selection_inttype = SPACE  "              Internal data type of the table fields
    i_selection_source =        " sy-datar      Category for source of the selectable fields
*   i_selection_type = SPACE    " sy-datar      Category of the table fields (all of them, keys, data)
*   i_start_column = SPACE      " sy-cucol      Column in the top left corner of popup (opt.)
*   i_start_row = 3             " sy-curow      Line in the top left corner of popup (opt.)
*   i_table_name = SPACE        "               Name of the Report Writer or DDIC table
*   i_table_name_additional = SPACE  "          Name of the additional DDIC table
*   i_no_field_sort = SPACE     " sy-datar      Flag for no sorting of selectable fields
  IMPORTING
    e_field_changed =           " sy-datar      Flag for changing table T_FIELDS
    e_field_first =             " sy-tabix      Table index of the first field in popup
  TABLES
    t_fields =                  " mcs01         Fields which are imported or exported
*   t_fields_exclude =          " mcs02         Fields which should not be displayed
  EXCEPTIONS
    ILLEGAL_SELECTION_SOURCE = 1  "             Invalid I_SELECTION_SOURCE
    .  "  MC_POPUP_TO_SELECT_FIELDS

ABAP code example for Function Module MC_POPUP_TO_SELECT_FIELDS





The ABAP code below is a full code listing to execute function module MC_POPUP_TO_SELECT_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_field_changed  TYPE SY-DATAR ,
ld_e_field_first  TYPE SY-TABIX ,
it_t_fields  TYPE STANDARD TABLE OF MCS01,"TABLES PARAM
wa_t_fields  LIKE LINE OF it_t_fields ,
it_t_fields_exclude  TYPE STANDARD TABLE OF MCS02,"TABLES PARAM
wa_t_fields_exclude  LIKE LINE OF it_t_fields_exclude .


SELECT single MCAPP
FROM TMCAP
INTO @DATA(ld_i_application).


SELECT single FCART
FROM TFCG
INTO @DATA(ld_i_catalog_type).

DATA(ld_i_column_width) = '123 '.
DATA(ld_i_field_first) = '123 '.
DATA(ld_i_field_number_max) = '123 '.
DATA(ld_i_field_number_min) = '123 '.
DATA(ld_i_flg_check_planning) = 'some text here'.
DATA(ld_i_flg_length) = 'some text here'.
DATA(ld_i_flg_format) = 'some text here'.
DATA(ld_i_flg_sort) = 'some text here'.
DATA(ld_i_flg_sort_down) = 'some text here'.
DATA(ld_i_formname) = 'some text here'.

SELECT single LIB
FROM T801K
INTO @DATA(ld_i_library_name).

DATA(ld_i_line_size_max) = '123 '.

DATA(ld_i_maxlen) = Check type of data required
DATA(ld_i_no_unit_fields) = 'some text here'.
DATA(ld_i_object_name_plural) = 'some text here'.
DATA(ld_i_object_name_plural_titlebar) = 'some text here'.
DATA(ld_i_object_name_singular) = 'some text here'.
DATA(ld_i_popup_length) = '123 '.
DATA(ld_i_popup_width) = '123 '.
DATA(ld_i_progname) = '123 '.
DATA(ld_i_selection_inttype) = 'some text here'.
DATA(ld_i_selection_source) = 'some text here'.
DATA(ld_i_selection_type) = 'some text here'.
DATA(ld_i_start_column) = '123 '.
DATA(ld_i_start_row) = '123 '.
DATA(ld_i_table_name) = 'some text here'.
DATA(ld_i_table_name_additional) = 'some text here'.
DATA(ld_i_no_field_sort) = '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_fields_exclude to it_t_fields_exclude. . CALL FUNCTION 'MC_POPUP_TO_SELECT_FIELDS' EXPORTING * i_application = ld_i_application * i_catalog_type = ld_i_catalog_type * i_column_width = ld_i_column_width * i_field_first = ld_i_field_first * i_field_number_max = ld_i_field_number_max * i_field_number_min = ld_i_field_number_min * i_flg_check_planning = ld_i_flg_check_planning * i_flg_length = ld_i_flg_length * i_flg_format = ld_i_flg_format * i_flg_sort = ld_i_flg_sort * i_flg_sort_down = ld_i_flg_sort_down * i_formname = ld_i_formname * i_library_name = ld_i_library_name * i_line_size_max = ld_i_line_size_max * i_maxlen = ld_i_maxlen * i_no_unit_fields = ld_i_no_unit_fields * i_object_name_plural = ld_i_object_name_plural * i_object_name_plural_titlebar = ld_i_object_name_plural_titlebar * i_object_name_singular = ld_i_object_name_singular * i_popup_length = ld_i_popup_length * i_popup_width = ld_i_popup_width * i_progname = ld_i_progname * i_selection_inttype = ld_i_selection_inttype i_selection_source = ld_i_selection_source * i_selection_type = ld_i_selection_type * i_start_column = ld_i_start_column * i_start_row = ld_i_start_row * i_table_name = ld_i_table_name * i_table_name_additional = ld_i_table_name_additional * i_no_field_sort = ld_i_no_field_sort IMPORTING e_field_changed = ld_e_field_changed e_field_first = ld_e_field_first TABLES t_fields = it_t_fields * t_fields_exclude = it_t_fields_exclude EXCEPTIONS ILLEGAL_SELECTION_SOURCE = 1 . " MC_POPUP_TO_SELECT_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_field_changed  TYPE SY-DATAR ,
ld_i_application  TYPE TMCAP-MCAPP ,
it_t_fields  TYPE STANDARD TABLE OF MCS01 ,
wa_t_fields  LIKE LINE OF it_t_fields,
ld_e_field_first  TYPE SY-TABIX ,
ld_i_catalog_type  TYPE TFCG-FCART ,
it_t_fields_exclude  TYPE STANDARD TABLE OF MCS02 ,
wa_t_fields_exclude  LIKE LINE OF it_t_fields_exclude,
ld_i_column_width  TYPE SY-CUCOL ,
ld_i_field_first  TYPE SY-TABIX ,
ld_i_field_number_max  TYPE SY-TABIX ,
ld_i_field_number_min  TYPE SY-TABIX ,
ld_i_flg_check_planning  TYPE STRING ,
ld_i_flg_length  TYPE STRING ,
ld_i_flg_format  TYPE STRING ,
ld_i_flg_sort  TYPE STRING ,
ld_i_flg_sort_down  TYPE STRING ,
ld_i_formname  TYPE STRING ,
ld_i_library_name  TYPE T801K-LIB ,
ld_i_line_size_max  TYPE SY-LINSZ ,
ld_i_maxlen  TYPE MCS01-INTLEN ,
ld_i_no_unit_fields  TYPE STRING ,
ld_i_object_name_plural  TYPE STRING ,
ld_i_object_name_plural_titlebar  TYPE STRING ,
ld_i_object_name_singular  TYPE STRING ,
ld_i_popup_length  TYPE SY-CUROW ,
ld_i_popup_width  TYPE SY-CUCOL ,
ld_i_progname  TYPE SY-REPID ,
ld_i_selection_inttype  TYPE STRING ,
ld_i_selection_source  TYPE SY-DATAR ,
ld_i_selection_type  TYPE SY-DATAR ,
ld_i_start_column  TYPE SY-CUCOL ,
ld_i_start_row  TYPE SY-CUROW ,
ld_i_table_name  TYPE STRING ,
ld_i_table_name_additional  TYPE STRING ,
ld_i_no_field_sort  TYPE SY-DATAR .


SELECT single MCAPP
FROM TMCAP
INTO ld_i_application.


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

SELECT single FCART
FROM TFCG
INTO ld_i_catalog_type.


"populate fields of struture and append to itab
append wa_t_fields_exclude to it_t_fields_exclude.
ld_i_column_width = '123 '.
ld_i_field_first = '123 '.
ld_i_field_number_max = '123 '.
ld_i_field_number_min = '123 '.
ld_i_flg_check_planning = 'some text here'.
ld_i_flg_length = 'some text here'.
ld_i_flg_format = 'some text here'.
ld_i_flg_sort = 'some text here'.
ld_i_flg_sort_down = 'some text here'.
ld_i_formname = 'some text here'.

SELECT single LIB
FROM T801K
INTO ld_i_library_name.

ld_i_line_size_max = '123 '.

ld_i_maxlen = Check type of data required
ld_i_no_unit_fields = 'some text here'.
ld_i_object_name_plural = 'some text here'.
ld_i_object_name_plural_titlebar = 'some text here'.
ld_i_object_name_singular = 'some text here'.
ld_i_popup_length = '123 '.
ld_i_popup_width = '123 '.
ld_i_progname = '123 '.
ld_i_selection_inttype = 'some text here'.
ld_i_selection_source = 'some text here'.
ld_i_selection_type = 'some text here'.
ld_i_start_column = '123 '.
ld_i_start_row = '123 '.
ld_i_table_name = 'some text here'.
ld_i_table_name_additional = 'some text here'.
ld_i_no_field_sort = '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_SELECT_FIELDS or its description.