‎2008 Dec 01 11:09 AM
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.
‎2008 Dec 01 11:11 AM
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
‎2008 Dec 01 11:16 AM
‎2008 Dec 01 11:17 AM
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
‎2008 Dec 01 11:19 AM
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
‎2008 Dec 01 11:25 AM
*--
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.
‎2008 Dec 03 11:55 AM
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.
‎2008 Dec 03 11:59 AM
Hi
go in your smartforms and select the text type as include text
then give the value.
Regard
Sam.
‎2008 Dec 03 12:00 PM
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.