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

Table Maintenance Validation

Former Member
0 Likes
1,315

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

9 REPLIES 9
Read only

Former Member
0 Likes
1,099

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

Read only

0 Likes
1,099

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

Read only

RaymondGiuseppi
Active Contributor
0 Likes
1,099

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

Read only

gastn_jareo
Active Participant
0 Likes
1,099

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!

Read only

0 Likes
1,099

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

Read only

former_member15255
Active Participant
0 Likes
1,099

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

Read only

0 Likes
1,099

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!

Read only

0 Likes
1,099

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

Read only

0 Likes
1,099

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?