‎2009 Dec 15 11:42 AM
hi
i need to check whether all entries in SELECT-OPTIONS range are valid or not.
*my select-options field is s-pernr as below.
SELECT-OPTIONS: s_pernr FOR pernr-pernr.
*all valid entries from PA0000 table will be selected into pernr_table.
SELECT DISTINCT pernr
FROM pa0000
INTO TABLE pernr_table
WHERE pernr IN s_pernr.
now i have to check all invalid pernr's in s_pernr.
s_pernr contains: 1, 5, 6, 7, 8, 9, 10.
PA0000 contains: 1, 2, 5, 8, 10, 11, 13, 15...
then pernr_table = 1, 5, 8, 10 only.
that means pernr 6, 7, 9 in s_pernr were invalid.
How to fetch these values as s_pernr is SELECT-OPTIONS field and it may have any combination of values.
‎2009 Dec 15 1:34 PM
Hi,
Change the select-options as No-Extension/No-Intervals or else change it to parameter.
Otherwise we cannot validate all values as select options also involved exclusion or ranges.
Regards
Karthik D
‎2009 Dec 15 11:47 AM
u have define the select-option.
U know it is struture with SIGN OPTION,HIGH and LOW FIELD.
use FOR ALL ENTRIES for that selction structure.
‎2009 Dec 15 12:01 PM
Hi Manjari Agrawal,
Use
AT SELECTION-SCREEN.
SELECT DISTINCT pernr
FROM pa0000
INTO TABLE pernr_table
WHERE pernr IN s_pernr.Compare the value of internal table pernr_table and select-option range..
if not matching then give error message..
Here pernr_table table contains only valid PERNRs... so whatever PERNRs are not matching this criteria will be invalid..
Hope it will solve your problem..
Thanks & Regards
ilesh 24x7
ilesh Nandaniya
‎2009 Dec 15 12:07 PM
no.
i have to compare the value of select-option range with those in internal table pernr_table.
and not the vice versa
‎2009 Dec 15 12:13 PM
Hi,
You can try either of these.
1. Copy your internal table data into some temporary internal table and try
DELETE it_temp WHERE field NOT IN s_selopt
This will delete all those data that are not present in s_selopt.
2. Alternatively, write a logic to convert all the data in your select options to some internal table.
Please be mindful of 'I', 'E', 'BT', 'EQ', 'CP'.
‎2009 Dec 15 12:07 PM
AT SELECTION-SCREEN ON SO_PROM().
perfrom validate_promo.
write ur code in this perform.
hope it solves your problem.
regards,
Abhijit
‎2009 Dec 15 12:15 PM
Hi,
As far as what i get from your question is, user put multiple values in the LOW field of the select-option and you have to
check all the values entered in the select-option-LOW field.
If this is the case, you can loop at select-option as show :-
1) create an internal table of type
BEGIN OF ty_pernr ,
sign(1) TYPE c,
option(2) TYPE c,
low TYPE pa0000-pernr,
high TYPE pa0000-pernr,
END OF ty_pernr.
2) create workarea of type ty_pernr.
data wa_pernr type ty_pernr.
3) loop at the select-option.
loop at s_pernr into wa_pernr.
SELECT single pernr
FROM pa0000
INTO TABLE pernr_table
WHERE pernr eq wa_pernr-low.
if sy-subrc ne 0.
"give error message.
endif.
endloop.
Hope this solves ur problem.
Regards,
Bhavesh.
‎2009 Dec 15 12:50 PM
Hello,
Your idea of validating a SELECT-OPTION is flawed if you can maintain ranges i.e., HIGH & LOW values.
You have to restrict the SELECT-OPTION so that user cannot input range values, else i cannot think of any fullproof solution for this
BR,
Suhas
‎2009 Dec 15 1:34 PM
Hi,
Change the select-options as No-Extension/No-Intervals or else change it to parameter.
Otherwise we cannot validate all values as select options also involved exclusion or ranges.
Regards
Karthik D
‎2009 Dec 16 12:12 PM
Instead of using the select statement in loop better to use for all entries and then compare the retrieved data with the input data (selection screen).