Application Development 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: 

Fetching the standard text using Read_Text

Former Member
0 Kudos
632

Hi,

I have to fetch standard text using Read_text fm

with id:002 name, vbak-vbeln,text:vbbk,Language:Nast-spras

for that I have wrote the code as

DATA: I_LINE LIKE STANDARD TABLE OF TLINE WITH HEADER LINE,

ID like THEAD-TDID,

TNAME LIKE THEAD-TDNAME,

TDOBJECT like THEAD-TDOBJECT.

ID = '0002'.

TNAME = P_VBELN.

TDOBJECT = 'VBBK'.

CALL FUNCTION 'READ_TEXT'

EXPORTING

id = ID

language =

name = TNAME

object = TDOBJECT

TABLES

lines = I_LINE.

READ TABLE I_LINE.

IF SY-SUBRC = 0.

I_TEXT-V_TEXT = I_LINE-TDLINE.

ENDIF.

WRITE:/ i_text-v_text.

But, I am not understanding how to relate and access language from 'Nast" table

1 ACCEPTED SOLUTION

Sandra_Rossi
Active Contributor
0 Kudos
264

Hi,

I try to guess. You are developing a sapscript form or smart form, and it is called via correspondence (output type).

So, the NAST info is passed implicitly by declaring

TABLES nast

in the top of your program. That makes it share a common memory filled by the calling program.

Sandra

10 REPLIES 10

Sandra_Rossi
Active Contributor
0 Kudos
265

Hi,

I try to guess. You are developing a sapscript form or smart form, and it is called via correspondence (output type).

So, the NAST info is passed implicitly by declaring

TABLES nast

in the top of your program. That makes it share a common memory filled by the calling program.

Sandra

0 Kudos
264

Hi Sandra Rossi ,

Your guess is correct, I am developing a smartform for displaying contract details in SD.

I couldn't understand the solution that u have replied,Can u plzz elaborate it more.

Thanks

Kangarun.

0 Kudos
264

Hi

The driven program where you smartform is called should have just the NAST record, this should be moved to your smartforms, so the language can be got out from current NAST record.

Max

0 Kudos
264

Just make sure TABLES nast statement is in your program, you'll see that NAST has automatically values assigned. For more information, read the ABAP documentation about "interface work area" (and TABLES statement).

0 Kudos
264

Hi Max,

then what i have to specify that for "language" parameter in "READ_TEXT' FM

0 Kudos
264

Hi

Yes I've understood it

But the language has to be from the message you're printing

The message data are in the NAST so the language too.

What I mean your print is managed by a message type?

Max

0 Kudos
264

TABLES nast.
...
CALL FUNCTION 'READ_TEXT'
EXPORTING
id = ID
language = nast-spras "<====== leave it unchanged
name = TNAME
object = TDOBJECT
TABLES
lines = I_LINE.

former_member320332
Contributor
0 Kudos
264

Hi KangAruN,

I guess you are not sure about how data is getting populated in NAST.If this is the

case you can refer below reply

If you have configured your form triggering by output types via NACE tcode then

you will get the Message Status in NAST. To access this data just declare it using

tables in your program and use it.

Thanks,

Pawan

0 Kudos
264

Hi

are you displaying this data in smartform output? If yes, then have a look into this standard SF /SMB40/SDCON_A.

Use general attributes, then type Include Text and pass the below details:

Text Name &<FS>-TDNAME&

Text Object VBBP

Text ID 0002

Language

Std paragraph T2

First paragraph

Shiva

0 Kudos
264

Thanks all for ur help in solving this issue.