2024 Feb 10 10:25 PM
Hi team. I have the following task to complete:
* Data Objects with Built-in Types ********************************************************************** " comment/uncomment the following declarations and check the output DATA variable TYPE string. * DATA variable TYPE i. * DATA variable TYPE d. * DATA variable TYPE c LENGTH 10. * DATA variable TYPE n LENGTH 10. * DATA variable TYPE p LENGTH 8 DECIMALS 2. * Output ********************************************************************** out->write( 'Result with Initial Value)' ). out->write( variable ). out->write( '---------' ). variable = '19891109'. out->write( 'Result with Value 19891109' ). out->write( variable ). out->write( '---------' ).
I have the following error:
Field "VARIABLE" is unknown.
Please assist. I am a beginner.
Brice.
2024 Feb 11 8:12 AM
You have to declare the variable first. I assume the exercise was to figure out which data declaration is the correct one.
Since the variable gets its value later on, variable = '19891109'.
You have to see which one from the following can be
DATA variable TYPE string.
DATA variable TYPE i.
DATA variable TYPE d.
DATA variable TYPE c LENGTH 10.
DATA variable TYPE n LENGTH 10.
DATA variable TYPE p LENGTH 8 DECIMALS 2.
You need only one of the declarations, i wont tell which one. Try it out and see which one works.
2024 Feb 12 9:06 AM - edited 2024 Feb 12 9:09 AM
Click on the three dots in the editor.
Then click on the </> button.
Then post your code.
* Data Objects with Built-in Types ********************************************************************** " comment/uncomment the following declarations and check the output DATA variable TYPE string. * DATA variable TYPE i. * DATA variable TYPE d. * DATA variable TYPE c LENGTH 10. * DATA variable TYPE n LENGTH 10. * DATA variable TYPE p LENGTH 8 DECIMALS 2. * Output **********************************************************************
out->write( 'Result with Initial Value)' ).
out->write( variable ).
out->write( '---------' ).
variable = '19891109'.
out->write( 'Result with Value 19891109' ).
out->write( variable ).
out->write( '---------' )
so much nicer, don't you think?
In answer to your original question it would really help if you would follow the instructions:
comment/uncomment the following declarations and check the output