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

Select-option/Parameter & Primary Key

Former Member
0 Likes
1,264

Dear Abaper,

    It this compulsory to have a Table fields define in Parameter/Select-option of Selection screen should be  Primary key of respective tables??

and

 

  If we used two different tables having common fields and if common field of Table1  is primary key and Table2  is not a primary key can we used that common field in Parameter/Select-option of selection screen?

Thanks & regards

Mahendra

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
1,081

Hi,

Its not necessary to have fields in parameters/select options to be primary key. It just takes the datatype irrespective of the primary key.

.

I have written a small example for you:

PARAMETERS: a(18) type c,

            b type matnr, "data element

            c type mara-matnr. "table-fieldname

These all are one and the same thing. a/b/c will have char 18 data type and length.

Regards

Purnand

6 REPLIES 6
Read only

kakshat
Product and Topic Expert
Product and Topic Expert
0 Likes
1,081

Hi Mahendra,

You can try this out for yourself and find the answer to your queries.

No, it's not compulsory for the fields you use in select-options to be primary key fields in a table. And, as long as the data type of the common field in your two tables is same, you should be able to use the same field for querying on both the tables.

Read only

Former Member
0 Likes
1,081

Parameter n select-option fields can be anything according to your requirement..

its not compulsory. n you can use common field of two tables in query to fetch the related data

Read only

Former Member
0 Likes
1,082

Hi,

Its not necessary to have fields in parameters/select options to be primary key. It just takes the datatype irrespective of the primary key.

.

I have written a small example for you:

PARAMETERS: a(18) type c,

            b type matnr, "data element

            c type mara-matnr. "table-fieldname

These all are one and the same thing. a/b/c will have char 18 data type and length.

Regards

Purnand

Read only

Former Member
0 Likes
1,081

Hi Gaurav,

u will come to better conclusions when u urself try the things and face issues and then try to resolve them ............

I suggest you to go thru online R/3 help and Debugger. I'm sure u'll be able to proceed .....

Thanks

Vivek

Read only

Former Member
0 Likes
1,081

Hi Gaurav,

Please close the thread if you have got your answer.

Regards

Purnand

Read only

0 Likes
1,081

Thanks all for your Valuable answers.

]

Thanks & Regards

Gaurav Mahendra