SAP Function Modules

G_TABLE_OPEN_CURSOR SAP Function module







G_TABLE_OPEN_CURSOR 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 G_TABLE_OPEN_CURSOR into the relevant SAP transaction such as SE37 or SE80.

Associated Function Group: GUSL
Released Date: Not Released
Processing type: Normal fucntion module
Normal function module settings


Pattern for FM G_TABLE_OPEN_CURSOR - G TABLE OPEN CURSOR





CALL FUNCTION 'G_TABLE_OPEN_CURSOR' "
  EXPORTING
    i_tabname =                 " t800a-tab
*   i_selection =               " gusl_t_selection
*   i_fieldlist =               " gusl_t_fields
*   i_sortlist =                " gusl_t_fields
*   i_max_period = 999          " i
*   i_aggregation = GUSL_C_FALSE  " gusl_bool
*   i_period_aggregation = GUSL_C_PERAGGR_NONE  " gusl_peraggr
*   i_cumulated = GUSL_C_FALSE  " gusl_bool
*   i_sorted = GUSL_C_FALSE     " gusl_bool
*   i_with_hold = GUSL_C_FALSE  " gusl_bool
*   i_client_specified = GUSL_C_FALSE  " gusl_bool
*   i_zero_records = GUSL_C_FALSE  " gusl_bool
*   i_db_commit = GUSL_C_FALSE  " gusl_bool
*   i_dbcon_name =              " dbcon_name
  IMPORTING
    e_cursor =                  " gusl_cursor
  EXCEPTIONS
    INVALID_SELECTION = 1       "
    INVALID_TABLE = 2           "
    INTERNAL_ERROR = 3          "
    FOREIGN_LOCK = 4            "
    .  "  G_TABLE_OPEN_CURSOR

ABAP code example for Function Module G_TABLE_OPEN_CURSOR





The ABAP code below is a full code listing to execute function module G_TABLE_OPEN_CURSOR 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_cursor  TYPE GUSL_CURSOR .


SELECT single TAB
FROM T800A
INTO @DATA(ld_i_tabname).

DATA(ld_i_selection) = 'Check type of data required'.
DATA(ld_i_fieldlist) = 'Check type of data required'.
DATA(ld_i_sortlist) = 'Check type of data required'.
DATA(ld_i_max_period) = 'Check type of data required'.
DATA(ld_i_aggregation) = 'Check type of data required'.
DATA(ld_i_period_aggregation) = 'Check type of data required'.
DATA(ld_i_cumulated) = 'Check type of data required'.
DATA(ld_i_sorted) = 'Check type of data required'.
DATA(ld_i_with_hold) = 'Check type of data required'.
DATA(ld_i_client_specified) = 'Check type of data required'.
DATA(ld_i_zero_records) = 'Check type of data required'.
DATA(ld_i_db_commit) = 'Check type of data required'.
DATA(ld_i_dbcon_name) = 'Check type of data required'. . CALL FUNCTION 'G_TABLE_OPEN_CURSOR' EXPORTING i_tabname = ld_i_tabname * i_selection = ld_i_selection * i_fieldlist = ld_i_fieldlist * i_sortlist = ld_i_sortlist * i_max_period = ld_i_max_period * i_aggregation = ld_i_aggregation * i_period_aggregation = ld_i_period_aggregation * i_cumulated = ld_i_cumulated * i_sorted = ld_i_sorted * i_with_hold = ld_i_with_hold * i_client_specified = ld_i_client_specified * i_zero_records = ld_i_zero_records * i_db_commit = ld_i_db_commit * i_dbcon_name = ld_i_dbcon_name IMPORTING e_cursor = ld_e_cursor EXCEPTIONS INVALID_SELECTION = 1 INVALID_TABLE = 2 INTERNAL_ERROR = 3 FOREIGN_LOCK = 4 . " G_TABLE_OPEN_CURSOR
IF SY-SUBRC EQ 0. "All OK ELSEIF SY-SUBRC EQ 1. "Exception "Add code for exception here ELSEIF SY-SUBRC EQ 2. "Exception "Add code for exception here ELSEIF SY-SUBRC EQ 3. "Exception "Add code for exception here ELSEIF SY-SUBRC EQ 4. "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_cursor  TYPE GUSL_CURSOR ,
ld_i_tabname  TYPE T800A-TAB ,
ld_i_selection  TYPE GUSL_T_SELECTION ,
ld_i_fieldlist  TYPE GUSL_T_FIELDS ,
ld_i_sortlist  TYPE GUSL_T_FIELDS ,
ld_i_max_period  TYPE I ,
ld_i_aggregation  TYPE GUSL_BOOL ,
ld_i_period_aggregation  TYPE GUSL_PERAGGR ,
ld_i_cumulated  TYPE GUSL_BOOL ,
ld_i_sorted  TYPE GUSL_BOOL ,
ld_i_with_hold  TYPE GUSL_BOOL ,
ld_i_client_specified  TYPE GUSL_BOOL ,
ld_i_zero_records  TYPE GUSL_BOOL ,
ld_i_db_commit  TYPE GUSL_BOOL ,
ld_i_dbcon_name  TYPE DBCON_NAME .


SELECT single TAB
FROM T800A
INTO ld_i_tabname.

ld_i_selection = 'Check type of data required'.
ld_i_fieldlist = 'Check type of data required'.
ld_i_sortlist = 'Check type of data required'.
ld_i_max_period = 'Check type of data required'.
ld_i_aggregation = 'Check type of data required'.
ld_i_period_aggregation = 'Check type of data required'.
ld_i_cumulated = 'Check type of data required'.
ld_i_sorted = 'Check type of data required'.
ld_i_with_hold = 'Check type of data required'.
ld_i_client_specified = 'Check type of data required'.
ld_i_zero_records = 'Check type of data required'.
ld_i_db_commit = 'Check type of data required'.
ld_i_dbcon_name = 'Check type of data required'.

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 G_TABLE_OPEN_CURSOR or its description.