SAP R/3 форум ABAP консультантов
Russian ABAP Developer's Club

Home - FAQ - Search - Memberlist - Usergroups - Profile - Log in to check your private messages - Register - Log in - English
Blogs - Weblogs News

Retrieve Org. Unit structure



 
Post new topic   Reply to topic    Russian ABAP Developer's Club Forum Index -> HR
View previous topic :: View next topic  
Author Message
admin
Администратор
Администратор



Joined: 01 Sep 2007
Posts: 1639

PostPosted: Sat Oct 13, 2007 1:07 pm    Post subject: Retrieve Org. Unit structure Reply with quote

Retrieve oganisation unit structure

The below code shows how RH_PM_GET_STRUCTURE is used. You pass it an Organisation
Unit(OBJID) and it will retrieve all the units below it in the org. tree (including idividual personnel). Also
'RH_DIR_ORG_STRUC_GET' is an alternative but seems to be much slower.

The OBJECT_TAB table stores all the objects within the org structure zorg_unit (including all sub levels).
The key for these objects is stored within the 'OTYPE' field. Therefor if you loop through the table you can
retrive the objects you require.
i.e. The following code will loop around all the personnel numbers:

Code:
* Loops around personnel numbers within Org. Unit.
   LOOP AT objec_tab where otype = 'P'.
*       Processing....
   ENDLOOP.

data: objec_tab like objec occurs 0 with header line.
data: zorg_unit   type p0001-orgeh.
data: t_org_tab like rhldapp occurs 0 with header line.



  call function 'RH_PM_GET_STRUCTURE'
       exporting
            plvar           = '01'   "p0000-plvar
            otype           = 'O'  "0001-otype
            objid           = zorg_unit
            begda           = pn-begda
            endda           = pn-endda
            status          = '1'
            wegid           = 'SBESX'
            77aw_int        = ' '
       tables
            objec_tab       = objec_tab
       exceptions
            not_found       = 1
            ppway_not_found = 2
            others          = 3.


***************************
Alternative, but very slow*
***************************
*    call function 'RH_DIR_ORG_STRUC_GET'
*        exporting
*              act_orgunit     = zorg_unit
*              act_plvar       = '01'
*              act_date        = pn-begda
*         tables
*              org_units       = t_org_tab
*         exceptions
*              no_active_plvar = 1
*              others          = 2.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    Russian ABAP Developer's Club Forum Index -> HR All times are GMT + 4 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


All product names are trademarks of their respective companies. SAPNET.RU websites are in no way affiliated with SAP AG.
SAP, SAP R/3, R/3 software, mySAP, ABAP, BAPI, xApps, SAP NetWeaver and any other are registered trademarks of SAP AG.
Every effort is made to ensure content integrity. Use information on this site at your own risk.