cancel
Showing results for 
Search instead for 
Did you mean: 

Reg : Multiple Select Option with validation.

Former Member
0 Kudos
52

Hi Abap Guru's,

In my report iam giving the Input using the select option : Movement type in which i need to take only few mov.types like 101,105,321,344 in my report .Pls help me how to do ASAP..?

Accepted Solutions (1)

Accepted Solutions (1)

ravisankara_varaprasad
Active Participant
0 Kudos

Hi,

please follow the below approach which will give you the desire results.

data: mtype(3) type c.

select-options: s_mtype for mtype.

Types: begin of ty_range,

sign type bapisign,

Option type bapioption,

low(3) type c,

high(3) type c,

End of ty_range.

Data: i_range type standard table of ty_range,

wa_range type ty_range.

Clear wa_range.

Wa_range-sign = 'I'.

wa_range-option = 'EQ'.

wa_range-low = '101'.

Append wa_range to i_range.

*Clear wa_range.

*Wa_range-sign = ‘I’.

*Wa_range-option = ‘EQ’.

*Wa_range-mtype = ’105’.

*Append wa_range to i_range.

*

*Clear wa_range.

*Wa_range-sign = ‘I’.

*Wa_range-option = ‘EQ’.

*Wa_range-mtype = ’321’.

*Append wa_range to i_range.

*

*Clear wa_range.

*Wa_range-range-sign = ‘I’.

*Wa_range-option = ‘EQ’.

*Wa_range-mtype = ’344’.

*Append wa_range to i_range.

*

*read table i_range into wa_range with key low in s_mtype[].

delete s_mtype[] where low not in i_range[].

If s_mtype[] is initial.

break-point.

*“ raise the error here.

else.

" use this internal table for furhter process

Endif.

Hope it helps you.

Kind Regards,

Ravi Sankar.Z

Former Member
0 Kudos

Hi,

An addition to what Ravi sugested. Check for LOW as well as HIGH value in ranges of moment type.

Regards

Sourabh verma

Former Member
0 Kudos

Hi,

While trying to execute ur code then its not showing the default movement types like 101,105,321,344.Pls help me.

ravisankara_varaprasad
Active Participant
0 Kudos

Hi ,

refer the below code.

First it defaults the required values to selection screen ( at initialization event ).

and then if user enters any other value then this value will be ignored.

&----


*& Report ZRTESTTEST

*&

&----


*&

*&

&----


REPORT ZRTESTTEST.

data: mtype(3) type c.

select-options: s_mtype for mtype.

Types: begin of ty_range,

sign type bapisign,

Option type bapioption,

low(3) type c,

high(3) type c,

End of ty_range.

Data: i_range type standard table of ty_range,

wa_range type ty_range.

initialization. " initialization.

s_mtype-sign ='I'.

s_mtype-option = 'EQ'.

s_mtype-low = '101'.

append s_mtype.

clear s_mtype.

s_mtype-sign ='I'.

s_mtype-option = 'EQ'.

s_mtype-low = '105'.

append s_mtype.

clear s_mtype.

s_mtype-sign ='I'.

s_mtype-option = 'EQ'.

s_mtype-low = '321'.

append s_mtype.

clear s_mtype.

s_mtype-sign ='I'.

s_mtype-option = 'EQ'.

s_mtype-low = '344'.

append s_mtype.

Clear wa_range.

Wa_range-sign = 'I'.

wa_range-option = 'EQ'.

wa_range-low = '101'.

Append wa_range to i_range.

start-of-selection.

Clear wa_range.

Wa_range-sign = 'I'.

Wa_range-option = 'EQ'.

Wa_range-low = '105'.

Append wa_range to i_range.

Clear wa_range.

Wa_range-sign = 'I'.

Wa_range-option = 'EQ'.

Wa_range-low = '321'.

Append wa_range to i_range.

Clear wa_range.

Wa_range-sign = 'I'.

Wa_range-option = 'EQ'.

Wa_range-low = '344'.

Append wa_range to i_range.

*

delete s_mtype[] where low not in i_range[].

If s_mtype[] is initial.

break-point.

*“ raise the error here.

Endif.

Hope this helps you.

Kind Regards,

Ravi Sankar.Z

Former Member
0 Kudos

Hi,

Thanks a lot paaa ..so useful

ravisankara_varaprasad
Active Participant
0 Kudos

Hi Arthi,

Thanks for the points too.:)

Kind Regards

Ravi Sankar.Z

Answers (3)

Answers (3)

Former Member
0 Kudos

Hi,

Check this code.


At selection screen on S_movement_type.

if s_movement_type-low ne 101 or s_movement_type-low ne 105 
or s_movement_type-low ne 321 or s_movement_type-low ne 344. 
Message 'Give proper input' type 'E'.
endif.

Reward if helpful.

Regards.

Former Member
0 Kudos

Hi ,

This is addition to kumar suggested,

SELECT-OPTIONS:S_BWART FOR MSEG-BWART.

After executing,in the side press the Multiple selection and enter the movement types like 101, 105, 321 and 344 and save as variant.

whenever u want jst execute with varinat you will get desired output.

Regards,

Vishvesh

rewards if helfpul.

former_member210123
Active Participant
0 Kudos

AT SELECTION-SCREEN ON select_option.

right the conditions.

select_option-low will give the lowest value entered and high will the highest value entered.

former_member708410
Contributor
0 Kudos

Hi Arthi,

Use this code,

SELECT-OPTIONS:S_BWART FOR MSEG-BWART NO INTERVALS OBLIGATORY.

After executing,in the side press the pushbutton and enter the movement types.

Reward if helpful.

Regards,

Kumar