Quantcast
Channel: SCN: Message List
Viewing all articles
Browse latest Browse all 9024

Re: IBASE creation program giving wrong IBASE structure

$
0
0

Hi Anandhan,

 

Its the same process with CRM_IBASE_COMP_CREATE you get ls_comp, so map this to ls_father an so on.

 

 

DATA: ls_ibib1       TYPE ibib1,
        ls_father     TYPE ibap_dat1,
        ls_comp_det   TYPE ibap_comp3,
        ls_comp       TYPE ibap_dat1,
        ls_product    TYPE comt_product,
        lv_logsys     TYPE comm_product-logsys,
        ls_categories TYPE comt_prod_cat_rel_maintain,
        lt_categories TYPE comt_prod_cat_rel_maintain_tab.

*******************************************************************
**************Making Header IBASE**********************************
*******************************************************************
CALL FUNCTION 'CRM_IBASE_CREATE'
    EXPORTING
      i_ibase_type        = '01'
    IMPORTING
      e_ibib1             = ls_ibib1
    EXCEPTIONS
      data_not_consistent = 1
      not_succesful       = 2
      no_authority        = 3
      OTHERS              = 4.

IF sy-subrc = 0.
    CALL FUNCTION 'CRM_IBASE_SAVE' .
    COMMIT WORK AND WAIT.
ELSE.
    MESSAGE ID sy-msgid
          TYPE sy-msgty
        NUMBER sy-msgno
          WITH sy-msgv1
               sy-msgv2
               sy-msgv3
               sy-msgv4.
ENDIF.


**********************************************************************
*************************1st Level ( Component)***********************
**********************************************************************
CLEAR: ls_father,
          ls_comp_det,
          ls_comp.

ls_father-ibase       = ls_ibib1-ibase.
ls_comp_det-descr     = 'SUBLEVEL1'.
ls_comp_det-sortf     = 'SUBLEVEL1'.
ls_comp_det-deviceid  = 'DEVICEID'.
ls_comp_det-extobjtyp = 'CRMBASIC'.

CALL FUNCTION 'CRM_IBASE_COMP_CREATE'
    EXPORTING
      i_father            = ls_father
      i_comp_det          = ls_comp_det
    IMPORTING
      e_comp              = ls_comp
    EXCEPTIONS
      data_not_consistent = 1
      ibase_locked        = 2
      not_succesful       = 3
      OTHERS              = 4.


IF sy-subrc = 0.
    CALL FUNCTION 'CRM_IBASE_SAVE' .
    COMMIT WORK AND WAIT.
ENDIF.

***************************************************************
**********************Adding Component sublevel 2***************
****************************************************************

CLEAR: ls_father,
          ls_comp_det,
          ls_comp.

ls_father-ibase       = ls_ibib1-ibase.
ls_comp_det-descr     = 'SUBLEVEL2'.
ls_comp_det-sortf     = 'SUBLEVEL2'.
ls_comp_det-deviceid  = 'Upload_DEVICEID'.
ls_comp_det-extobjtyp = 'CRMBASIC'.

CALL FUNCTION 'CRM_IBASE_COMP_CREATE'
    EXPORTING
      i_father            = ls_father
      i_comp_det          = ls_comp_det
    IMPORTING
      e_comp              = ls_comp
    EXCEPTIONS
      data_not_consistent = 1
      ibase_locked        = 2
      not_succesful       = 3
      OTHERS              = 4.
IF sy-subrc = 0.
    CALL FUNCTION 'CRM_IBASE_SAVE' .
    COMMIT WORK AND WAIT .
ENDIF.

 

CALL FUNCTION 'CONVERSION_EXIT_ALPHA_INPUT'
    EXPORTING
      input  = lv_product_id
    IMPORTING
      output = lv_product_id.

ls_father-ibase         = ls_comp-ibase.
ls_father-instance      = ls_comp-instance.
ls_comp_det-product_id  = lv_product_id.
ls_comp_det-amount      = " Your amount
ls_comp_det-unit        = " Your unit
ls_comp_det-sortf       = " Your desc.
ls_comp_det-extobjtyp   = 'CRMPRODUCT'.
 
CALL FUNCTION 'CRM_IBASE_COMP_CREATE'
    EXPORTING
      i_father            = ls_father
      i_comp_det          = ls_comp_det
    IMPORTING
      e_comp              = ls_comp
    EXCEPTIONS
      data_not_consistent = 1
      ibase_locked        = 2
      not_succesful       = 3
      OTHERS              = 4.

IF sy-subrc = 0.
    CALL FUNCTION 'CRM_IBASE_SAVE' .
    COMMIT WORK AND WAIT .
ENDIF.


CALL FUNCTION 'CONVERSION_EXIT_ALPHA_INPUT'
    EXPORTING
      input  = lv_product_id2
    IMPORTING
      output = lv_product_id2.


ls_father-ibase         = ls_comp-ibase.
ls_father-instance      = ls_comp-instance.
ls_comp_det-product_id  = lv_product_id2.
ls_comp_det-amount      = " Your amount
ls_comp_det-unit        = " Your unit
ls_comp_det-sortf       = " Your desc.
ls_comp_det-extobjtyp   = 'CRMPRODUCT'.
 
CALL FUNCTION 'CRM_IBASE_COMP_CREATE'
    EXPORTING
      i_father            = ls_father
      i_comp_det          = ls_comp_det
    IMPORTING
      e_comp              = ls_comp
    EXCEPTIONS
      data_not_consistent = 1
      ibase_locked        = 2
      not_succesful       = 3
      OTHERS              = 4.

IF sy-subrc = 0.
    CALL FUNCTION 'CRM_IBASE_SAVE' .
    COMMIT WORK AND WAIT .
ENDIF.

 

 

Have I solved all your questions?

 

Best regards.


Viewing all articles
Browse latest Browse all 9024

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>