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

Saving/Creating InfoType Text

Former Member
0 Likes
2,138

I am using BAPI_HRMASTER_SAVE_REPL_MULT to create some new infotype records for Actions (Infotype 0000) and Org (InfoType 0001) and I also want to be able to create some text for Infotype 0000. If you were doing this manually you would press F9 in the PA30 Actions Screen.

READ_TEXT AND SAVE_TEXT function modules will not work for Infotypes. There is HR_ECM_READ_TEXT_INFOTYPE which allows me to read infotype text, but I cannot find any function module to create/save new text. I have read some of the various posts on this topic but cannot get anything to work. Does anyone know of a function module that will allow me to save text for various infotypes or can someone send me a complete set of simple code that I could use? thx in Advance ... points will be rewarded.

1 ACCEPTED SOLUTION
Read only

suresh_datti
Active Contributor
0 Likes
764

try this..a quick & dirty one.. may be you can fine tune it.. the Infotype record must exist.. only then you will be able to maintain the texts..

report  zp_pa_0019_save_notes                    .
tables:
 pernr.
infotypes:
 0019.
data:  key like pskey.
data: begin of ptext occurs 200.
data:   line(72).
data: end of ptext.
selection-screen begin of block abc with frame title text-001.
parameters:
               p_pernr like pernr-pernr.
selection-screen end of block abc.
ptext-line = 'Test Text1'.
append ptext.
ptext-line = 'Test Text2'.
append ptext.
ptext-line = 'Test Text3'.
append ptext.
rp-read-infotype p_pernr 0019 p0019 '18000101' '99991231'.
sort p0019 descending.
read table p0019 index 1.
move-corresponding p0019 to key.
p0019-itxex = 'X'.
update pa0019 set itxex = 'X'
              where pernr = p_pernr.
export ptext to database pcl1(tx) id key.
commit work.

~Suresh

2 REPLIES 2
Read only

suresh_datti
Active Contributor
0 Likes
765

try this..a quick & dirty one.. may be you can fine tune it.. the Infotype record must exist.. only then you will be able to maintain the texts..

report  zp_pa_0019_save_notes                    .
tables:
 pernr.
infotypes:
 0019.
data:  key like pskey.
data: begin of ptext occurs 200.
data:   line(72).
data: end of ptext.
selection-screen begin of block abc with frame title text-001.
parameters:
               p_pernr like pernr-pernr.
selection-screen end of block abc.
ptext-line = 'Test Text1'.
append ptext.
ptext-line = 'Test Text2'.
append ptext.
ptext-line = 'Test Text3'.
append ptext.
rp-read-infotype p_pernr 0019 p0019 '18000101' '99991231'.
sort p0019 descending.
read table p0019 index 1.
move-corresponding p0019 to key.
p0019-itxex = 'X'.
update pa0019 set itxex = 'X'
              where pernr = p_pernr.
export ptext to database pcl1(tx) id key.
commit work.

~Suresh

Read only

0 Likes
764

Fantastic. This worked perfectly and it is simple. thx so much ... points are rewarded.