Skip to Content
-1

How to delete space in character text?

I wrote a code that automatically pulls time-related information from the system. As indicated in the table is fixed t247 Month names to 10 characters in length. But it is a bad image when showing on the report screen.


I print this way:

  WRITE : 'Bugün', t_month_names-ltx, ' ayının'.
  CONCATENATE gv_words-word '''nci günü' INTO date.
  CONCATENATE date ',' INTO date.
  CONCATENATE date gv_year INTO date SEPARATED BY space.
  TRANSLATE   date TO LOWER CASE.

I tried the CONDENSE t_month_names-ltx NO-GAPS. method to delete the spaces, but it was not enough.

After WRITE, I was able to write statically by setting the blank value:

  WRITE : 'Bugün', t_month_names-ltx.
  WRITE : 14 'ayının'.
  CONCATENATE gv_words-word '''nci günü' INTO date.
  CONCATENATE date ',' INTO date.
  CONCATENATE date gv_year INTO date SEPARATED BY space.
  TRANSLATE   date TO LOWER CASE.

But this is not a correct use. How do I achieve this dynamically?

bkabo.png (11.9 kB)
klwv8.png (11.9 kB)
Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

3 Answers

  • Best Answer
    Posted on Jul 23, 2020 at 10:58 PM

    I think this should help you

    DATA(lv_text) = |Bugün { t_month_names-ltx } ayının { gv_words-word } 'nci günü, { gv_year }  |.
    CONDENSE lv_text.
    WRITE:/ lv_text.
    
    
    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Jul 23, 2020 at 10:57 PM

    use backspace it may help you

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Jul 24, 2020 at 04:22 AM
    -2

    Hi,

    You can also use

    REPLACE ALL OCCURRENCES OF space IN lv_text WITH ''.

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.