SAP CNSG_SET_SORT_FIELDS Function Module for NOTRANSL: Projekt-Infosystem: Popup zur Eingabe von Sortier- und Gruppierk
CNSG_SET_SORT_FIELDS is a standard cnsg set sort fields SAP function module available within SAP R/3 or S/4 Hana systems, depending on your version and release level. It is used for NOTRANSL: Projekt-Infosystem: Popup zur Eingabe von Sortier- und Gruppierk processing and below is the pattern details for this FM, showing its interface including any import and export parameters, exceptions etc. there is also a full "cut and paste" ABAP pattern code example, along with implementation ABAP coding, documentation and contribution comments specific to this or related objects.
See here to view full function module documentation and code listing for cnsg set sort fields FM, simply by entering the name CNSG_SET_SORT_FIELDS into the relevant SAP transaction such as SE37 or SE38.
Function Group: CNSG
Program Name: SAPLCNSG
Main Program:
Appliation area: C
Release date: N/A
Mode(Normal, Remote etc): Normal Function Module
Update:

Function CNSG_SET_SORT_FIELDS pattern details
In-order to call this FM within your sap programs, simply using the below ABAP pattern details to trigger the function call...or see the full ABAP code listing at the end of this article. You can simply cut and paste this code into your ABAP progrom as it is, including variable declarations.CALL FUNCTION 'CNSG_SET_SORT_FIELDS'"NOTRANSL: Projekt-Infosystem: Popup zur Eingabe von Sortier- und Gruppierk.
EXPORTING
* I_FLG_DISPLAY = 'X' "Checkbox
* I_FIELDS_NAME = "Generic Type
* I_FLG_GROUPS = "Generic Type
* I_FLG_UNITS = 'X' "Checkbox
* I_FLG_SORT_DOWN = "Checkbox
* I_FLG_NEW_ACTUAL_FIELDS = "Checkbox
* I_ACTION_FIELD = "Interface Structure for Func.Mod. MC_POPUP_TO_SELECT_FIELDS
* I_ACTION = "DE-EN-LANG-SWITCH-NO-TRANSLATION
* I_MAX_NUMBER = 20 "Maximum Number
* I_TITLE = "Title text
* I_FIELD_NAME = "Generic Type
CHANGING
C_HANDLE = "Int.ID
TABLES
* T_ACTUAL_FIELDS = "Interface Structure for Func.Mod. MC_POPUP_TO_SELECT_FIELDS
* T_ALL_FIELDS = "Interface Structure for Func.Mod. MC_POPUP_TO_SELECT_FIELDS
* T_INCL_FIELDS = "Structure of Excluding Tab. for FB MC_POPUP_TO_SELECT_FIELDS
* T_EXCL_FIELDS = "Structure of Excluding Tab. for FB MC_POPUP_TO_SELECT_FIELDS
* T_GROUPS = "Field Groups
EXCEPTIONS
CANCEL = 1 NO_ALLOWED_FIELDS = 2
IMPORTING Parameters details for CNSG_SET_SORT_FIELDS
I_FLG_DISPLAY - Checkbox
Data type: XFELDDefault: 'X'
Optional: Yes
Call by Reference: No ( called with pass by value option)
I_FIELDS_NAME - Generic Type
Data type: CLIKEOptional: Yes
Call by Reference: No ( called with pass by value option)
I_FLG_GROUPS - Generic Type
Data type: CLIKEOptional: Yes
Call by Reference: No ( called with pass by value option)
I_FLG_UNITS - Checkbox
Data type: XFELDDefault: 'X'
Optional: Yes
Call by Reference: No ( called with pass by value option)
I_FLG_SORT_DOWN - Checkbox
Data type: XFELDOptional: Yes
Call by Reference: No ( called with pass by value option)
I_FLG_NEW_ACTUAL_FIELDS - Checkbox
Data type: XFELDOptional: Yes
Call by Reference: No ( called with pass by value option)
I_ACTION_FIELD - Interface Structure for Func.Mod. MC_POPUP_TO_SELECT_FIELDS
Data type: MCS01Optional: Yes
Call by Reference: No ( called with pass by value option)
I_ACTION - DE-EN-LANG-SWITCH-NO-TRANSLATION
Data type:Optional: Yes
Call by Reference: No ( called with pass by value option)
I_MAX_NUMBER - Maximum Number
Data type: IDefault: 20
Optional: Yes
Call by Reference: No ( called with pass by value option)
I_TITLE - Title text
Data type: CLIKEOptional: Yes
Call by Reference: No ( called with pass by value option)
I_FIELD_NAME - Generic Type
Data type: CLIKEOptional: Yes
Call by Reference: No ( called with pass by value option)
CHANGING Parameters details for CNSG_SET_SORT_FIELDS
C_HANDLE - Int.ID
Data type: ABAP-MEMORY_IDOptional: No
Call by Reference: No ( called with pass by value option)
TABLES Parameters details for CNSG_SET_SORT_FIELDS
T_ACTUAL_FIELDS - Interface Structure for Func.Mod. MC_POPUP_TO_SELECT_FIELDS
Data type: MCS01Optional: Yes
Call by Reference: No ( called with pass by value option)
T_ALL_FIELDS - Interface Structure for Func.Mod. MC_POPUP_TO_SELECT_FIELDS
Data type: MCS01Optional: Yes
Call by Reference: No ( called with pass by value option)
T_INCL_FIELDS - Structure of Excluding Tab. for FB MC_POPUP_TO_SELECT_FIELDS
Data type: MCS02Optional: Yes
Call by Reference: No ( called with pass by value option)
T_EXCL_FIELDS - Structure of Excluding Tab. for FB MC_POPUP_TO_SELECT_FIELDS
Data type: MCS02Optional: Yes
Call by Reference: No ( called with pass by value option)
T_GROUPS - Field Groups
Data type: CNFA_GROUPSOptional: Yes
Call by Reference: No ( called with pass by value option)
EXCEPTIONS details
CANCEL - Cancel
Data type:Optional: No
Call by Reference: No ( called with pass by value option)
NO_ALLOWED_FIELDS - DE-EN-LANG-SWITCH-NO-TRANSLATION
Data type:Optional: No
Call by Reference: No ( called with pass by value option)
Copy and paste ABAP code example for CNSG_SET_SORT_FIELDS Function Module
The ABAP code below is a full code listing to execute function module POPUP_TO_CONFIRM including all data declarations. The code uses the original data declarations rather than 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 newer method of declaring data variables on the fly. 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), which i why i have stuck to the origianl for this example.| DATA: | ||||
| lv_cancel | TYPE STRING, " | |||
| lv_c_handle | TYPE ABAP-MEMORY_ID, " | |||
| lv_i_flg_display | TYPE XFELD, " 'X' | |||
| lt_t_actual_fields | TYPE STANDARD TABLE OF MCS01, " | |||
| lv_i_fields_name | TYPE CLIKE, " | |||
| lv_i_flg_groups | TYPE CLIKE, " | |||
| lv_i_flg_units | TYPE XFELD, " 'X' | |||
| lt_t_all_fields | TYPE STANDARD TABLE OF MCS01, " | |||
| lv_no_allowed_fields | TYPE MCS01, " | |||
| lt_t_incl_fields | TYPE STANDARD TABLE OF MCS02, " | |||
| lv_i_flg_sort_down | TYPE XFELD, " | |||
| lt_t_excl_fields | TYPE STANDARD TABLE OF MCS02, " | |||
| lv_i_flg_new_actual_fields | TYPE XFELD, " | |||
| lt_t_groups | TYPE STANDARD TABLE OF CNFA_GROUPS, " | |||
| lv_i_action_field | TYPE MCS01, " | |||
| lv_i_action | TYPE MCS01, " | |||
| lv_i_max_number | TYPE I, " 20 | |||
| lv_i_title | TYPE CLIKE, " | |||
| lv_i_field_name | TYPE CLIKE. " |
|   CALL FUNCTION 'CNSG_SET_SORT_FIELDS' "NOTRANSL: Projekt-Infosystem: Popup zur Eingabe von Sortier- und Gruppierk |
| EXPORTING | ||
| I_FLG_DISPLAY | = lv_i_flg_display | |
| I_FIELDS_NAME | = lv_i_fields_name | |
| I_FLG_GROUPS | = lv_i_flg_groups | |
| I_FLG_UNITS | = lv_i_flg_units | |
| I_FLG_SORT_DOWN | = lv_i_flg_sort_down | |
| I_FLG_NEW_ACTUAL_FIELDS | = lv_i_flg_new_actual_fields | |
| I_ACTION_FIELD | = lv_i_action_field | |
| I_ACTION | = lv_i_action | |
| I_MAX_NUMBER | = lv_i_max_number | |
| I_TITLE | = lv_i_title | |
| I_FIELD_NAME | = lv_i_field_name | |
| CHANGING | ||
| C_HANDLE | = lv_c_handle | |
| TABLES | ||
| T_ACTUAL_FIELDS | = lt_t_actual_fields | |
| T_ALL_FIELDS | = lt_t_all_fields | |
| T_INCL_FIELDS | = lt_t_incl_fields | |
| T_EXCL_FIELDS | = lt_t_excl_fields | |
| T_GROUPS | = lt_t_groups | |
| EXCEPTIONS | ||
| CANCEL = 1 | ||
| NO_ALLOWED_FIELDS = 2 | ||
| . " CNSG_SET_SORT_FIELDS | ||
ABAP code using 7.40 inline data declarations to call FM CNSG_SET_SORT_FIELDS
The below ABAP code uses the newer in-line data declarations. This allows you to see the coding differences/benefits of the later inline syntax. Please note some of the newer syntax below, such as the @DATA is not available until 4.70 EHP 8.| "SELECT single MEMORY_ID FROM ABAP INTO @DATA(ld_c_handle). | ||||
| DATA(ld_i_flg_display) | = 'X'. | |||
| DATA(ld_i_flg_units) | = 'X'. | |||
| DATA(ld_i_max_number) | = 20. | |||
Search for further information about these or an SAP related objects