Skip to Content
0
Former Member
Apr 09, 2012 at 10:45 AM

Not able to insert comment for 0019 infotype

138 Views

Hi ,

I am facing a problem. I have a requirement where i have to insert a task in 0019 infotype. I am using HR_INFOTYPE_OPERATION FM to insert record in infotype 0019. And then using the key values of the record, I am Exporting the text to cluster table PCL1. I am able to see a new record being created in the PCL1 table. But when i go to transaction PA30 and display the 0019 infotype for that pernr i am not able to see the comment. Below is the code i am using . Please let me know where i am wrong.

(Note: in HR_INFOTYPE_OPERATION i am passing the itxex field value as 'X' but in PA0019 it is not setting the field so i have used update command to set the field ITXEX to 'X')

CALL FUNCTION 'HR_INFOTYPE_OPERATION'
EXPORTING
INFTY = '0019'
NUMBER = ls_0019-pernr
SUBTYPE = ls_0019-subty
OBJECTID = ls_0019-objps
VALIDITYEND = ls_0019-endda
VALIDITYBEGIN = ls_0019-begda
RECORDNUMBER = ls_0019-seqnr
RECORD = ls_0019
OPERATION = 'INS'
IMPORTING
RETURN = RETURN3
KEY = KEY3.

Update pa0019 set itxex = 'X' where Pernr = ls_0019-pernr AND subty = ls_0019-subty
AND objps = ls_0019-objps AND SPRPS = ls_0019-sprps
AND ENDDA = ls_0019-endda AND BEGDA = ls_0019-begda
AND seqnr = ls_0019-seqnr.

" Save Comment field
CLEAR: text_version,
line,
tx_key.
REFRESH lt_ptext.
tx_key-pernr = ls_0019-pernr.
tx_key-infty = ls_0019-pernr.
tx_key-subty = ls_0019-subty.
tx_key-OBJPS = ls_0019-OBJPS.
tx_key-SPRPS = ls_0019-SPRPS.
tx_key-endda = ls_0019-endda.
tx_key-begda = ls_0019-begda.
tx_key-SEQNR = ls_0019-seqnr.
text_version-nummer = '00'.
pcl1-histo = 'X'.
pcl1-uname = SY-UNAME.
pcl1-aedtm = SY-DATUM.


EXPORT text_version FROM text_version
ptext FROM lt_ptext
TO DATABASE pcl1(tx) FROM pcl1
ID tx_key
.