Implement the GET_ENTITY method for the BusinessPartner entity.
Procedure
- From the Class Interface screen, scroll down to the BUSINESSPARTNER_GET_ENTITY
method, place the cursor in the row, and click Redefine.
- Implement the method using this code:
method BUSINESSPARTNERS_GET_ENTITY.
DATA: lt_keys TYPE /IWBEP/T_MGW_TECH_PAIRS,
ls_key TYPE /IWBEP/S_MGW_TECH_PAIR,
ls_bp_id type BAPI_EPM_BP_ID,
lv_bp_id(10) type N.
lt_keys = IO_TECH_REQUEST_CONTEXT->GET_KEYS( ).
READ TABLE lt_keys with key name = 'BP_ID' INTO ls_key.
lv_bp_id = ls_key-value.
ls_bp_id-bp_id = lv_bp_id.
CALL FUNCTION 'BAPI_EPM_BP_GET_DETAIL'
EXPORTING
BP_ID = ls_bp_id
IMPORTING
HEADERDATA = er_entity
* TABLES
* CONTACTDATA =
* RETURN = lt_return
.
endmethod.
The BAPI function BAPI_EPM_BP_GET_DETAIL returns the business partner header
information by passing in the BP_ID key.
- Click the Activate icon.
- If you see any warnings, recheck the code, correct any mistakes, then click
Activate again.
- Click Back
to return to the Class
Interface screen.