Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

Please help me with this issue........

Former Member
0 Likes
1,039

Hi Seniors,

I have to get the Long Text of all the Materials and Norms Created in MM01 by End Used From the SAP SYSTEM to an EXCEL Sheet. I want all the Materials and Norms Descriptions LONG TEXT given when Creating a Material or Norms......I have come to know that the long text is saved in TEXT format....how can i retrieve the TEXT DATA for All the Norms.....and Download it to Excel sheet.

Thank you.

waiting for your reply.

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
968

use READ_TEXT to read Text Data

9 REPLIES 9
Read only

Former Member
0 Likes
969

use READ_TEXT to read Text Data

Read only

Former Member
0 Likes
968

Hi,

All the texts are stored in tables STXH and STXL. But u cant directly access the texts using select statements.

Hence u can use the FM READ_TEXT to read all the texts.

Please reward points for useful answers

Regards,

Himanshu

Read only

Former Member
0 Likes
968

All texts are stored in STXL table

So u can use READ_TEXT function module to retrieve those

To get the values of parameters check out the STXL table

Once u get the text store it in an internal table and then use

FM GUI_DOWNLOAD and get the texts in excel sheet

Hope this helps..reward if it does

Read only

Former Member
0 Likes
968

Hi,

This can be achived by using fm "Read_Text":

CALL FUNCTION 'READ_TEXT'

EXPORTING

  • CLIENT = SY-MANDT

id = 'GRUN'

language = 'E'

name = "material name

"example of material number "000000000000001121

object = 'MATERIAL'

  • ARCHIVE_HANDLE = 0

  • LOCAL_CAT = ' '

  • IMPORTING

  • HEADER =

tables

lines = L_LINES "THIS WILL HAVE THE LONG "TEXT TYPE TDLINES

EXCEPTIONS

ID = 1

LANGUAGE = 2

NAME = 3

NOT_FOUND = 4

OBJECT = 5

REFERENCE_CHECK = 6

WRONG_ACCESS_TO_ARCHIVE = 7

OTHERS = 8

.

IF sy-subrc <> 0.

  • MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO

  • WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.

ENDIF.

This data can be downloaded to excel by formating the above text along with material number in to internal table and using the fm "SO_DOCUMENT_REPOSITORY_MANAGER" to dwonload the internal table into excel..

Reward points if reply found useful...

Read only

Former Member
0 Likes
968

I was trying all the solutions for my issue......the solutions given are for getting the long text for Only one material I guess........I have hundreds of materials..where there are different long text for different Materials ......Is there a best and a Easy Logic to get the long text Of Material Master in an EXCEL FILE....

waiting for your reply....seniors

Thanks you.

Read only

0 Likes
968

As suggested earlier, you can use READ_TEXT.

Suppose you have all the materials in an internal table IT_MATNR.

LOOP AT IT_MATNR.

READ TEXT FOR EACH MATERIAL.

APPEND DATA TO EXCEL FILE.

ENDLOOP.

Download file.

This should work for you.

ashish

Read only

0 Likes
968

Hi,

If there are many materials, then select all the material into internal table (itab)

then each material should be looped though the FM " READ_TEXT".

loop at itab.

call function 'read_text'.

import

;;;;;;;;

export

= l_text.

append l_text to itab2. (each long text should be written to another itab)

endloop.

Now ur itab2 contains the long text for each material.

just use the fm " Gui_download" to dowan load to excel file.

Revert back if any issues,

reward if helpful.

regards,

Naveen

Read only

Former Member
0 Likes
968

Hi,

If you want to select the text data..you have to retireve the following values and then pass it to <b>FM read_text.</b>

Declarations of variables..

TXOBJ type STXH-TDOBJECT.

TXNAME TYPE STXH-TDNAME

TXID TYPE STXH-TDID

TXSPRAS TYPE STXH-TDSPRAS

Take this into an internal table and display where needed.

SELECT SINGLE tdobject tdname tdid tdspras FROM stxh

INTO (txobj, txname, txid, txspras)

WHERE condition.

<b>CALL FUNCTION 'READ_TEXT'</b>

EXPORTING

  • CLIENT = SY-MANDT

id = txid

language = txspras

name = txname

object = txobj

  • ARCHIVE_HANDLE = 0

  • LOCAL_CAT = ' '

  • IMPORTING

  • HEADER =

tables

lines = Gt_HEADER

EXCEPTIONS

ID = 1

LANGUAGE = 2

NAME = 3

NOT_FOUND = 4

OBJECT = 5

REFERENCE_CHECK = 6

WRONG_ACCESS_TO_ARCHIVE = 7

OTHERS = 8

.

IF sy-subrc <> 0.

  • MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO

  • WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.

ENDIF.

Try this ,it may help you out.

Regards,

Neha.

Read only

Former Member
0 Likes
968

Thank for you time in helping me....according to me the text data is loaded in STXL table

which contains OBJECT = MATERIAL , NAME = MATERIAL NUMBERS , ID = BEST for that Material Numbers ,LAN...= E , CLUSTD feild contains all the converted text format

i am trying use this table and convert the Unknow text to Normal Text using Read_text FM...and looping to get the long text for all the materials...if this is correct please help me with the coding....if not give me the logic...which table to use and how to keep the fields in an internal table and pass it to FM.

Thank U.

TABLES : STXL.

DATA: BEGIN OF it_stxl ,

tdobject TYPE stxl-tdobject,

tdname TYPE stxl-tdname,

tdid TYPE stxl-tdid,

tdspras TYPE stxl-tdspras,

clustd TYPE stxl-clustd,

END OF it_stxl.

DATA: IT_ITAB LIKE TABLE OF IT_STXL WITH HEADER LINE.

PERFORM DISPLAY.

SELECT TDOBJECT TDNAME TDID TDSPRAS CLUSTD FROM STXL INTO TABLE IT_ITAB.

&----


*& Form DISPLAY

&----


  • text

----


  • --> p1 text

  • <-- p2 text

----


form DISPLAY .

CALL FUNCTION 'READ_TEXT'

EXPORTING

  • CLIENT = SY-MANDT

id = BEST

language = E

name = TDNAME

object = MATERIAL

  • ARCHIVE_HANDLE = 0

  • LOCAL_CAT = ' '

  • IMPORTING

  • HEADER =

tables

lines =

  • EXCEPTIONS

  • ID = 1

  • LANGUAGE = 2

  • NAME = 3

  • NOT_FOUND = 4

  • OBJECT = 5

  • REFERENCE_CHECK = 6

  • WRONG_ACCESS_TO_ARCHIVE = 7

  • OTHERS = 8

.

IF sy-subrc <> 0.

  • MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO

  • WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.

ENDIF.

endform. " DISPLAY

LOOP AT IT_ITAB INTO IT_ITAB.

WRITE: /10 IT_ITAB-TDOBJECT,

IT_ITAB-TDNAME,

IT_ITAB-TDID,

IT_ITAB-TDSPRAS,

IT_ITAB-CLUSTD.

ENDLOOP.