‎2017 Nov 02 1:20 PM
I have managed to make the READ_TEXT FM work only for one cID at a time on multiple calls of function read_text(for example I found out how to access it for cID = 'GRUN' cObject = 'MATERIAL'. Can anyone advise how to connect read_text function so that inspection text(cID = 'GRUN' cObject = 'MATERIAL') will be dispalyed in my alv grid on the same line with material details? Please see below output when running my program:

FORM READTEXT.
data: it_MVKE type standard table of MVKE initial size 0.
data: lMVKE like MVKE, lMAKT like MAKT, lT002 like T002 ,
lTDNAME like THEAD-TDNAME,"text header
it_TLINE type standard table of TLINE,
wa_TLINE type TLINE.
data: cObject(10) type c, cID(4) type c.
select MATNR from MARA into corresponding fields of table it_MVKE
where MATNR in Material order by MATNR.
cID = 'GRUN'. cObject = 'MATERIAL'. "Text date principale "
loop at it_MVKE into lMVKE.
lTDNAME = lMVKE-MATNR.
select spras from T002 into lT002.
CALL FUNCTION 'READ_TEXT'
EXPORTING
CLIENT = SY-MANDT
ID = cID
LANGUAGE = lT002-SPRAS
NAME = lTDNAME
OBJECT = cObject
TABLES
LINES = it_TLINE
EXCEPTIONS
ID = 1
OTHERS = 8.
IF SY-SUBRC EQ 0.
select single * from MAKT into lMAKT where MATNR eq lMVKE-MATNR
and SPRAS eq lT002-SPRAS.
LOOP AT it_TLINE INTO wa_TLINE.
wa_join-TEXTPRI = wa_TLINE-TDLINE.
append wa_join to lt_join.
clear wa_join.
ENDLOOP.
ENDIF.
ENDSELECT.
ENDLOOP.
ENDFORM.
‎2017 Nov 02 4:03 PM
And which is the problem you are facing?
i do not see anything difficult in it, just a really wrong code structure from my point of view.
‎2017 Nov 03 6:01 AM
Dear Simone,
I need to display in my alv at the same time cID = PRUE ,cID =0001, cID = IVER .At the moment i can make it work only individually.
‎2017 Nov 03 6:55 AM
‎2017 Nov 03 7:08 AM
‎2017 Nov 03 1:16 PM
Hi Raymond , in the mean time i found some other way of doing it as i understand that i cannot do multiple calls on ID. Please find below,trouble is that i get an message error on line : w_stxl_raw-clustr = <stxl>-clustr saying : Fields <STXL>-CLUSTR is unknown. It is neither in one of the specified tables nor defined by a " DATA" statement
data: it_MVKE type standard table of MVKE initial size 0.
data: lMVKE like MVKE, lMAKT like MAKT, lT002 like T002,
lTDNAME like THEAD-TDNAME,
it_TLINE type standard table of TLINE,
wa_TLINE type TLINE, lText type string.
types: begin of i_Report,
MATNR(18) type c,
MAKTX like MAKT-MAKTX,
VKORG(5) type c,
VTWEG(5) type c,
SPRAS(2) type c,
Text type string,
end of i_Report.
data: wa_Report type i_Report,
it_Report type standard table of i_Report initial size 0.
data: cID(4) type c, cObject(10) type c.
types: begin of cids,
cid(4) type c,
cobject(10) type c,
lTDNAME(70) TYPE c,
end of cids.
data: wa_cids type cids.
data: it_cids type standard table of cids.
TYPES: BEGIN OF ty_stxl_raw,
clustr TYPE stxl-clustr,
clustd TYPE stxl-clustd,
END OF ty_stxl_raw,
BEGIN OF ty_stxl,
tdname TYPE stxl-tdname,
clustr TYPE stxl-clustr,
clustd TYPE stxl-clustd,
END OF ty_stxl.
DATA: t_stxl_raw TYPE STANDARD TABLE OF ty_stxl_raw,
t_stxl TYPE TABLE OF ty_stxl,
w_stxl_raw TYPE ty_stxl_raw.
DATA: t_tline TYPE STANDARD TABLE OF tline.
FIELD-SYMBOLS: <tline> TYPE tline,
<stxl> LIKE LINE OF t_stxl.
wa_cids-cid = 'GRUN'.
wa_cids-cobject = 'MATERIAL'.
append wa_cids to it_cids.
if cID = '0001'.
concatenate lMVKE-MATNR lMVKE-VKORG lMVKE-VTWEG into wa_cids-lTDNAME.
else.
lTDNAME = lMVKE-MATNR.
endif.
append wa_cids to it_cids.
SELECT l~tdname l~clustr l~clustd
INTO CORRESPONDING FIELDS OF TABLE t_stxl
FROM stxl AS l
JOIN stxh AS h
ON h~tdobject = l~tdobject
AND h~tdname = l~tdname
AND h~tdid = l~tdid
FOR ALL ENTRIES in it_cids
WHERE l~relid = 'TX' "standard text
AND h~tdobject = it_cids-cobject
AND h~tdname = it_cids-lTDNAME
AND h~tdid = it_cids-cid
AND l~tdspras = sy-langu.
LOOP AT t_stxl ASSIGNING <stxl>.
CLEAR: t_stxl_raw[], t_tline[].
w_stxl_raw-clustr = <stxl>-clustr.
w_stxl_raw-clustd = <stxl>-clustd.
APPEND w_stxl_raw TO t_stxl_raw.
IMPORT tline = t_tline FROM INTERNAL TABLE t_stxl_raw.
LOOP AT t_tline ASSIGNING <tline>.
wa_Report-TEXT = <tline>-TDLINE.
append wa_Report to it_Report.
ENDLOOP.
ENDLOOP.
ENDFORM.
‎2017 Nov 03 4:51 PM
The code is rather unreadable, sorry (could you possibly change formatting?). But I don't see <stxl> assigned, so could that be a problem?
‎2017 Nov 06 6:41 AM
‎2017 Nov 06 7:14 AM
Dear Jelena,
Thank you for your answer.You were right i didn`t declared <stxl> . i have declared it now and i don`t get any errors but my program doesn`t do what is expected regarding this function.
‎2017 Nov 06 10:07 AM
I have , please see below:
LOOP AT t_stxl ASSIGNING <stxl>.
CLEAR: t_stxl_raw[], t_tline[].
w_stxl_raw-clustr = <stxl>-clustr.
w_stxl_raw-clustd = <stxl>-clustd.
APPEND w_stxl_raw TO t_stxl_raw.
IMPORT tline = t_tline FROM INTERNAL TABLE t_stxl_raw.
LOOP AT t_tline ASSIGNING <tline>.
wa_Report-TEXT = <tline>-TDLINE.
append wa_Report to it_Report.
ENDLOOP.
ENDLOOP.
‎2017 Nov 06 12:39 PM
(your posted source is hardly readable...)
You cannot use the import TLINE with two mixed set of lines, the IMPORT should be in the LOOP in a AT END OF step, internal table refreshed in the AT NEW)
LOOP AT t_stxl ASSIGNING <stxl>.
" New text
AT NEW tdid.
REFRESH: t_stxl_raw, t_tline.
ENDAT.
" > your current code to fill t_stxl_raw goes here
" End of a text
AT END OF tdid.
IMPORT tline = t_tline FROM INTERNAL TABLE t_stxl_raw.
LOOP AT t_tline ASSIGNING <tline>.
" > Your current code to add report records goes here
ENDLOOP.
ENDAT.
ENDLOOP.
‎2017 Nov 06 12:51 PM
Hi Raymond,
Thank you , i`ve made the modifications advised and i get the error: "No component exists with the name "TDID"."
‎2017 Nov 06 12:53 PM
‎2017 Nov 06 1:17 PM
"Declared and selected as below , still doesn`t do nothing
TYPES: BEGIN OF ty_stxl_raw,
clustr TYPE stxl-clustr,
tdid TYPE stxl-tdid,
clustd TYPE stxl-clustd,
END OF ty_stxl_raw,
BEGIN OF ty_stxl,
tdname TYPE stxl-tdname,
tdid TYPE stxl-tdid,
clustr TYPE stxl-clustr,
clustd TYPE stxl-clustd,
END OF ty_stxl.
SELECT l~tdid l~tdname l~clustr l~clustd
INTO CORRESPONDING FIELDS OF TABLE t_stxl
FROM stxl AS l
JOIN stxh AS h
ON h~tdobject = l~tdobject
AND h~tdname = l~tdname
AND h~tdid = l~tdid
FOR ALL ENTRIES in it_cids
WHERE l~relid = 'TX' "standard text
AND h~tdobject = it_cids-cobject
AND h~tdname = it_cids-lTDNAME
AND h~tdid = it_cids-cid
AND l~tdspras = sy-langu.
LOOP AT t_stxl ASSIGNING <stxl>.
"New text
AT NEW tdid.
REFRESH: t_stxl_raw, t_tline.
ENDAT.
"> your current code to fill t_stxl_raw goes here
"End of a text
AT END OF tdid.
IMPORT tline = t_tline FROM INTERNAL TABLE t_stxl_raw.
LOOP AT t_tline ASSIGNING <tline>.
"> Your current code to add report records goes here
ENDLOOP.
ENDAT.
ENDLOOP.
‎2017 Nov 06 1:29 PM
‎2017 Nov 06 1:47 PM
Hi Giuseppi,
I am confused , at the beginning i wanted to use read_text, then i searched for READ_MULTIPLE_TEXTS .Now i found this partial code on which i am confused. Please tell me what do you mean by :1 .Your current code to add report records goes here and
2:Your current code to add report records goes here. Sorry to be a pain:(
‎2017 Nov 06 1:52 PM
‎2017 Nov 06 1:53 PM
Hi, i think is like this,but it doesn`t show up nothing on screen,thank you :
LOOP AT t_stxl ASSIGNING <stxl>.
* New text
AT NEW tdid.
REFRESH: t_stxl_raw, t_tline.
ENDAT.
CLEAR: t_stxl_raw[], t_tline[].
w_stxl_raw-clustr = <stxl>-clustr.
w_stxl_raw-clustd = <stxl>-clustd.
APPEND w_stxl_raw TO t_stxl_raw.
* End of a text
AT END OF tdid.
IMPORT tline = t_tline FROM INTERNAL TABLE t_stxl_raw.
LOOP AT t_tline ASSIGNING <tline>.
* > Your current code to add report records goes here
wa_Report-TEXT = <tline>-TDLINE.
append wa_Report to it_Report.
ENDLOOP.
ENDAT.
ENDLOOP.<br>
‎2017 Nov 06 2:17 PM
‎2017 Nov 06 2:27 PM
‎2017 Nov 07 11:50 AM
Dear Raymond, i think i will stick with read_text or read_multiple_text.Do you have any example for read_text or read_multiple_text for which i could read more multiple ID on all languages maintained?
‎2017 Nov 06 9:10 AM