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

About READ_TEXT

Former Member
0 Likes
1,555

Hi All

I need to retrive the text from CAUFVD-STTXT.

Basically this is the text to be retrieved pertaining to a Production Order (AUFK-AUFNR). Production Orders can be found in CO03 Tcode.

All i know is that we need to use the FM "READ_TEXT".

How to use this FM in the above specified scenario..??????

Please help me by mentioning the parameters to be used in the READ_TEXT module....

Regards

Pavan

1 ACCEPTED SOLUTION
Read only

jayanthi_jayaraman
Active Contributor
0 Likes
1,488

Hi,

Here is the pseudo code from http://www.sapdevelopment.co.uk/fmodules/fms_readtext.htm.

*Internal table to store standard texts

DATA: IT_TEXTS like T_LINE occurs o with header line.

CALL FUNCTION 'READ_TEXT'

EXPORTING

  • CLIENT = SY-MANDT

id = "Text ID

language = 'E'

name = "Text name

object = "text object

  • ARCHIVE_HANDLE = 0

  • IMPORTING

  • HEADER =

tables

lines = IT_TEXTS "Internal table

  • 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.

8 REPLIES 8
Read only

jayanthi_jayaraman
Active Contributor
0 Likes
1,489

Hi,

Here is the pseudo code from http://www.sapdevelopment.co.uk/fmodules/fms_readtext.htm.

*Internal table to store standard texts

DATA: IT_TEXTS like T_LINE occurs o with header line.

CALL FUNCTION 'READ_TEXT'

EXPORTING

  • CLIENT = SY-MANDT

id = "Text ID

language = 'E'

name = "Text name

object = "text object

  • ARCHIVE_HANDLE = 0

  • IMPORTING

  • HEADER =

tables

lines = IT_TEXTS "Internal table

  • 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.

Read only

Former Member
0 Likes
1,488

Hi,

Check here.

http://www.google.com/custom?q=read_text&client=pub-0901176218310532&forid=1&ie=ISO-8859-1&oe=ISO-88...

You can find lot of sample code.

search in sapfans.com for read_text.

Read only

Former Member
0 Likes
1,488

Hi Pavan

Please check the code

Here in the export parameters you need to find ID, LANG, NAME, and OBJECT

By the query I can say that NAME is value of AUFK-AUFNR, and object is 'AUFK'.

You can debug the text for Production Order by going into T-code CO03 and putting a break-point at FM Read text and can retrieve all 4 export parameters..

CALL FUNCTION 'READ_TEXT'

EXPORTING

  • CLIENT = SY-MANDT

id = 'F01'

language = 'E'

name = d_name

object = 'EKKO'

  • ARCHIVE_HANDLE = 0

  • LOCAL_CAT = ' '

  • IMPORTING

  • HEADER =

tables

lines = it_text

EXCEPTIONS

  • ID = 1

  • LANGUAGE = 2

  • NAME = 3

NOT_FOUND = 4

  • OBJECT = 5

  • REFERENCE_CHECK = 6

  • WRONG_ACCESS_TO_ARCHIVE = 7

  • OTHERS = 8

.

Thanks

Gaurav

Read only

Former Member
0 Likes
1,488

Hello Pavan,

You can use this code.

CALL FUNCTION 'READ_TEXT'

EXPORTING

id = 'KOPF'

language = sy-langu

name = aufk-aufnr

object = 'AUFK'

tables

lines = it_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.

Regards,

Manoj

Read only

0 Likes
1,488

Hi All...

Thanks for your Response.

I have used the following code in my program to retrieve the Order Status(CAUFVD-STTXT) from a Production Order.

loop at i_aufk.

move i_aufk-aufnr to l_aufnr.

CALL FUNCTION 'READ_TEXT'

EXPORTING

CLIENT = SY-MANDT

ID = 'KOPF'

LANGUAGE = sy-langu

NAME = l_aufnr

OBJECT = AUFK

  • ARCHIVE_HANDLE = 0

  • LOCAL_CAT = ' '

  • IMPORTING

  • HEADER =

TABLES

LINES = i_line

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.

clear l_aufnr.

endloop.

The internal Table i_aufk contains 10 Production Orders and i need to find the respective Order Status of those orders.

Using above code, the system is giving RunTime error at the statement "CALL FUNCTION 'READ_TEXT'".....

What might be the problem..??????

Regards

Pavan

Read only

0 Likes
1,488

Hi Pavan ,

Just one simple change in the code.

The Name that is to be passed must be in this format

<b>client</b><i>productionordernumber</i>

for e.g

if client is 999 and production order is 1002723,

since length of PO order is 12 so it must occupy 12 chars so the final value you pass to the FM must be

<b>999</b><i>000001002723</i>

and yes do <b>declare the correct variable</b> type the reason for your dump can be incompatable data type.

Please test and see if it works.

Regards

Arun

  • Reward with points if reply is helpful

Read only

0 Likes
1,488

Declare l_aufnr as type thead-tdname.

data: l_aufnr type thead-tdname.

Regards,

Manoj

Read only

Former Member
0 Likes
1,488

Thanks for your guidance....

Wishing You and Your Family a Happy and joyful New Year...

Lets Rock in 2007...