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

binary (how to replace zeros with space)

Former Member
0 Likes
1,270

hi ,

I am using FM SRET_TEXT_TO_BINARY

i get an output as

526173686D6900000000000000000000000000000000000000000000000000000000000000

which i then pass to a variable an internal table with a field(say x )of type 'RAW'

this internal table is the displayed in a Document type of output ..in short in a word document.

now my problem is that

when x is displayed alon with teh text it allso displays the remaining zreos

eg abcdef 0000000000000000000000000000000000000000000000

now i dont want this ... can

anyone suggest me how i can remove these zeros with spaces.

thanks

6 REPLIES 6
Read only

Former Member
0 Likes
981

use fm

1.conversion_exit_alpha_input

2.conversion_exit_alpha_output

for zeros before the value i mean padding of zeros before the value.

before the value is passed to ur fm u can check this.

can u explain the scenario a little bit more as how u are getting this value and what is/are the declaration(s).

regards,

vijay

Read only

Former Member
0 Likes
981

see if this logic works for u .

REPORT zforum12 .

data : val(60) type c value
 'abcdef000000000000000000000000000000000000000'.

 write:/ val .


REPLACE all occurances of '0' IN val WITH space INTO val. "check this syntax
 write:/ val.

im working on 4.6c so please check on ur system for all occurance if this supports .

regards,

vijay

Read only

Former Member
0 Likes
981

replace all occurrances of '0' IN V_VAL with space.

Award Points

Read only

Former Member
0 Likes
981

Hi,

After converting '526173686D6900000000000000000000000000000000000000000000000000000000000000' into 'abcdef 0000000000000000000000000000000000000000000000' use the following code to solve the problem.

SHIFT text RIGHT DELETING TRAILING '0'.

Reward points if the answer is helpful.

Regards,

Mukul

Read only

athavanraja
Active Contributor
0 Likes
981

i guess end of file is missing.

may be try this FM

SCMS_TEXT_TO_BINARY

Regards

Raja

Read only

Former Member
0 Likes
981

hi Rashmi

try ..

Write l_variable To l_variable NO-ZERO.

No need to use functin modules .

Reward points if helpful.