Fonction SAP BAPI_CLASS_SELECT_OBJECTS - Find Objects in Class

Paramètre Reférence Type Long. Valeur par déf. Facultatif Description
CLASSNUM BAPI_CLASS_KEY-CLASSNUM C 18 Class Number
CLASSTYPE BAPI_CLASS_KEY-CLASSTYPE C 3 Class Type
I_STATUS_INCOMPLETE BAPI1003_KEY-STATUS C 1 X With Incomplete Assignments
I_STATUS_LOCKED BAPI1003_KEY-STATUS C 1 X With Locked Assignments
KEYDATE BAPI_KEY_DATE-KEY_DATE D 8 SY-DATUM X Validity Time
LANGUINT BAPI_LANGUAGE-LANGUAGE_INT C 1 X Internal Language Key
LANGUISO BAPI_LANGUAGE-LANGUAGE_ISO C 2 X Language Key
MAXHITS BAPI_MAX_HITS-MAX_HITS I 4 100 X Maximum Hits Read

Paramètre Reférence Type Long. Description
RETURN BAPIRETURN1 u 470 Return Messages

Paramètre Reférence Long. Facultatif Description
OBJECTCLASSIFICATION BAPI_OBJECT_VALUES 240 X Values of Selected Characteristics for Objects
SELECTEDOBJECTS BAPI_SELECTED_OBJECTS 90 Objects Found
SELECTIONCRITERIONS BAPI_SELECTION_CRITERIONS 120 Selection Criteria

Functionality
This function module is for implementing BAPI Class.Objectselection.This allows you to start the "find objects in class" function in theclassification system from an external application. For performancereasons, you cannot use all of the search options (see Restrictions).
The result of the search is a list of numbers and language-dependentdescriptions of the objects (not including classes) that match yourselection criteria. You can alos read classifications of the objectsfound for specific characteristics.
On the external application side, the class types, classes,characteristics, and allowed values must be known. In future, BAPIswill be provided to transfer data. Currently, however, you must usefunction modules that can use RFC:
Checks on your entries must be made by the external application. If youenter a characteristic value that is not allowed, you get an emptysearch result.
You must transfer characteristic values, not value descriptions.
The external application must check whether the selection criteria aregood, to ensure good response times.
There is also a parameter for restricting the maximum number of hits.However, for technical reasons, this parameter only acts after objectshave been found, so the parameter only reduces the time for displayingobjects, network transports, and processing data with the externalapplication.
- Classes with multiple object types are not supported.
Exception: batches Restriction: only batches are returned
- No returning of classes
- Reference characteristics are not supported
- Interval characteristics are not supported
- No open intervals
- No exclusive search
- No string search
- No display of objects without values
- Objects with locked classification status are not returned

Example
DATA: so LIKE bapi_selected_objects OCCURS 0 WITH HEADER LINE,
sc LIKE bapi_selection_criterions OCCURS 0 WITH HEADER LINE,
oc LIKE bapi_object_values OCCURS 0 WITH HEADER LINE,
return like bapireturn1.
*- Set up selection criteria
*- Characteristic name
sc-name_char = 'NUM_CHAR'.
*- Numeric value from
sc-num_val_fm = 0.
*- Numeric value to
sc-num_val_to = 1000.
*- Set indicator that describes interval
sc-val_relatn = '2'.
APPEND sc.
*- Characteristics whose assigned values you want to read
oc-name_char = 'CHARX'.
APPEND oc.
CALL FUNCTION 'BAPI_CLASS_SELECT_OBJECTS'
EXPORTING
classtype = '001'
classnum = 'CF10'
langu_iso = 'EN'
key_date = sy-date
max_hits = 10
IMPORTING
return = return
TABLES
selection_criterions = sc
selected_objects = so
object_classifications = oc
EXCEPTIONS
others = 0.

Notes

Description
Return parameter for messages

Description
External class number: together with CLASSTYPE, this identifies aclass.

Description
Class type: together with CLASSNUM, this identifies a class.

Value range
No classes with multiple object types (table TCLA, indicator MULTOBJ
not set). Exception: 022 Batches.

Description
Validity time

Default
System date

Description
Internal language key

Description
Language key

Description
Maximum number of hits read

Default
100

Description
Assigned values for objects for selected characteristics

Description
Objects found

Description
Selection criteria