‎2009 Aug 26 2:29 PM
Hi all ,
I have a TableControl Having 4 columns and the Last Column is date.
My requirement is The Date field should not be blank ( if i left blank, it will fire a message To fill Date )
and the Date field of 2ndrow must be same like the Datefield -1st Row.
Condition 1 --if i enter a date ( 22.03.2009 ) in the Datefield-1st row and didnt enter the datefield in 2nd row-
MESSAGE that would be fired------ Pls enter the date .
*condition 2* --- if i enter the date ( 22.03.2009 ) in the Datefield-1st row and DIFFERENT DATE in 2nd row-Date field .
MESSAGE that would be fired -
pls enter same date.
My code is like below..
IN PAI ..
When 'enter' .
if Screenfield-Date is not initial .
it_date = screenfield-date.
else.
message ' enter the date ' .
endif..
But am confused For the condition -to Enter Same Date.
‎2009 Aug 27 4:24 AM
Hi
In PAI.
Loop at itab.
field itab-v_date module check_date.
endloop.
in program.
module check_date.
if tc-current_line = 1.
if itab-v_date is initial.
v_date = itab-v_date.
message 'Please enter a Valid Date'.
endif.
elseif itab-v_date <> v_date.
message 'Please enter the same date as you entered in the First row' type 'E'.
endif.
endmodule.
in top include declare a variable to V_date to capture the first entered Date
Hope this will serve your purpose
‎2009 Aug 26 7:46 PM
Hi,
Try like below:
1. Create a global variable like gv_previous this you have to do in top include.
2. Add code like below
{code]
IN PAI ..
When 'enter' .
if Screenfield-Date is not initial .
it_date = screenfield-date.
else.
message ' enter the date ' .
endif..
if not gv_previous is initial and gv_previous <> screenfield-Date.
message 'Date should be same as for row 1'.
else.
gv_previous = screenfield-date.
endif.
{code}
Regards,
Himanshu
‎2009 Aug 27 6:28 AM
Hi ,
thnks for ur reply ..
if not gv_previous is initial and gv_previous screenfield-Date. ??
Wht is this condition ?
‎2009 Aug 27 9:55 AM
Hi,
I think Himanshu meant 'NE'
if not gv_previous is initial and gv_previous NE screenfield-Date.
‎2009 Aug 27 4:24 AM
Hi
In PAI.
Loop at itab.
field itab-v_date module check_date.
endloop.
in program.
module check_date.
if tc-current_line = 1.
if itab-v_date is initial.
v_date = itab-v_date.
message 'Please enter a Valid Date'.
endif.
elseif itab-v_date <> v_date.
message 'Please enter the same date as you entered in the First row' type 'E'.
endif.
endmodule.
in top include declare a variable to V_date to capture the first entered Date
Hope this will serve your purpose
‎2010 Feb 07 6:34 PM
yes, i did declare a global variable to capture the first Value of date and then just assign that date to next date fields in table control .
thanks for all your support