‎2007 Apr 19 7:54 AM
HI all,
I am inserting text in the text editor through MIRO. I have mentioned the output type REKL and my driver program in NACE. I am reading the text through my driver program. But its not printing on the form. Why is it so?
The code for reading the text and WRITE_FORM is as below..
REPORT zam_miro_text_print .
TABLES : nast.
DATA : id TYPE thead-tdid,
name TYPE thead-tdname,
object TYPE thead-tdobject,
lines TYPE TABLE OF tline,
wa LIKE LINE OF lines.
DATA : w_objky TYPE na_objkey,
w_belnr TYPE re_belnr.
FORM entry_rekl USING ent_retco ent_screen.
PERFORM get_inv_data USING ent_retco ent_screen.
PERFORM output_data.
ENDFORM. "FORM_ENTRY
FORM get_inv_data USING p_ent_retco
p_ent_screen.
Get data from table RBKP
SELECT SINGLE belnr
FROM rbkp
INTO w_belnr
WHERE belnr = nast-objky+4(10).
ENDFORM. " get_inv_data
FORM output_data.
id = 'ST'.
name = '100'.
object = 'TEXT'.
CALL FUNCTION 'READ_TEXT'
EXPORTING
client = sy-mandt
id = id
language = sy-langu
name = name
object = object
TABLES
lines = 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.
ENDIF.
CALL FUNCTION 'OPEN_FORM'
EXPORTING
application = 'TX'
device = 'PRINTER'
dialog = 'X'
form = 'ZTEST'
language = sy-langu
EXCEPTIONS
canceled = 1
device = 2
form = 3
OPTIONS = 4
unclosed = 5
mail_options = 6
archive_error = 7
invalid_fax_number = 8
more_params_needed_in_batch = 9
spool_error = 10
codepage = 11
OTHERS = 12.
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 lines INTO wa.
AT FIRST.
CALL FUNCTION 'WRITE_FORM'
EXPORTING
element = 'HD'
function = 'SET'
type = 'BODY'
window = 'MAIN'
EXCEPTIONS
element = 1
function = 2
type = 3
unopened = 4
unstarted = 5
window = 6
bad_pageformat_for_print = 7
spool_error = 8
codepage = 9
OTHERS = 10.
IF sy-subrc <> 0.
MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
ENDIF.
ENDAT.
CALL FUNCTION 'WRITE_FORM'
EXPORTING
element = 'ITM'
function = 'SET'
type = 'BODY'
window = 'MAIN'
EXCEPTIONS
element = 1
function = 2
type = 3
unopened = 4
unstarted = 5
window = 6
bad_pageformat_for_print = 7
spool_error = 8
codepage = 9
OTHERS = 10.
IF sy-subrc <> 0.
MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
ENDIF.
ENDLOOP.
CALL FUNCTION 'CLOSE_FORM'.
ENDFORM. "FORM_ENTRY
please help!!
‎2007 Apr 19 7:59 AM
Hi,
First check the fun module READ_TEXT
by executing in SE37 and passing the same paramters what you are passing in the code for ID,OBJECT,NAME and LANG and see,
if you are fetching the text then no problem.
then use it in the script, to display those lines.
reward if useful
regards,
Anji
‎2007 Apr 19 8:05 AM
HI,
After the WRITE_FROM you need to call WRITE_FORM_LINES function module to print the text lines
CALL FUNCTION 'WRITE_FORM_LINES'
EXPORTING
HEADER =
WINDOW = 'MAIN'
FUNCTION = 'SET'
TYPE = 'BODY'
IMPORTING PENDING_LINES =
FROMPAGE =
TABLES LINES = ?...
EXCEPTIONS FUNCTION =
TYPE =
UNOPENED =
UNSTARTED =
WINDOW =