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

Problem in Read_text function Module

Former Member
0 Likes
1,168

Hi,

I tried to retrieve the text by using READ_TEXT function module, it reads garbage values with the text value.

In read text iam passing textid, object, name and Language

Regards,

Sreedhar.T

7 REPLIES 7
Read only

jayanthi_jayaraman
Active Contributor
Read only

0 Likes
958

Hi,

Now i found exactly where this garbage value is coming, it is available in database level itself.

My Question is " i need the text 'test' in the field tdline but iam getting "test ####&^*()77' like this.

any code is available for removing this garbage values and one more point is iam not sure how much length they are using to define the text, it may be 3 chars or 30 chars.

Please advice on this. it is possible or not?

Regards,

Sreedhar

Read only

Former Member
0 Likes
958

Hello,

Check the STXH table for the entries you passed to the FM.

If u get data for that entry in the table then defienetly the FM will return the coreect text.

If useful reward.

Vasanth

Read only

0 Likes
958

Hi,

Now i found exactly where this garbage value is coming, it is available in database level itself.

My Question is " i need the text 'test' in the field tdline but iam getting "test ####&^*()77' like this.

any code is available for removing this garbage values and one more point is iam not sure how much length they are using to define the text, it may be 3 chars or 30 chars.

Please advice on this. it is possible or not?

Regards,

Sreedhar

Read only

Former Member
0 Likes
958

hi

good

go through this

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.

thanks

mrutyun^

Read only

0 Likes
958

Hi,

Now i found exactly where this garbage value is coming, it is available in database level itself.

My Question is " i need the text 'test' in the field tdline but iam getting "test ####&^*()77' like this.

any code is available for removing this garbage values and one more point is iam not sure how much length they are using to define the text, it may be 3 chars or 30 chars.

Please advice on this. it is possible or not?

Regards,

Sreedhar

Read only

Former Member
0 Likes
958

Hi Sreedhar

I guess the problem is due to some exceptional characters which can not be identified by the code page you are using.

Please check the same...

Kind Regards

Eswar