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

Screen validations

Former Member
0 Likes
837

Hi Experts,

How can i do the screen validations with Ranges. The below is the Description in the Func. Specs.

Posting date-FAGLFLEXA-BUDAT-Range with F4 help on date. Single Multiple values should also work

G/L Account-FAGLFLEXA-RACCT-Range with F4 help. Single Multiple values should also work

Validation: Verify that this FAGLFLEXA-RACCT is maintained as KONTS in the table T030K. The chart of account T030K-KTOPL required to access this table can be found by entering Company code BUKRS into table V_001_S and pick up V_001_S-KTOPL.

Thanks & Regards,

Ramana

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
779

AT SELECTION-SCREEN Event

Take s_variable which contains date.

Loop at s_variable.

your validation code with following field

s_variable-low.

s_variable-high.

Endloop.

Regards,

Swarup

Edited by: swarup basagare on Jun 26, 2008 8:18 AM

6 REPLIES 6
Read only

Former Member
0 Likes
779

Hi,

in AT SELECTION-SCREEN Event.

FAGLFLEXA-RACCT for this field check table is SKB1.

if your selection screen has sales org.

select SAKNR into l_SAKNR

from SKB1

up to 1 rows

where BUKRS = s_BUKRS

and SAKNR = s_SAKNR.

if sy-subrc <> 0.

message e000(8i) with 'Error'.

endif.

otherwise.

select SAKNR into l_SAKNR

from SKB1

up to 1 rows

where SAKNR = s_SAKNR.

if sy-subrc <> 0.

message e000(8i) with 'Error'.

endif.

this will work for single and range values.

Regards,

SB

Read only

Former Member
0 Likes
780

AT SELECTION-SCREEN Event

Take s_variable which contains date.

Loop at s_variable.

your validation code with following field

s_variable-low.

s_variable-high.

Endloop.

Regards,

Swarup

Edited by: swarup basagare on Jun 26, 2008 8:18 AM

Read only

0 Likes
779

Hi Swarup,

Thanks for your reply.

But can you clearly explain that.

Thanks in Advance.

Regards,

Ramana

Read only

0 Likes
779

As per your question u are using select-option.

select-option is nothing but it creates internal table.

suppose if u r using S_date then it creates internal table of same name containing sign,opt,low, high columns

If you put range then s_date-low contains <lower limit> & s_date-high higher <higher limit>

i.e.

s_date = 01.05.2008 to 05.05.2008

then

s_date-low = 01.05.2008

s_date-high = 05.05.2008

like that

and if you put multiple values like diffrent dates

then i appends that multiple date in to s_date-low

ie

s_date = 01.05.2008

03.05.2008

06.05.2008

then it will appear as

sign opt low high

I EQ 01.05.2008

I EQ 03.05.2008

I EQ 06.05.2008

in select option.

Now i guess u will clear with the select option concept

Accordingly you can use LOOP STATEMENT on S_DATE

either in AT-SELECTION screen or in INITIALIZATION

Hope you will get an Answer

Regards ,

Swarup

Read only

former_member156446
Active Contributor
0 Likes
779

hi check this code:

form validate_screen .

if s_werks-low is initial.
message 'Please enter a plant.' type 'E'.
endif.
clear: v_ekorg,
v_werks.
loop at s_werks.
if s_werks-high ne ' '.
if s_werks-low is initial.
message e445(wu).
else.
select t001w~ekorg t001w~werks from t001w
into (v_ekorg, v_werks)
where t001w~werks ge s_werks-low and
t001w~werks le s_werks-high.
clear v_errflag.
authority-check object 'M_BEST_EKO'
id 'ACTVT' dummy
id 'EKORG' field v_ekorg.
if sy-subrc ne 0.
v_errflag = v_errflag + 1.
endif.
authority-check object 'M_MSEG_WRK'
id 'ACTVT' dummy
id 'WERKS' field v_werks.
if sy-subrc ne 0.
v_errflag = v_errflag + 1.
endif.
if v_errflag > 1.
message e007(wrb) with v_werks.
endif.
endselect.
endif.
else.
select t001w~ekorg t001w~werks from t001w
into (v_ekorg, v_werks)
where t001w~werks eq s_werks-low.
clear v_errflag.
authority-check object 'M_BEST_EKO'
id 'ACTVT' dummy
id 'EKORG' field v_ekorg.
if sy-subrc ne 0.
v_errflag = v_errflag + 1.
endif.
authority-check object 'M_MSEG_WRK'
id 'ACTVT' dummy
id 'WERKS' field v_werks.
if sy-subrc ne 0.
v_errflag = v_errflag + 1.
endif.
if v_errflag > 1.
message e007(wrb) with v_werks.
endif.
endselect.
endif.
endloop.

endform. " validate_screen

Read only

Former Member
0 Likes
779

Resolved by Myself