2008 Jan 17 2:00 AM
Dear all,
I need to print out a report of PO data. need to print out the text from Info record note (like the picture shown below) in ME23, how should I pull that field and display out?
I need the solution urgently. Hope experts can help.
Thank you very much.
[http://img293.imageshack.us/img293/238/inforecordnd1.png]
2008 Jan 17 2:55 AM
Hi,
We can extract texts using FM: READ_TEXT and then use them in the program to display/print.
To the determine the parameters for determining the text, do as below:
1. Take an existing document.
2. Go to Texts.
3. Double click on the required text, which takes us to the editor.
4. In editor, use menupath Goto->Header
5. Here we find the parameters like Text Name, Language, Text ID and Text Object. These are the parameters required for FM: READ_TEXT.
Observer the pattern of Text Name, for PO items it can be PO Number + Item Number.
Use the same pattern for each PO and use the same in the program.
Hope the above info gives you lead...
Kind Regagrds
Eswar
2008 Jan 17 2:55 AM
Hi,
We can extract texts using FM: READ_TEXT and then use them in the program to display/print.
To the determine the parameters for determining the text, do as below:
1. Take an existing document.
2. Go to Texts.
3. Double click on the required text, which takes us to the editor.
4. In editor, use menupath Goto->Header
5. Here we find the parameters like Text Name, Language, Text ID and Text Object. These are the parameters required for FM: READ_TEXT.
Observer the pattern of Text Name, for PO items it can be PO Number + Item Number.
Use the same pattern for each PO and use the same in the program.
Hope the above info gives you lead...
Kind Regagrds
Eswar
2008 Jan 17 3:32 AM
Hi,
I never use read text function module before, can you please write a sample code to let me refer?
The text field will be like what the picture show. I need to pull out the data from the field RM06E-LTEX1 and print it into 2 column.. 1 of the column print 'Y' .. another column print 'active'.
Is that possible to make it?
[http://img237.imageshack.us/img237/13/inforecordnotedr1.png]
2008 Jan 17 3:57 AM
Please check below sample code:
PARAMETERS: p_ebeln TYPE ebeln OBLIGATORY.
TYPES: BEGIN OF ty_ekpo,
ebeln TYPE ebeln,
ebelp TYPE ebelp,
END OF ty_ekpo.
DATA: i_ekpo TYPE TABLE OF ty_ekpo,
wa_ekpo TYPE ty_ekpo.
DATA: l_name TYPE tdobname,
i_tline TYPE TABLE OF tline,
wa_tline TYPE tline.
CONSTANTS: c_id TYPE tdid VALUE 'F02',
c_object TYPE tdobject VALUE 'EKPO'.
AT SELECTION-SCREEN.
SELECT SINGLE ebeln INTO p_ebeln
FROM ekko
WHERE ebeln = p_ebeln.
IF sy-subrc NE 0.
MESSAGE e001(00) WITH 'Enter valid PO Number'.
ENDIF.
START-OF-SELECTION.
SELECT ebeln ebelp INTO TABLE i_ekpo
FROM ekpo
WHERE ebeln = p_ebeln.
LOOP AT i_ekpo INTO wa_ekpo.
CONCATENATE wa_ekpo-ebeln wa_ekpo-ebelp
INTO l_name.
CALL FUNCTION 'READ_TEXT'
EXPORTING
id = c_id
language = sy-langu
name = l_name
object = c_object
TABLES
lines = i_tline
EXCEPTIONS
id = 1
language = 2
name = 3
not_found = 4
object = 5
reference_check = 6
wrong_access_to_archive = 7
OTHERS = 8.
IF sy-subrc EQ 0.
LOOP AT i_tline INTO wa_tline.
WRITE:/ wa_tline-tdline.
" Format wa_tline-tdline in the way you need to print out
ENDLOOP.
ENDIF.
ENDLOOP.
Regards
Eswar