11-26-2008 10:18 AM
Hi all,
im creating a report in which i want the user should enter the posting date vaules only in the folowing 2 cond.
1. both values blank
2. both values mentioned.
i dont want the user to be enter only one value whether its budat-low or budat-high.
i tried it by using if cond. but its not working..
so plz give me the soln.
thanx....
11-26-2008 10:28 AM
see this...
REPORT Zpopup message-id zmsg.
select-options : s_date for sy-datum .
at selection-screen output .
if s_date-low is initial and s_date-high is not initial .
message i023 with 'enter both values or enter both blank'.
elseif s_date-low is not initial and s_date-high is initial .
message i023 with 'enter both values or enter both blank'.
endif.
.
11-26-2008 10:21 AM
hi,
use at selection screen on field event and write your logic.
ex:
at selection-screen on bpvno.
select single bukrs belnr gjahr augdt from bseg into ibseg3
where bukrs = ccode and
augdt in p_clrdt and
belnr in bpvno .
if sy-subrc = 0.
select single bukrs belnr blart from bkpf into ibkpf3 where
bukrs = ccode and
belnr in bpvno and
gjahr = ibseg3-gjahr.
endif.
if ibkpf3-blart ne 'BR'.
message 'Enter BR Document Type' type 'E'.
endif.
11-26-2008 10:25 AM
Hi,
If it is a selection screen field then when u execute the program they will appear as blank and if u give some values , i mean default values then they will have values....
Regards,
Nagaraj
11-26-2008 10:28 AM
Hi,
try this,
If budat-low is initial or budat-high is initial.
message w005(ZA).
endif.
it will work.
Regards,
Kusuma.
11-26-2008 10:28 AM
see this...
REPORT Zpopup message-id zmsg.
select-options : s_date for sy-datum .
at selection-screen output .
if s_date-low is initial and s_date-high is not initial .
message i023 with 'enter both values or enter both blank'.
elseif s_date-low is not initial and s_date-high is initial .
message i023 with 'enter both values or enter both blank'.
endif.
.
11-26-2008 10:48 AM
>
> see this...
>
> REPORT Zpopup message-id zmsg.
>
> select-options : s_date for sy-datum .
>
> at selection-screen output .
>
> if s_date-low is initial and s_date-high is not initial .
>
> message i023 with 'enter both values or enter both blank'.
>
> elseif s_date-low is not initial and s_date-high is initial .
>
> message i023 with 'enter both values or enter both blank'.
>
> endif.
> .
thanx a lot it worked i just added stop to this .
and removed 'i' from mesg id and added 's'.
can u tel me how to increase the length of the message if it is possible..?
and also i dont want the msg. no to be display..
thanx...
11-26-2008 11:08 AM
>
> >
> > see this...
> >
> > REPORT Zpopup message-id zmsg.
> >
> > select-options : s_date for sy-datum .
> >
> > at selection-screen output .
> >
> > if s_date-low is initial and s_date-high is not initial .
> >
> > message i023 with 'enter both values or enter both blank'.
> >
> > elseif s_date-low is not initial and s_date-high is initial .
> >
> > message i023 with 'enter both values or enter both blank'.
> >
> > endif.
> > .
>
> thanx a lot it worked i just added stop to this .
> and removed 'i' from mesg id and added 's'.
> can u tel me how to increase the length of the message if it is possible..?
> and also i dont want the msg. no to be display..
> thanx...
plzz answer this one..
11-26-2008 10:30 AM
i have already created the report but this is the last minute change so i dont want to make changes in my code now. so im trying to do it by if i.e simple way and without changeing the code..
11-26-2008 10:32 AM
Hi Nilesh,
Try this,
IF ( budat-low is initial and budat-high is initial ) OR (budat-low is not initial and budat-high is not initial ).
ENDIF.
11-26-2008 10:34 AM
Hi Nilesh,
Try it this way:
Data:
w_date type budat.
Select-options:
s_date for w_date.
At selection-screen on s_date.
If s_date-low is initial and s_date-high is not initial.
Message: 'enter a value in s_date-low' type 'E'.
Elseif s_date-high is initial and s_date-low is not initial.
Message: 'enter a value in s_date-high' type 'E'.
Endif.
End-of-selection.
Write:/ s_date-low,
s_date-high.
With luck,
Pritam.
11-26-2008 10:34 AM
Hi Nilesh,
Do it in this way:
at selection-screen output .
if s_budat-low is initial and not s_budat-high is initial.
Give your error message***
elseif not s_budat-low is initial and s_budat-high is initial.
Check your condition and give error message***
endif.
Regards,
Nitin.
11-26-2008 10:35 AM
sample example.
select-options : s_budat for bsad-budat.
at selection-screen.
if s_budat-low ne '' or s_budat-high = ''.
.
message E001(0) with 'remove date you entered'.
endif.
11-26-2008 11:03 AM
11-26-2008 11:12 AM
05-22-2009 12:30 PM