cancel
Showing results for 
Search instead for 
Did you mean: 

problem in Reading Material Long text in Sapscript

Former Member
0 Kudos

Dear firends,

I have written following code in sapscrit to fetch the longtext of the material

INCLUDE &MARA-MATNR(K)& OBJECT MATERIAL ID GURN LANGUAGE &NAST-SPRAS&

Test name - material no(MARA-MATNR)

object - MATERIAL

text id - GURN

LANGUAGE - EN

but i am not table read the longtext by using above code, when i see in debug mode ,i am getting warning message

"data is not available for materil 0000013,GURN,MATERIAL" like that.

i don't find any problem in code , long text also availble for material 0000013.

i don't where is the problem , please give me solve this issue.

Regards,

D.prabhu

Accepted Solutions (0)

Answers (3)

Answers (3)

Former Member
0 Kudos

Pass all the values between single quotes..i.e.

INCLUDE &MARA-MATNR(K)& OBJECT 'MATERIAL' ID 'GURN' LANGUAGE &NAST-SPRAS&

and check dat whether text exists for these parameters..

Check the Table STXL with these parameters..

or jus for debugginf sake run the FM READ_TEXT in SE37..

pass these same parametrs 2 it and check the result..if text exists

or whether the parameters are passed correctly

former_member196280
Active Contributor
0 Kudos

you cannot display long text directly, for reading long text use function module "READ_TEXT"

Regards,

Sairam

Former Member
0 Kudos

Hi

You have to fetch this Long text of this Material using READ_TEXT fun module by passing the 4 parameters as mentioned by you by writing some code in the program or by writing the external subroutine using PERFORM statement

Only Application HEADER and ITEM texts can be included in script using the INCLUDE command

So write the code for the Read _Text fun module and fetch it into Internal table lines and pass/print those to script

pass the same 4 parameters

Test name - material no(MARA-MATNR)

object - MATERIAL

text id - GURN

LANGUAGE - EN

see the sample code

data:begin of it_stxh occurs 0,

tdobject type tdobject,

tdname type tdobname,

tdid type tdid,

tdspras type spras,

end of it_stxh.

types:begin of ty_lines.

include structure tline.

types:end of ty_lines.

data:it_lines type standard table of ty_lines with header line.

it_stxh-tdid = 'GRUN'.

it_stxh-tdspras = 'E'.

it_stxh-tdobject = itab-matnr.

CALL FUNCTION 'READ_TEXT'

EXPORTING

  • CLIENT = SY-MANDT

ID = it_stxh-tdid

LANGUAGE = it_stxh-tdspras

NAME = it_stxh-tdname

OBJECT = it_stxh-tdobject

  • ARCHIVE_HANDLE = 0

  • LOCAL_CAT = ' '

  • IMPORTING

  • HEADER =

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 eq 0.

loop at it_lines.

< Print these lines in script by passing to script>

endloop.

ENDIF.

Regards

Anji