‎2010 Mar 30 4:54 PM
Hi friends,
I have a file text file in one of my directory in application server.
Now iam using dataset concept and reading the data and appending into another internal table
Iam facing a problem here. i have the data in text file in the directory and the data is as below
10000#ABCD#40000#1234#
ie : the data is seperated by #
but iam facing aproblem here if there is any field empty in between then it is displaying it as #
for example if i take the same above record
10000#ABCD###1234#
but it should be in the below format if any field is empty in between it show display space
10000#ABCD# #1234#
actually iam split at # and taking those into different fields and appedning those into another internal table. when i get a # for empty space the data is not populating correctly.
how can i do that.
Regards
Kumar
‎2010 Mar 30 5:03 PM
Hi,
Why can't you replace all # with Space using replace for all occurances of statment and then split record at Space using Split statement.
Hope above will solve the problem.
‎2010 Mar 30 5:34 PM
Looks like you have a tab-delimited file coming in...have you checked to see if the '#' or hex 09 (tab)?
‎2010 Mar 30 6:01 PM
‎2010 Mar 30 6:07 PM
How do you know it is # character & not tabs ? If you see the # in AL11, it is because of some garbage character which SAP cannot display. So it displays the replacement character # instead.
Try downloading the file to presentation server & check the structure of the file.
BR,
Suhas
‎2010 Mar 30 8:16 PM
Hi,
In your program declare one char 1 variable with value normal #. Then in debugg mode check the hexadecimal value of the normal one and the another #, coming from application server file. If these are defferent then these not a normal #.
Similarly you can check that this # is tab or not. Check hexadecimal value of CL_ABAP_CHAR_UTILITY=>HORIZONTAL_TAB.
If any thing didnot match you can get unicode char from the hexadecimal value of special char using the method
CL_ABAB_COND_IN_CE=>CUPP. Here you need to pass the hex value. It will return the unicode char.
After that splitt at these char(may be normal #, tab , or the special char coming from method CL_ABAB_COND_IN_CE=>CUPP)
Thanks
Subhankar
‎2010 Mar 31 10:54 AM
hi subhankar
can you tell me how to use CL_ABAB_COND_IN_CE=>CUPP
Regards
Kumar
‎2010 Mar 31 11:17 AM
Did you really check the hexadecimal value of the # in the debugging? If you dint yet, do it and let us know that it is.
‎2010 Mar 31 11:30 AM
HI Vikranth,
how to check that in debugging..
when i double click on # in the debugging, iam getting field cannot be copied.
how can i check it
Regards
Kumar
‎2010 Mar 31 11:39 AM
Hello Kumar,
Declare a variable of type string and do READ DATASET to capture the file content in the string. Now identify the hexadecimal value of the # by checking the value of whole string or a easy is as suggested by suhas, use CG3Y to download the particular application server file into text file and check what the # refers to either horizontal tab or space or anything.
Vikranth
‎2010 Mar 31 11:48 AM
when i download it to presentation server # is representing it as space..
Regards
Kumar