2023 Sep 04 3:36 AM
Dear All,
i need to remove space character from input free text in program displayed #### in table
so in smartforms display look like this
1. text exampel here
2. text exampel 2 here
2023 Sep 04 5:47 AM
Line feeds must not be achieved using CRLF characters, they must be achieved by using SAPscript text format e.g.
TDFORMAT TDLINE
* 1.RC still
stopped.
* 2.Opportunity jobs
will show on separate lines in the Smart Form
1.RC still stopped.
2.Opportunity jobs
What is important is the meaning of TDFORMAT, i.e. "*" is new paragraph of type default.
Other values are explained in SAP Library - Structure TLINE of the Lines Table.
In parameters of Smart Form, define input parameter OPERATION_TEXT of type TSFTEXT (components TDFORMAT and TDLINE).
In the text field, choose "Dynamic text" and indicate &OPERATION_TEXT&
2023 Sep 04 4:58 AM
The origin of the issue starts where the input is stored, not in the Smart Form. Please clarify what's in table OR show debug of Smart Form parameter value, etc.
2023 Sep 04 5:15 AM
in the program input like this
thats is possible using cl_abap_char_utilities=>cr_lf replace # with space in smartforms.
2023 Sep 04 5:28 AM
2023 Sep 04 5:29 AM
2023 Sep 04 5:47 AM
Line feeds must not be achieved using CRLF characters, they must be achieved by using SAPscript text format e.g.
TDFORMAT TDLINE
* 1.RC still
stopped.
* 2.Opportunity jobs
will show on separate lines in the Smart Form
1.RC still stopped.
2.Opportunity jobs
What is important is the meaning of TDFORMAT, i.e. "*" is new paragraph of type default.
Other values are explained in SAP Library - Structure TLINE of the Lines Table.
In parameters of Smart Form, define input parameter OPERATION_TEXT of type TSFTEXT (components TDFORMAT and TDLINE).
In the text field, choose "Dynamic text" and indicate &OPERATION_TEXT&
2023 Sep 04 7:35 AM
iam trying to add some code to get from table so i put in the initialization from global definition
wa_rmark1-tdline is value from table '1.RC still stopped.###########2.Oppurtunity jobs (ME) :###########'
so i also put operation_text of TYPE TSFTEXT in the global and create dynamic text
but the value still look like this
2023 Sep 04 2:02 PM
1) Do you call this Smart Form from an ABAP program?
If yes, I strongly recommend to add the code in the ABAP program, right before calling the Smart Form, and then do as I said in the Smart Form, because it's very difficult to maintain ABAP code in Smart Form (high technical debt).
2) It seems that your text comes from a long text already (due to TDLINE in WA_RMARK1-TDLINE), you could then simplify. Could you explain more about the origin of the text?
3) It seems that you are STILL NOT translating line feeds into '*' (or you forget to remove them).
2023 Sep 05 5:28 AM
Thank your for your advice, i will change my code into abap program.
the text is from other program so its already in wa_rmark1-tdline.
The tdline field is char132, so if inputing text and enter newline after saving the text in databased cannot read the enter space so the databased look like this #####
so in abap program i have the value store in work area (WA_RMARK1-TDLINE)
I dont know how to passing wa_rmark1-tdline to operation_text type of TSFTEXT and how to translating line feed '*' or remove them.
Thank you for your feedback.
2023 Sep 05 7:34 AM
The other program which stores in WA_RMARK1-TDLINE is then functionally buggy and you or your colleagues should fix it: it's storing line feed characters in TDLINE = it stores non-long text format (line feeds) in long text container (TLINE structured type = TDFORMAT/TDLINE). Either store string with line feeds in STRING type, or convert string into long text format and store in TLINE format.
Note that I just see # in your screenshots which may represent any kind of "control characters", and you should analyze which control characters they are by debug + display the hexadecimal value of the string, because it may not be only line feed characters.
Concerning the transformation of string with line feeds into TLINE format (officially known as ITF), you may use CONVERT_STREAM_TO_ITF_TEXT (search the Web for examples and questions).
2023 Sep 06 5:17 AM
its work using this FM "CONVERT_STREAM_TO_ITF_TEXT"
but iam confusing how to convert all table ztable-tdline
iam only testing using 1 work area
DATA: lt_stram_lines TYPE STANDARD TABLE OF string,
ls_string TYPE string,
operation_text TYPE tsftext.
LOOP AT lt_remarks INTO DATA(ls_remarks).
IF ls_remarks-trows = '1'.
MOVE-CORRESPONDING ls_remarks TO wa_rmark1.
ls_string = wa_rmark1-tdline.
APPEND ls_string TO lt_stram_lines.
CALL FUNCTION 'CONVERT_STREAM_TO_ITF_TEXT'
EXPORTING
stream_lines = lt_stram_lines
lf = 'X'
TABLES
itf_text = operation_text.
ENDIF.
ENDLOOP.
how do i convert ztable-tdline using that FM CONVERT_STREAM_TO_ITF_TEXT?
2023 Sep 06 6:02 PM
I don't really understand why you get the text in a TDLINE component which should be reserved to ITF text, but what you did is the right way.