‎2007 Mar 26 2:21 PM
Hi,
I have created a table with a maintenance generator. I have fields MATNR and WERKS for Material number and Plant.
I have then created two foreign keys to tables MARA and T001W to validate the materials and plants.
Now the problem comes when I need to create entries with "*" (Indicating all materials or plants) but SAP validates against tables MARA and T001W and doesn't allow me to do this.
Is there a way for me to allow "*" without being stopped by SAP?
Hope I made myself clear.
Thanks in advance.
Ernesto
‎2007 Mar 26 2:39 PM
first we enter the *entries in check table mara ,t001 and then enter in your main table then i hope that it doesn't have a problem.let me know if it is not working
‎2007 Mar 26 3:20 PM
Hi Sunil, thanks for answering.
I really don't understand the t001 check table part. Why should I use it as a check table?
Thanks
Ernesto
‎2007 Mar 26 3:37 PM
You have to remove the control in foreign key definition and implement it yourself in table maintenance.
I suggest Event 05 (creating a new record)
But there is a "gap" in analysis. Your table is not relational.
Example : in the table you get
MATNR : * WERKS : 'PLT1' and
MATNR 'REF' WERKS '*'
What is the correct value for 'REF' 'PLT1' ?
Maybe WERKS has precedence to MATNR
So you should have a table "WERKS" parameter
and a secondary table "WERKS-MATNR" when MATNR has other parameters?
You can then mix the two table maintenance in a cluster of view giving something like
PLT1 - default value
PLT2 - default-value
PLT1-PART1 - value
PLT2-PART1 - value
PLT2-PART2 - value
When using these table, first check WERKS parameters and if found check WERKS-MATNR parameters.
Regards
‎2007 Mar 26 3:46 PM
I'm not an expert on ABAP, but I think you can't enter a * value in a foreign key unless the * code is indeed in a record of the related table.
If you want to check the relation but you want to allow the * option too may be you should enter a record on the related table with an * at primary key to allow the relation.
Other option could be to delete the table relation and to manage them manally by code.
On se54 you can add an event to the maintenance view you have generated (SE54 - Environment - Events. The proper event code is 05 (Creating new entry), then push Editor icon and make the check by ABAP code if the field has no *. If the value doesn't exists on related table give a type 'E' message to avoid it.
Hope it helps!
‎2007 Mar 26 8:41 PM
Hi Gaston,
I've decided for the se54 approach.
I've done what you said but I have a problem. When I create an entry, if I have a mistake I send a message type E but after correcting the field value, SAP doesn't allow me to continue entering data in the rest of the row.
Don't know if the problem is clear enough.
Thank you
Ernesto
‎2007 Mar 27 6:33 AM
Hi,
Please go to the table definition thru SE11 transaction and remove the check table enteries for the fields and activate the table this would help u out
regards
suresh krishnan
‎2007 Mar 27 1:29 PM
I think Suresh is right. Did you delete the table relation on SE11? If you did please give us a more a detail of what happens when system avoid your record.
Regards!
‎2007 Mar 27 3:11 PM
Hi,
Thank you all for your help.
What I did was deleting the relation between tables so when I enter "*" SAP doesn't validate against the tables so the * is a valid value. Now I have another problem.
I must validate what the user enters so I'm using Events (05 when creating new entries) and if the user enters a wrong value, SAP tells me to correct that value and when I do so, I CAN'T continue enterign the rest of the values for that row.
Any idea why?
The tables goes like this:
MANDT
MATNR
WERKS
Thank you all
Ernesto
‎2007 Mar 27 3:27 PM
I'd like to know the exact message SAP gave you. Could you do it again and copy it to us? Please, enter on the detail of the error (doble-click on it) and copy it too.
In other hand, if you enter a wrong value and then you correct it you cant save the line. What about if you enter a right line from the beginning. Can you save this line?