Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

How do I construct a single variable value in ABAP 750?

jrgkraus
Active Contributor
1,885

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?

1 ACCEPTED SOLUTION
Read only

brazel_pilipp
Explorer
1,643

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

5 REPLIES 5
Read only

nomssi
Active Contributor
1,643

Hello Jörg,

not sure I got your point, but in this context I would use xsdbool( ).

JNN

Read only

jrgkraus
Active Contributor
0 Likes
1,643

This does not work. LET is not possible within XSDBOOL( )

Read only

brazel_pilipp
Explorer
1,644

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

Read only

ChristianGnter
Contributor
1,643

You can use CONV instead of EXACT to get rid of the warning.

Read only

jrgkraus
Active Contributor
1,643

This is the solution with conv

    data(success) = conv abap_bool(
      let data_necessary = get_data_necessary( `input` ) in
      do_booking( data_necessary ) ).