Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

user exit for filling custom fields in IDOC message type HRMD_A

Former Member
0 Kudos

Hi ALL,

We have extended out basic type HRMD_A07 with our custom segment that consists to some custom fields which is pulling data from various text tables like country language etc.

Is there any user exit to fill data of the fields in the custom segment and send it to the target system

Thanks

Bala Duvvuri

1 ACCEPTED SOLUTION

Former Member
0 Kudos

Hi Bala,

You can use enhancement "RHALE001".

Edit :

Or implement BADI "HRALE00OUTBOUND_IDOC".

Regards

Vinod

Edited by: Vinod Kumar on May 7, 2010 5:12 PM

3 REPLIES 3

Former Member
0 Kudos

Hi Bala,

You can use enhancement "RHALE001".

Edit :

Or implement BADI "HRALE00OUTBOUND_IDOC".

Regards

Vinod

Edited by: Vinod Kumar on May 7, 2010 5:12 PM

Former Member
0 Kudos

Hi Bala,

If you have implemented this could you pls provide me the coding of uploading or filling

the fields of custom segments so that will be helpfull for me to complete my object

which is similar to this ?

pls provide me the same.

Thanks,

Robi

0 Kudos

elseif receiver ca 'X'.

  • This code is used to write the data into custom fields of custom segment ZHCMS_PI_SEGMENT

  • which is created for custom idoc type ZHRMD_A07 for HCMS and PI system

  • SREYAB 18.05.2010

data: sgmnt_e1pityp type e1pityp.

field-symbols: <wplog> type any.

field-symbols: <wplog1> type any.

data: ixxxx type e1pityp, iyyyy type e1plogi,sgmnt_hcms_pi type zhcms_pi_segment,wa_idoc_data_x type edidd, ls_idoc_data type edidd.

data: lv_p0001 type standard table of p0001 ,lv_p0002 type standard table of p0002 ,lv_p0007 type standard table of p0007 .

data: lv_p0521 type standard table of p0521 ,lv_p0710 type standard table of p0710 ,lv_p2001 type standard table of p2001 .

data: ls_p0001 type p0001,ls_p0002 type p0002,ls_p0007 type p0007 ,ls_p0521 type p0521 ,ls_p0710 type p0710 ,ls_p2001 type p2001 .

data: row_index type sy-tabix,del_index type sy-tabix.

data: lcx_root type ref to cx_root.

  • fILL THE E1PITYP

try.

            • Keep the segments which have changed date greater than last run date in update mode

  • CALL FUNCTION 'ZMODIFY_ALE_SEGMENT'

  • CHANGING

  • idoc_data_ret = idoc_data.

  • Clear all the empty segments before making changes

loop at idoc_data into wa_idoc_data_x where segnam = 'E1PITYP'.

del_index = sy-tabix.

del_index = del_index + 1.

read table idoc_data into wa_idoc_data_x index del_index.

if wa_idoc_data_x-segnam = 'E1PITYP'. " Empty segment found in the last index.

del_index = del_index - 1.

delete idoc_data index del_index.

clear wa_idoc_data_x.

endif.

endloop.

read table idoc_data into wa_idoc_data_x with key segnam = 'E1PITYP'.

assign wa_idoc_data_x-sdata to <wplog> casting type e1pityp.

ixxxx = <wplog>.

loop at idoc_data into wa_idoc_data_x where segnam = 'E1PLOGI'.

row_index = sy-tabix + 1.

assign wa_idoc_data_x-sdata to <wplog1> casting type e1plogi.

iyyyy = <wplog1>.

sgmnt_e1pityp-plvar = ixxxx-plvar.

sgmnt_e1pityp-otype = ixxxx-otype.

sgmnt_e1pityp-objid = iyyyy-objid.

sgmnt_e1pityp-infty = '0001'.

  • sgmnt_e1pityp-subty = t_hrobjinfty-subty.

sgmnt_e1pityp-begda = ixxxx-begda.

sgmnt_e1pityp-endda = ixxxx-endda.

clear ls_idoc_data.

ls_idoc_data-segnam = 'E1PITYP'.

ls_idoc_data-sdata = sgmnt_e1pityp.

insert ls_idoc_data into idoc_data index row_index.

  • APPEND t_idoc_data .

  • Get the ZZSWISSREID

call function 'HR_READ_INFOTYPE'

exporting

pernr = iyyyy-objid

infty = '0001'

begda = ixxxx-begda

endda = ixxxx-endda

tables

infty_tab = lv_p0001.

sort lv_p0001 by begda descending.

read table lv_p0001 into ls_p0001 index 1.

sgmnt_hcms_pi-zzswissreid = ls_p0001-zzswissreid.

  • Get the custom data from IT0002

call function 'HR_READ_INFOTYPE'

exporting

pernr = iyyyy-objid

infty = '0002'

begda = ixxxx-begda

endda = ixxxx-endda

tables

infty_tab = lv_p0002.

sort lv_p0002 by begda descending.

read table lv_p0002 into ls_p0002 index 1.

sgmnt_hcms_pi-zzglobalid = ls_p0002-zzglobalid.

sgmnt_hcms_pi-zzsource_id = ls_p0002-zzsource_id.

sgmnt_hcms_pi-zzlegacy_emp_id = ls_p0002-zzlegacy_emp_id.

  • Get the data for IT0007

call function 'HR_READ_INFOTYPE'

exporting

pernr = iyyyy-objid

infty = '0007'

begda = ixxxx-begda

endda = ixxxx-endda

tables

infty_tab = lv_p0007.

sort lv_p0007 by begda descending.

read table lv_p0007 into ls_p0007 index 1.

sgmnt_hcms_pi-zzempct = ls_p0007-zzempct.

  • Get the data for IT0521

call function 'HR_READ_INFOTYPE'

exporting

pernr = iyyyy-objid

infty = '0521'

begda = ixxxx-begda

endda = ixxxx-endda

tables

infty_tab = lv_p0521.

sort lv_p0521 by begda descending.

read table lv_p0521 into ls_p0521 index 1.

sgmnt_hcms_pi-atzph = ls_p0521-atzph.

  • Get the data for IT0710

call function 'HR_READ_INFOTYPE'

exporting

pernr = iyyyy-objid

infty = '0710'

begda = ixxxx-begda

endda = ixxxx-endda

tables

infty_tab = lv_p0710.

sort lv_p0710 by begda descending.

read table lv_p0710 into ls_p0710 index 1.

sgmnt_hcms_pi-assign_type = ls_p0710-assign_type.

  • Get the data for IT2001

call function 'HR_READ_INFOTYPE'

exporting

pernr = iyyyy-objid

infty = '2001'

begda = ixxxx-begda

endda = ixxxx-endda

tables

infty_tab = lv_p2001.

sort lv_p2001 by begda descending.

read table lv_p2001 into ls_p2001 index 1.

sgmnt_hcms_pi-awart = ls_p2001-awart.

clear ls_idoc_data.

ls_idoc_data-segnam = 'ZHCMS_PI_SEGMENT' .

ls_idoc_data-sdata = sgmnt_hcms_pi.

row_index = row_index + 1.

insert ls_idoc_data into idoc_data[] index row_index.

clear : lv_p2001[] , lv_p0001[] , lv_p0002[] , lv_p0710[] ,lv_p0007[], lv_p0521[], ls_p2001 , ls_p0001 , ls_p0002 , ls_p0710 ,ls_p0007, ls_p0521 .

  • APPEND t_idoc_data.

endloop.

catch cx_root into lcx_root.

endtry.

endif.