I-Base & LSMW data migration

Question: I need to migrate I-Base from a legacy system to SAP CRM. Unfortunately, I can't find a BAPI or an IDoc. I have been looking at LSMW and Batch Input, but there must be a more elegant way to do this?

Can anyone please post some guidance?

Answer:
Hi,
Check FM: CRM_IBASE*

Answer:
I have tried these function modules in this order:

CALL FUNCTION 'CRM_IBASE_INITIALIZE'.
CALL FUNCTION 'CRM_IBASE_CREATE'
*CALL FUNCTION 'CRM_IBASE_COMP_CREATE' <-- not using this yet...
CALL FUNCTION 'CRM_IBASE_SAVE'.


Although the IBase functions return a new IB number - it doesn't get saved to the database until I explicitly call "COMMIT WORK" (not sure whether the INIT and SAVE function modules do anything at teh IBase level - the underlying functions seem to deal with components). Did you have the same issue?

Answer:
Hi,
I had other requirements.
IBase was exist in my system. It was necessary for me to create only components(instance).
But I know, that after execution FM"CRM_IBASE_COMP_CREATE" , I called
FM'CRM_IBASE_SAVE' and commit work.
For example:

IFATHER-ibase = itab-ibase.
i_comp_det-OBJECT_GUID = EV_PRODUCT_GUID.
i_comp_det-DESCR = itab-object_id.
i_comp_det-EXTOBJTYP = 'CRM_OBJECT'.

CALL FUNCTION 'CRM_IBASE_COMP_CREATE'
EXPORTING
I_FATHER = IFATHER
I_COMP_DET = I_COMP_DET
IMPORTING
E_COMP = E_COMP
EXCEPTIONS
DATA_NOT_CONSISTENT = 1
IBASE_LOCKED = 2
NOT_SUCCESFUL = 3
OTHERS = 4.

if sy-subrc eq 0.
CALL FUNCTION 'CRM_IBASE_SAVE'.
COMMIT WORK.
endif.

Answer:
(I'm posting this for the benefit of others - so they don't have to re-invent the wheel)
I have been tinkering with these function modules and the following works for me :

CALL FUNCTION 'CRM_IBASE_INITIALIZE'.
CALL FUNCTION 'CRM_IBASE_CREATE'
--> this function does not have inputs for Descriptions and other data, so...
CALL FUNCTION 'CRM_IBASE_CHANGE' with the details not included in the CREATE
CALL FUNCTION 'CRM_IBASE_COMP_CREATE' with the component details

Note!! there are a number of fields that have input conversion exits eg:

PRODUCT_ID
CALL FUNCTION 'CONVERSION_EXIT_PRID1_INPUT'
EXPORTING
INPUT = ls_product-PRODUCT_ID "12345
IMPORTING
OUTPUT = ls_product-PRODUCT_ID "0000000000000000000000000000000000012345

UNIT
CALL FUNCTION 'CONVERSION_EXIT_CUNIT_INPUT'
EXPORTING
INPUT = ls_comp_det-UNIT "PC
LANGUAGE = SY-LANGU
IMPORTING
OUTPUT = ls_comp_det-UNIT "ST

<check SY-SUBRC>
CALL FUNCTION 'CRM_IBASE_SAVE'.
COMMIT WORK.
</check SY-SUBRC>
Copyright ?2007 - 2008 www.jt77.com