cancel
Showing results for 
Search instead for 
Did you mean: 

calling long text in script

sureshcres
Explorer
0 Kudos

Hi everyone,

can any one say the function module used to call the long text in scripts.

Accepted Solutions (0)

Answers (7)

Answers (7)

Former Member
0 Kudos

Hi

You can use read_text function module

Important thing to notice while using READ_TEXT is that

TEXT-ID field needs to be properly created based on Order number, Item no, Slaes Org, Distribution channel etc.

Most of the time You will find that Sales organization field is of 4 characters lenght, (Say 0001) in this case Since SAP discards first 3 zeroes of the number to blank spaces, you need to append zeroes to the final text-id field making it of required 20 characters key field (Say).

Therefore, you need to take care of append zeroes, shift spaces, concatenate command, etc. which depends on your scenario.

you have to check the following parameters

ID: this textid

language:language u maintained the text,this also important

name: The no in which text-id is maintained

Usually we make mistake here,the no is combination of purchase order no and item no.

Example:420000210000010(Puchase orderno:4200002100 item no:00010)

Object:it change based on the text-id so u can check it the document no.

CALL FUNCTION 'READ_TEXT'

EXPORTING

id = p_var

language = g_f_langu

name = g_f_tdname

object = g_f_obj

TABLES

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

Hope this definitely help.

Regards

- Atul

Former Member
0 Kudos

hi ya the table tline contains two fields tdline and one more smething lik tht but ya two fields.

n other question i cant answer me jus a beginner n currently workin on my first project

Former Member
0 Kudos

suresh i tried this out in my case also

the number was a combination of company code , document number,fiscal year and the item numer

language i think i gave en,rest i don remember and sorry cant telll u noe bcoz sap isnt workin ova here.

but still i got the data in Lines table which is a struccture of type Tline.

Former Member
0 Kudos

U can use read_text

u have to chek the following parameters

ID: this textid

language:language u maintained the text,this also important

name: The no in which text-id is maintained

Usually we make mistake here,the no is combination of purchase order no and item no.

Example:420000210000010(Puchase orderno:4200002100 item no:00010)

Object:it change based on the text-id so u can check it the document no.

CALL FUNCTION 'READ_TEXT'

EXPORTING

id = p_var

language = g_f_langu

name = g_f_tdname

object = g_f_obj

TABLES

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

Pass the varibles as i have said and let me know if u face any problem.

Regards

Former Member
0 Kudos

try out the function 'Read_text'.

Former Member
0 Kudos

HI Aman,

One small doubt regarding this question.

i.e in sO10 there is a standard text contains data 2 pages.my requirement is just display 1000 charecters only from that standard text.

If i use READ_TEXT is it possible?

One more doubt is T_lines table contain 2 fields with 132 charecters?

Please clarify this..

Regards,

Kishore.

Former Member
0 Kudos

Hi

first upload the text file into standard text name in SO10 transaction code and transport that in se78 and call it in the form

INCLUDE standardtextname OBJECT TEXT ID ST

Former Member
0 Kudos

Hi ,

I guess you have the standard text created.

In the text elements

go to text and then click the standart and then give your standard text.

INCLUDE &ZTXTNAME& OBJECT BOM ID MZU

Thanks

VENKI