‎2005 Dec 06 11:30 AM
Hi ,
In our RFC to place an order we are using the FM CREATE_TEXT to save header text in salesorder . The text that needs to be saved is entered through the front end ( java ). Now the issue we are facing is that , if in the front end they use a new line character while they enter the header text ( i.e. , if the user press enter ) , the same character is being stored in SAP as ##. We don't want this character to be stored as it is creating some errors while transferring the sales order data to some other system other than SAP , through IDOC's .
Assumption is that ## is a command for page break (probably done when entered the text in the front end and translated into this command when posting the text in SAP).
Is there anyway that we can avoid this special character being stored in SAP ?
Any help in this regard would be highly appreciated
Regards,
Beena
‎2005 Dec 06 11:35 AM
HI Beena,
You may replace all occurences of '#' in the field using the command:
REPLACE ALL OCCURRENCES OF '#' WITH ''.
or
REPLACE ALL OCCURRENCES OF '#' WITH SPACE.
Regards,
Sudhakar.
‎2005 Dec 06 11:41 AM
Hi Sudhakar ,
But in the data that we are getting from front end there is no ## character at all . In the header text also we won't find this character , But if we go to the text editor we can see that # character is stored there .
Regards
Beena
‎2005 Dec 06 11:57 AM
Hi
I think that text may be having some prohibited chars like Euro symoboll
regards
vijay
‎2005 Dec 06 11:56 AM
HI Beena,
You might be using some Program or FM within SAP to upload Sales order text into SAP. What is the method which you are using?
You may need to change the Posting program before saving the data into SAP.
Regards,
Sudhakar.
‎2005 Dec 06 12:11 PM
Hi Beena,
While passing the text to the FM CREATE_TEXT, why dont you search and replace '##' with a single blank space?
Or, you dont have control over the text passed to the FM?
Understood that you dont find them while creating, then use FMs READ_TEXT modify the text, so that these are removed('##') and again use FM SAVE_TEXT, to save the text.
Regards,
Raj
Message was edited by: Rajasekhar Dinavahi
‎2005 Dec 06 12:21 PM
Hi raj ,
We do have the control of the text , but we couldn't find any ## character there for the new line character , instead it shows only space . somehow it gets stored in SAP when we pass it to FM create_text
Regards
Beena
‎2005 Dec 06 12:25 PM
Hi Beena,
1. In fact the chacters
(which may be shown as ##)
are but LINE FEED Characters
ie ASCII(10)
ASCII(13).
2. We need to replace ASCII(10) and ASCII(13)
(and not ##)
Regards,
Amit M.
‎2005 Dec 06 12:30 PM
Hi Amit ,
How can v achieve that as in the input text we are finding only space character for the line feed ?
sorry if this seems to be silly
Regards,
beena
‎2005 Dec 06 12:30 PM
Hi Beena,
If you have control over there, then why don't you remove the blank space which you have founded in the text field?
Regards,
Sudhakar.
‎2005 Dec 06 12:37 PM
Hi Sudhakar ,
We can't remove the space characters just like that as there could be chances wherein the user enter space character between two words . In that case if we remove that space , it will be a problem
Regards
Beena
‎2005 Dec 06 12:44 PM
Hi Beena,
You can check for the space at first character of the text field. If it equals to Space you can delete it right?
Say you are getting order text into v_text.
if v_text+0(1) = space.
shift v_text.
endif.
Regards,
Sudhakar.
‎2005 Dec 06 12:54 PM
Hi Sudhakar,
I don't think it is possible as we are getting the text into an internal table rather than a variable and this space character for the line feed can appear anywhere in that internal table records
Rgds
Beena
‎2005 Dec 06 12:59 PM
Hi Beena,
It should be possible, Even though you are getting text into Internal table.
Loop at ITAB.
if itab-ordertext+0(1) = space.
shift itab-ordertext.
endif.
modify itab index sy-tabix.
Endloop.
What is the structure of internal table in which you are getting the text?
Regards,
Sudhakar.
‎2005 Dec 06 1:11 PM
The structure is TLINE
TDFORMAT CHAR 2
TDLINE CHAR 132
From the front end they pass the text into field TDline by spliting into 132 characters .
so it won't be always that the first character of each record is a space .so i guess the logic that you have provided doesn't work
Rgds
Beena
‎2005 Dec 06 1:24 PM
Beena,
Can you try using FORMAT_TEXTLINES function and give the input that you are getting from Java application.
Look at the output of this. This might fix the issue. If output looks fine, that will be the input to the CREATE_TEXT function.
Regards,
Ravi
‎2005 Dec 06 1:26 PM
Interesting!...
How many order texts may contain in your internal table for each RFC call? Only one or more than one?
You mean to say one order text can be splitted twice or more times into TDLINE? If so, how do you differenciating between one order text to another order text?
--Sudhakar.