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

At selection screen validation

Former Member
0 Likes
781

hi all

i wanna do validation in at selection-screen for the field Fiscal year and fiscal period. no alphabets should be entered and in fiscal period no numbers more than 12 should be enterd. if it is entered so , should give error message.

Pls let me know wat to dowith this.

Thanks

Saravana

6 REPLIES 6
Read only

Former Member
0 Likes
728

hi,

At selection-screen on p_year.

if p_year cp sy-abcde.

message I001. "error'.

endif.

define define the length of fiscal year character of length 12.

rewards if useful

regards,

nazeer

Read only

0 Likes
728

Hello Saravana,

Declare your parameter for Fiscal Year as TYPE any data element of NUMC4.

Example: BEGJJ

As for fiscal period, u can declare it TYPE AM_MONAT (just an example).

AM_MONAT domain is of NUMC2 and has value range 1 to 12.

U can have a range with values 1 to 12. If parameter for fiscal period NOT IN that range, throw an error.

Please reward if this helps U.

Regards,

Johnson

Message was edited by:

Johnson Ittyerah

Read only

0 Likes
728

hi saravana,

u can use this code.... it will work

data : P_MONTH LIKE VVIS_SOPTI-SMONTH.

PARAMETERS : S_MONTH LIKE T247-MNR OBLIGATORY.

PARAMETERS : P_YEAR LIKE SCAL-YEAR OBLIGATORY.

AT SELECTION-SCREEN ON VALUE-REQUEST FOR S_MONTH.

CALL FUNCTION 'REAL_ESTATE_F4_MONTH'

EXPORTING

I_MONTH = 00

I_POPUP_TITLE = 'Choose Month'

IMPORTING

E_MONTH = P_MONTH.

  • E_SEL_OK =

S_MONTH = P_MONTH.

then u ca use if condition,

if p_year gt sy-datum+0(4).

message 'u cant enter future year' type 'I'.

endif.

Read only

Former Member
0 Likes
728

Hi

declare variables like

data: v_no(10) type C value '0123456789',

v_m1(2) type n value '01'.

v_m2(2) type n value '12'.

At selection-screen on p_year.

if not p_year CS v_no. (you can user other string parametrs like CO, CN etc)

message 'Enter correct fiscal year'.

endif.

At selection-screen on p_year.

if ( p_monat lt p_m1 and p_monat gt p_m2 ).

message 'Enter correct fiscal period'.

endif.

Reward points if useful

Regards

Anji

Read only

Former Member
0 Likes
728

hi,

data : abc type c.

At selection-screen p_fiscalyear p_fiscal period.

if p_fiscalyear > 12 and p_fiscalyear = abc.

message (Zerror) .

endif.

go to SE93 and type error message for Zerror Transaction code.

Reward with points if helpful.

Read only

Former Member
0 Likes
728

HI SRAVAN,

parameters: p1(2) type i,

p2(2) type i.

data: v_no(10) type C value '0123456789',

v_m1(2) type n value '01'.

v_m2(2) type n value '12'.

At selection-screen on p_year.

if not p_year CS v_no. (you can user other string parametrs like CO, CN etc)

message W000 WITH 'Enter correct fiscal year'.

endif.

At selection-screen on p_year.

if ( p_month lt p_m1 and p_month gt p_m2 ).

message W000 WITH 'Enter correct fiscal period'.

endif.

if helpful reward some points.

with regards,

suresh babu.