cancel
Showing results for 
Search instead for 
Did you mean: 

Validation at Selection Screen Fileds

Former Member
0 Kudos

Hi Experts,

I have a scenario in which user needs to provide two Date fields From_Date & To_Date. Now i want to validate these fields that To_Date > From_Date in the selection Screen.How can i achieve this.

I have written a code in the Customer Exit giving an Error Message as in ABAP but as this error is raised connection to the BW Server gets disconnected. I want that, control should remain at the selection screen and it should ask for valid values.

Thanks.

Arpit Agarwal

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi,

If i am right the code is in the i_step = 2.

Please send me your code, let me check and get back to you.

--Hari

Former Member
0 Kudos

Hi

i_step = 3 should be used for validations.

Thanks

Gaurav

Former Member
0 Kudos

WHEN 'ZVALD05'.

IF i_step = 2 .

CLEAR : ls_range ,

wa_range ,

varcal_d.

ls_range-sign = 'I'.

ls_range-opt = 'EQ'.

READ TABLE i_t_var_range INTO wa_range

WITH KEY vnam = 'ZVALD04'.

varcal_d = wa_range-low.

READ TABLE i_t_var_range INTO wa_range

WITH KEY vnam = 'ZVALD01' .

IF wa_range-low > varcal_d.

MESSAGE e000(000) WITH 'Expiry Before should be greater than validon date'.

ENDIF.

ls_range-low = wa_range-low.

APPEND ls_range TO e_t_range .

ENDIF .

This is the code I am using.

Former Member
0 Kudos

Hi,

Have chek this link for hot to documnet.

use this link if you have an OSS ID.

http://service.sap.com/~form/sapnet?_SHORTKEY=00200797470000078090&_SCENARIO=01100035870000000112&_O...

Also you should verify the values in ISTEP 3.

put this code in I_STEP 3

IF wa_range-low > varcal_d.

MESSAGE e000(000) WITH 'Expiry Before should be greater than validon date'.

ENDIF.

Thanks

Former Member
0 Kudos

Arpit,

Validations needs to be coded with I_STEP = 3.

Nagesh Ganisetti.

  • Assign points if it helps.

Former Member
0 Kudos

but when i debug when istep = 3 variable name is coming to be blank

so where to write this code.

Former Member
0 Kudos

Try this code...

IF I_STEP = 3.

SORT I_T_VAR_RANGE BY VNAM.

READ TABLE I_T_VAR_RANGE INTO LOC_VAR_RANGE

WITH KEY VNAM = 'ZFV_QTR' BINARY SEARCH.

IF SY-SUBRC = 0.

CASE LOC_VAR_RANGE-LOW+51(8).

WHEN ' 1.00000' OR ' 2.00000' OR ' 3.00000' OR ' 4.00000'.

WHEN OTHERS.

CALL FUNCTION 'RRMS_MESSAGE_HANDLING'

EXPORTING

I_CLASS = 'RSBBS'

I_TYPE = 'I'

I_NUMBER = '000'

I_MSGV1 = 'Quarter Value Should be 1 or 2 or 3 or 4!'.

RAISE NO_REPLACEMENT.

ENDCASE.

ENDIF.

ENDIF.

change the Variable Name and Logic. Trigger your message using FM. Variable values you can get from I_T_VAR_RANGE.

Nagesh Ganisetti.

  • Assign points if it helps.

Former Member
0 Kudos

Hi Arpit ,

1. Define a static variable of let say LV_ERROR Type C .

2. In step I_STEP =2 if errornous situation found then set this flag (LV_ERROR) to 'X' .

3. Check the value of this varaible in I_STEP =3 if the value remains 'X' then issue error message. This way you wont require all the variable values in I_Step = 3.

Hope that helps.

Regards

Mr Kapadia

Former Member
0 Kudos

HI gaurav,

where will we find these codes..

Iam beginner in reporting ..

I-step??? where can i find these

pavan

Answers (1)

Answers (1)

Former Member
0 Kudos

Hi all,

I forgot to mention that this all needs to be done in Bex.

Thanks again

Arpit Agarwal

Former Member
0 Kudos

Would it be possible to setup a date variable based upon a "range". When it is "between" 2 dates, the from-date has to be before the to-date.