SAP G_TABLE_OPEN_CURSOR Function Module for









G_TABLE_OPEN_CURSOR is a standard g table open 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 open cursor FM, simply by entering the name G_TABLE_OPEN_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_OPEN_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_OPEN_CURSOR'"
EXPORTING
I_TABNAME = "
* I_WITH_HOLD = GUSL_C_FALSE "
* I_CLIENT_SPECIFIED = GUSL_C_FALSE "
* I_ZERO_RECORDS = GUSL_C_FALSE "
* I_DB_COMMIT = GUSL_C_FALSE "
* I_DBCON_NAME = "
* I_SELECTION = "
* I_FIELDLIST = "
* I_SORTLIST = "
* I_MAX_PERIOD = 999 "
* I_AGGREGATION = GUSL_C_FALSE "
* I_PERIOD_AGGREGATION = GUSL_C_PERAGGR_NONE "
* I_CUMULATED = GUSL_C_FALSE "
* I_SORTED = GUSL_C_FALSE "

IMPORTING
E_CURSOR = "

EXCEPTIONS
INVALID_SELECTION = 1 INVALID_TABLE = 2 INTERNAL_ERROR = 3 FOREIGN_LOCK = 4
.



IMPORTING Parameters details for G_TABLE_OPEN_CURSOR

I_TABNAME -

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

I_WITH_HOLD -

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

I_CLIENT_SPECIFIED -

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

I_ZERO_RECORDS -

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

I_DB_COMMIT -

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

I_DBCON_NAME -

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

I_SELECTION -

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

I_FIELDLIST -

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

I_SORTLIST -

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

I_MAX_PERIOD -

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

I_AGGREGATION -

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

I_PERIOD_AGGREGATION -

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

I_CUMULATED -

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

I_SORTED -

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

EXPORTING Parameters details for G_TABLE_OPEN_CURSOR

E_CURSOR -

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

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_OPEN_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_e_cursor  TYPE GUSL_CURSOR, "   
lv_i_tabname  TYPE T800A-TAB, "   
lv_invalid_selection  TYPE T800A, "   
lv_i_with_hold  TYPE GUSL_BOOL, "   GUSL_C_FALSE
lv_i_client_specified  TYPE GUSL_BOOL, "   GUSL_C_FALSE
lv_i_zero_records  TYPE GUSL_BOOL, "   GUSL_C_FALSE
lv_i_db_commit  TYPE GUSL_BOOL, "   GUSL_C_FALSE
lv_i_dbcon_name  TYPE DBCON_NAME, "   
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_max_period  TYPE I, "   999
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_sorted  TYPE GUSL_BOOL. "   GUSL_C_FALSE

  CALL FUNCTION 'G_TABLE_OPEN_CURSOR'  "
    EXPORTING
         I_TABNAME = lv_i_tabname
         I_WITH_HOLD = lv_i_with_hold
         I_CLIENT_SPECIFIED = lv_i_client_specified
         I_ZERO_RECORDS = lv_i_zero_records
         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_MAX_PERIOD = lv_i_max_period
         I_AGGREGATION = lv_i_aggregation
         I_PERIOD_AGGREGATION = lv_i_period_aggregation
         I_CUMULATED = lv_i_cumulated
         I_SORTED = lv_i_sorted
    IMPORTING
         E_CURSOR = lv_e_cursor
    EXCEPTIONS
        INVALID_SELECTION = 1
        INVALID_TABLE = 2
        INTERNAL_ERROR = 3
        FOREIGN_LOCK = 4
. " G_TABLE_OPEN_CURSOR




ABAP code using 7.40 inline data declarations to call FM G_TABLE_OPEN_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_with_hold) = GUSL_C_FALSE.
 
DATA(ld_i_client_specified) = GUSL_C_FALSE.
 
DATA(ld_i_zero_records) = GUSL_C_FALSE.
 
DATA(ld_i_db_commit) = GUSL_C_FALSE.
 
 
 
 
 
 
 
 
DATA(ld_i_max_period) = 999.
 
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_sorted) = GUSL_C_FALSE.
 


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!