cancel
Showing results for 
Search instead for 
Did you mean: 

Pur Org table

Former Member
0 Kudos

Hi Gurus,

Can ny one tell me from which table we will get the users Purg Organisation data.

Thabks in advance,

Satish Gopal

Accepted Solutions (0)

Answers (4)

Answers (4)

Former Member
0 Kudos

Select the OBJID from tables HRP5500 & HRT5500

I did a view of the tables link by TABNR that I will do reference as HRV5500a

This are the parameter of my custom FM

IMPORTING
REFERENCE(IV_PURCH_GROUP_CODE) TYPE  EKGRP
EXPORTING
REFERENCE(EV_PURCH_ORG) TYPE  HROBJID

Data Declaration:

constants c_stpurchgrp     type subtyp value '0300'.
  constants c_stpurchorg     type subtyp value '0200'.
  constants c_orgeh          type otype  value 'O'.
  constants c_plvar          type plvar  value '01'.

  data lv_purchgrp_objid     type hrobjid.
  data lv_purchorg_objid     type hrobjid.
  data lt_roots              type hrtb_object.
  data ls_roots              type hrrootob.
  data lt_otypes             type hrtb_otype.
  data ls_otypes             type otype.
  data lt_struc              type struc_t.
  data ls_struc              type struc.

select objid from hrv5500 up to 1 rows into lv_purchgrp_objid
where plvar eq c_plvar and
          otype eq c_orgeh and
          subty eq c_stpurchgrp and
          begda le sy-datum and
          endda ge sy-datum and
          ekgrp eq iv_purch_group_code.
  endselect.

Gets the roots to pass to the FM

ls_otypes = c_orgeh.
  append ls_otypes to lt_otypes.
  ls_roots-otype = c_orgeh.
  ls_roots-objid = lv_purchgrp_objid.
  append ls_roots to lt_roots.

Call FM BBP_OM_STRUC_READ_UP_INT

call function 'BBP_OM_STRUC_READ_UP_INT'
    exporting
      roots                   = lt_roots
      return_otypes           = lt_otypes
      sel_date                = sy-datum
      ppoma_call              = space
      authority_check         = space
    importing
      struc                   = lt_struc
    exceptions
      path_not_found          = 1
      error_reading_structure = 2
      no_roots                = 3
      invalid_roots           = 4
      others                  = 5.

Now loop at lt_struc to get the top organization

loop at lt_struc into ls_struc
    where otype eq c_orgeh.
    select objid
      from hrv5500a up to 1 rows
      into lv_purchorg_objid
      where plvar eq c_plvar and
            otype eq c_orgeh and
            objid eq ls_struc-objid and
            subty eq c_stpurchorg and
            begda le sy-datum and
            endda ge sy-datum.
    endselect.
    if sy-subrc eq 0.
      ev_purch_org = lv_purchorg_objid.
      exit.
    endif.
  endloop.

Former Member
0 Kudos

Hi,

Please check table : BBP_PDORG

in this table the Input will be the user GUID

Regards

Ganesh Kumar .G

Former Member
0 Kudos

You can go to TCODE PPOMA_BBP or PPOSA_BBP and search for a user then in the function tab of the user you can see the code for the Purchasing Organization.

Then you can go to table HRP1001 and in OTYPE enter "O" and in OBJID enter the Purchase Org Code it will return all the users that are in the same org code (UNAME)

If you want the name of the Org then you need to go to table HRP1000 and do the same as above then in the field STEXT it will display the organization name.

OTYPE O = Organization, S = Position, CP = Central Person

To answer your question it will be HRP1001 and HRP1000.

Hope this help!

Please Provide points if is helpful!

thanks!

Jason PV

pedro_santos6
Contributor
0 Kudos

Hi,

You can use the FM BBP_OM_STRUC_GET_USER_FROM_ORG to get the users from a purchase organization.

Rgs,

Pedro Marques