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: 

HR Buffer and FM question

bryan_cain
Contributor
0 Kudos
172

Hi all -

This question may have a simple answer that I'm just missing.

I found a FM called "HR_PUT_ORG_STRUCTURE" that writes infotype 0001 data to the buffer according to the comments in the code.

How do I save the data from the buffer to the DB? I've tried commit work, RH_UPDATE_DATABASE and RHOM_WRITE_BUFFER_TO_DB, none seem to work.

Thanks in advance!

Bryan

1 ACCEPTED SOLUTION

LucianoBentiveg
Active Contributor
0 Kudos
83

Can you use? :


CALL FUNCTION 'HR_INFOTYPE_OPERATION'      
     EXPORTING                             
          infty         = '0001'           
          number        = pernr            
          subtype       = p0001_aux-subty  
          objectid      = p0001_aux-objps  
          lockindicator = p0001_aux-sprps  
          validityend   = p0001_aux-endda  
          validitybegin = p0001_aux-begda  
          recordnumber  = p0001_aux-seqnr  
          record        = p0001_aux        
          operation     = 'MOD'            
          tclas         = 'A'              
          dialog_mode   = '0'              
          nocommit      = 'X'              
     IMPORTING                             
          return        = return1.         

3 REPLIES 3

LucianoBentiveg
Active Contributor
0 Kudos
84

Can you use? :


CALL FUNCTION 'HR_INFOTYPE_OPERATION'      
     EXPORTING                             
          infty         = '0001'           
          number        = pernr            
          subtype       = p0001_aux-subty  
          objectid      = p0001_aux-objps  
          lockindicator = p0001_aux-sprps  
          validityend   = p0001_aux-endda  
          validitybegin = p0001_aux-begda  
          recordnumber  = p0001_aux-seqnr  
          record        = p0001_aux        
          operation     = 'MOD'            
          tclas         = 'A'              
          dialog_mode   = '0'              
          nocommit      = 'X'              
     IMPORTING                             
          return        = return1.         

0 Kudos
83

I'll try it, but I don't think it's going to work. I've tried using that FM in another program, and it won't let me change infotype 0001 values. If I go into transaction PA30, that won't let me change those values either, if the employee has been tied to an org unit - Basically, I'm trying to change an employee's org unit when that org unit gets updated in the org master.

It seems this value (pa0001-orgeh) only changes when you change where the position is assigned in Org master data, PPOSE. Basically, I'm trying to simulate that.

Thanks for the suggestion though. Once I've tested I'll come back and award points as appropriate.

0 Kudos
83

That did it! I'm not sure why I couldn't get it to work before, but thanks for your help.