on 11-02-2007 10:01 AM
In p2001(abscences) when we create records for an employee there is an option called free text. How to extract this text in to a field to display on to the output screen from a report using a function module hr_ecm_read_text_infotype?.
Hi,
In the infotype (change mode), if you press F9 button, it will get you to the free text screen.
The following code works fine to get the text from infotype.
FORM GET_NOTES_OF_AN_INFOTYPE
USING MINFTY MSUBTY MPERNR MBEGDA MENDDA MSEQNR.
DATA: TX-KEY LIKE PSKEY.
DATA: BEGIN OF TEXT-VERSION,
NUMMER TYPE X VALUE '02',
END OF TEXT-VERSION.
DATA: BEGIN OF PTEXT OCCURS 200.
DATA: LINE(78).
DATA: END OF PTEXT.
DATA : IS_FIRST TYPE I .
DATA : LINES_OF_NOTES TYPE I .
--------------------------------------
Preparing Key for Reading Texts of
Infotype
--------------------------------------
CLEAR TX-KEY .
CLEAR: PTEXT .
REFRESH: PTEXT .
TX-KEY-PERNR = MPERNR .
TX-KEY-INFTY = MINFTY .
TX-KEY-SUBTY = MSUBTY .
TX-KEY-ENDDA = MENDDA .
TX-KEY-BEGDA = MBEGDA .
TX-KEY-SEQNR = MSEQNR .
--------------------------------------
READING CLUSTER TX - (Texts)
--------------------------------------
IMPORT TEXT-VERSION
PTEXT
FROM DATABASE PCL1(TX)
ID TX-KEY
USING PCL1_EXP_IMP(SAPFP50P) .
IF SY-SUBRC NE 0 .
CLEAR: TEXT-VERSION .
CLEAR: PTEXT .
REFRESH: PTEXT .
SY-SUBRC = 4 .
ENDIF .
--------------------------------------
Writing texts retrieved
--------------------------------------
DESCRIBE TABLE PTEXT LINES LINES_OF_NOTES .
IF LINES_OF_NOTES GT 0 .
IS_FIRST = 1 .
LOOP AT PTEXT .
T_EMPLOYEE-REMARKS = PTEXT-LINE.
MODIFY T_EMPLOYEE TRANSPORTING REMARKS.
ENDLOOP.
ENDIF.
ENDFORM.
Hope this helps.
Reward if this helps you.
Regards,
Subbu.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
103 | |
12 | |
11 | |
6 | |
5 | |
4 | |
3 | |
3 | |
3 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.