‎2007 Jun 22 12:57 PM
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
‎2007 Jun 22 2:20 PM
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?
‎2007 Jun 25 7:39 AM
I am uploading text file with ASC format using FM GUI_UPLOAD
‎2007 Jun 25 7:40 AM
Just assign space to the field as told by Rich.
Or just use CONDENSE.
Reward points if useful.
Regards,
Atish
‎2007 Jun 25 7:45 AM
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)
‎2007 Jun 22 2:21 PM
‎2007 Jun 25 7:42 AM
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.
‎2008 Jul 04 1:20 PM
‎2015 Apr 02 4:54 AM
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.
‎2022 Sep 22 4:00 PM
This works perfectly for us, your're the best Former Member I've ever met.
Thanks!