2019 Apr 17 9:33 AM
Every now and then I happen to be in need of the construction of a single variable value. The VALUE operator does it only for structures and tables, so I use a workaround with EXACT. See the example:
r_success = exact abap_bool(
let data_necessary = get_data_necessary( i_input ) in
do_booking( data_necessary ) ).
Now, syntax check says, this is a redundant conversion and I have to use a pragma to hide this. Isn't there a possibility to construct only one single variable similar to VALUE for structures without ugly workarounds?
2019 Apr 17 1:53 PM
Hello Jörg,
can the CONV operater help in this question?
The ABAP Help says:
"The conversion operator CONV closes the gap where the value operator VALUE cannot be used to construct values for elementary data objects except for the initial value."
Regards,
Philipp
Hello Jörg,
can the CONV operater help in this question?
The ABAP Help says:
"The conversion operator CONV closes the gap where the value operator VALUE cannot be used to construct values for elementary data objects except for the initial value."
Regards,
Philipp
2019 Apr 17 10:05 AM
Hello Jörg,
not sure I got your point, but in this context I would use xsdbool( ).
JNN
2019 Apr 17 11:31 AM
2019 Apr 17 1:53 PM
Hello Jörg,
can the CONV operater help in this question?
The ABAP Help says:
"The conversion operator CONV closes the gap where the value operator VALUE cannot be used to construct values for elementary data objects except for the initial value."
Regards,
Philipp
2019 Apr 17 1:56 PM
You can use CONV instead of EXACT to get rid of the warning.
2019 Apr 18 6:16 AM
This is the solution with conv
data(success) = conv abap_bool(
let data_necessary = get_data_necessary( `input` ) in
do_booking( data_necessary ) ).
| User | Count |
|---|---|
| 3 | |
| 2 | |
| 2 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |