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

Removing Null values from character string

Former Member
0 Likes
4,008

Hi All,

Can i remove NULL values (hexadecimal - 0000) from character string. I am uploading a file from presentation layer (shared server) and getting NULL values in many fields which i want to remove.

please assist.

Thanks for you help..

Regards,

Mohaiyuddin

9 REPLIES 9
Read only

Former Member
0 Likes
2,178

Hi Mohaiyuddin

What is the type of file that you are uploading?

What is the function module that you are using to upload the file?

Read only

0 Likes
2,178

I am uploading text file with ASC format using FM GUI_UPLOAD

Read only

0 Likes
2,178

Just assign space to the field as told by Rich.

Or just use CONDENSE.

Reward points if useful.

Regards,

Atish

Read only

0 Likes
2,178

Hi Atish,

I tried condense, split, replace...none is working properly. i cannot declare char variable with NULL value. I have to declare it in X format....String manipulation does not work with X and character combined with each other. (i tried declaring hex variable -- assigning it null and then moving the value to char, it is not working as well)

Read only

RichHeilman
Developer Advocate
Developer Advocate
0 Likes
2,178

Simply move space to them.

field1 = space.

Regards,

RIch Heilman

Read only

0 Likes
2,178

Null values are embedded in field -- example field value = L## (I have used replacement = #, its not working, it's showing # while debugging, but downloading it as NULL, L## -- 004C 000D 0000 -- hex for L, hex for CR and hex for NULL). i want to remove null from this value.

Read only

Former Member
0 Likes
2,178

no solution found.. Implemented work around at file source.

Read only

Former Member
0 Likes
2,178

Hi,

Most likely, nobody needed it, but if anybody in future will need the solution for related problem  - here's solution:

data: lv_nullchar type xstring value '0'.

shift lv_xstring right deleting trailing lv_nullchar in byte mode.

shift lv_xstring left deleting leading lv_nullchar in byte mode.

This hack deleting null chars in lv_xstring at end file and at begining of file. Works perfect for me, where i also worked with files.

Read only

2,178

This works perfectly for us, your're the best Former Member I've ever met.

Thanks!