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: 

Create OM Info type 1002 programatically for Position

Former Member
0 Kudos

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

5 REPLIES 5

ian_maxwell2
Active Participant
0 Kudos

Check out the following threads:

There is a framework that SAP has implimented for the updating programatically of infotypes. It works on some infotypes so it might work for what you are doing. The framework is built such that over time they can expand it to various different infotypes and they can all be accessed in a similiar way.

The following is an example from where I played around with the framework a bit:

form f_Main.
  data:
    l_MasterData_BL TYPE REF TO IF_hrpa_masterdata_BL,
    l_Container_Tab type HRPAD_INFTY_CONTAINER_TAB,
    l_Message_List type Ref to CL_HRPA_MESSAGE_LIST,
    l_Container type ref to IF_HRPA_INFTY_CONTAINER,
    l_NewContainer type ref to IF_HRPA_INFTY_CONTAINER,
    l_Ok type Boole_d,
    l_NewContainer_impl type ref to CL_HRPA_INFOTYPE_CONTAINER,
    l_PSKey type PSKey.
 
  create object l_Message_List.
  CL_HRPA_MASTERDATA_BL=>GET_INSTANCE( importing MasterData_BL = l_MasterData_BL ).
  l_MasterData_BL->READ( exporting Tclas = 'A'
                                   Pernr = '90000017'
                                   Infty = '2002'
                                   Begda = '20060101'
                                   Endda = '20070101'
                                   No_Auth_Check = 'X'
                                   Message_Handler = l_Message_List
                                   Mode = '6'
                         importing Container_Tab = l_Container_Tab ).
  clear l_Container.
  read table l_Container_Tab
  into l_Container
  index 1.
  if ( sy-subrc = 0 ).
    l_PSKey = l_Container->A_PSKey.
    l_PSKey-Endda = '20061002'.
    l_PSKey-Begda = '20061002'.
    l_NewContainer = l_Container->Modify_Key( l_PSKey ).
    l_NewContainer_impl ?= l_NewContainer.
    clear l_Ok.
    l_MasterData_BL->Insert( exporting Message_Handler = l_Message_list
                             importing Is_Ok = l_Ok
                             changing Container = l_NewContainer ).
    l_MasterData_BL->Flush( exporting No_Commit = 'x' ).
    commit work and wait.
  endif.
endform.

~Ian

Former Member
0 Kudos

Thanks for your response. I am afraid this won't work for my scenario where i am trying to progrmatically create/update IT 1002 sub types.

Thanks,

Saurabh

Former Member
0 Kudos

I have done lil more reserach and I think using the new de coupled framework as you suggested should work.

Thanks,

Saurabh

0 Kudos

Hello Saurabh.

Could you post your solution/sample code on how to update infotype 1002 programmatically?

Thanks a lot.

Irina

Former Member
0 Kudos

Irina,

Sorry it took longer to post the Solution. I used the FM RH_OBJECT_DESCRIPTION_WRITE for this purpose.

Saurabh