‎2007 May 31 4:49 AM
Hi
My requirement is ,i have to read the long text entered in the FB03 transaction(it may be several lines) in my Z Print program and pass that to the sapscript form that it gets displayed as line item. can you please send sample how to do in program and how it is called in sapscript form..
Thanks
Swarna.
‎2007 May 31 5:00 AM
See the below program :
REPORT zread_test.
DATA: it_lines LIKE TABLE OF tline WITH HEADER LINE.
CALL FUNCTION 'READ_TEXT'
EXPORTING
id = 'LTXT'
language = sy-langu
name = '000001100184'
object ='AUFK'
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 = 0.
Data: mystring type string.
LOOP AT it_lines.
concatenate mystring it_lines-tdline into mystring
separated by space.
ENDLOOP.
pass ur text id,text object and so on
Reward Points if it is helpful
Thanks
seshu
‎2007 May 31 5:10 AM
Hi
Can you please tell me how i pass this value to may sapscript because when i pass in sapscript nothing appears.How to call the variable in the form....
‎2007 May 31 5:36 AM
Hello Swarna,
I belive you will not too many space to print text ,i think you may have some 200 charcters.
declarate one variable :
data v_text(200) type c.
Concatenate ur text separted by space using tlines loop.
now you will have data v_text.
use write form dircetly
here mention ur window and text element
p1 &V_text&
I done same thing and try to ask functional guy and see print output.
do not use write_form in loop and endloop ,
Reward Points if it is helpful
Thanks
Seshu
‎2007 May 31 5:15 AM
maybe you don't need to read it in the abap driver at all but can just include it in the sapscript:
/: INCLUDE &VBDKR-TDNAME& OBJECT VBBK ID 1405 PARAGRAPH K
‎2007 May 31 5:22 AM
Hi
You have to use FM READ_TEXT.
In FB03 Transaction, you can get the Technical information of the Text Area. Use those as inputs to this FM, which will return the text entered into an internal table.
You can use this Internal table data to write onto script.
Eg:
stxl_id-tdobject = 'VBBK'.
stxl_id-tdname = wa_vbfa-vbelv.
stxl_id-tdid = '0012'.
stxl_id-tdspras = 'EN'.
DATA: BEGIN OF tlines OCCURS 10.
INCLUDE STRUCTURE tline.
DATA: END OF tlines.
clear: i_text.
*DATA : l_text(120) TYPE c,
DATA : l_text(1050) TYPE c,
v_tline LIKE tline-tdline.
CALL FUNCTION 'READ_TEXT'
EXPORTING
client = sy-mandt
id = stxl_id-tdid
language = stxl_id-tdspras
name = stxl_id-tdname
object = stxl_id-tdobject
archive_handle = 0
local_cat = ' '
IMPORTING
HEADER =
TABLES
lines = tlines
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.
ENDIF.
LOOP AT TLINES.
CALL FUNCITON 'WRITE_FORM' with the text element..
ENDLOOP.
Regards,
Raj