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

Table control condition ??Hi

NR_Ranasingh
Participant
0 Likes
566

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.

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
538

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

5 REPLIES 5
Read only

Former Member
0 Likes
538

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

Read only

0 Likes
538

Hi ,

thnks for ur reply ..

if not gv_previous is initial and gv_previous screenfield-Date. ??

Wht is this condition ?

Read only

0 Likes
538

Hi,

I think Himanshu meant 'NE'



if not gv_previous is initial and gv_previous NE screenfield-Date.

Read only

Former Member
0 Likes
539

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

Read only

NR_Ranasingh
Participant
0 Likes
538

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