SAP CNSG_SORT_TABLE Function Module for NOTRANSL: Projekt-Infosystem: Tabelle nach Sortier- und Gruppierkriterien









CNSG_SORT_TABLE is a standard cnsg sort table 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: Tabelle nach Sortier- und Gruppierkriterien 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 sort table FM, simply by entering the name CNSG_SORT_TABLE 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_SORT_TABLE 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_SORT_TABLE'"NOTRANSL: Projekt-Infosystem: Tabelle nach Sortier- und Gruppierkriterien
EXPORTING
* I_GENERAL_ORDER = "Field Name
* I_SORTINDEX = "Field Name
* I_FLG_SORT_DOWN = "Checkbox
* I_FLG_WITH_SORT = 'X' "Checkbox
* I_FLG_WITH_AGGREGATION = 'X' "Checkbox
* I_FLG_WITH_GROUPS = 'X' "Checkbox
* I_FLG_CHECK_LIS_NAMES = "Checkbox
* I_FLG_STABLE = "Checkbox

CHANGING
C_HANDLE = "Int.ID

TABLES
T_TABLE = "DE-EN-LANG-SWITCH-NO-TRANSLATION
.



IMPORTING Parameters details for CNSG_SORT_TABLE

I_GENERAL_ORDER - Field Name

Data type: DFIES-FIELDNAME
Optional: Yes
Call by Reference: No ( called with pass by value option)

I_SORTINDEX - Field Name

Data type: DFIES-FIELDNAME
Optional: Yes
Call by Reference: No ( called with pass by value option)

I_FLG_SORT_DOWN - Checkbox

Data type: XFELD
Optional: Yes
Call by Reference: No ( called with pass by value option)

I_FLG_WITH_SORT - Checkbox

Data type: XFELD
Default: 'X'
Optional: Yes
Call by Reference: No ( called with pass by value option)

I_FLG_WITH_AGGREGATION - Checkbox

Data type: XFELD
Default: 'X'
Optional: Yes
Call by Reference: No ( called with pass by value option)

I_FLG_WITH_GROUPS - Checkbox

Data type: XFELD
Default: 'X'
Optional: Yes
Call by Reference: No ( called with pass by value option)

I_FLG_CHECK_LIS_NAMES - Checkbox

Data type: XFELD
Optional: Yes
Call by Reference: No ( called with pass by value option)

I_FLG_STABLE - Checkbox

Data type: XFELD
Optional: Yes
Call by Reference: No ( called with pass by value option)

CHANGING Parameters details for CNSG_SORT_TABLE

C_HANDLE - Int.ID

Data type: ABAP-MEMORY_ID
Optional: No
Call by Reference: No ( called with pass by value option)

TABLES Parameters details for CNSG_SORT_TABLE

T_TABLE - 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_SORT_TABLE 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:
lt_t_table  TYPE STANDARD TABLE OF STRING, "   
lv_c_handle  TYPE ABAP-MEMORY_ID, "   
lv_i_general_order  TYPE DFIES-FIELDNAME, "   
lv_i_sortindex  TYPE DFIES-FIELDNAME, "   
lv_i_flg_sort_down  TYPE XFELD, "   
lv_i_flg_with_sort  TYPE XFELD, "   'X'
lv_i_flg_with_aggregation  TYPE XFELD, "   'X'
lv_i_flg_with_groups  TYPE XFELD, "   'X'
lv_i_flg_check_lis_names  TYPE XFELD, "   
lv_i_flg_stable  TYPE XFELD. "   

  CALL FUNCTION 'CNSG_SORT_TABLE'  "NOTRANSL: Projekt-Infosystem: Tabelle nach Sortier- und Gruppierkriterien
    EXPORTING
         I_GENERAL_ORDER = lv_i_general_order
         I_SORTINDEX = lv_i_sortindex
         I_FLG_SORT_DOWN = lv_i_flg_sort_down
         I_FLG_WITH_SORT = lv_i_flg_with_sort
         I_FLG_WITH_AGGREGATION = lv_i_flg_with_aggregation
         I_FLG_WITH_GROUPS = lv_i_flg_with_groups
         I_FLG_CHECK_LIS_NAMES = lv_i_flg_check_lis_names
         I_FLG_STABLE = lv_i_flg_stable
    CHANGING
         C_HANDLE = lv_c_handle
    TABLES
         T_TABLE = lt_t_table
. " CNSG_SORT_TABLE




ABAP code using 7.40 inline data declarations to call FM CNSG_SORT_TABLE

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).
 
"SELECT single FIELDNAME FROM DFIES INTO @DATA(ld_i_general_order).
 
"SELECT single FIELDNAME FROM DFIES INTO @DATA(ld_i_sortindex).
 
 
DATA(ld_i_flg_with_sort) = 'X'.
 
DATA(ld_i_flg_with_aggregation) = 'X'.
 
DATA(ld_i_flg_with_groups) = 'X'.
 
 
 


Search for further information about these or an SAP related objects



Comments on this SAP object

What made you want to lookup this SAP object? Please tell us what you were looking for and anything you would like to be included on this page!