08-26-2015 4:03 PM
Dear ABAP Team,
I am facing a strange problem in the Smart form.
I am using the Include text inside the Smart forms where I am populating the the document number through the work are as shown below.
Strangely, after seeing the print preview of the billing document for that material it is showing '#' in the end of the text.
Can you please throw some points on why the special character '#' is coming. There are no special characters while uploading the file through notepad.
Thanks and Regards.
Pavithrra
08-27-2015 2:07 PM
Usual solution for those copied texts with special characters is usage of FM CONVERT_ITF_TO_ASCII.
Hint: Look for OSS notes released for your version, as SAP has already corrected some programs.
Regards,
Raymond
08-26-2015 4:20 PM
08-27-2015 1:30 PM
Hi Blanc,
Sorry my system was down from morning.
Can you please tell me where exactly do I have to add this class, because from the driver program i am passing this document number to the work area.
Thanks,
Pavithrra
08-27-2015 1:59 PM
Yo can code it directly in the smartform. Or in your program prior to call the smartform FM.
08-27-2015 2:11 PM
08-26-2015 10:59 PM
08-27-2015 1:31 PM
Hi Sandeep,
Inside the STXH table it is not showing any text. even i checked inside the STXL table.
Thanks,
Pavithrra
08-27-2015 9:52 AM
Hello Pavithrra,
Check those standard text first - See do you have any space in the end of the line. Just press a back space at end of the line in standard text.
See whether that could be causing the proble ?
Thanks,
SK
08-27-2015 1:42 PM
Hi SK,
Thanks for the input.
It is not a standard text, As far as i knew the functional is uploading the data through the note pad that data is passed inside the document number under the Item Texts tab and having the space which creates the #.
But he is not adding any space in the file then how come it is creating space.
Thanks and Regards,
Pavithrra
08-27-2015 2:07 PM
Usual solution for those copied texts with special characters is usage of FM CONVERT_ITF_TO_ASCII.
Hint: Look for OSS notes released for your version, as SAP has already corrected some programs.
Regards,
Raymond
08-27-2015 2:10 PM
Adding some more points to my original post. below are the attached screen-shot of the issue I am facing:
Inside the editor:
08-27-2015 2:33 PM
Item texts will have an entry in STXH/STXL tables. Please check carefully with the right parameters. The other way to check this is executing READ_TEXT function module. Click on the header like shown below and you could find the correct parameters used to execute READ_TEXT or STXH table
08-27-2015 2:42 PM
Hi,
from your screenshot (good you showed the contents of the "old" ITF editor) we can see that the # is already contained there. I assume this is an artefact created somehow by uploading/importing the text from notepad into the ITF editor... Could it be that the person doing the import is using cut-and-paste from notepad into the "PC" editor?
I believe this has nothing to do with smart forms INCLUDE operation.
Regards,
Alex
08-27-2015 2:49 PM
Hi Sandeep,
Thanks I got it after your screen-shot. The texts are stored with # but while the functional is uploading there was no #. I think the read_text converts the space to #.
Regards,
Pavithrra
08-27-2015 2:53 PM
AFAIK the conversion from "invisible" character to "special" character displayed as # occurs during first save.
(Also standard report may be using FM CONVERT_ITF_TO_STREAM_TEXT before displaying text)
Regards,
Raymond
08-27-2015 3:04 PM
Good. So the text is saved with special characters and hence you are getting on the form too. From your screenshot, Go to the SAPScript editor and delete the # sign. The old editor might have considered space as #. So try doing that or go to your functional consultant and ask him to correct the same.
08-28-2015 3:20 PM
Hi Raymond,
Thanks for suggesting the function module CONVERT_ITF_TO_ASCII.
Sorry I am using this for the first time, can you please let me know anything do I have to pass in the tab substitute. after doing the below way the '#' is not removed in the text.
Below is my sample code:
DATA: lt_lines type TLINE_T,
ls_lines type tline,
ls_ascii TYPE string,
lt_ascii TYPE tdtab_c132,
lv_text type char72,
lv_name TYPE THEAD-TDNAME.
lv_name = ls_manual_adj-manual_desc.
CALL FUNCTION 'READ_TEXT'
EXPORTING
* CLIENT = SY-MANDT
ID = '0001'
LANGUAGE = sy-langu
NAME = lv_name
OBJECT = 'VBBP'
TABLES
LINES = lt_lines.
check not lt_lines is initial.
CALL FUNCTION 'CONVERT_ITF_TO_ASCII'
EXPORTING
CODEPAGE = '0000'
FORMATWIDTH = 72
* LANGUAGE = SY-LANGU
TABLETYPE = 'ASC'
* TAB_SUBSTITUTE = 'C#'
* LF_SUBSTITUTE = ' #'
** REPLACE_SYMBOLS = ' '
* REPLACE_SAPCHARS = '#'
IMPORTING
* FORMATWIDTH_E =
* X_DATATAB =
C_DATATAB = lt_ascii
* X_SIZE =
TABLES
ITF_LINES = lt_lines
* EXCEPTIONS
* INVALID_TABLETYPE = 1
* OTHERS = 2
.
check lt_ascii[] is not initial.
loop at lt_lines into ls_lines.
read table lt_ascii into ls_ascii index sy-tabix.
ls_lines-tdline = ls_ascii.
modify lt_lines from ls_lines index sy-tabix.
endloop.
Kindly, let me know anything I am doing wrong.
THanks everyone for your time and inputs. Learnt a lot.
Regards,
Pavithrra
09-02-2015 2:24 PM
I tried using the fm CONVERT_ITF_TO_STREAM_TEXT which converts the text with # into normal text.
THanks everyone for your valid points.
Thread is closed.