Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

Selection-Screen Validation

Former Member
0 Likes
738

Hi All,

In selection screen i should enter the month field only from MKPF-BUDAT.

which contains date as 01.03.2008.

i should capture only month.

selection screen should be like this..

Month----


> 03

i should not allow to enter day n year.

how to validate this

Regards

Suprith

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
699

Hi

lets say you declared PARAMATERS Like this

parameters month(2).

and you entered 03

now AT SELECTION-SCREEN event

select single month from t247 INTO month where month = month

( for correct field names go through T247 table)

if sy-subrc <> 0

message 'Please enter a Valid Month' type 'E'

endif.

Best Regards

Ramchander Rao.K

6 REPLIES 6
Read only

Former Member
0 Likes
700

Hi

lets say you declared PARAMATERS Like this

parameters month(2).

and you entered 03

now AT SELECTION-SCREEN event

select single month from t247 INTO month where month = month

( for correct field names go through T247 table)

if sy-subrc <> 0

message 'Please enter a Valid Month' type 'E'

endif.

Best Regards

Ramchander Rao.K

Read only

Former Member
0 Likes
699

Hi,

use the following piece of code :



report sy-repid.

parameters : p_month(2) type num.

Using this automtcailly user will have to enter a month number only and nothing else will be accepted.

Regards,

Mansi

Read only

0 Likes
699

Hi,

I need to use select-options not parameters

Read only

GauthamV
Active Contributor
0 Likes
699

hi,

use this data element.

Bkpf-MONAT.

Read only

Former Member
0 Likes
699

Hi suprith kumar,

rather using bkpf-budat. try out below way..

REPORT ZTEST_MONTH.

TABLES : ISELLIST.

SELECT-OPTIONS : S_MONTH FOR ISELLIST-MONTH.
DATA: MONTH LIKE VVIS_SOPTI-SMONTH.

AT SELECTION-SCREEN ON VALUE-REQUEST FOR S_MONTH-LOW.

  CALL FUNCTION 'REAL_ESTATE_F4_MONTH'
    EXPORTING
      I_MONTH       = 00
      I_POPUP_TITLE = 'Choose Month'
    IMPORTING
      E_MONTH       = MONTH.
*  E_SEL_OK =
  S_MONTH-LOW = MONTH.

AT SELECTION-SCREEN ON VALUE-REQUEST FOR S_MONTH-HIGH.

  CALL FUNCTION 'REAL_ESTATE_F4_MONTH'
    EXPORTING
      I_MONTH       = 00
      I_POPUP_TITLE = 'Choose Month'
    IMPORTING
      E_MONTH       = MONTH.
*  E_SEL_OK =
  S_MONTH-HIGH = MONTH.

Hope it will solve your problem..

Thanks & Regards

ilesh 24x7

Read only

Former Member
0 Likes
699

Hi..

For your specific select option just write the code

at selection-screen...

check if p_mon > 0 and p_mon <13...

consider the month numbers from 1 to 12..and then continue with the code for this check..this shud solve ur problem or else u can give errro messages for all other checks....