Application Development and Automation 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: 
Read only

Update or Insert OM infotypes

Former Member
0 Likes
3,128

Hi Gurus,

I have a requirement where i will get data from a flat file and i have to update 4 OM infotypes 1000, 1001, 1002, 1005, 1080. I know i have to use FM RH_INSERT_INFTY. Based on the data already existing or not i have to update or insert. Is there a way to dynamically pass the internal tables to INNNN parameter. And can you please provide me with an example for this scenario.

Thank you in advance for your help.

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
1,693

Hi,

Give INSERT operation as input for act_fcode. If an object already exist it will modify the already exisiting one and if it doesnt exist it will create a new one.

   CALL FUNCTION 'RH_PNNNN_MAINTAIN'
      EXPORTING
        act_fcode           = c_inse         " Insert Operation
        act_otype           = ls_p1001-otype " Object Type
        act_objid           = ls_p1001-objid " Object ID
        act_pnnnn           = ls_p1001       " HRP1001 Sturcture
        suppress_dialog     = '2'            " No dialog
        act_commit_flg      = ''             " No Auto commit
      EXCEPTIONS
        infty_not_valid     = 1
        no_plvar            = 2
        object_not_defined  = 3
        otype_not_valid     = 4
        no_authority        = 5
        action_rejected     = 6
        no_gdate            = 7
        fcode_not_supported = 8
        OTHERS              = 9.

2 REPLIES 2
Read only

Former Member
0 Likes
1,694

Hi,

Give INSERT operation as input for act_fcode. If an object already exist it will modify the already exisiting one and if it doesnt exist it will create a new one.

   CALL FUNCTION 'RH_PNNNN_MAINTAIN'
      EXPORTING
        act_fcode           = c_inse         " Insert Operation
        act_otype           = ls_p1001-otype " Object Type
        act_objid           = ls_p1001-objid " Object ID
        act_pnnnn           = ls_p1001       " HRP1001 Sturcture
        suppress_dialog     = '2'            " No dialog
        act_commit_flg      = ''             " No Auto commit
      EXCEPTIONS
        infty_not_valid     = 1
        no_plvar            = 2
        object_not_defined  = 3
        otype_not_valid     = 4
        no_authority        = 5
        action_rejected     = 6
        no_gdate            = 7
        fcode_not_supported = 8
        OTHERS              = 9.

Read only

0 Likes
1,693

Hi Jegadeesan,

Thanks for the reply. I have a few doubts.

Does it act the same for all infotypes or only 1001.

What is the difference between RH_INSERT_INFTY and RH_PNNNN_MAINTAIN.