SAP G_TABLE_SELECT_WITH_CURSOR Function Module for
G_TABLE_SELECT_WITH_CURSOR is a standard g table select with cursor SAP function module available within SAP R/3 or S/4 Hana systems, depending on your version and release level. It is used to perform a specific ABAP function and below is the pattern details, 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 g table select with cursor FM, simply by entering the name G_TABLE_SELECT_WITH_CURSOR into the relevant SAP transaction such as SE37 or SE38.
Function Group: GUSL
Program Name: SAPLGUSL
Main Program: SAPLGUSL
Appliation area: G
Release date: N/A
Mode(Normal, Remote etc): Normal Function Module
Update:

Function G_TABLE_SELECT_WITH_CURSOR 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 'G_TABLE_SELECT_WITH_CURSOR'".
EXPORTING
I_TABNAME = "
* I_SORTED = GUSL_C_FALSE "
* I_CLIENT_SPECIFIED = GUSL_C_FALSE "
* I_DB_COMMIT = GUSL_C_FALSE "
* I_DBCON_NAME = "
* I_SELECTION = "
* I_FIELDLIST = "
* I_SORTLIST = "
* I_AGGREGATION = GUSL_C_FALSE "
* I_PERIOD_AGGREGATION = GUSL_C_PERAGGR_NONE "
* I_CUMULATED = GUSL_C_FALSE "
* I_APPENDING_TABLE = GUSL_C_FALSE "
* I_ZERO_RECORDS = GUSL_C_FALSE "
CHANGING
* C_T_DATA = "
* C_T_GLU1 = "
EXCEPTIONS
INVALID_SELECTION = 1 INVALID_TABLE = 2 INTERNAL_ERROR = 3 FOREIGN_LOCK = 4
IMPORTING Parameters details for G_TABLE_SELECT_WITH_CURSOR
I_TABNAME -
Data type: T800A-TABOptional: No
Call by Reference: No ( called with pass by value option)
I_SORTED -
Data type: GUSL_BOOLDefault: GUSL_C_FALSE
Optional: Yes
Call by Reference: No ( called with pass by value option)
I_CLIENT_SPECIFIED -
Data type: GUSL_BOOLDefault: GUSL_C_FALSE
Optional: Yes
Call by Reference: No ( called with pass by value option)
I_DB_COMMIT -
Data type: GUSL_BOOLDefault: GUSL_C_FALSE
Optional: Yes
Call by Reference: No ( called with pass by value option)
I_DBCON_NAME -
Data type: DBCON_NAMEOptional: Yes
Call by Reference: No ( called with pass by value option)
I_SELECTION -
Data type: GUSL_T_SELECTIONOptional: Yes
Call by Reference: No ( called with pass by value option)
I_FIELDLIST -
Data type: GUSL_T_FIELDSOptional: Yes
Call by Reference: No ( called with pass by value option)
I_SORTLIST -
Data type: GUSL_T_FIELDSOptional: Yes
Call by Reference: No ( called with pass by value option)
I_AGGREGATION -
Data type: GUSL_BOOLDefault: GUSL_C_FALSE
Optional: Yes
Call by Reference: No ( called with pass by value option)
I_PERIOD_AGGREGATION -
Data type: GUSL_PERAGGRDefault: GUSL_C_PERAGGR_NONE
Optional: Yes
Call by Reference: No ( called with pass by value option)
I_CUMULATED -
Data type: GUSL_BOOLDefault: GUSL_C_FALSE
Optional: Yes
Call by Reference: No ( called with pass by value option)
I_APPENDING_TABLE -
Data type: GUSL_BOOLDefault: GUSL_C_FALSE
Optional: Yes
Call by Reference: No ( called with pass by value option)
I_ZERO_RECORDS -
Data type: GUSL_BOOLDefault: GUSL_C_FALSE
Optional: Yes
Call by Reference: No ( called with pass by value option)
CHANGING Parameters details for G_TABLE_SELECT_WITH_CURSOR
C_T_DATA -
Data type: TABLEOptional: Yes
Call by Reference: Yes
C_T_GLU1 -
Data type: GUSL_T_GLU1Optional: Yes
Call by Reference: Yes
EXCEPTIONS details
INVALID_SELECTION -
Data type:Optional: No
Call by Reference: No ( called with pass by value option)
INVALID_TABLE -
Data type:Optional: No
Call by Reference: No ( called with pass by value option)
INTERNAL_ERROR -
Data type:Optional: No
Call by Reference: No ( called with pass by value option)
FOREIGN_LOCK -
Data type:Optional: No
Call by Reference: No ( called with pass by value option)
Copy and paste ABAP code example for G_TABLE_SELECT_WITH_CURSOR 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_c_t_data | TYPE TABLE, " | |||
| lv_i_tabname | TYPE T800A-TAB, " | |||
| lv_invalid_selection | TYPE T800A, " | |||
| lv_i_sorted | TYPE GUSL_BOOL, " GUSL_C_FALSE | |||
| lv_i_client_specified | TYPE GUSL_BOOL, " GUSL_C_FALSE | |||
| lv_i_db_commit | TYPE GUSL_BOOL, " GUSL_C_FALSE | |||
| lv_i_dbcon_name | TYPE DBCON_NAME, " | |||
| lv_c_t_glu1 | TYPE GUSL_T_GLU1, " | |||
| lv_i_selection | TYPE GUSL_T_SELECTION, " | |||
| lv_invalid_table | TYPE GUSL_T_SELECTION, " | |||
| lv_i_fieldlist | TYPE GUSL_T_FIELDS, " | |||
| lv_internal_error | TYPE GUSL_T_FIELDS, " | |||
| lv_i_sortlist | TYPE GUSL_T_FIELDS, " | |||
| lv_foreign_lock | TYPE GUSL_T_FIELDS, " | |||
| lv_i_aggregation | TYPE GUSL_BOOL, " GUSL_C_FALSE | |||
| lv_i_period_aggregation | TYPE GUSL_PERAGGR, " GUSL_C_PERAGGR_NONE | |||
| lv_i_cumulated | TYPE GUSL_BOOL, " GUSL_C_FALSE | |||
| lv_i_appending_table | TYPE GUSL_BOOL, " GUSL_C_FALSE | |||
| lv_i_zero_records | TYPE GUSL_BOOL. " GUSL_C_FALSE |
|   CALL FUNCTION 'G_TABLE_SELECT_WITH_CURSOR' " |
| EXPORTING | ||
| I_TABNAME | = lv_i_tabname | |
| I_SORTED | = lv_i_sorted | |
| I_CLIENT_SPECIFIED | = lv_i_client_specified | |
| I_DB_COMMIT | = lv_i_db_commit | |
| I_DBCON_NAME | = lv_i_dbcon_name | |
| I_SELECTION | = lv_i_selection | |
| I_FIELDLIST | = lv_i_fieldlist | |
| I_SORTLIST | = lv_i_sortlist | |
| I_AGGREGATION | = lv_i_aggregation | |
| I_PERIOD_AGGREGATION | = lv_i_period_aggregation | |
| I_CUMULATED | = lv_i_cumulated | |
| I_APPENDING_TABLE | = lv_i_appending_table | |
| I_ZERO_RECORDS | = lv_i_zero_records | |
| CHANGING | ||
| C_T_DATA | = lv_c_t_data | |
| C_T_GLU1 | = lv_c_t_glu1 | |
| EXCEPTIONS | ||
| INVALID_SELECTION = 1 | ||
| INVALID_TABLE = 2 | ||
| INTERNAL_ERROR = 3 | ||
| FOREIGN_LOCK = 4 | ||
| . " G_TABLE_SELECT_WITH_CURSOR | ||
ABAP code using 7.40 inline data declarations to call FM G_TABLE_SELECT_WITH_CURSOR
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 TAB FROM T800A INTO @DATA(ld_i_tabname). | ||||
| DATA(ld_i_sorted) | = GUSL_C_FALSE. | |||
| DATA(ld_i_client_specified) | = GUSL_C_FALSE. | |||
| DATA(ld_i_db_commit) | = GUSL_C_FALSE. | |||
| DATA(ld_i_aggregation) | = GUSL_C_FALSE. | |||
| DATA(ld_i_period_aggregation) | = GUSL_C_PERAGGR_NONE. | |||
| DATA(ld_i_cumulated) | = GUSL_C_FALSE. | |||
| DATA(ld_i_appending_table) | = GUSL_C_FALSE. | |||
| DATA(ld_i_zero_records) | = GUSL_C_FALSE. | |||
Search for further information about these or an SAP related objects