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

string break after 35 character

Former Member
0 Likes
715

dear,

"Line 2, Item #50006632: Vendor to pay half the cost for replacement of incorrrect product. The unit of measure is also incorrect. It is listed as SET and should be Each. Thank You"

this is my string from item text of po.which is getting from read_text call -function.

now ,

i have to display this text as

'Line 2, Item #50006632: Vendor to pay half the

cost for replacement of incorrrect product

The unit of measure is also incorrect.

It is listed as SET and should be Each. Thank You''

that is it should break after 35 character.

and OUT-PAR as

TEXT1,

TEXT2,

TEXT3,

TEXT4.

so that it should have 35-38 character length.

one below other.

dear,

"Line 2, Item #50006632: Vendor to pay half the cost for replacement of incorrrect product. The unit of measure is also incorrect. It is listed as SET and should be Each. Thank You"

this is my string from item text of po.which is getting from read_text call -function.

now ,

i have to display this text as

'Line 2, Item #50006632: Vendor to pay half the

cost for replacement of incorrrect product

The unit of measure is also incorrect.

It is listed as SET and should be Each. Thank You''

that is it should break after 35 character.

and OUT-PAR as

TEXT1,

TEXT2,

TEXT3,

TEXT4.

so that it should have 35-38 character length.

one below other.

5 REPLIES 5
Read only

former_member156446
Active Contributor
0 Likes
677

text1 = text+(35)

text2 = text+36(35)

text3 = text+71(35)

Read only

Former Member
0 Likes
677

Hi ,

Can you tell me where do you want to display this text, means in a report or some thing,

please let me know.

because once you have it in you TDLINE structure you can easily break the sentence with proper offsets.

regards,

taher

Read only

0 Likes
677

hi ,

It should be like

text1 = tdline +(35)

text2 = tdline+36(35)

text3 = tdline+71(35)

syntax is like

text = tdline +from_position (how many characters)

Read only

Former Member
0 Likes
677

In ur form painter the coding should be something like this in order to truncate the line at 35 th character

if itab-tline+0(35) ne ' '.

endif.

if itab-tline+35(35) ne ' '.

endif.

if itab-tline+70(35) ne ' '.

endif.

This will capture string offset of 35 line wise.

Vijay

Read only

Former Member
0 Likes
677

Hi,

If you are working on single byte char (ex: english) you can break the text directly by using offsets.

In ur case :

Text1 = l_f_string+0(35).

Text2 = l_f_string+35(35).

Text3 = l_f_string+70(35).

etc..

If you are working on multiple byte char (ex: Japanese), then use FM :TRUNCATE_MULTIPLE_BYTE_STRING to find proper place to truncate the string.