SAP VALUES_DISPLAY_AND_RETURN_TAB Function Module for









VALUES_DISPLAY_AND_RETURN_TAB is a standard values display and return tab 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 values display and return tab FM, simply by entering the name VALUES_DISPLAY_AND_RETURN_TAB into the relevant SAP transaction such as SE37 or SE38.

Function Group: SHL2
Program Name: SAPLSHL2
Main Program: SAPLSHL2
Appliation area:
Release date: N/A
Mode(Normal, Remote etc): Normal Function Module
Update:



Function VALUES_DISPLAY_AND_RETURN_TAB 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 'VALUES_DISPLAY_AND_RETURN_TAB'"
EXPORTING
* CUCOL = 0 "Cursor position: Column
* CUROW = 0 "Cursor position: Line
* DISPLAY = ' ' "Display flag
* FIELDNAME = ' ' "Table field name
* TABNAME = ' ' "Name of an ABAB/4 Dictionary table
* SHRINK_FLAG = ' ' "

IMPORTING
SELECT_VALUE = "Selected value
EXTERNAL_F4_CALL_2ND_TIME = "
RETURNCODE = "

TABLES
VALUES = "Values to be displayed
VALUESTRUCTURE = "Values structure definition
SELECTION_TAB = "Lines and values return table

EXCEPTIONS
CHECK_TABLE_LOCKED = 1 NO_VALUES_FOR_FIELD = 2 TABLEFIELD_DOES_NOT_EXIST = 3
.



IMPORTING Parameters details for VALUES_DISPLAY_AND_RETURN_TAB

CUCOL - Cursor position: Column

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

CUROW - Cursor position: Line

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

DISPLAY - Display flag

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

FIELDNAME - Table field name

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

TABNAME - Name of an ABAB/4 Dictionary table

Data type: HELP_INFO-TABNAME
Default: SPACE
Optional: Yes
Call by Reference: No ( called with pass by value option)

SHRINK_FLAG -

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

EXPORTING Parameters details for VALUES_DISPLAY_AND_RETURN_TAB

SELECT_VALUE - Selected value

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

EXTERNAL_F4_CALL_2ND_TIME -

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

RETURNCODE -

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

TABLES Parameters details for VALUES_DISPLAY_AND_RETURN_TAB

VALUES - Values to be displayed

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

VALUESTRUCTURE - Values structure definition

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

SELECTION_TAB - Lines and values return table

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

EXCEPTIONS details

CHECK_TABLE_LOCKED - Check table locked

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

NO_VALUES_FOR_FIELD - No values available

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

TABLEFIELD_DOES_NOT_EXIST - Table field does not exist

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

Copy and paste ABAP code example for VALUES_DISPLAY_AND_RETURN_TAB 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_cucol  TYPE SY-CUCOL, "   0
lt_values  TYPE STANDARD TABLE OF SHVALUE, "   
lv_select_value  TYPE HELP_INFO-FLDVALUE, "   
lv_check_table_locked  TYPE HELP_INFO, "   
lv_curow  TYPE SY-CUROW, "   0
lt_valuestructure  TYPE STANDARD TABLE OF SHSTRUC, "   
lv_no_values_for_field  TYPE SHSTRUC, "   
lv_external_f4_call_2nd_time  TYPE SHSTRUC, "   
lv_display  TYPE SHSTRUC, "   SPACE
lv_returncode  TYPE SY-SUBRC, "   
lt_selection_tab  TYPE STANDARD TABLE OF SHVALUE, "   
lv_tablefield_does_not_exist  TYPE SHVALUE, "   
lv_fieldname  TYPE HELP_INFO-FIELDNAME, "   SPACE
lv_tabname  TYPE HELP_INFO-TABNAME, "   SPACE
lv_shrink_flag  TYPE HELP_INFO. "   SPACE

  CALL FUNCTION 'VALUES_DISPLAY_AND_RETURN_TAB'  "
    EXPORTING
         CUCOL = lv_cucol
         CUROW = lv_curow
         DISPLAY = lv_display
         FIELDNAME = lv_fieldname
         TABNAME = lv_tabname
         SHRINK_FLAG = lv_shrink_flag
    IMPORTING
         SELECT_VALUE = lv_select_value
         EXTERNAL_F4_CALL_2ND_TIME = lv_external_f4_call_2nd_time
         RETURNCODE = lv_returncode
    TABLES
         VALUES = lt_values
         VALUESTRUCTURE = lt_valuestructure
         SELECTION_TAB = lt_selection_tab
    EXCEPTIONS
        CHECK_TABLE_LOCKED = 1
        NO_VALUES_FOR_FIELD = 2
        TABLEFIELD_DOES_NOT_EXIST = 3
. " VALUES_DISPLAY_AND_RETURN_TAB




ABAP code using 7.40 inline data declarations to call FM VALUES_DISPLAY_AND_RETURN_TAB

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 CUCOL FROM SY INTO @DATA(ld_cucol).
 
 
"SELECT single FLDVALUE FROM HELP_INFO INTO @DATA(ld_select_value).
 
 
"SELECT single CUROW FROM SY INTO @DATA(ld_curow).
 
 
 
 
DATA(ld_display) = ' '.
 
"SELECT single SUBRC FROM SY INTO @DATA(ld_returncode).
 
 
 
"SELECT single FIELDNAME FROM HELP_INFO INTO @DATA(ld_fieldname).
DATA(ld_fieldname) = ' '.
 
"SELECT single TABNAME FROM HELP_INFO INTO @DATA(ld_tabname).
DATA(ld_tabname) = ' '.
 
DATA(ld_shrink_flag) = ' '.
 


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!