Application Development 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: 

Material text in report

Former Member
0 Kudos

Hi ,

I want to write the material text, which is also carried to the Purchase Order as PO Text to a new z report.

This text is not storted in a table. From where can i get the data to print on a z report.

Thanks,

1 ACCEPTED SOLUTION

Former Member
0 Kudos

Hi Simi,

I am not sure which text you are looking for. If you are looking for long texts, then you can retrieve these using the READ_TEXT function module. You need to pass ID, LANGUAGE, NAME, and OBJECT. You will find the ID and OBJECT in the long text editor menu under

'Go To --> Header'. NAME will be your material number in the internal format.

STXH and STXD are the tables, but the long text itself is stored as raw data and you have to use the function module.

Let me know if you need any further help.

Srinivas

9 REPLIES 9

Former Member
0 Kudos

Hi Simi,

I am not sure which text you are looking for. If you are looking for long texts, then you can retrieve these using the READ_TEXT function module. You need to pass ID, LANGUAGE, NAME, and OBJECT. You will find the ID and OBJECT in the long text editor menu under

'Go To --> Header'. NAME will be your material number in the internal format.

STXH and STXD are the tables, but the long text itself is stored as raw data and you have to use the function module.

Let me know if you need any further help.

Srinivas

0 Kudos

Hi Srinivas,

That is exactly what ia m looking for. I got the information regarding the

ID, LANG, NAME, OBJECT.

what do i have to put in the

TAbles

LINES:

It is not accepting STXH or STXD. Also will it enable it to write also, or so i have to give again an command to write.

Thanks,

0 Kudos

Hi Simi,

Create an internal table as follows....

<b>DATA: t_tline TYPE tline occurs 0 with header line.</b>

use <b>t_lines</b> in your function call.

Hope that helps!

Rishi

0 Kudos

Hi,

I tried to create an internal table as you said. But somehow its also not working, its giving dump.

I am writing the process i did, pls suggest where i went wrong.

I created an Internaltable to get the matnr.

in the function module 'read_text' i am entering

DATA: t_tline TYPE tline occurs 0 with header line.

IF SY-SUBRC = 0.

CALL FUNCTION 'READ_TEXT'

EXPORTING

  • CLIENT = SY-MANDT

ID = 'BEST'

LANGUAGE = 'EN'

NAME = ITAB-MATNR

OBJECT = 'MATERIAL'

  • ARCHIVE_HANDLE = 0

  • LOCAL_CAT = ' '

  • IMPORTING

  • HEADER =

TABLES

LINES = t_tline

  • EXCEPTIONS

  • ID = 1

  • LANGUAGE = 2

  • NAME = 3

  • NOT_FOUND = 4

  • OBJECT = 5

  • REFERENCE_CHECK = 6

  • WRONG_ACCESS_TO_ARCHIVE = 7

  • OTHERS = 8

thanks,

0 Kudos

Hi Simi,

Try this:

  DATA:
        NAME LIKE THEAD-TDNAME,
        OBJECT LIKE THEAD-TDOBJECT VALUE 'MATERIAL',
        ID LIKE THEAD-TDID value 'BEST'.
  DATA: BEGIN OF LT_LINES OCCURS 0.
          INCLUDE STRUCTURE TLINE.
  DATA: END OF LT_LINES.


  NAME = ITAB-MATNR.
  CALL FUNCTION 'READ_TEXT'
       EXPORTING
            ID                      = ID
            LANGUAGE                = SY-LANGU
            NAME                    = NAME
            OBJECT                  = OBJECT
            …

Andreas

0 Kudos

Hi Andreas,

Thanks for the set of code. How to enable it to write on the report. This just reads the data.

what about writing it.

Thanks,

Former Member
0 Kudos

Simi

PO Short text (or the material text copied over to the PO) is stored in the PO line item table <b>EKPO</b> field <b>TXZ01</b>.

Hope that Helps!

Rishi

Former Member
0 Kudos

Hello Simi,

you have to make a loop on the return table tline

and print it.

Shravan

0 Kudos

thanks,

it works...