cancel
Showing results for 
Search instead for 
Did you mean: 

HCM, how to find name of the General management

Former Member
0 Kudos

So, i got this little problem.

I get all the data from this user, we can call it "Jhon doe", But i need the name of the General management. I mean:

General management  > data i need

               '

               '

               '

               management

                               '

                              '

                              '

                              jhon doe > data i got.

I just need the name of the General management where my friend "Jhon doe"  is working. this is for an abap project so i need a FM or something like that, if one of you can help me,

     Thanks in advance.

PD: Sorry for the bad english.

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

I solved this.

i use the ORGEH from the pa0001 using the pern of my employee

select * into TABLE t0001 from pa0001 where pernr = v_pernr.

   SORT t0001 by endda DESCENDING.

   READ TABLE t0001 index 1.

   v_ORGEH = t0001-ORGEH.

then i look in the table hrp1001 the field SOBID.

SELECT SINGLE sobid

INTOv_sobid FROM hrp1001 WHERE OBJID = v_ORGEH AND PLVAR = '01' AND  RSIGN = 'A' AND RELAT = '002'.


and use the FM HR_READ_FOREIGN_OBJECT_TEXT

call function 'HR_READ_FOREIGN_OBJECT_TEXT'

   exporting

     otype                                     = 'O'

    OBJID                                    = v_sobid

*   COSTCENTER                      =

*   CONTROLLINGAREA            =

*   STATUS                               = '1'

*   BEGDA                                = '18000101'

*   ENDDA                                = '99991231'

*   REFERENCE_DATE             = SY-DATUM

*   LANGU                                = SY-LANGU

  IMPORTING

   SHORT_TEXT                        = General_name 'Name of the General Management'.

   OBJECT_TEXT                       =

   COSTCENTER_NAME            =

   INTEGRATION_ACTIVE           =

   RETURN                                =

EXCEPTIONS

   NOTHING_FOUND                 = 1

   WRONG_OBJECTTYPE              = 2

   MISSING_COSTCENTER_DATA       = 3

   MISSING_OBJECT_ID             = 4

   OTHERS                        = 5

           .

if sy-subrc <> 0.

* MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO

*         WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.

endif.

thanks all for you help.

Answers (1)

Answers (1)

markus_deuter
Active Participant
0 Kudos

Can u please explain, what you mean with "general management" ?! What transaction ?

Do you mean "User maintanance", SU01 ? Or some kind of HCR ? Which solution ? ERP, CRM, SRM ?

Greetings

Markus

Former Member
0 Kudos

is for a global field exit. I need to fill a field with the name of the general management from the employee.

So, i got the pernr, ceco, and the management from the employee, but i need the name from the higher management. can you help me?

Former Member
0 Kudos

Hi,

Use the FM RH_STRUC_GET with act_otype as P, act_objid as pernr and give act_wegid as 'P-S-O' and check the RESULT_* tables.

This should give you all the higher levels.

Thanks,

Shambu