2007 Jan 17 11:51 PM
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
2007 Jan 18 12:06 AM
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
2007 Jan 17 11:57 PM
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
2007 Jan 18 12:06 AM
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
2007 Jan 18 5:20 AM
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
2007 Jan 18 5:49 AM
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
2007 Jan 18 6:26 AM
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.
2007 Jan 18 3:36 AM
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
2007 Jan 18 3:49 AM
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
2007 Jan 18 3:54 AM
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.