‎2012 Jun 04 2:40 PM
Hi experts,
I have recently add an extra field "C" to the append structure of the database table MARA. It has 3 extra fields: A, B and C. The, I adjust the table MARA using transaction SE14.
Parameter "C" has a domain XFELD (Yes/No), so when I was testing the correct adjustment of the indexes, I noticed that if I made a query with this field it also takes into consideration the registers created after the modification. I would expected to return all the registers that have field C in blanks.
SELECT * FROM mara WHERE c = ' '.
Is that correct or I am forgetting to execute any other adjust?
Lots of thanks,
Javier
‎2012 Jun 04 3:50 PM
You should activate the flag "initial value"at included structure level as this is not possible at subfield level.
Call SE11 on the table, navigate to append structure, there in the menu navigate to : Extras, DB Attributes, Initialization Flag On/Off. Activate again append structure and table, and then adjust database if required.
Regards,
Raymond
‎2012 Jun 04 2:47 PM
Registers?
If you are talking of selecting data from MARA where C = space, then the query is correct.
Can you explain ?
Thanks,
Shambu
‎2012 Jun 04 2:49 PM
I'm confused by your formulation, normally the unexpected effect is that entries created before the adjustment are not found by a query like the one you listed.
In that case the reason usually is that flag "initial values" has not been set in SE11 for the new columns, so all existing entries have a NULL (hex 00) value, as opposed to initial value (space, hex 20, for character fields).
In any case you can try to set this flag for "C", adjust the entries again, and see if this changes anything.
Thomas
P.S. I hope "C" is just a placeholder for the actual name
‎2012 Jun 04 2:51 PM
Hi Javier,
I think since you used XFELD as data type,
If you want to select all records with C = 'No'...
Write like as follows
SELECT * FROM mara WHERE c NE 'X'.
Regards,
Venkat
‎2012 Jun 04 3:06 PM
You are right, Thomas.
Inside the append structure, it is not possible to set the column "Initial values".
So, which solution are you suggesting? Maybe combine in the WHERE condition the expression with "NOT NULL" for the old records and another with " = ' ' for the new ones?
Lots of thanks for your help!!!
P.S. Exactly, "C" is just a placeholder to simplify the explanation here in the forum
‎2012 Jun 04 3:40 PM
Good point, when you are maintaining your append fields, the check box is not available, when you are back in the main (standard) table, the check box is there, but you cannot change it without an access key (which we don't want). What are we missing?
I think changing code to cater for this is not a good approach. Did you try the option "Extras -> Force Conversion" in SE14 for MARA already? Speak to your system administrator first.
Thomas
‎2012 Jun 04 3:50 PM
You should activate the flag "initial value"at included structure level as this is not possible at subfield level.
Call SE11 on the table, navigate to append structure, there in the menu navigate to : Extras, DB Attributes, Initialization Flag On/Off. Activate again append structure and table, and then adjust database if required.
Regards,
Raymond
‎2012 Jun 04 3:56 PM
Exactly, Raymond. Problem solved!!!
Thanks to all of you for your help.