Application Development 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: 

Raw to Xstring conversion

Former Member
0 Kudos

Hi Experts,

I have raw data in an internal table.


data: lo_conv type ref to cl_abap_conv_obj,

       lv_input_length TYPE i.

CREATE OBJECT lo_conv.

loop at lt_bin_data into ls_bin_data.

   CALL METHOD lo_conv->convert

     EXPORTING

       inbuff    = ls_bin_data

       INBUFFLG  = lv_input_length

       outbufflg = 25000

     IMPORTING

       outbuff   = lv_xstring.

ENDLOOP.


Using the above code i am converting raw data into type XSTRING.

But during the conversion it is converting 000000000000000 in the end with AAAAAAAAAAAAAAAAaaa.

For eg. in ls_bin_data = 78932467865

as it is raw it is stored as 789324678650000000000000000000 i.e filling the remmaining space wuth zero.

And when i convert it in XSTRING it is replacing the ending zeroes with AAAAAA.

Is there any possibility that the field ls_bin_data doesnt append zeroes in the left out space.

that is 78932467865 should remain as 78932467865.

Please give ur comments.

Regards,

Akriti

7 REPLIES 7

Former Member
0 Kudos

This message was moderated.

Former Member
0 Kudos

Hi Akriti,

check this below link:

http://scn.sap.com/thread/1778133

Regards,

Dipti

JL23
Active Contributor
0 Kudos

Dear  Diptilata Rout ,

Please do not reply with links only. This is just spoon feeding and  evidence that the user did not search enough himself. It would be more beneficial for his future if you tell him how you  searched to find those discussions.

A link shall support your own answer, but not replace your own answer.

You may want to read the blog and the comments to the blog to understand that it is really not a desired action

0 Kudos

Hi Jurgen,

I will surely take care of these things in future.

Regards,

Dipti.

Former Member
0 Kudos

Thanks Dipti

Now its working

0 Kudos

Ok Aakriti.

0 Kudos

can you share the solution please ?