‎2006 Jan 09 9:07 PM
HI all,
REPORT ZV_PARAMETERS_DEMO.
Declaration of internal table.
data itab like mara occurs 0 with header line.
*defining parameters
PARAMETERS: value TYPE i DEFAULT 100 visible length 10,
p_matnr TYPE mara-matnr OBLIGATORY VALUE CHECK visible
length 10.
*populating data into internal table.
select * from mara into table itab where matnr = p_matnr.
*processing data from internal table.
loop at itab.
write : / itab-matnr,itab-ersda.
endloop.
Above is a sample code written by me for parameters. I expect the input boxes of both the parameters to be of equal length but they are not. can anyone tell me the reason.
Regards,
vijay
‎2006 Jan 09 9:10 PM
It is dependent on the type. Say we change the value parameter to have a length of 40 and TYPE C, then the two fields will match.
* Declaration of internal table.
data itab like mara occurs 0 with header line.
*defining parameters
PARAMETERS: <b>value(40) TYPE C</b> DEFAULT 100 visible length 10,
p_matnr TYPE mara-matnr OBLIGATORY VALUE CHECK
visible length 10.
*populating data into internal table.
select * from mara into table itab where matnr = p_matnr.
*processing data from internal table.
loop at itab.
write : / itab-matnr,itab-ersda.
endloop.Regards,
Rich Heilman
Message was edited by: Rich Heilman
‎2006 Jan 09 9:10 PM
It is dependent on the type. Say we change the value parameter to have a length of 40 and TYPE C, then the two fields will match.
* Declaration of internal table.
data itab like mara occurs 0 with header line.
*defining parameters
PARAMETERS: <b>value(40) TYPE C</b> DEFAULT 100 visible length 10,
p_matnr TYPE mara-matnr OBLIGATORY VALUE CHECK
visible length 10.
*populating data into internal table.
select * from mara into table itab where matnr = p_matnr.
*processing data from internal table.
loop at itab.
write : / itab-matnr,itab-ersda.
endloop.Regards,
Rich Heilman
Message was edited by: Rich Heilman
‎2006 Jan 09 9:17 PM
Also, if you change it to a TYPE N field, they also will have matching lengths.
* Declaration of internal table.
data itab like mara occurs 0 with header line.
*defining parameters
PARAMETERS: <b>value(40) TYPE n</b> DEFAULT 100 visible length 10,
p_matnr TYPE mara-matnr OBLIGATORY VALUE CHECK
visible length 10.
*populating data into internal table.
select * from mara into table itab where matnr = p_matnr.
*processing data from internal table.
loop at itab.
write : / itab-matnr,itab-ersda.
endloop.
REgards,
Rich Heilman