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: 

FM for org unit shortname

Former Member
0 Kudos
535

Hello All,

Im looking for a functionmodule to get org unit shortname. (HR-OM)

I'm using HR_READ_FOREIGN_OBJECT_TEXT to get position shortname. can i somehow use this FM to get org unit shortname as well? or is there another fm that i can use?

CALL FUNCTION 'HR_READ_FOREIGN_OBJECT_TEXT'
     EXPORTING
          OTYPE                   = 'S'
          OBJID                   = p0001-plans
          BEGDA                   = pn-begda
          ENDDA                   = pn-endda
     IMPORTING
          OBJECT_TEXT             = ls_stext
     EXCEPTIONS
          NOTHING_FOUND           = 1
          WRONG_OBJECTTYPE        = 2
          MISSING_COSTCENTER_DATA = 3
          MISSING_OBJECT_ID       = 4
          OTHERS                  = 5.

Thanks

Claes

4 REPLIES 4

former_member181962
Active Contributor
0 Kudos
110

CALL FUNCTION 'HR_READ_FOREIGN_OBJECT_TEXT'

EXPORTING

OTYPE = 'S'

OBJID = p0001-plans

BEGDA = pn-begda

ENDDA = pn-endda

IMPORTING

OBJECT_TEXT = ls_stext

<b> SHORT_TEXT = ls_short_text</b>

EXCEPTIONS

NOTHING_FOUND = 1

WRONG_OBJECTTYPE = 2

MISSING_COSTCENTER_DATA = 3

MISSING_OBJECT_ID = 4

OTHERS = 5.

make the highlighted change.

0 Kudos
110

Thank you for the fast reply.

But don't i get the position short name then?

/Claes

0 Kudos
110

Okej I solved it. Thanks anyway.

0 Kudos
110

Hi Claes,

Yes you were right.. I didn't notice.

In case you want to get the org unit short text, then you should use the same Function module by passing the objid ,otype = 'O' etc for the org unit to get the text for the org unit.

In other words this function module gives the text for one object(The object can be anything person, job, position, org unit etc).

so, get the relation between the position and the org unit it belongs to.

For that org unit , use this fm again.

Regards,

Ravi