2010 Aug 03 4:14 PM
Hi Experts
i am facing a issue with DESCRIBE LENGTH
my code is somewhat liek this
DESCRIBE FIELD <fs> LENGTH lv_len IN CHARACTER MODE.
here <fs> is of type P and its coming dynamically and gives dump that At the statment "DESCRIBE"
only character-type data objects are supported at the argument position "<FS>", but no strings are supported (data types STRING and XSTRING).
and just one more thing value coming in <fs> is sometimes decimal also like 78.20 .
Please help .
Sunny.
Moderator message: subject edited, please do not use all upper case in the future.
Edited by: Thomas Zloch on Aug 3, 2010 5:43 PM
Hi Experts
i am facing a issue with DESCRIBE LENGTH
my code is somewhat liek this
DESCRIBE FIELD <fs> LENGTH lv_len IN CHARACTER MODE.
here <fs> is of type P and its coming dynamically and gives dump that At the statment "DESCRIBE"
only character-type data objects are supported at the argument position "<FS>", but no strings are supported (data types STRING and XSTRING).
and just one more thing value coming in <fs> is sometimes decimal also like 78.20 .
Please help .
Sunny.
Moderator message: subject edited, please do not use all upper case in the future.
Edited by: Thomas Zloch on Aug 3, 2010 5:43 PM
2010 Aug 03 4:35 PM
Hi. You could make a new variable:
data: lv_str(132) type c.
lv_str = <fs>.
DESCRIBE FIELD lv_str LENGTH lv_len IN CHARACTER MODE.
2010 Aug 03 4:57 PM
2010 Aug 03 6:02 PM
Hi Sunny,
Sorry about that... I should have run that code I guess...
This works for both type P and 😧
data: lv_str_fs type string.
lv_str_fs = <fs>.
CONDENSE lv_str_fs.
lv_len = STRLEN( lv_str_fs ).
- Erik
2010 Aug 03 5:24 PM
Hi ,
Just one question ..do you need the length of the field or the length of the field content ?
If you need the length of the field then you have to give the name of the field in describe statement.
without knowing how your <fs> is getting populated its hard to give a solution.
2010 Aug 04 10:50 AM
if u want to find field content length then use following logic
DATA: linelength TYPE i VALUE 0.
DATA: text TYPE string.
text = 'L0593V1'.
linelength = STRLEN( text ).
write linelength.
2010 Aug 04 11:49 AM
Try something like this,
data: lv_type type c.
DESCRIBE FIELD <fs> type lv_type.
if lv_type CA 'CNDTS'.
DESCRIBE FIELD <fs> LENGTH lv_len IN CHARACTER MODE.
else.
DESCRIBE FIELD <fs> LENGTH lv_len IN BYTE MODE.
endif.
Vikranth
2010 Sep 15 11:13 AM
| User | Count |
|---|---|
| 4 | |
| 2 | |
| 2 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |