Skip to Content

Archived discussions are read-only. Learn more about SAP Q&A

BAPI Selection Criteria

Hi everyone,

I tried to call the BAPI_CLASS_SELECT_OBJECTS, but i can't retrieve any result. Anything wrong??

*&---------------------------------------------------------------------*
*& Report  ZFETCH_BATCH
*&
*&---------------------------------------------------------------------*
*&
*&
*&---------------------------------------------------------------------*

REPORT  zfetch_batch.

DATA: c_classnum       TYPE bapi_class_key-classnum   VALUE '023_094', "Class Number
      c_classtype      TYPE bapi_class_key-classtype VALUE '022' , "Class Type
      it_selectioncriterions  LIKE bapi_selection_criterions OCCURS 1, " criteria
      it_selectedobjects      LIKE bapi_selected_objects OCCURS 0.    " result

DATA: l_selectioncriterions LIKE LINE OF it_selectioncriterions,
      l_selectedobjects LIKE LINE OF it_selectedobjects.

l_selectioncriterions-name_char = 'PURITY002'.
l_selectioncriterions-char_value = '*'.

APPEND l_selectioncriterions TO it_selectioncriterions.

CALL FUNCTION 'BAPI_CLASS_SELECT_OBJECTS'
  EXPORTING
    classtype                  =  c_classtype
    classnum                   =  c_classnum
*   LANGUISO                   =
*   LANGUINT                   =
*   KEYDATE                    = SY-DATUM
*   MAXHITS                    = 100
*   I_STATUS_LOCKED            =
*   I_STATUS_INCOMPLETE        =
* IMPORTING
*   RETURN                     =
  TABLES
    selectioncriterions        =  it_selectioncriterions
    selectedobjects            =  it_selectedobjects
*   OBJECTCLASSIFICATION       =
          .

LOOP AT it_selectedobjects INTO l_selectedobjects.
  WRITE: / l_selectedobjects-object.
  WRITE: / l_selectedobjects-objecttext.
ENDLOOP.

Regards,

Kit

Tags:
Former Member

Helpful Answer

by
Not what you were looking for? View more on this topic or Ask a question