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

Former Member
0 Likes
941

Hi,

Program to enable user to enter data and display data.

Define the following Parameters and Select-options:

Field Type Length Default Value Assign Value

P_PARAM1 I ‘959’

P_PARAM2 C 30

S_MATNR MARA-MATNR

P_DATE D SY-DATUM

select option for s_matnr

LOOP AT S_MATNR.

WRITE:/ S_MATNR-LOW.

ENDLOOP.

After writing the program it is showing the error that:

"Structures with components that are not character type can not be displayed on the selection screen".

Thanks

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
916

HI,

Try like this,

tables: mara.

parameters: P_PARAM1 type I default 959,

P_PARAM2(30) type C .

select-options S_MATNR for MARA-MATNR .

parameter: P_DATE like SY-DATUM .

LOOP AT S_MATNR.

WRITE:/ S_MATNR-LOW.

ENDLOOP.

Regards

Subramanian

8 REPLIES 8
Read only

Former Member
0 Likes
916

yoru declaration is wrong. use this

parameters:

P_PARAM1 type I,

P_PARAM2(30),

P_DATE type SY-DATUM.

select-option s_matnr for mara-matnr.

it will work.

-Guru

Reward helpful answers

Read only

Former Member
0 Likes
917

HI,

Try like this,

tables: mara.

parameters: P_PARAM1 type I default 959,

P_PARAM2(30) type C .

select-options S_MATNR for MARA-MATNR .

parameter: P_DATE like SY-DATUM .

LOOP AT S_MATNR.

WRITE:/ S_MATNR-LOW.

ENDLOOP.

Regards

Subramanian

Read only

0 Likes
916

Two questions arises in my mind:

1) why we need to write MARA-MATNR? what is meaning of that?

2) even without LOOP....END LOOP I can execute the program, so what is the requirement for this?

Thanks

Sulogna

Read only

0 Likes
916

Hi,

The reason why you require MARA-MATNR, is to inform which characteristics of data element of which table should the variable acquire.

For this you have to declare that table name in the TABLES declaration part. [ This is nothing but the work area for that table ].

Select-options are in the form of an internal table which has a structure of fields:

sign,

option,

low,

and high.

So all the values you enter in the select-options are stored in the form of an internal table. To read this internal table, you should use loop..endloop.

Regards

Subramanian

Read only

0 Likes
916

Hi,

tables: mara.

parameters: p_param type I default 959,

p_param2(30).

select-options : s_matnr for mara-matnr .

parameter: p_date like sy-datum .

loop at s_matnr.

write : / s_matnr-low.

endloop.

1. In Mara table matnr field is of type char whose length is 18

<b>select-options : s_matnr for mara-matnr</b>

here u r taking range of values of a variable of type char whose length is 18

if u r using select-options u have to mention table statement

tables : mara.

2. when ever u r entering values in s_matnr ( say 10 35 )

10 will be stored in s_matnr-low

35 will be stored in s_matnr-high

if u want to print s_matnr-low value u dont need loop and endloop.

directly u can write the statement

<b>write : / s_matnr-low.</b>

tables: mara.

parameters: p_param type I default 959,

p_param2(30).

select-options : s_matnr for mara-matnr .

parameter: p_date like sy-datum .

write : / s_matnr-low.

Read only

Former Member
0 Likes
916

sorry i can not understand your actual requirement but if you want to display in outputn list then please use event start-of-selection and then use writhe command.

i think you are using some at selection-screen event.

start-of-selection.

LOOP AT S_MATNR.

WRITE:/ S_MATNR-LOW.

ENDLOOP.

regards

shiba dutta

Read only

Former Member
0 Likes
916

Hi,

the problem is with declaration kindly check the same

P_PARAM1 I ‘959’

P_PARAM2 C 30

S_MATNR MARA-MATNR

P_DATE D SY-DATUM

try like this

tables : mara.

data : P_PARAM1 type I value 959,

P_PARAM2(30) type C,

P_DATE type SY-DATUM.

select-options :S_MATNR for MARA-MATNR.

LOOP AT S_MATNR.

WRITE:/ S_MATNR-LOW.

ENDLOOP.

Hope this will help.

Thanks

Shiva

Read only

Former Member
0 Likes
916

hi,

there is a problem in your declaration.

data:

P_PARAM1 type I default ‘959’ ,

P_PARAM2 type c value '30' , " if 30 is length then P_PARAM2(30) type c

S_MATNR for MARA-MATNR ,

P_DATE type SY-DATUM .

select option for s_matnr

LOOP AT S_MATNR.

WRITE:/ S_MATNR-LOW.

ENDLOOP.

check this.