We have added search box. Key in SAP issue keyword to search
TopBottom

Announcement: wanna exchange links? contact me at sapchatroom@gmail.com.

[sap-dev] Retrieve Multiple Long Text Through Function read_text

Posted by Admin at
Share this post:
Ma.gnolia DiggIt! Del.icio.us Yahoo Furl Technorati Reddit

Question from dragospirnut on Nov 9 at 8:35 AM
I`ve been searching last days for how to call function read_text for multiple cID.Does anybody know how to do this for the code below: Thank you for your support. Now it works only when : cID = 'GRUN'. cObject = 'MATERIAL' and lTDNAME = lMVKE-MATNR. in know that function read_text can be called multiple times. Please advise

data: it_MVKE type standard table of MVKE initial size 0.

data: lMVKE like MVKE, lMAKT like MAKT, lT002 like T002 ,"lSTXL like STXL,
lTDNAME like THEAD-TDNAME,"text header

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,
"tdid type c,
end of i_Report.

data: wa_Report type i_Report,
it_Report type standard table of i_Report initial size 0.
data: cObject(10) type c, cID(4) type c.

types: begin of cids,
cid(4) type c,
cobject(10) type c,
end of cids.

data: wa_cids type cids.
data: it_cids type standard table of cids.

wa_cids-cid = 'GRUN'.
wa_cids-cobject = 'MATERIAL'.

append wa_cids to it_cids.



IF cID = '0001'. cObject = 'MVKE'.
select * from MVKE into table it_MVKE
where MATNR in Material." AND
VKORG IN UnitLog.

ELSE.
select MATNR from MARA into corresponding fields of table it_MVKE
where MATNR in Material order by MATNR.
cID = 'PRUE'. cObject = 'MATERIAL'. "Text verificare


select MATNR from MARA into corresponding fields of table it_MVKE
##too_many_itab_fields
where MATNR in Material order by MATNR.
cID = 'GRUN'. cObject = 'MATERIAL'. "Basic View Text -text date principale "

endif.

wa_Report-MATNR = 'MATNR'.
wa_Report-MAKTX = 'MAKTX'.
wa_Report-VKORG = 'VKORG'.
wa_Report-VTWEG = 'VTWEG'.
wa_Report-SPRAS = 'SPRAS'.
wa_Report-Text = 'Text'.
append wa_Report to it_Report.




"https://archive.sap.com/discussions/thread/2084953
loop at it_MVKE into lMVKE.
if cID = '0001'. cObject = 'MVKE'.
"concatenate lMVKE-MATNR lMVKE-VKORG lMVKE-VTWEG into lTDNAME.
else.
lTDNAME = lMVKE-MATNR.
endif.
select spras from T002 into lT002. "where WERKS in Unitlog."SPRAS in s_SPRAS.


loop at it_cids into wa_cids.

cID = 'GRUN'. cObject = 'MATERIAL'. "Basic View Text -text date principale

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.

ENDLOOP.

IF SY-SUBRC EQ 0.
select single * from MAKT into lMAKT where MATNR eq lMVKE-MATNR.
select single * from MAKT into lMAKT where MATNR eq lMVKE-MATNR
and SPRAS eq lT002-SPRAS. "p_SPRAS.

wa_Report-MATNR = lMVKE-MATNR.
wa_Report-MAKTX = lMAKT-MAKTX.
wa_Report-VKORG = lMVKE-VKORG.
wa_Report-VTWEG = lMVKE-VTWEG.
wa_Report-SPRAS = lT002-SPRAS. "p_SPRAS.
"wa_report-tdid = lSTXL-tdid.
LOOP AT it_TLINE INTO wa_TLINE.
wa_Report-TEXT = wa_TLINE-TDLINE.
append wa_Report to it_Report.
ENDLOOP.
ENDIF.
"endselect.
endloop.
loop at it_Report into wa_Report.
write: / wa_Report-MATNR, wa_Report-MAKTX,
wa_Report-VKORG, wa_Report-VTWEG, wa_Report-SPRAS, wa_Report-Text.
endloop.
 
Reply to this email to post your response.
 
__.____._
Manage Settings | Unsubscribe | Create FAQ | Send Feedback
  
© 2017 Ziff Davis, LLC. and message author.
Ziff Davis, LLC. 28 E 28th Street New York, NY 10016
dragospirnut  
 
View this online
Ask a new question
 
In the Spotlight
Have a technical question? Need to find IT solutions? Ask your peers in the Toolbox for IT community.

_.____.__

0 comments:

Post a Comment

T r a n s l a t e to your language