Skip to Content
author's profile photo Former Member
Former Member

Primary Key Issue

Hi Frnds,

I have created a table with 2 primary keys sold to and ship to. and created a maintenance View.

Criteria to enter the records in the maintenance view is such that both sold to and ship to should have unique values, Such that once one sold to value is entered for a ship to value then the same sold to value should not be allowed to enter with other ship to combination. Similarly if one ship to value is entered for a sold to value, it should not be allowed to enter the same ship to value again for any other sold to value combination.

How can we do? Please help me.

Thanks in Advance

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

2 Answers

  • Posted on Jun 18, 2008 at 12:09 PM

    If you want to avoid much coding:

    - declare only sold-to as primary key

    - create a secondary, unique index on ship-to

    The system should then prevent you from entering any value twice.


    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Jun 18, 2008 at 12:11 PM

    Declare one field as primary key....for the uniqueness of the other field u can follow the below way..

    in table maintainance generator...go to environment >modification->events

    There u can write a code for this....

    Reward points if the above ans is useful...

    Add a comment
    10|10000 characters needed characters exceeded

    • Former Member


      Thanks for the reply. I have done with the one which was suggested by you.

      I have one doubt on it. How can i loop the entire table to verify whether the entered ship to party has been already entered with some other sold to party. If this is the first time I am entering the value in the table through NEW ENTRY Tab.

      If I entered the same ship to party with different sold to party how can i validate with the earlier entry. If the entry is sequential we can verify with the previous entry. If the entry made was not sequencial then we can't check.

      Extract is the internal table which is holding all the datas in the maintenance table control. But I am not able to loop it.It throughs an error that extract is not declared. How can i loop the values in extract table to validate for ship to party.

      Please hlp me.

      Thanks in Advance.

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.