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

problem with data in debugging

Former Member
0 Likes
1,078

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

10 REPLIES 10
Read only

Former Member
0 Likes
1,050

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.

Read only

Former Member
0 Likes
1,050

Looks like you have a tab-delimited file coming in...have you checked to see if the '#' or hex 09 (tab)?

Read only

0 Likes
1,050

Hi

short dumep

it is # how can i correct this

Regards

Kumar

Read only

SuhaSaha
Product and Topic Expert
Product and Topic Expert
0 Likes
1,050

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

Read only

0 Likes
1,050

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

Read only

0 Likes
1,050

hi subhankar

can you tell me how to use CL_ABAB_COND_IN_CE=>CUPP

Regards

Kumar

Read only

0 Likes
1,050

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.

Read only

0 Likes
1,050

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

Read only

0 Likes
1,050

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

Read only

0 Likes
1,050

when i download it to presentation server # is representing it as space..

Regards

Kumar