07-23-2020 11:16 PM
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?
07-23-2020 11: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.
07-23-2020 11:57 PM
07-23-2020 11: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.
07-24-2020 5:20 AM
Some clarification regarding CONDENSE:
Also, you are not showing all of your relevant coding, as there are the final WRITE statements missing.
07-24-2020 5:22 AM
Hi,
You can also use
REPLACE ALL OCCURRENCES OF space IN lv_text WITH ''.
07-24-2020 8:17 AM
Sorry! But with your solution, I get a short dump. The statement "REPLAECE ALL OCCURRENCES OF space..." runs into an endless loop
07-24-2020 5:23 AM
text = ' My text '.
CONDENSE text. " => ' My text ' becomes 'My text'.
text = ' My text '.
CONDENSE text NO-GAPS. " => ' My text ' becomes 'Mytext'.
07-24-2020 6:33 AM
You currently get:
Bugün Temmuz ayının yirmidört'nci günü, 2020
OR
Bugün Temmuz ayının yirmidört'nci günü, 2020
What exact text do you expect please? Do you expect this text to be stored in a variable or to be output with WRITE?
07-24-2020 8:59 AM
I did it this way and it worked :
DATA l_month TYPE STRING.
l_month = t_month_names-ltx.
WRITE : 'Bugün', l_month.
WRITE : '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.
thank you to everyone for reply!