‎2010 Apr 09 8:00 AM
Hey guys I have a structure (a workare) which I want to set NULL not 0. I tried it with the command CLEAR WITH NULL but it doesnt work because my structure fields content references. This is not supported by the CLEAR WITH NULL command and I get an error.
Do you have any idea how to solve that problem?
Thans a lot
‎2010 Apr 09 8:17 AM
Null value is set in special cases only by the system. I.e. when you don't use certain fields from table in the view and you do an insert . In this case the system puts null values to all remaining fields in the underlying tables.
CLEAR WITH NULL is obsolete. I would simply suggeest to use CLEAR with no addition. This will initialize your reference variable which means in the field there is nothing stored.
Regards
Marcin
‎2010 Apr 09 8:20 AM
The problem is that i have numfields too and they are set to 0 then but I dont want to have 0 in there because my output shall show empty fields and not 0 :). Any other idea?
Thanks for ur post
Marko
‎2010 Apr 09 8:23 AM
If you have oupput in ALV formt you can use NO_ZERO = 'X' attribute of fieldcatalog to turn off displaying zeros in tat column.
Regards
Marcin
‎2010 Apr 09 8:25 AM
ABAP does not support NULL values. ABAP only supports INITIAL values, but with these you are not able to differ between content and non-contont.
You need to fill your structure with self defined indicater variables indicating if a value contains data or nor. something like this:
TYPES:
begin of struct,
a type p decimals 5,
a_i type apap_bool,
b type c length 30,
b_i type abap:bool
end of struct.Filling the _i components you have full control if a componet contains NULL values or initial values.