cancel
Showing results for 
Search instead for 
Did you mean: 

How to use BBP_SOS_BADI

Former Member
0 Kudos

Hi all,

I've created an implementation of the badi BBP_SOS_BADI. The problem is that if I fill the table et_found_contract the result list is displayed empty.

This is my code:


METHOD if_ex_bbp_sos_badi~bbp_sos_search.

DATA: ls_index_search TYPE bbps_index_search,
        ls_found_contract LIKE LINE OF et_found_contract.

  MOVE-CORRESPONDING is_search_criteria TO ls_index_search.
  CLEAR: ls_index_search-proc_org.

  CALL FUNCTION 'BBP_PD_INDEX_FIND'
    EXPORTING
      iv_check_location       = 'X'
      is_index_search         = ls_index_search
    IMPORTING
      et_found_contracts      = et_found_contract
    EXCEPTIONS
      mandatory_field_missing = 1
      no_search_criteria      = 2
      OTHERS                  = 3.

* Modify position ID
  LOOP AT et_found_contract INTO ls_found_contract.
    ls_found_contract-pos_id = is_search_criteria-pos_id.
    MODIFY et_found_contract FROM ls_found_contract.
  ENDLOOP.

  IF et_found_contract[] IS INITIAL.
    cv_search_for_contract = 'X'.
  ELSE.
    cv_search_for_contract = SPACE.
  ENDIF.

ENDMETHOD.

I'm seeing the code of the example class CL_EX_BBP_SOS_BADI but i don't understand anything...

Can anyone help me?

Thanks in advance.

Accepted Solutions (0)

Answers (1)

Answers (1)

Former Member
0 Kudos

Solved.

This is my code:

DATA: ls_index_search TYPE bbps_index_search,
        ls_found_contract LIKE LINE OF et_found_contract.
  MOVE-CORRESPONDING is_search_criteria TO ls_index_search.
  CLEAR: ls_index_search-proc_org.

  CALL FUNCTION 'BBP_PD_INDEX_FIND'
    EXPORTING
      iv_check_location       = 'X'
      is_index_search         = ls_index_search
    IMPORTING
      et_found_contracts      = et_found_contract
    EXCEPTIONS
      mandatory_field_missing = 1
      no_search_criteria      = 2
      OTHERS                  = 3.

* Read contract details and enhance data
 PERFORM contract_enhance IN PROGRAM SAPLBBP_PD_SOS USING iv_tolerant_search
                                                          is_search_criteria
                                                    CHANGING et_found_contract.
  IF et_found_contract[] IS INITIAL.
    cv_search_for_contract = 'X'.
  ELSE.
    cv_search_for_contract = SPACE.
  ENDIF.