‎2006 Sep 07 6:54 PM
hi all,
first i need to know in wich table is the long description of a material, i looked in the makt but only has the short description. i found in the mm03 if i look my material that is 111 and i select the tab sales text has a text box where is the description of the material. can anybody helpe telling me where is that value storaged?
‎2006 Sep 07 7:02 PM
Please see the following program, this is how you will get the text. You need to concatenate the material number with the sales org and distribution channel, this is your NAME, the object is MVKE and the id is 0001.
report zrich_0001.
data: name type thead-tdname.
data: lines type table of TLINE with header line.
parameters: p_matnr type mvke-matnr,
p_vkorg type mvke-vkorg,
p_vtweg type mvke-vtweg.
concatenate p_matnr p_vkorg p_vtweg into name.
call function 'READ_TEXT'
exporting
id = '0001'
language = sy-langu
name = name
object = 'MVKE'
tables
lines = lines
EXCEPTIONS
ID = 1
LANGUAGE = 2
NAME = 3
NOT_FOUND = 4
OBJECT = 5
REFERENCE_CHECK = 6
WRONG_ACCESS_TO_ARCHIVE = 7
OTHERS = 8.
loop at lines.
write:/ lines-tdline.
endloop.
Regards,
Rich Heilman
‎2006 Sep 07 6:55 PM
‎2006 Sep 07 7:02 PM
‎2006 Sep 07 7:04 PM
For sales text, I believe you'll find your data using:
TDOBJECT = 'MVKE'
TDNAME = concatenate of MATNR, VKORG, VTWEG
TDID = usually '0001', but could be different depending on your system.
TDSPRAS = language
These correspond to OBJECT, NAME, ID, LANGUAGE in the READ_TEXT function.
You can verify that the record exists by looking at STXH.
‎2006 Sep 07 7:02 PM
Please see the following program, this is how you will get the text. You need to concatenate the material number with the sales org and distribution channel, this is your NAME, the object is MVKE and the id is 0001.
report zrich_0001.
data: name type thead-tdname.
data: lines type table of TLINE with header line.
parameters: p_matnr type mvke-matnr,
p_vkorg type mvke-vkorg,
p_vtweg type mvke-vtweg.
concatenate p_matnr p_vkorg p_vtweg into name.
call function 'READ_TEXT'
exporting
id = '0001'
language = sy-langu
name = name
object = 'MVKE'
tables
lines = lines
EXCEPTIONS
ID = 1
LANGUAGE = 2
NAME = 3
NOT_FOUND = 4
OBJECT = 5
REFERENCE_CHECK = 6
WRONG_ACCESS_TO_ARCHIVE = 7
OTHERS = 8.
loop at lines.
write:/ lines-tdline.
endloop.
Regards,
Rich Heilman
‎2006 Sep 07 7:08 PM
HI,
You have to used the READ_TEXT functions to read the SAP long text. To check your long text header, go into the long text. <b>Click Goto -> Header</b>
Example:
CALL FUNCTION 'READ_TEXT'
EXPORTING
* CLIENT = SY-MANDT
ID = <Give the ID>
LANGUAGE = 'E'
NAME = <Object Name>
OBJECT = '<Object Name>'
* 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.
For Header text details, Click Goto -> Header, then you will find the ID,NAme and Object
For details text, Click Goto -> Detail.
<b>
Example Program for your sake:-</b>
REPORT ZTEXT .
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.
Mark all the helpful answers
Regards
Sudheer