on 02-18-2009 8:22 AM
Hi,
I used following code to Read Header Text (Text ID F01) for purchase order print out some times the characters in this text field may be 1000 characters or higher but at the end of this code i get only 254 characters in Remarks so please help me to solve this issue (all characters are comes in FM output "HeaderLine" and its workarea)
Data: Remarks type CHAR780
CLEAR WA_STXL.
SELECT SINGLE
FROM STXL INTO
WA_STXL WHERE TDNAME = l_doc-xekko-ebeln AND TDID = 'F01'.
IF WA_STXL-TDID IS NOT INITIAL.
CALL FUNCTION 'READ_TEXT'
EXPORTING
ID = WA_STXL-TDID
LANGUAGE = WA_STXL-TDSPRAS
NAME = WA_STXL-TDNAME
OBJECT = WA_STXL-TDOBJECT
TABLES
LINES = HEADERLINE
EXCEPTIONS
ID = 1
LANGUAGE = 2
NAME = 3
NOT_FOUND = 4
OBJECT = 5
REFERENCE_CHECK = 6
WRONG_ACCESS_TO_ARCHIVE = 7
OTHERS = 8.
clear REMARKS.
DATA: WA_REMARKS TYPE tline.
LOOP AT HEADERLINE INTO WA_REMARKS.
CONCATENATE REMARKS WA_REMARKS-tdline INTO REMARKS." SEPARATED BY SPACE.
ENDLOOP.
ENDIF.
Regards
Nausal
used following code to solve this issue
CLEAR WA_STXL.
SELECT SINGLE
FROM STXL INTO
WA_STXL WHERE TDNAME = POLINENO AND TDID = 'F01'.
IF WA_STXL-TDID IS NOT INITIAL.
CALL FUNCTION 'READ_TEXT'
EXPORTING
ID = WA_STXL-TDID
LANGUAGE = WA_STXL-TDSPRAS
NAME = WA_STXL-TDNAME
OBJECT = WA_STXL-TDOBJECT
TABLES
LINES = ITEMDESCRIPTION
EXCEPTIONS
ID = 1
LANGUAGE = 2
NAME = 3
NOT_FOUND = 4
OBJECT = 5
REFERENCE_CHECK = 6
WRONG_ACCESS_TO_ARCHIVE = 7
OTHERS = 8.
ENDIF.
IF sy-subrc <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
*End of Code For Item Details Pick It from Item Text Text
clear: ITEMREMARKS1,ITEMREMARKS2,ITEMREMARKS3,ITEMREMARKS4,
ITEMREMARKS5,ITEMREMARKS6,ITEMREMARKS7,ITEMREMARKS8,
ITEMREMARKS9,ITEMREMARKS10,ITEMREMARKS11,ITEMREMARKS12,
ITEMREMARKS13,ITEMREMARKS14,ITEMREMARKS15,ITEMREMARKS16,ITEMREMARKS17,
ITEMREMARKS18,ITEMREMARKS19,ITEMREMARKS20.
DATA: WA_ITEMDES TYPE tline.
LOOP AT ITEMDESCRIPTION INTO WA_ITEMDES.
CONCATENATE ITEMDESTEXT WA_ITEMDES-TDLINE INTO ITEMDESTEXT SEPARATED BY SPACE.
read table ITEMDESCRIPTION INTO WA_ITEMDES index 1.
if sy-subrc = 0. ITEMREMARKS1 = WA_ITEMDES-tdline. endif.
read table ITEMDESCRIPTION INTO WA_ITEMDES index 2.
if sy-subrc = 0. ITEMREMARKS2 = WA_ITEMDES-tdline. endif.
read table ITEMDESCRIPTION INTO WA_ITEMDES index 3.
if sy-subrc = 0. ITEMREMARKS3 = WA_ITEMDES-tdline. endif.
read table ITEMDESCRIPTION INTO WA_ITEMDES index 4.
if sy-subrc = 0. ITEMREMARKS4 = WA_ITEMDES-tdline. endif.
read table ITEMDESCRIPTION INTO WA_ITEMDES index 5.
if sy-subrc = 0. ITEMREMARKS5 = WA_ITEMDES-tdline. endif.
read table ITEMDESCRIPTION INTO WA_ITEMDES index 6.
if sy-subrc = 0. ITEMREMARKS6 = WA_ITEMDES-tdline. endif.
read table ITEMDESCRIPTION INTO WA_ITEMDES index 7.
if sy-subrc = 0. ITEMREMARKS7 = WA_ITEMDES-tdline. endif.
read table ITEMDESCRIPTION INTO WA_ITEMDES index 8.
if sy-subrc = 0. ITEMREMARKS8 = WA_ITEMDES-tdline. endif.
read table ITEMDESCRIPTION INTO WA_ITEMDES index 9.
if sy-subrc = 0. ITEMREMARKS9 = WA_ITEMDES-tdline. endif.
read table ITEMDESCRIPTION INTO WA_ITEMDES index 10.
if sy-subrc = 0. ITEMREMARKS10 = WA_ITEMDES-tdline. endif.
read table ITEMDESCRIPTION INTO WA_ITEMDES index 11.
if sy-subrc = 0. ITEMREMARKS11 = WA_ITEMDES-tdline. endif.
read table ITEMDESCRIPTION INTO WA_ITEMDES index 12.
if sy-subrc = 0. ITEMREMARKS12 = WA_ITEMDES-tdline. endif.
read table ITEMDESCRIPTION INTO WA_ITEMDES index 13.
if sy-subrc = 0. ITEMREMARKS13 = WA_ITEMDES-tdline. endif.
read table ITEMDESCRIPTION INTO WA_ITEMDES index 14.
if sy-subrc = 0. ITEMREMARKS14 = WA_ITEMDES-tdline. endif.
read table ITEMDESCRIPTION INTO WA_ITEMDES index 15.
if sy-subrc = 0. ITEMREMARKS15 = WA_ITEMDES-tdline. endif.
read table ITEMDESCRIPTION INTO WA_ITEMDES index 16.
if sy-subrc = 0. ITEMREMARKS16 = WA_ITEMDES-tdline. endif.
read table ITEMDESCRIPTION INTO WA_ITEMDES index 17.
if sy-subrc = 0. ITEMREMARKS17 = WA_ITEMDES-tdline. endif.
read table ITEMDESCRIPTION INTO WA_ITEMDES index 18.
if sy-subrc = 0. ITEMREMARKS18 = WA_ITEMDES-tdline. endif.
read table ITEMDESCRIPTION INTO WA_ITEMDES index 19.
if sy-subrc = 0. ITEMREMARKS19 = WA_ITEMDES-tdline. endif.
read table ITEMDESCRIPTION INTO WA_ITEMDES index 20.
if sy-subrc = 0. ITEMREMARKS20 = WA_ITEMDES-tdline. endif.
ENDLOOP.
Thanks,
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
if the text is too long we can make it too come in a single line.
use the synatx as given below.
'hbkbdsfnlfnlkdfdsk;lm;dfm;ldfm;lsd' &
'jsdkflfnlkdsfnldknfdf;kldm;flmds;fl;;'.
the text should be given in single cote and if it no of lines, line should end with &
then it will take all in a single line.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
u can use word wrap FM it will split the lines
Function module to create the texts
call function 'READ_TEXT'
exporting
fid = gv_id
flanguage = gv_language
fname = lv_matnr
fobject = gv_mobject
save_direct = gc_x
tables
flines = gt_lines
exceptions
no_init = 1
no_save = 2
others = 3.
call function 'RKD_WORD_WRAP'
exporting
textline = wa_purmat-line
delimiter = ' '
outputlen = 40
IMPORTING
OUT_LINE1 =
OUT_LINE2 =
OUT_LINE3 =
tables
out_lines = gt_text_file.
EXCEPTIONS
OUTPUTLEN_TOO_LARGE = 1
OTHERS = 2
.
if sy-subrc eq 0.
loop at gt_text_file into wa_text_file.
wa_lines-tdline = wa_text_file-line.
append wa_lines to gt_lines.
endloop.
endif.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
85 | |
10 | |
10 | |
9 | |
7 | |
6 | |
6 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.