Application Development 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: 

copy from source to target

Former Member
0 Kudos

Hi,

I need to write code to copy the source text into target text. There might be more lines in the source. All those with or without text has to be copied from the source and overwritten on the target.

I have tried using FM READ_TEXT and SAVE_TEXT.

However it doesnt recognise the empty lines in the source. Even if it is empty line in source, that also has to be put in the target even if the target has got any text already.

For eg: If the source has got no text(blank) in one line and the atrget has got some text, it has to become blank as it is in the source.

Kindly help me out.

Thanks in advance.

5 REPLIES 5

Former Member
0 Kudos

since u want to overwrite target text use this paramter INSERT of save_text - pass it as 'X'

u want over write target text even if source text doesnot have any text for that see this excerpt from sap help

A text you want to store in the text file must consist of at least one line whose paragraph format or line contents is unequal to SPACE. Otherwise the system automatically deletes this text from the text file.

http://help.sap.com/saphelp_nw04/helpdata/en/d6/0db771494511d182b70000e829fbfe/frameset.htm

if ur source text is empty then pass empty table to save_text and it will delete target text too

http://help.sap.com/saphelp_nw04/helpdata/en/d6/0db8ef494511d182b70000e829fbfe/frameset.htm

кu03B1ятu03B9к

Former Member
0 Kudos

If you still wnat to keep the space on target side, try to keep asome special character like . or ,

in the blank line , then it will retain the line, this just a work around and not a true solution.

0 Kudos

Hi,

I have tried it. Nothing works out. Suggest me something else please.

0 Kudos

You can delete the TEXT from target and then try to copy from source.

0 Kudos

can u explain ur requirement a bit more.

if ur source is empty u want to clear ur target too. is that correct ? so when u pas empty table to target with Insert = X doesnot that clear the target?

кu03B1ятu03B9к