如何通过parent object ID获得underlying object structure IBASE ID

81 阅读1分钟

Created by Jerry Wang, last modified on Sep 07, 2014

通过object ID ZJERRY0906D2获得underlying object structure ID: 112450:

 

clipboard1

 

 

 

clipboard2

 

 

 

clipboard3

 

 

 

REPORT ZIBASE_GET_STRUCTURE_BY_OBJ.

PARAMETERS: id TYPE comm_product-product_id OBLIGATORY DEFAULT 'ZJERRY0906D2'.

START-OF-SELECTION.

  data: lv_guid TYPE comm_product-product_guid,

        lv_header TYPE IBAP_HEAD1.

  SELECT SINGLE product_guid FROM comm_product INTO lv_guid WHERE product_id = id.

  CHECK sy-subrc = 0.

  CALL FUNCTION 'PRDIB_GET_STRUCTURE'

    EXPORTING

      iv_object_guid       = lv_guid

    IMPORTING

     EV_IBASE_HEAD        = lv_header

   EXCEPTIONS

     WRONG_CALL           = 1

     OTHERS               = 2.

  IF sy-subrc <> 0.

     WRITE: / 'no underlying object structure existed for current object.' COLOR COL_HEADING.

     RETURN.

  ENDIF.

  WRITE: / 'Underlying IBASE: ' , lv_header-ibase COLOR COL_NEGATIVE.

 

 

用如下的report也能实现相反方向的查询: 通过IBASE id查到parent object guid:

clipboard4