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

read_text

Former Member
0 Likes
879

hi

iam printing sales order details in smartform

i have only one parameter in se38 ie for vbeln..but in mainwindow

iam printing the items(10,20,30)..there i have to use read_text for every lineitem .

how can i print text using read_text.. where tdname will be changing.

8 REPLIES 8
Read only

Former Member
0 Likes
836

why cant u take TDNAME dynamically using select query. Always keep on hitting the database for TDNAME and pass to READ_TEXT. So that u will get text as per TDNAME.

Regards,

Ajay

Read only

0 Likes
836

iam new to abap..can u be more clear

Read only

SuhaSaha
Product and Topic Expert
Product and Topic Expert
0 Likes
836

Hello Vamsi,

If you are using SFs you need not use READ_TEXT fm. You can change the Text Type to "Include Text"

and in the Text Name click on the "Dynamic Field Value" (black button at the right) and give the dynamic TDNAME (e.g., &V_TDNAME&).

Hope this helps.

BR,

Suhas

Read only

Former Member
0 Likes
836

instead of using Read_text inside the smartform fetch all the data in the driver program itself and store in a internal table.

Pass this in the smartform and print it.

Hope this helps

Regards

Bikas

Read only

Former Member
0 Likes
836

*--


Begin To fetch the header text

SELECT single tdid from

ttxit into lv_ttxit

WHERE tdtext = 'ETD'

AND tdobject = 'VBBK'

AND tdspras = 'EN'.

l_name = wa_final-vbeln1.

CALL FUNCTION 'READ_TEXT'

EXPORTING

CLIENT = SY-MANDT

ID = lv_ttxit

LANGUAGE = sy-langu

NAME = l_name

OBJECT = 'VBBK'

TABLES

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

CLEAR: wa_final-htext. " Means there is no ETD text maintained for this order

ELSE.

READ TABLE tbl_lines INDEX 1.

IF sy-subrc = 0.

wa_final-htext = tbl_lines-tdline.

refresh: tbl_lines.

clear : tbl_lines.

ELSE.

refresh: tbl_lines.

clear : tbl_lines,

wa_final-htext.

ENDIF.

ENDIF.

Read only

Former Member
0 Likes
836

EXAMPLE:

REPORT z_test1.

TABLES:

thead.

PARAMETERS:

p_vbeln TYPE vbak-vbeln.

PARAMETERS:

p_textid TYPE thead-tdid.

DATA:

BEGIN OF t_thead OCCURS 0.

INCLUDE STRUCTURE thead.

DATA:

END OF t_thead.

DATA:

w_line TYPE i,

w_idx TYPE i,

w_flag TYPE i.

DATA:

BEGIN OF t_tline OCCURS 0.

INCLUDE STRUCTURE tline.

DATA:

END OF t_tline.

DATA:

w_test TYPE thead-tdname.

START-OF-SELECTION.

w_test = p_vbeln.

CALL FUNCTION 'READ_TEXT'

EXPORTING

client = sy-mandt

id = p_textid

language = sy-langu

name = w_test

object = 'VBBK'

TABLES

lines = t_tline

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

MESSAGE 'NO TEXT EXITS FOR THIS TEXT ID' TYPE 'I'.

ENDIF.

END-OF-SELECTION.

LOOP AT t_tline.

WRITE: / t_tline-tdline.

ENDLOOP.

Read only

Former Member
0 Likes
836

Hi

go in your smartforms and select the text type as include text

then give the value.

Regard

Sam.

Read only

Former Member
0 Likes
836

hi Vamsi,

LOOP AT IT_FINAL.

CONCATENATE: IT_FINAL-VBELN IT_FINAL-POSNR INTO WA_THEAD1-TDNAME.

        • Use Read_Text FM

ENDLOOP.

try this.

Vikki.