Hot Search: my ipod 4th generation wont turn on how to configure uwl with mdm Go Launcher themth disk utility konica minolta job parameters crashing user soa composer filetype:ini wordfence ramada inns
Home >Default > Validation of SELECT OPTIONS

Validation of SELECT OPTIONS

-0001-11-30 | Default
Advertisement
Hi Gurus,
Please let me know which is the best way to validate a select option and performance way also it must be best.
May be this is a silly question but still I was not able to find the best convincing answer in the FORUM.
Kindly validate.
Method 1:
AT SELECTION-SCREEN ON so_vbeln . " Delivery document
PERFORM validate_vbeln .
FORM validate_vbeln.
DATA : l_t_vbeln TYPE TABLE OF vbuk-vbeln WITH HEADER LINE ,
l_f_vbeln TYPE vbuk-vbeln .
RANGES ra_vbeln FOR vbuk-vbeln.
LOOP AT so_vbeln.
IF NOT so_vbeln-low IS INITIAL.
ra_vbeln-sign = 'I'.
ra_vbeln-option = 'EQ'.
ra_vbeln-low = so_vbeln-low.
APPEND ra_vbeln.
ENDIF.
IF NOT so_vbeln-high IS INITIAL.
ra_vbeln-sign = 'I'.
ra_vbeln-option = 'EQ'.
ra_vbeln-low = so_vbeln-high..
APPEND ra_vbeln.
ENDIF.
ENDLOOP .
IF NOT so_vbeln[] IS INITIAL.
SELECT vbeln INTO TABLE l_t_vbeln
FROM vbuk
WHERE vbeln IN ra_vbeln.
ENDIF.
LOOP AT so_vbeln.
IF so_vbeln-low space.
READ TABLE l_t_vbeln WITH KEY = so_vbeln-low.
IF sy-subrc 0.
SET CURSOR FIELD 'SO_vbeln-LOW'.
MESSAGE e001(vb) WITH so_vbeln-low.
ENDIF.
ENDIF.
IF so_vbeln-high space.
READ TABLE l_t_vbeln WITH KEY = so_vbeln-high.
IF sy-subrc 0.
SET CURSOR FIELD 'SO_vbeln-HIGH'.
MESSAGE e001(vb) WITH so_vbeln-high.
ENDIF.
ENDIF.
ENDLOOP.
ENDFORM. " validate_vbeln
Method 2
AT SELECTION-SCREEN ON so_werks.
PERFORM validate_plant.
FORM validate_plant.
DATA: BEGIN OF l_t_werks OCCURS 0,
werks LIKE t001w-werks,
END OF l_t_werks.
IF NOT so_werks[] IS INITIAL.
SELECT werks INTO TABLE l_t_werks
FROM t001w
WHERE werks IN so_werks.
ENDIF.
LOOP AT so_werks.
IF so_werks-low space.
READ TABLE l_t_werks WITH KEY werks = so_werks-low.
IF sy-subrc 0.
MESSAGE e892(m7) WITH so_werks-low.
ENDIF.
ENDIF.
IF so_werks-high space.
READ TABLE l_t_werks WITH KEY werks = so_werks-high.
IF sy-subrc 0.
MESSAGE e892(m7) WITH so_werks-high.
ENDIF.
ENDIF.
ENDLOOP.
ENDFORM.

Latest answer

Advertisement
Hello Raj,
For me if the SELECT-OPTION fetches atleast one record from the check table, processing should be allowed to proceed.
It's not required to check each & every records in the select-option & throw an error message for these invalid records (unlike PARAMETERs)
I would code something like this:
SELECT vbeln INTO TABLE l_t_vbeln UP TO 1 ROWS
FROM vbuk
WHERE vbeln IN so_vbeln. ENDSELECT.
IF sy-subrc NE 0.
  MESSAGE 'No valid Sales Order selected for the input range. Please check.' TYPE 'E'.
ENDIF.
BR,
Suhas

Related recommended

How to do validations for select-options

Hi gurus, can you suggest me how to do validations for select-options Thanks&ragards, Kals.HI, TABLES: BKPF. TYPES: BEGIN OF TY_BKPF,        BUKRS TYPE BUKRS,   "COMPANY CODE        GJAHR TYPE GJAHR,   "FISCAL YEAR        MONAT TYPE MONAT,   [More]

-0001-11-30 Default

Validation of select-options in WEb DynPro ABAP

Can anyone please help me on validating select-options. I want to have a functionality like what we use in normal text field while validating the field. We generally use the REPORT_ATTRIBUTE_ERROR_MESSAGE funciton. How can we achieve the same thing w [More]

2015-10-11 Default

Validation for Select-Option - Issue

Hi Experts!! I have a select-option s_field on which I have written a validation under AT SELECTION-SCREEN. Now, the problem is that, if validation fails in second line of s_field, then to change it when we click on Extension, it's not allowing to en [More]

2015-10-11 Default

Validation of SELECT-OPTIONS in selection screen

Hi Experts, I need to validate the user entered values in the selection screen, specifically in SELECT-OPTIONS. So, currently am doing by checking S_VBELN-LOW and S_VBELN-HIGH. BUt, curious that Is there any standard SAP Function module to use for th [More]

2015-10-11 Default

Validation of Select Options for a field

Hi All, I need to write a validation logic for a select option for VTWEG (Distribution Channel). select-options:  s_vtweg for komg-vtweg. I need to check whether the user has entered the correct value based on the search help. The check table of this [More]

-0001-11-30 Default

Validation of SELECT OPTIONS

Hi Gurus, Please let me know which is the best way to validate a select option and performance way also it must be best. May be this is a silly question but still I was not able to find the best convincing answer in the FORUM. Kindly validate. Method [More]

-0001-11-30 Default

Validation for select-options

need help in validaiton for select-options.Hi.., could u paste ur selection screen declarations here !!! check this.. *"Selection screen elements............................................ select-options :   s_vbeln for vbak-vbeln,              &quo [More]

-0001-11-30 Default

Validation of select-option in module pool

Hi experts, I want to make a check according to a field on my dynpro 100. The dynpro has a subscreen area and there is a select-option which I want to check (so_matnr). According to the check I want to update my table control on the same dnypro. How [More]

-0001-11-30 Default

Validating a select option

What is the best way to validate a select option on the selection screen. Is there any way to do it without firing a select query.Hi, Refer This code.                 AT SELECTION SCREEN                                  * AT SELECTION-SCREEN. *--This [More]

-0001-11-30 Default

Date validation using select-options

i have declared date1 as select-options which is in date format. I need to validate min of SIX months duration from LOW value to HIGH value in select-options.How to validate for min SIX monthsHi, u can go through the following code.. data:   w_date l [More]

-0001-11-30 Default

Click Ranking

  • Recording audio from internet

    This thread has been moved to another message board. Click the link to jump to its new location.The Recorder Forum is HERE.  This is the Laptop Computer Forum.Read other 2 answers

  • How to change the battery in my bluetooth

    i got the new one but don't want to harm the case to change it.a little help please.Hmm, a quick scan over the manual does not indicate how to change the battery.  But their web page has a contact tab which will open your email client to sent them em

  • Can I use both iPhoto and Aperture on the same library?

    I like some of the features of iPhoto (like faces and places) but prefer to work in Aperture for its rich tool content. Is there any way I can use both iPhoto and Aperture on the same library? Or, import images from Aperture into iPhoto? Thanks much!

  • Problem exporting HUGE ship drawings to any graphics format.

    I work at a law firm which deals with very large drawings (some of which are 4 feet wide, by about 16 to 20 feet long).  Sometimes we receive PDF's of these drawings, but their sheer size makes them unmanageable to print.  One option is to export the

  • Raw fine tuning not working in slideshows

    Hi, Does anyone know why when I adjust the de-noise level of an image in Raw Fine Tuning and then use that image in a slideshow why the adjustment is not applied to the image shown in the slideshow? I've tried regenerating the preview but it didn't m

  • Random FRM 92101 and FRM 92050

    Hello Everyone, I have Oracle EBS R12.1.3 installed with Vizio Demo Instance on Oracle Database 11.0.7.0. I have 3 application servers. Web Server runs on all three application servers. While trying to launch forms from Security->User->Define/Monito

  • Removing Features of Controls, on Embedded Video

    Is there any way to remove the expand feature from the controls on an embedded video?  When my video expands... it doesn't center.  Or is there a reason why it isn't centering?Please upload it to dropbox or anyother online storage service, and send u

  • How do I permanently remove apps from iCloud?

    I would like to permanently remove old and unwanted apps from iCloud and all my devices (iPad, iPhone, and iTunes), but there does not seem to be a way to do this. In fact, there seems to be an strong underlying effort to avoid this option. No discus

  • Can't see systemd-journald log

    Hi I'm new about arch linux I have tired enabling systemd log with system.conf and journald.conf like below. But I can't see log system.conf 13 [Manager]                                                                        14 LogLevel=debug       

  • Bex Formula Rounding Up Values!

    Hi Guys, I am doing a calculation in BEx where I divide items by days (items%Adays) but the result value is 4.77 on a calculator but Bex rounds up to 4.0!  All my results differ by the fraction so I need to the 4.77 to come up else all columns will b