03-11-2009 4:20 AM
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.
03-11-2009 4:52 AM
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к
03-11-2009 5:01 AM
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.
03-11-2009 5:26 AM
Hi,
I have tried it. Nothing works out. Suggest me something else please.
03-11-2009 5:28 AM
You can delete the TEXT from target and then try to copy from source.
03-11-2009 5:31 AM
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к