cancel
Showing results for 
Search instead for 
Did you mean: 

abap-hr

Former Member
0 Kudos

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?.

Accepted Solutions (0)

Answers (1)

Answers (1)

Former Member
0 Kudos

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.

Former Member
0 Kudos

I need to know the parameters of the function module hr_ecm_read_text_infotype especially regarding the table in which the text need to pass on and how to display it to the screen with already set displaying fields....