2023 May 02 5:29 PM
Hi All,
I am fetching one field from DB table which is of length CHAR35 and I want to use the same in another SELECT statement via FOR ALL ENTRIES where field name of 10 character is being compared with field of 35 characters.
I don't want to use offset method but wanted to convert CHAR35 field into CHAR10 field using CAST operator in SELECT statements. I searched couple of threads on SDN but couldn't help.
Can anyone suggest.
Thanks !!
2023 May 02 6:33 PM
btp_rap
You can try using the LEFT function in the SELECT statement to convert the CHAR35 field into a CHAR10 field. This will extract the 10 leftmost characters of the CHAR35 field and return it as a CHAR10 field.
Syntax:
SELECT LEFT(<char35_field>, 10)
FROM <table_name>
For example:
SELECT LEFT(field_name_35, 10)
FROM table_name
2023 May 02 9:14 PM
2023 May 05 3:44 PM
TYPES: BEGIN OF ys_demo,
material TYPE char10,