01-28-2009 3:04 PM
Hi all,
we have an integration between HR and CRM system.when we send all required infotypes from HR to CRM system,then business partner is created succesfully in CRM system.Everyday a job is running read change pointers and send all infotypes to CRM system.
My problem is when hire a person in HR we don't create address infotype (0006) at first, so in CRM system business partners doesn't create. they don't want create address when hire a new person, so i locked.
I tried to insert a initial address infotype for a person into idoc_data inbound badi in CRM. but business partner isn't created.
I insert the segments E1PITYP and E1P0006 in idoc data but don't create.
how can i solve this problem, any ideas?
in inbound badi my code is like this;
add 1 to lv_segnum.
CLEAR ls_e1pityp.CLEAR wa_idoc_data.
ls_e1pityp-plvar = '01'.
ls_e1pityp-otype = 'P'.
ls_e1pityp-objid = s_pernr-pernr.
ls_e1pityp-infty = '0006'.
ls_e1pityp-subty = '1'.
ls_e1pityp-begda = '18000101'.
ls_e1pityp-endda = '99991231'.
wa_idoc_data-segnam = 'E1PITYP'.
wa_idoc_data-sdata = ls_e1pityp.
wa_idoc_data-mandt = s_pernr-mandt.
wa_idoc_data-docnum = s_pernr-docnum.
wa_idoc_data-segnum = lv_segnum.
wa_idoc_data-hlevel = 3.
wa_idoc_data-DTINT2 = s_pernr-DTINT2.
wa_idoc_data-psgnum = 1.
APPEND wa_idoc_data TO idoc_data.
add 1 to lv_segnum.
CLEAR ls_e1p0006.CLEAR wa_idoc_data.
ls_e1p0006-pernr = s_pernr-pernr.
ls_e1p0006-infty = '0006'.
ls_e1p0006-subty = '1'.
ls_e1p0006-endda = '99991231'.
ls_e1p0006-begda = sy-datum.
ls_e1p0006-aedtm = sy-datum.
ls_e1p0006-uname = sy-uname.
ls_e1p0006-anssa = '1'.
ls_e1p0006-LAND1 = 'EN'.
wa_idoc_data-mandt = s_pernr-mandt.
wa_idoc_data-docnum = s_pernr-docnum.
wa_idoc_data-segnam = 'E1P0006'.
wa_idoc_data-sdata = ls_e1p0006.
wa_idoc_data-segnum = lv_segnum.
wa_idoc_data-hlevel = '4'.
wa_idoc_data-DTINT2 = s_pernr-DTINT2.
wa_idoc_data-psgnum = lv_psgnum.
APPEND wa_idoc_data to idoc_data.
Thanks
01-30-2009 11:48 AM
i solved.
insert E1PITYP and E1P0006 line after that personnel's E1PLOGI line in inbound badi and business partners are created succesfully.
01-30-2009 11:48 AM
i solved.
insert E1PITYP and E1P0006 line after that personnel's E1PLOGI line in inbound badi and business partners are created succesfully.
08-13-2014 8:25 AM
Hi Emre,
We have a similar kind of requirement in SRM.Can you please let me know the inbound badi name which you have used will just check if it matches with SRM.
Thanks.
Regards,
Kalyani
08-20-2014 9:35 AM
Hi, i copied IDOC_INPUT_HRMD and created Z_IDOC_INPUT_HRMD function module and write my codes.
09-29-2014 10:21 AM
Hi Emre,
Thanks.Solution provided by you gave me a hint to fix my issue.
But unfortunately even i got struck in the idoc sequence.With my code the segments E1PITYP and E1P0006 are being added at the end hence Business partner is not getting created in SRM. As you mentioned i tried several ways to insert E1PITYP and E1P0006 after personnel's E1PLOGI line but it didn't worked.The idoc node sequence is missing.
As am very much new to this concept can you please provide me the sample code you have used to set the sequence which is very helpful for me to fix the issue.
Thanks in advance.
Thanks.
Regards,
Kalyani
09-29-2014 12:00 PM
Here is my code, hope it helps you.
***** Adres sorunu için eklendi. 08.11.2008
TYPES : BEGIN OF t_pernr ,
pernr(8),
mandt like edidd-mandt,
docnum like edidd-docnum,
DTINT2 like edidd-DTINT2,
END OF t_pernr.
DATA gt_pernr TYPE TABLE OF t_pernr.
DATA s_pernr TYPE t_pernr.
DATA : wa_idoc_data TYPE edidd,
ls_e1p0000 TYPE e1p0000,
ls_e1p0006 TYPE e1p0006,
l_partner(10),
ls_but020 TYPE but020.
DATA ls_e1pityp TYPE e1pityp.
data lv_segnum type i.
data lv_PSGNUM type i.
LOOP AT idoc_data INTO wa_idoc_data.
if wa_idoc_data-segnam = 'E1P0000' or
wa_idoc_data-segnam = 'E1P0001' or
wa_idoc_data-segnam = 'E1P0002' .
ls_e1p0000 = wa_idoc_data-sdata.
s_pernr-pernr = ls_e1p0000-pernr.
s_pernr-mandt = wa_idoc_data-mandt.
s_pernr-docnum = wa_idoc_data-docnum.
s_pernr-DTINT2 = wa_idoc_data-DTINT2.
APPEND s_pernr to gt_pernr.
endif.
lv_segnum = wa_idoc_data-segnum.
if lv_psgnum < wa_idoc_data-psgnum.
lv_psgnum = wa_idoc_data-psgnum.
endif.
ENDLOOP.
SORT gt_pernr by pernr.
DELETE ADJACENT DUPLICATES FROM gt_pernr comparing pernr.
DATA l_cnt TYPE i.
add 1 to lv_psgnum.
LOOP AT gt_pernr INTO s_pernr.
CLEAR l_cnt.
LOOP AT idoc_data INTO wa_idoc_data WHERE segnam = 'E1P0006'.
ls_e1p0006 = wa_idoc_data-sdata.
IF ls_e1p0006-pernr = s_pernr-pernr.
l_cnt = 1.EXIT.
ENDIF.
ENDLOOP.
IF l_cnt = 0.
add 1 to lv_segnum.
CLEAR ls_e1pityp.CLEAR wa_idoc_data.
ls_e1pityp-plvar = '01'.
ls_e1pityp-otype = 'P'.
ls_e1pityp-objid = s_pernr-pernr.
ls_e1pityp-infty = '0006'.
ls_e1pityp-subty = '1'.
ls_e1pityp-begda = '18000101'.
ls_e1pityp-endda = '99991231'.
wa_idoc_data-segnam = 'E1PITYP'.
wa_idoc_data-sdata = ls_e1pityp.
wa_idoc_data-mandt = s_pernr-mandt.
wa_idoc_data-docnum = s_pernr-docnum.
wa_idoc_data-segnum = lv_segnum.
wa_idoc_data-hlevel = 3.
wa_idoc_data-DTINT2 = s_pernr-DTINT2.
wa_idoc_data-psgnum = 1.
APPEND wa_idoc_data TO idoc_data.
add 1 to lv_segnum.
CLEAR ls_e1p0006.CLEAR wa_idoc_data.
ls_e1p0006-pernr = s_pernr-pernr.
ls_e1p0006-infty = '0006'.
ls_e1p0006-subty = '1'.
ls_e1p0006-endda = '99991231'.
ls_e1p0006-begda = sy-datum.
ls_e1p0006-aedtm = sy-datum.
ls_e1p0006-uname = sy-uname.
ls_e1p0006-anssa = '1'.
ls_e1p0006-LAND1 = 'TR'.
wa_idoc_data-mandt = s_pernr-mandt.
wa_idoc_data-docnum = s_pernr-docnum.
wa_idoc_data-segnam = 'E1P0006'.
wa_idoc_data-sdata = ls_e1p0006.
wa_idoc_data-segnum = lv_segnum.
wa_idoc_data-hlevel = '4'.
wa_idoc_data-DTINT2 = s_pernr-DTINT2.
wa_idoc_data-psgnum = lv_psgnum.
APPEND wa_idoc_data to idoc_data.
ENDIF.
ENDLOOP.
*******************************************
CALL FUNCTION 'IDOC_INPUT_HRMD'
EXPORTING
input_method = input_method
mass_processing = mass_processing
IMPORTING
in_update_task = in_update_task
call_transaction_done = call_transaction_done
workflow_result = workflow_result
application_variable = application_variable
TABLES
idoc_contrl = idoc_contrl
idoc_data = idoc_data
idoc_status = idoc_status
return_variables = return_variables
serialization_info = serialization_info
EXCEPTIONS
wrong_function_called = 1
OTHERS = 2.
08-20-2014 4:15 PM
Hi Emre,
Infotype 0006 is really necessary in this interface. You may find a way to change the BADI but honestly I don't think it should be done.
If you schedule the report HRALXSYNC to run periodically then the BP will be created by the moment the IT0006 is created in your HR system (even if the employee and its CP was created one moment in past).
BR,
Anaer
09-01-2014 12:02 PM
Hi Anaer,
In a normal way you're right but in our scenario we had to transfer personel without address info to CRM system at that moment.