Skip to Content

Archived discussions are read-only. Learn more about SAP Q&A

Create OM Info type 1002 programatically (for Position object)

Scenario: I am doing a BDC to Create OM Position. Subtypes for Info type 1002 (Description) are free text controls that I beleive can't be recorded using the Transaction recording tool.

So Is my understanding correct that the subtypes for Info type 1002 can't be populated in BDC while creating other OM info types for Position?

Is there anyway that i can programatically create/update IT1002 subtypes for an existing position?

Hint: The data in these sub types are stored in tables HRP1002 & HRT1002 and the class CL_GUI_TEXTEDIT (methods SET_TEXT_AS_R3TABLE, GET_TEXT_AS_R3TABLE) seems to be doing some trick. I am not sure how can i get hold of the Text control instance to upload data though. Itu2019s different from what I have done for SD/MM modules where I used Object/Object key, etc with the FM CREATE_TEXT to populate free text for objects like Sales order, Purchase order, etc.

Any ideas will be greatly appreciated.

Thanks,

Saurabh

replied

Saurabh,

1. Create position object ID(IT1000) using FM RH_OBJECT_CREATE...

2. Using the generated Object ID generate relation(IT1001) using FM

RH_RELATION_MAINTAIN..

Use the FM RH_RELATION_MAINTAIN in this way,

LOOP AT T_MAINTAIN INTO WA_MAINTAIN.

WA_MAINTAIN-FCODE = 'INSE'.

WA_MAINTAIN-PLVAR = '01'.

WA_MAINTAIN-ISTAT = '1'.

*Relate account to project

IF WA_MAINTAIN-OTYPE = 'O' AND WA_MAINTAIN-SCLAS = 'O'.

WA_MAINTAIN-RSIGN = 'B'.

WA_MAINTAIN-RELAT = '002'.

*Relate position to project

ELSEIF WA_MAINTAIN-OTYPE = 'O' AND WA_MAINTAIN-SCLAS = 'S'.

WA_MAINTAIN-RSIGN = 'B'.

WA_MAINTAIN-RELAT = '003'.

*Relate job to position

ELSEIF WA_MAINTAIN-OTYPE = 'S' AND WA_MAINTAIN-SCLAS = 'C'.

WA_MAINTAIN-RSIGN = 'B'.

WA_MAINTAIN-RELAT = '007'.

*Relate employee to position

ELSEIF WA_MAINTAIN-OTYPE = 'S' AND WA_MAINTAIN-SCLAS = 'P'.

WA_MAINTAIN-RSIGN = 'A'.

WA_MAINTAIN-RELAT = '008'.

ENDIF.

WA_MAINTAIN-ENDDA = '99991231'.

*FM to create relationship

CALL FUNCTION 'RH_RELATION_MAINTAIN'

EXPORTING

ACT_FCODE = WA_MAINTAIN-FCODE

ACT_PLVAR = WA_MAINTAIN-PLVAR

ACT_OTYPE = WA_MAINTAIN-OTYPE

ACT_OBJID = WA_MAINTAIN-OBJID

ACT_ISTAT = WA_MAINTAIN-ISTAT

ACT_RSIGN = WA_MAINTAIN-RSIGN

ACT_RELAT = WA_MAINTAIN-RELAT

ACT_SCLAS = WA_MAINTAIN-SCLAS

ACT_SOBID = WA_MAINTAIN-SOBID

ACT_BEGDA = WA_MAINTAIN-BEGDA

ACT_ENDDA = WA_MAINTAIN-ENDDA

ACT_PROZT = WA_MAINTAIN-PROZT

EXCEPTIONS

MAINTAINANCE_FAILED = 1

OTHERS = 2.

IF SY-SUBRC <> 0.

  • WRITE : WA_INPUT-OBJID.

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

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

ENDIF.

COMMIT WORK.

ENDLOOP.

3. Using FM RH_OBJECT_DESCRIPTION_WRITE create Description(IT1002).

4.For further infotype i m not sure of FM....you can try BDC for those things...

1 View this answer in context

Helpful Answer

by
Not what you were looking for? View more on this topic or Ask a question