SAP SF_ATTRIBUTE_RETRIEVAL Function Module for Retrieve via attributes









SF_ATTRIBUTE_RETRIEVAL is a standard sf attribute retrieval SAP function module available within SAP R/3 or S/4 Hana systems, depending on your version and release level. It is used for Retrieve via attributes 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 sf attribute retrieval FM, simply by entering the name SF_ATTRIBUTE_RETRIEVAL into the relevant SAP transaction such as SE37 or SE38.

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



Function SF_ATTRIBUTE_RETRIEVAL 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 'SF_ATTRIBUTE_RETRIEVAL'"Retrieve via attributes
EXPORTING
CLASS = "Information class
* LANGUAGE = 'D' "Language indicator
REFINER = "Switch for refinement

IMPORTING
CARD_OF_POINTERS = "Number of pointers

TABLES
ATTR_RESTR_TAB = "Attribute restriction table
HIT_TABLE = "Pointer list

EXCEPTIONS
ATTRIBUTE_TABLE_EMPTY = 1 CHECK_ROUTINE_IS_MISSING = 2 IMPOSSIBILITY_OF_REFINING = 3 INTERN_ERROR = 4 NO_POINTERS_FOUND = 5 NO_VALUE_IN_INDEX = 6
.



IMPORTING Parameters details for SF_ATTRIBUTE_RETRIEVAL

CLASS - Information class

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

LANGUAGE - Language indicator

Data type: SY-LANGU
Default: 'D'
Optional: Yes
Call by Reference: No ( called with pass by value option)

REFINER - Switch for refinement

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

EXPORTING Parameters details for SF_ATTRIBUTE_RETRIEVAL

CARD_OF_POINTERS - Number of pointers

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

TABLES Parameters details for SF_ATTRIBUTE_RETRIEVAL

ATTR_RESTR_TAB - Attribute restriction table

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

HIT_TABLE - Pointer list

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

EXCEPTIONS details

ATTRIBUTE_TABLE_EMPTY - Attribute restriction table is emp

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

CHECK_ROUTINE_IS_MISSING - Check routine not known

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

IMPOSSIBILITY_OF_REFINING - Refinement not possible

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

INTERN_ERROR - Internal error

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

NO_POINTERS_FOUND - No pointers to texts found

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

NO_VALUE_IN_INDEX - No corresponding value in index fi

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

Copy and paste ABAP code example for SF_ATTRIBUTE_RETRIEVAL 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_class  TYPE TFIC-CLASS, "   
lt_attr_restr_tab  TYPE STANDARD TABLE OF ATRES, "   
lv_card_of_pointers  TYPE FIST-HITS, "   
lv_attribute_table_empty  TYPE FIST, "   
lv_language  TYPE SY-LANGU, "   'D'
lt_hit_table  TYPE STANDARD TABLE OF PTAB, "   
lv_check_routine_is_missing  TYPE PTAB, "   
lv_refiner  TYPE RSFIN-BOOL, "   
lv_impossibility_of_refining  TYPE RSFIN, "   
lv_intern_error  TYPE RSFIN, "   
lv_no_pointers_found  TYPE RSFIN, "   
lv_no_value_in_index  TYPE RSFIN. "   

  CALL FUNCTION 'SF_ATTRIBUTE_RETRIEVAL'  "Retrieve via attributes
    EXPORTING
         CLASS = lv_class
         LANGUAGE = lv_language
         REFINER = lv_refiner
    IMPORTING
         CARD_OF_POINTERS = lv_card_of_pointers
    TABLES
         ATTR_RESTR_TAB = lt_attr_restr_tab
         HIT_TABLE = lt_hit_table
    EXCEPTIONS
        ATTRIBUTE_TABLE_EMPTY = 1
        CHECK_ROUTINE_IS_MISSING = 2
        IMPOSSIBILITY_OF_REFINING = 3
        INTERN_ERROR = 4
        NO_POINTERS_FOUND = 5
        NO_VALUE_IN_INDEX = 6
. " SF_ATTRIBUTE_RETRIEVAL




ABAP code using 7.40 inline data declarations to call FM SF_ATTRIBUTE_RETRIEVAL

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 CLASS FROM TFIC INTO @DATA(ld_class).
 
 
"SELECT single HITS FROM FIST INTO @DATA(ld_card_of_pointers).
 
 
"SELECT single LANGU FROM SY INTO @DATA(ld_language).
DATA(ld_language) = 'D'.
 
 
 
"SELECT single BOOL FROM RSFIN INTO @DATA(ld_refiner).
 
 
 
 
 


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!