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-options

Former Member
0 Likes
812

Hi all,

I have a declaration like

data : begin of it_data occurs 0,

matnr like mara-matnr,

ernam like mara-ernam,

end of it_data.

select-options s_data for it_data.

so frnds can anyone tell me what is the problems in using this select-options and any performance problem.

regards,

satish

7 REPLIES 7
Read only

Former Member
0 Likes
793

Hi Satish,

You can not use SELECT-OPTION for an internal table.

You can only use Database tables.

And for using these table u have to define them in the top by using TABLES option.

Example if u want to use table field from MATNR in your select option.

Do like this.

TABLES : MATNR.

SELECT-OPTIUON.................................... and so on.

<REMOVED BY MODERATOR>

Edited by: Alvaro Tejada Galindo on Feb 15, 2008 2:51 PM

Read only

Former Member
0 Likes
793

Hi,

Select-options are declared only for feilds not for table. In your requirement you have to declare as

select-options: s_matnr for mara-matnr,

s_erdat for mara-erdat.

then it will execute perfectly.

Thanks

Sarada

Read only

0 Likes
793

.

Edited by: pranjali mode on Feb 15, 2008 4:36 PM

Read only

0 Likes
793

Hi,

After execution, it will display low option and high option with 30char length each(18 matnr & 12 ernam)..

So when u wil fill 30 characters in low then it wil fill matnr-low and ernam-low in sequence same applies to high option. Here we can access all fields MATNR-LOW HIGH & ERNAM-LOW HIGH. And selection table strucre wil b like sign option matnr-low ernam-low matnr-high ernam-high.

So it will execute normally.

<REMOVED BY MODERATOR>

-Pranjali.

Edited by: Alvaro Tejada Galindo on Feb 15, 2008 2:53 PM

Read only

Former Member
0 Likes
793

hi,

here s_data is internal Table.

The Components of This S_DATA is.

SIGN OPTION LOW-MATNR LOW-ERNAM HIGH-MATNR HIGH-ERNAM.

After execution of program if u give any value for low.

Every time it is assiging to LOW-MATNR.

we can not Assign the value LOW-ERNAM.

Similarly for HIGH-ERNAM also.

That is only the drawback with the above Declaration..

Anyway u done a Nice experiment.

<REMOVED BY MODERATOR>

Edited by: Alvaro Tejada Galindo on Feb 15, 2008 2:52 PM

Read only

RaymondGiuseppi
Active Contributor
0 Likes
793

By using this syntax, you get a SELECT-OPTIONS on a CHAR field of length 30

Be aware than in low field (resp. high) the conversion exit for matnr has not been executed,

Also, user will have to count the character and no search help available.

And you wont be able to use this SELECT-OPTIONS in a SELECT ... WHERE X IN selopt.

Interesting, but what was your purpose?

Regards

Read only

Former Member
0 Likes
793

SELECT-OPTION for DB table fields not for internal table fields.

you use code like this

data : abc type mara-matnr. (instead of table it is efficient)

data : begin of it_data occurs 0,

matnr like mara-matnr,

ernam like mara-ernam,

end of it_data.

select-options s_data for abc.