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

How to remove.

Former Member
0 Likes
1,111

HI all

I am downloading some data into file(.TXT) from SAP sever and uploading into other UNIX server.

Here in the file(.TXT) we are having MAKTX is: Vendor needs to pay##

Eg: 1202 789654 vendor needs to pay## 10000245623654

When I was uploaded this file into UNIX server we are getting 2 lines.

Eg: 1202 789654 vendor needs to pay^M

10000245623654

If you observe here we are getting u2018^Mu2019 this special word we donu2019t know how we are geeting. Due that ^M the u201810000245623654u2019 it is going to next line.

I think in unix ^M is taking enter action .

So can any body tell me what is the problem what I need to do.

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
1,070

'##' Seems to be Carriage return or line feed.

CL_ABAP_CHAR_UTILITIES=>CR_LF   or
CL_ABAP_CHAR_UTILITIES=>NEWLINE

These functions are represented by '##' in ABAP, so its pushing your characters to the next line.

Amandeep

HI all

I am downloading some data into file(.TXT) from SAP sever and uploading into other UNIX server.

Here in the file(.TXT) we are having MAKTX is: Vendor needs to pay##

Eg: 1202 789654 vendor needs to pay## 10000245623654

When I was uploaded this file into UNIX server we are getting 2 lines.

Eg: 1202 789654 vendor needs to pay^M

10000245623654

If you observe here we are getting u2018^Mu2019 this special word we donu2019t know how we are geeting. Due that ^M the u201810000245623654u2019 it is going to next line.

I think in unix ^M is taking enter action .

So can any body tell me what is the problem what I need to do.

7 REPLIES 7
Read only

Former Member
0 Likes
1,070

hi use this replace all occurances ..after getting the file name..

then condense it

data:char(25) value '5#4#2#&1#'.

replace all occurrences of '#' in char with space .

write: char.

Read only

0 Likes
1,070

Try to FTP the file in binary mode.

Read only

0 Likes
1,070

HI venkat,

take my example,

Here I_TEXT-TSGTXT is--> vendor needs to pay##

IF I_TEXT-TSGTXT CA '#'.

REPLACE ALL OCCURRENCES OF '#' IN I_TEXT-TSGTXT WITH ' '.

ENDIF.

But wonder here is sy-subrc = 4

So it means it was not considering these ##.

Some thing problem.

This is very urjent guys

Read only

0 Likes
1,070

try using TRANSLATE instead of REPLACE...

=> TRANSLATE I_TEXT-TSGTXT USING '# '.

replace doesn't works fine with spaces...

regards,

Edited by: Sebasti Bustamante on Jul 15, 2008 4:59 PM

Read only

Former Member
0 Likes
1,071

'##' Seems to be Carriage return or line feed.

CL_ABAP_CHAR_UTILITIES=>CR_LF   or
CL_ABAP_CHAR_UTILITIES=>NEWLINE

These functions are represented by '##' in ABAP, so its pushing your characters to the next line.

Amandeep

Read only

0 Likes
1,070

HI amadeep,

Thank you very much..

My problem was solved

Read only

Former Member
0 Likes
1,070

Do this Way.

REPLACE ALL OCCURENCES OF cl_abap_char_utilities=>cr_lf IN maktxt WITH space.