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

Parameters doubt

Former Member
0 Likes
410

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

1 ACCEPTED SOLUTION
Read only

RichHeilman
Developer Advocate
Developer Advocate
0 Likes
392

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

2 REPLIES 2
Read only

RichHeilman
Developer Advocate
Developer Advocate
0 Likes
393

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

Read only

0 Likes
392

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