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

Script

Former Member
0 Likes
564

Hi friends,

If I want to display item text maintained in tcode,Whether it is mandatory to concatenate Item no & document no and passing it into FM READ_TEXT?

Kindly reply.

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
548

Hi,

Yes you need to pass document number and item no.

See the below example:

dl_id = 'F03'.

dl_object = 'EKPO'.

dl_langu = sy-langu.

concatenate i_ebeln i_ebelp into dl_name.

CALL FUNCTION 'READ_TEXT'

EXPORTING

  • CLIENT = SY-MANDT

ID = dl_id

LANGUAGE = dl_langu

NAME = dl_name

OBJECT = dl_object

  • ARCHIVE_HANDLE = 0

  • LOCAL_CAT = ' '

  • IMPORTING

  • HEADER =

TABLES

LINES = dt_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.

raise not_found.

ENDIF.

Thanks,

Keerthi.

6 REPLIES 6
Read only

Former Member
0 Likes
549

Hi,

Yes you need to pass document number and item no.

See the below example:

dl_id = 'F03'.

dl_object = 'EKPO'.

dl_langu = sy-langu.

concatenate i_ebeln i_ebelp into dl_name.

CALL FUNCTION 'READ_TEXT'

EXPORTING

  • CLIENT = SY-MANDT

ID = dl_id

LANGUAGE = dl_langu

NAME = dl_name

OBJECT = dl_object

  • ARCHIVE_HANDLE = 0

  • LOCAL_CAT = ' '

  • IMPORTING

  • HEADER =

TABLES

LINES = dt_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.

raise not_found.

ENDIF.

Thanks,

Keerthi.

Read only

Former Member
0 Likes
548

HI,

Yes Both are Mandatory.

Please use the link below it will help you.

http://www.sap-basis-abap.com/sapac002.htm

With Regards,

Venkatesh.H.N

Please reward points if helpful

Read only

Former Member
0 Likes
548

Hi Hosmath,

I think it is not necessary.

You have four parameters in READ_TEXT function module .

ID
LANGUAGE
NAME
OBJECT

You get these parameters from the text of the particulat transaction.

For Example in Transaction VA01.

Menu path

Goto ---> Header ---> Texts

we maintain the texts related to transaction here.

Here double click on the Text, now u can see the text editor.

here Menu Path

Goto ---> Header

Here you can find four fields. You need to pass these fields to the READ_TEXT function module..

Text Name
Language
Text ID
Text Object

Best regards,

raam

Read only

Former Member
0 Likes
548

HI,

Yes, because the textname is nothing but the combination of fields item No and document no.

Read only

Former Member
0 Likes
548

hi

in the script layout, inthe element where u want to print the text - write the code as given below:

INCLUDE <TDNAME> OBJECT <TDOBJECT> ID <TDID> language <&NAST-SPRAS&

Using thsi u can print the text directly without using READ_TEXT.

Cheers,

Snehi.

Read only

Former Member
0 Likes
548

Hi,

Yes it is mendatory to concatenate those things and pass this number to the 'READ_TEXT' Function module than you will get the text in your internal table.

Thanks,

Khushbu.