Skip to Content
author's profile photo Former Member
Former Member

Idoc enhancement with ABAP

Hi all,

we are currently in a project to implement SAP HR as HR master and distribute HR master data to other legacy systems using SAP XI.

There will be two different interfaces from SAP HR to XI, one for real-time updates of changes (delta) and one for batch updates of complete records. We use SAP R/3 4.7 ext2 and want to use Idoc type HRMD_A06 which contains all HR data (we will have to add segments for two infotypes, but that is not the problem).

The problem is that there is some information we need to distribute that not automatically gets included in this Idoc type (such as SAP personell number for manager of the org.unit an employee belongs to). My guess is that this has to be filled using some custom ABAP.

Does anyone have any experience with adding such information to an Idoc? We can always find a suitable field in the Idoc to store the values if we only can retrieve the correct information.

And secondly, how do we make sure this extra information is stored for the correct employee segment in the Idoc?

Finally, can we implement this function module so that it runs after the general Idoc is created, runs through the entire IDoc and adds the correct information for each employee segment, and then send the finished IDoc to XI? This goes for both real-time interface (implemented using change-pointers) and batch interface (scheduled job to collect master data).

Any information or experience on this matter will be highly appreciated. Any other suggestions to how this problems can be solved are also welcome.

Thanks in advance.

Best regards, Kenneth Eriksen

Add a comment
10|10000 characters needed characters exceeded

Related questions

1 Answer

  • Best Answer
    Posted on Dec 18, 2004 at 12:07 AM

    Hi,

    The requirement can be met by spending some effort on customization.

    1. Consider the batch update of complete records.

    For Example, An employee data with his positions,org unit,job,relationship should be dstributed to the external systems.

    Following filters needed to be added :

    0000,0001,0002,1000, 1001(subtype -A002).

    When u run PFAL transaction for employee object with plan version 01,object type-P and object id -(Employee pernr)

    All data related to filtered infotype will be picked up .

    As per the standard idoc, only relationships between positions will be picked up.Requires a Manager pernr to send to external system.

    Solution :

    1. Create a new segment ZIP0001 with field names Employee pernr, Manager pernr.

    2. Extend the HRMD_A06 idoc type with extension ZHRMD_A06 and attach new segment ZIP0001 to the original segment E1p0001.

    3. Now its time to fill the data exactly.Implement a user exit in the function module EXIT_SAPLRHA0_003 and also the source code as follows :

    ***user exit changes**

    case segment_type.

    when 'E1p0001'.

    l_plans = e1p0001-plans.

    SELECT SINGLE SOBID INTO L_SOBID FROM HRP1001

    WHERE OTYPE = 'S'

    AND OBJID = L_PLANS

    AND PLVAR = '01'

    AND RSIGN = 'A'

    AND RELAT = '002'

    AND BEGDA <= SY-DATUM

    AND ENDDA >= SY-DATUM.

    if sy-subrc eq 0.

    SELECT SOBID BEGDA ENDDA INTO CORRESPONDING

    FIELDS OF LIT_SUPERVISOR FROM HRP1001

    WHERE OTYPE = 'P'

    AND OBJID = L_SOBID

    AND PLVAR = '01'

    AND RSIGN = 'A'

    AND RELAT = '008'

    AND BEGDA LE SY-DATUM

    AND ENDDA GE SY-DATUM.

    if sy-subrc eq 0.

    • Get the latest Manager by sorting and assign the employee pernr and manager pernr to z1p0001.

    endif.

    endcase.

    2. Change-pointers :

    when there is a change in positions,new manager relationships, change-pointers specific to infotype 1001 will be triggered.

    implement the logic in user exit :EXIT_SAPLRHA0_001

    A. Infotype 1001 contains the Employees position with A002 relatioship to managers position.

    Determine the employees pernr from 1001 employees position.

    Select employee data from infotype 0001 and fill segment E1p0001.

    B. Code applicable to bacth job in user exit 0003 will be applicable to this scenario.

    C. Proper care should be taken in user exit 0001 - it should not fill E1p0001 records for the second time.

    The above solution will solve ur requirement.

    Please let me know for any concerns.

    Regards,

    Senthil

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.