06-20-2007 1:45 PM
Hi!
How do i get the textpool from a method? For reports i know its
"Read textpool prog into itab language lan."
but what do I have to use for 'prog' to get method-textpools? I tried the method-name and class->method but nothing worked an i can´t find anything about it!
thank you!!
Andreas
Message was edited by:
Andreas Buchmeier
06-20-2007 2:42 PM
Hi, I've looked into your problem, and it appears to me, that the text elements are not stored at the method level but at the class level, see this example program which tries to retrieve from both the class level as well as the method level, only the class level works.
REPORT zrich_001.
DATA includename TYPE program.
DATA class_name TYPE seoclsname.
DATA: comp TYPE seocpdkey.
DATA: itext TYPE TABLE OF textpool.
DATA: xtext LIKE LINE OF itext.
* At class level.
clear itext.
class_name = 'CL_GUI_FRONTEND_SERVICES'.
includename = cl_oo_classname_service=>get_classpool_name( class_name ).
READ TEXTPOOL includename INTO itext.
LOOP AT itext INTO xtext.
WRITE:/ xtext-id, xtext-key, xtext-entry, xtext-length.
ENDLOOP.
* At method level
clear itext.
comp-clsname = 'CL_GUI_FRONTEND_SERVICES'.
comp-cpdname = 'FILE_OPEN_DIALOG'.
includename = cl_oo_classname_service=>get_method_include( comp ).
READ TEXTPOOL includename INTO itext.
LOOP AT itext INTO xtext.
WRITE:/ xtext-id, xtext-key, xtext-entry, xtext-length.
ENDLOOP.
And you can see this in SE24, go to the class CL_GUI_FRONTEND_SERVICES and then to the method FILE_OPEN_DIALOG, then choose text elements from the main menu, notice that it appears to take you to a screen which is only associated with the class name and not the method name.
Regards,
Rich Heilman
06-20-2007 2:42 PM
Hi, I've looked into your problem, and it appears to me, that the text elements are not stored at the method level but at the class level, see this example program which tries to retrieve from both the class level as well as the method level, only the class level works.
REPORT zrich_001.
DATA includename TYPE program.
DATA class_name TYPE seoclsname.
DATA: comp TYPE seocpdkey.
DATA: itext TYPE TABLE OF textpool.
DATA: xtext LIKE LINE OF itext.
* At class level.
clear itext.
class_name = 'CL_GUI_FRONTEND_SERVICES'.
includename = cl_oo_classname_service=>get_classpool_name( class_name ).
READ TEXTPOOL includename INTO itext.
LOOP AT itext INTO xtext.
WRITE:/ xtext-id, xtext-key, xtext-entry, xtext-length.
ENDLOOP.
* At method level
clear itext.
comp-clsname = 'CL_GUI_FRONTEND_SERVICES'.
comp-cpdname = 'FILE_OPEN_DIALOG'.
includename = cl_oo_classname_service=>get_method_include( comp ).
READ TEXTPOOL includename INTO itext.
LOOP AT itext INTO xtext.
WRITE:/ xtext-id, xtext-key, xtext-entry, xtext-length.
ENDLOOP.
And you can see this in SE24, go to the class CL_GUI_FRONTEND_SERVICES and then to the method FILE_OPEN_DIALOG, then choose text elements from the main menu, notice that it appears to take you to a screen which is only associated with the class name and not the method name.
Regards,
Rich Heilman