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

PARAMETERS: id type comm_product-product_id OBLIGATORY DEFAULT 'ZJERRY0903P1'.
DATA: lv_guid TYPE comm_product-product_guid,
      ls_ibase_head TYPE ibas_head1.
SELECT SINGLE product_guid INTO lv_guid FROM comm_product WHERE product_id = id.
 CALL FUNCTION 'PRDIB_CREATE_STRUCTURE'
    EXPORTING
      iv_object_guid = lv_guid
    IMPORTING
      ev_ibase_head  = ls_ibase_head
    EXCEPTIONS
      wrong_call     = 1
      already_exist  = 2
      not_successful = 3
      OTHERS         = 5.
 WRITE: / 'IBASE created: ', ls_ibase_head-ibase.
 CALL FUNCTION 'CRM_IBASE_SAVE'.
 COMMIT WORK AND WAIT.
  CALL FUNCTION 'COM_IL_API_SAVE'
    EXPORTING
      iv_no_upd_task = 'X'.
Copy the code

This report will create a new object structure IBASE in CRM system and add the object specified in the report to the structure.



After the second execution of the report, attempts to assign an object to another IBASE will result in an error because only one object structure can be assigned: