2020 Jul 31 6:24 PM
Hi Team,
i need to populate space if filed value is blank.
im reading data from itab to file, few fields of itab contain blank value ,
CONCATENATE: <gfs_data>-znachn
<gfs_data>-zmidnm
<gfs_dara>-zvorna
<gfs_data>-zbnksa
gfs_data>-zstat
<gfs_data>-zstrt1
<gfs_data>-zstrt2
<gfs_data>-zcity
<gfs_data>-zstate
<gfs_data>-zworloc INTO gs_output SEPARATED BY gc_sep1.
so my output file created in application server as below.
devediano~~Ckrole~70002348~~Outvendor RN CAP 1~~3107580~~~~11170000~0010.
now how do i insert space between ~~ ?
so my output file should be as beow.
devediano~ ~Ckrole~70002348~ ~Outvendor RN CAP 1~~3107580~ ~ ~ ~11170000~0010.
Thank you
NK
2020 Jul 31 9:28 PM
Hi sathish,
Thanks for the reply, i added logic that " if no value populate "#" to itab, but when again replace it with space ..the output is again same as old.
devediano~#~Ckrole~70002348~#~Outvendor RN CAP 1~#~3107580~#~#~#~11170000~0010.
REPLACE ALL OCCURRENCES OF '#' IN gs_output WITH '~'.
devediano~ ~Ckrole~70002348~ ~Outvendor RN CAP 1~~3107580~ ~ ~ ~11170000~0010.
Please suggest.
thanks
2020 Jul 31 6:50 PM
uirji.netweaver,
Understand your issue, your problem here is you will not be able to know if there is value missing in a line item. But both blank and space values looks same in system.
What I would suggest is, before concatenation check if the fields hold some value. If they don't hold any value replace them with a special character probably # or $. This should help you identify in case there is a empty value.
Recommend you to go through the Thread as well.
Regards
2020 Jul 31 9:14 PM
2020 Jul 31 9:15 PM
You're not replace a blank character. The character doesn't exist. You're inserting a character between two others.
Answer is below.
2020 Jul 31 9:28 PM
Hi sathish,
Thanks for the reply, i added logic that " if no value populate "#" to itab, but when again replace it with space ..the output is again same as old.
devediano~#~Ckrole~70002348~#~Outvendor RN CAP 1~#~3107580~#~#~#~11170000~0010.
REPLACE ALL OCCURRENCES OF '#' IN gs_output WITH '~'.
devediano~ ~Ckrole~70002348~ ~Outvendor RN CAP 1~~3107580~ ~ ~ ~11170000~0010.
Please suggest.
thanks
2020 Jul 31 9:52 PM
Hi Matthew,
i tried with REPLACE ALL OCCURRENCES OF '~~' IN string WITH '~ ~'. , this is working if 2 fileds are missing but not working for 3 serial fields .
Example
devediano~~Ckrole~70002348~~Outvendor RN CAP 1~~3107580~~~11170000~0010.
REPLACE ALL OCCURRENCES OF '~~' IN string WITH '~ ~'.
devediano~ ~Ckrole~70002348~ ~Outvendor RN CAP 1~ ~3107580~ ~~11170000~0010.
Thank you
2020 Jul 31 10:59 PM
Thanks all
its working when i use TRANSLATE gs_output USING '#
thanks
'.