Skip to Content

Archived discussions are read-only. Learn more about SAP Q&A

unable to print text in continuity in smartform

Hi

I i am not able to print the whole text in the smartform , it prints half of the text in one line and half in the second .

I want to print it in continuity , how do i go about it ?

The code i wrote is as follows:

CLEAR: ls_object, itab_note, wa_note.

UNPACK contract-recnnr TO contract-recnnr.

CONCATENATE contract-bukrs contract-recnnr INTO ls_object-instid.

ls_object-typeid = 'BUS1505'.

ls_object-catid = 'BO'. "constant

CLEAR: ls_relopt, lt_relopt.

ls_relopt-sign = 'I'.

ls_relopt-option = 'EQ'.

ls_relopt-low = 'NOTE'.

APPEND ls_relopt TO lt_relopt.

TRY.

CALL METHOD cl_binary_relation=>read_links_of_binrels

EXPORTING

is_object = ls_object

it_relation_options = lt_relopt

ip_role = 'GOSAPPLOBJ'

ip_no_buffer = 'X'

IMPORTING

et_links = lt_link.

CATCH cx_obl_parameter_error.

CATCH cx_obl_internal_error.

CATCH cx_obl_model_error.

ENDTRY.

SORT lt_link DESCENDING BY utctime.

DATA: wf_clause(7) TYPE c.

DATA: itab_lines TYPE so_text255 OCCURS 0 WITH HEADER LINE.

DATA: wf_crlfch(10).

CALL FUNCTION 'SRET_BINARY_TO_TEXT'

EXPORTING

xbuffer = wc_crlf

laiso = '00'

IMPORTING

textbuffer = wf_crlfch

EXCEPTIONS

failed = 1

OTHERS = 2.

**FIND first note

IF lt_link IS NOT INITIAL.

LOOP AT lt_link INTO ls_link.

    • read content of note

ld_doc_id = ls_link-instid_b.

CALL FUNCTION 'SO_DOCUMENT_READ_API1'

EXPORTING

document_id = ld_doc_id

IMPORTING

document_data = doc_data

TABLES

object_content = t_notecontent

EXCEPTIONS

document_id_not_exist = 1

operation_no_authorization = 2

x_error = 3

OTHERS = 4.

wa_note-title = doc_data-obj_descr.

wa_note-createdby = doc_data-creat_name.

wa_note-createddate = doc_data-creat_date.

  • Check if the line begins with 'Clause:' (any case).

wf_clause = wa_note-title(7).

TRANSLATE wf_clause TO UPPER CASE.

IF wf_clause EQ 'CLAUSE:'.

  • Lease Notes with Clauses

wa_note-clauses = 'X'.

ELSE.

  • Lease Notes without Clauses

wa_note-clauses = ' '.

ENDIF.

LOOP AT t_notecontent INTO notecontent.

REFRESH itab_lines.

TRANSLATE notecontent-line USING wf_crlfch.

SPLIT notecontent-line AT '
' INTO TABLE itab_lines.

Not what you were looking for? View more on this topic or Ask a question