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: 

Export material sales long text

Former Member
0 Kudos

Hi,

i want to export the material sales long text from each material to a xls sheet. I've read in this forum that it should be possible with the READ_TEXT function.

Could anybody tell me the program code for it or could anyone give me a description how to do this?

THX!

strobbel

6 REPLIES 6

Former Member
0 Kudos

Hi,

you can use function as following:

data : tbody like TLINE occurs 0 with header line.


 CALL FUNCTION 'READ_TEXT'
   EXPORTING
     CLIENT                        = SY-MANDT
     ID                            = 'ST'
     LANGUAGE                      = sy-langu
     NAME                          = 'SO10_NAME'
     OBJECT                        = 'TEXT'
*    ARCHIVE_HANDLE                = 0
*    LOCAL_CAT                     = ' '
*  IMPORTING
*    HEADER                        =
   TABLES
     LINES                         = tbody
*  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.

Hope helps.

deniz.

Former Member
0 Kudos

Hi,

First get the OBJNR from AUFK table

Now go to table IHPA with the OBJNR value and PARNTER Function VU (VU is for User Responsible)

Get the PARNR value from IHPA table.

Now Go to Table USR21 with the PARNR from IHPA, as BNAME. Then you get the

PERSNUMBER and

ADDRNUMBER

Now go to the Table ADR6 with the Above PERSNUMBER and ADDRNUMBER , Get the email address .

Thanks&Regards,

Naresh

Former Member
0 Kudos

Are you both sure what i mean?

I mean the sales text in the mm03 for each material.

Could anybody else help me?

Edited by: strobbel on Sep 15, 2008 4:04 PM

0 Kudos

Now i've getting the program to run, but when i execute it ... nothing happens?!?

Could anybody help me?

0 Kudos

TDOBJECT : MVKE

TDNAME : Matl no. (18 char.) + Sales organization +

distribution channel

TDID : 0001

Language : Sy-langu

The above are the parameters you need to use while calling the Function READ_TEXT function.

0 Kudos

I had these settings before, but nothing happened ...

Here is the code:


*&---------------------------------------------------------------------*
*& Report  ZREADVERTRIEBSTEXT
*&
*&---------------------------------------------------------------------*
*&
*&
*&---------------------------------------------------------------------*

REPORT  ZREADVERTRIEBSTEXT.

data : tbody like TLINE occurs 0 with header line.


CALL FUNCTION 'READ_TEXT'
  EXPORTING
    CLIENT                        = SY-MANDT
    ID                            = '0001'
    LANGUAGE                      = SY-LANGU
    NAME                          = '5007093           101101'
    OBJECT                        = 'MVKE'

*    ARCHIVE_HANDLE                = 0
*    LOCAL_CAT                     = ' '
*  IMPORTING
*    HEADER                        =
  TABLES
    LINES                         = tbody
*  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.