‎2009 Mar 13 10:30 AM
Hi Guru's,
I've a problem with Read_Text when i try to extract the Overview Text. The SELECT from STHX fails, the parameters are correct but in the STHX the record there isn't.
I notice that in the ME23 , Item -> Text -> Text Overview , in 'Material PO Text' in the Status, there is this symbol ' * ', it is possible that this symbol is a problem when using the Read_Text FM ?
Are there any anothers idea or solution for this problem ?
Regards.
Angelo.
‎2009 Mar 13 10:38 AM
HI,
Kindly go through this below sample code:
TABLES: PBIM.
* stxh, stxl, stxb - trans tables for text
* ttxit - text on text-ids
* ttxot - Short texts on text objects
* Transaction MD63
SELECT-OPTIONS: S_MATNR FOR PBIM-MATNR,
S_WERKS FOR PBIM-WERKS.
DATA: BEGIN OF HTEXT.
INCLUDE STRUCTURE THEAD.
DATA: END OF HTEXT.
DATA: BEGIN OF LTEXT OCCURS 50.
INCLUDE STRUCTURE TLINE.
DATA: END OF LTEXT.
DATA: BEGIN OF DTEXT OCCURS 50.
DATA: MATNR LIKE PBIM-MATNR.
INCLUDE STRUCTURE TLINE.
DATA: END OF DTEXT.
DATA: TNAME LIKE THEAD-TDNAME.
SELECT * FROM PBIM WHERE WERKS IN S_WERKS.
MOVE PBIM-BDZEI TO TNAME.
CALL FUNCTION 'READ_TEXT'
EXPORTING
* CLIENT = SY-MANDT
ID = 'PB'
LANGUAGE = 'E'
NAME = TNAME
OBJECT = 'PBPT'
* ARCHIVE_HANDLE = 0
IMPORTING
HEADER = HTEXT
TABLES
LINES = LTEXT
EXCEPTIONS
ID = 1
LANGUAGE = 2
NAME = 3
NOT_FOUND = 4
OBJECT = 5
REFERENCE_CHECK = 6
WRONG_ACCESS_TO_ARCHIVE = 7
OTHERS = 8.
LOOP AT LTEXT.
IF LTEXT-TDLINE NE ''.
MOVE LTEXT-TDLINE TO DTEXT-TDLINE.
MOVE PBIM-MATNR TO DTEXT-MATNR.
APPEND DTEXT.
ENDIF.
ENDLOOP.
ENDSELECT.
LOOP AT DTEXT.
WRITE:/ DTEXT-MATNR, DTEXT-TDLINE.
ENDLOOP.
To find the Text id these are the following steps. Let us take an example of Billing document Header text.
1. goto VF03, enter Billing doc Number
2. from menuselect Goto>Header-->header Text..... New window will be displayed
3. select the Header Text. here you can see all the text.
4. click on the TEXT (which you want to know the Text id) , then press log ICON (you can find in bottom right of the text window) it looks like a rolled paper.
5. in the Next window you will find Text Name. Text ID, Language. etc...
Hope it helps
Regrds
Mansi
‎2009 Mar 13 10:42 AM
Hi
It could be possible that the Text that your are seeing in ME23n is really existing under a different TEXT ID, i.e. the text might be a reference text from another document.
As described above, you can find the correct parameters of the TEXT and then use these in READ_TEXT.
Cheers
Ravish
‎2009 Mar 13 10:51 AM
In me23 the parameters for READ_TEXT are correct.
In ME23 :
573000011500010
IT
F03
EKPO
The same for READ_TEXT but fails when try to extract text, i think that the problem isn't in the code but it is in the customizing.
‎2009 Mar 13 10:57 AM
Hi,
Can u post ur code?
In ME23N u might be looking english text. Just check whether parameters in ME23N and READ_TEXT are matching or not. Leading zeros also matters.
Thanks,
Vinod.
‎2009 Mar 13 11:08 AM
VA_EBELN = '573000011500010'.
CALL FUNCTION 'READ_TEXT_INLINE'
EXPORTING
ID = 'F03'
INLINE_COUNT = '1'
LANGUAGE = 'I'
NAME = VA_EBELN
OBJECT = 'EKPO'
* IMPORTING
* HEADER =
TABLES
INLINES = TB_LINE
LINES = TB_LINE1
EXCEPTIONS
ID = 1
LANGUAGE = 2
NAME = 3
NOT_FOUND = 4
OBJECT = 5
REFERENCE_CHECK = 6
OTHERS = 7.
IF SY-SUBRC EQ '0'.
LOOP AT TB_LINE1.
MOVE TB_LINE1-TDLINE TO TB_TESTO-TDLINE.
MOVE TB_EKPO-EBELP TO TB_TESTO-EBELP.
APPEND TB_TESTO.
ENDLOOP.
FREE TB_LINE1.
CLEAR TB_TESTO.
ENDIF.
I've debugged the read text in ME23, and compare with this, the difference is that in ME23 make an IMPORT CATALOG FROM MEMORY ID 'SAPLSTXD' that not fails.
In the code above this import fails.
‎2009 Mar 13 11:26 AM
Hi,
Did u try the same in SE37???
I am thinking that some of the parameters u r passing must be wrong. Just try to compare ME23N=>Select texts tab for that item, Select script editor in drop down list(Option 3) (Bottom side).
Menu=>goto=>Header. Compare if there is any descripency.
I can see its working in my system.
Also instead of hard coding try to declare variables/constants of same type as FM interface.
Thanks,
Vinod.
‎2009 Mar 13 11:47 AM
The parameters is correct :
http://www.pchs.it/image-hosting/out.php/i5893_Immagine.JPG.
The variables are already declared like type of FM interfaces.
Is a strange problem 😕
‎2009 Mar 13 11:55 AM
Hi,
In text ID r u passing F03 or FO3?
It should be F03(F zero 3). Copy paste all parameters from ME23N into ur code.
Can you check it carefully? Also just remove hard coding and see. It really don't matter. But still u can give a try. Apart from this i dont see any descrepency.
Thanks,
Vinod.
‎2009 Mar 13 12:52 PM
Angelo,
check the language key.
check if you have text maintained in the same langauage as you are passing it to FM.
‎2009 Mar 13 1:23 PM
For Vinod Reddy: Yes, F zero 3 is the same of function.
For santosh sarda: The language is Italian and the text work in italian language.
The unique difference that i've seen from another PO is this :
http://www.pchs.it/image-hosting/out.php/i5903_Immagine3.JPG
I don't know how to change this status ' * '. Another PO work fine with blank status.
‎2009 Mar 13 1:27 PM
‎2009 Mar 13 1:31 PM
Is the same, i've tryed using READ_TEXT, however inside READ_TEXT_INLINE there is READ_TEXT .
‎2009 Mar 13 1:37 PM
what is the sy-subrc value you are getting after FM execution. try to map it with exception and see where the error is.
also test it with another PO so you will come to know if this the problem with that perticular PO only.
‎2009 Mar 13 1:46 PM
The sy-subrc exception is refered to NOT_FOUND. I don't know if there is a aparticular PO that have problem with the READ_TEXT, the problem is trange because when i set a breakpoint into READ_TEXT and when I run me23 in debug the READ_TEXT work fine because the CATALOG(Internal Structure) is FILLED from IMPORT CATALOG FROM MEMORY ID 'SAPLSTXD'.
In custom program this don't happen because this IMPORT fail.