cancel
Showing results for 
Search instead for 
Did you mean: 

select-options

Former Member
0 Kudos

pls refer to the code below:

SELECT-OPTIONS: p_blart FOR bkpf-blart OBLIGATORY NO INTERVALS.

in the above code i can enter values of p_blart in multiple selections.

and now how should i write the values which i selected in multiple

selections .

how should i do it.

not i can code like this write: p-blart-low.

by which i get the lower range value.

but i do not need that. I want to write the values which i entered

in multiple selection screen.

how to di it.

deepak

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

LOOP at P_BLART.

write 😕 p_blart-low, p_blart-high.

ENDLOOP.

Answers (4)

Answers (4)

Former Member
0 Kudos

Hi,

Check with this code.

AT SELECTION-SCREEN.

check: not sy-ucomm = '%001'.

LOOP AT P_BLART.

IF P_BLART-SIGN NE 'I' OR P_BLART-OPTION NE 'EQ'.

message e000 with text-e02.

ENDIF.

ENDLOOP.

if P_BLART eq space.

message e000 with text-e01.

stop.

endif.

Here you can give your values in Ranges and Single selection.

loop at p_blart.

Select single * from ...............where BLART = P_blart-low.

endloop.

Thanks.

Message was edited by: Deepak333 k

Former Member
0 Kudos

There ar etwo ways to do that -

1.

Loop at p_blart.

write:/ p_blart-low, p_blart-high.

endloop.

This gives you only those selection that you entered in the selection screen for p_blart like if you give 'AA' in low value and give range of 'BB' to 'HH' by clicking on extension button, the above code will give you following output -

AA

BB HH

2.

data: begin of itab occurs 0,

blart like t003-blart,

end of itab.

select blart into table itab

from t003

where blart in p_blart.

if sy-subrc = 0.

loop at itab.

write:/ itab-blart.

endloop.

endif.

for the same above entries taken in point 1 i.e. 'AA' and range of 'BB' to 'HH', here you will get all those values as well which are in between 'BB' to 'HH'.

Message was edited by: Rajeev Nigam

andreas_mann3
Active Contributor
0 Kudos

Hi,

better select table T003 - this is clearly:

SELECT        * FROM  t003
       WHERE  blart  in p_blart.

write : / t003-blart.

ENDSELECT.

Andreas

Former Member
0 Kudos

if u want to write the inputs given in the select-optoins then u should loop the select-options .

loop at p_blart.

write : p_blart.

endloop.