on 10-04-2007 12:10 PM
Hi,
Is there a fast way that I can compare date in a table field. For example, I have
salesorder pos seq date
10001 10 1 01/02/2007
10001 10 2 01/02/2007
10001 10 3 01/02/2007
If the date is the same based on 3 seq, then return true, else return false.
Thanks, rewards will be given. Thanks a lot.
Hui,
try this... move ur itab values into a temp itab for comparision
itab2[] = itab[].
loop at itab where seq BETWEEN 1 AND 3.
read table itab2 with key seq = itab-seq.
if sy-subrc = 0.
if itab2-date = itab-date.
write: 'true'.
else.
write: 'false'.
endif.
endif.
endloop.
Reward if helpful,
Karthik
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
You need to loop throught the Internal table and check the dates,
LOOP AT ITAB, then pass the Date field to a local variable, then look at the second record in the internal table whether the second record is also having the same date or not, and also look at the third date also
Regards
Sudheer
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You can directly compare the dates by passing it a variable type DATS in yyyymmdd format.
w_date type dats.
loop at itab.
concatenate itab-date6(4) itab-date0(2) itab-date+3(2) into w_date.
if w_date1 is initial.
w_date1 = w_date.
endif.
if w_date1 NE w_date.
w_flag = '1'. "False
w_date1 = w_date.
else.
w_flag = '0'. "True
endif.
endloop.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
HI HUI
SEE THIS EXAMPLE
l_err = text-022.
ENDIF.
*for back dating
IF wa_data-efffromdate < sy-datum.
l_err = text-023.
ENDIF.
*FOR INVALID DATE.
CONDENSE wa_data-efffromdate.
l_lines = STRLEN( wa_data-efffromdate ).
IF l_lines LT 8.
l_err = text-025.
ENDIF.
CONDENSE wa_data-efftodate.
l_lines = STRLEN( wa_data-efftodate ).
IF l_lines LT 8.
l_err = text-025.
ENDIF.
IF NOT wa_data-efffromdate+4(2) BETWEEN '01' AND '12'.
l_err = text-029.
ENDIF.
IF NOT wa_data-efftodate+4(2) BETWEEN '01' AND '12'.
l_err = text-030.
ENDIF.
IF NOT wa_data-efffromdate+6(2) BETWEEN '01' AND '31'.
l_err = text-031.
ENDIF.
IF NOT wa_data-efftodate+6(2) BETWEEN '01' AND '31'.
l_err = text-032.
ENDIF.
User | Count |
---|---|
93 | |
10 | |
10 | |
9 | |
9 | |
7 | |
6 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.