Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

SD_SALESDOCUMENT_CREATE - Insert text with new lines using cr_lf

Claytoncbj
Participant
0 Likes
2,006

Hi!

I need to include text in the multi-line sales order.

At the end of each line I have already included cr_lf or newline.

However, when I do this, the next line has a space at the beginning.

What can I do to make this not happen?

Thanks!

In the intern table SD_SALESDOCUMENT_CREATE.

See that from the 2nd to the 7th line there is a space before the number.

1 ACCEPTED SOLUTION
Read only

Claytoncbj
Participant
0 Likes
1,926

HI vijay.hariharan!

If I removed it, the text will be with number in same line.

Thank you!

I solved the problem include '/' in the text records. (<lfs_bapi>-format_col = '/'.)

program:

IF <lfs_bapi> IS ASSIGNED.

<lfs_bapi>-langu = sy-langu.

<lfs_bapi>-text_id = lc_uuid_mx.

<lfs_bapi>-text_line = lv_uuid_txt(lv_off).

CLEAR lv_off2.

FIND lv_crlf(1) IN <lfs_bapi>-text_line MATCH OFFSET lv_off2 MATCH LENGTH lv_len.

IF sy-subrc = 0 AND lv_off2 > 0.

<lfs_bapi>-text_line = <lfs_bapi>-text_line(lv_off2).

ENDIF.

<lfs_bapi>-format_col = '/'.

lv_len = STRLEN( lv_uuid_txt ).

lv_off = lv_off + 1.

lv_len = lv_len - lv_off.

lv_uuid_txt = lv_uuid_txt+lv_off(lv_len).

ENDIF.

3 REPLIES 3
Read only

vijay_hariharan
Contributor
0 Likes
1,926

Have you tried without the # at the end in the TEXT_LINE field.. Maybe you can try for one of the lines in T_TEXTS just to confirm whether this causes the space..

Regards,
Vijay

Read only

RaymondGiuseppi
Active Contributor
0 Likes
1,926

Try to remove the cr or cr_lf character, and put a '*' in FORMAT_COL field to force end of line.

Read only

Claytoncbj
Participant
0 Likes
1,927

HI vijay.hariharan!

If I removed it, the text will be with number in same line.

Thank you!

I solved the problem include '/' in the text records. (<lfs_bapi>-format_col = '/'.)

program:

IF <lfs_bapi> IS ASSIGNED.

<lfs_bapi>-langu = sy-langu.

<lfs_bapi>-text_id = lc_uuid_mx.

<lfs_bapi>-text_line = lv_uuid_txt(lv_off).

CLEAR lv_off2.

FIND lv_crlf(1) IN <lfs_bapi>-text_line MATCH OFFSET lv_off2 MATCH LENGTH lv_len.

IF sy-subrc = 0 AND lv_off2 > 0.

<lfs_bapi>-text_line = <lfs_bapi>-text_line(lv_off2).

ENDIF.

<lfs_bapi>-format_col = '/'.

lv_len = STRLEN( lv_uuid_txt ).

lv_off = lv_off + 1.

lv_len = lv_len - lv_off.

lv_uuid_txt = lv_uuid_txt+lv_off(lv_len).

ENDIF.