cancel
Showing results for 
Search instead for 
Did you mean: 

BAPI or FM to create OrgUnits and positions in Organizational Management

Former Member
0 Kudos

Hi all,

is there a way to create a OrgUnit or a Position in the Organizational Management without using the user interface (ppome)?

Does an BAPI or function module exists to create a position or OrgUnit in the background?

Or how can I realize this?

Thanks for any help

regards,

hans

Accepted Solutions (1)

Accepted Solutions (1)

BGarcia
Active Contributor
0 Kudos

Hello Hans,

I do that by using function module CRM_ORGMAN_CREATE_REL_OBJ.

See if can help you too.

Kind regards,

Bruno

Former Member
0 Kudos

Hi Bruno

I'm working with this BAPI, however...I'm not sucessfully creating the relatioship between OrgUnit and Position...

with this BAPI, I've created the OrgUnit but I can not be able to assign the Position to this Org.Unit.

Example:

Father structure:

PL: 01

OT: O

OBJID: 50000157

BEGDA: 06082008

ENDDA: 31129999

I: A

H:blank

Short: X Description

Stext: Y Description

Realoc: blank

PLVAR: 01

OTYPE: S

OSTAT: 1

BEGDA: 06082008

ENDDA: 31129999

RSIGN_FATHER_TO_SON: B

RELAT: 003

PERCENTAGE: 100

SHORT: X Position

STEXT: Y Position

IS_ROOT_OBJECT: blank

Do you have any idea why I can not assign Position to the OrgUnit ?

regards,

ahm

BGarcia
Active Contributor
0 Kudos

Hello Ahm,

I do something very similiar with your code. I do something like this:


CALL FUNCTION 'CRM_ORGMAN_CREATE_REL_OBJ'
    EXPORTING
      FATHER                    = ls_father_objec
      OTYPE                     = 'S'
      BEGDA                     = sy-datum
      RELAT                     = '003'
      SHORT                     = 'shorttxt'
      STEXT                     = 'longtxt'
    IMPORTING
      NEW_OBJECT                = ls_objec
    EXCEPTIONS
      ERROR_DURING_INSERT       = 1
      CORR_EXIT                 = 2
      NO_ACTIVE_PLVAR           = 3
      PLVAR_NOT_VALID           = 4
      OTYPE_NOT_FOUND           = 5
      OTYPE_NOT_ALLOWED         = 6
      NO_BASE_AUTHORITY         = 7
      NO_STRU_AUTHORITY_OBJID   = 8
      NO_AUTHORITY              = 9
      NO_AUTHORIZATION          = 10
      FORBIDDEN_RELATION        = 11
      WRITE_ERROR_WITH_RELATION = 12
      INFTY_NOT_ALLOWED         = 13
      BEGDA_GT_ENDDA            = 14
      SHORT_AND_STEXT_EMPTY     = 15
      GENERAL_ERROR             = 16
      OTHERS                    = 17.

And it works perfectly. Can you try it?

Kind regards,

Bruno

Former Member
0 Kudos

Hi Bruno,

yes, it worked..

tks

Former Member
0 Kudos

Bruno/ahm,

Thank you for the code, it works for me as well. One question, I want to assign this position as the head of the organizational unit. How can I accomplish that?

Thank you for your assistance in advanced. !

IN

om_awasthi1
Participant
0 Kudos

Hi Irma,

Please let me know if you were able to find the solution for assigning the psoition as head of the organizatin unit using the function module .

Thanks,

OM

Answers (0)