2007 Jul 12 9:59 AM
Dear All,
there are two dated l_date1 and l_date2.
i want find out the difference between these dates in days.
dif = l_date1 - l_date2 works fine if l_date1 > l_date2 but if l_date2 > l_date1 then direct substraction is not giving the proper answere.In this case i want minus symbol if l_date2 > l_date1.
How to get this.
2007 Jul 12 10:05 AM
Hi ..
This code is working fine .. plz check
<b>parameters: pd1 type sy-datum, pd2 type sy-datum.
data d type i.
d = pd1 - pd2.
write: d.</b>
reward if helpful.
Dear All,
there are two dated l_date1 and l_date2.
i want find out the difference between these dates in days.
dif = l_date1 - l_date2 works fine if l_date1 > l_date2 but if l_date2 > l_date1 then direct substraction is not giving the proper answere.In this case i want minus symbol if l_date2 > l_date1.
How to get this.
2007 Jul 12 10:05 AM
Use this code.
IF date1 > date2.
diff = date1 - date2.
ELSE.
diff = -1 * ( date2 - date1 ).
ENDIF.
2007 Jul 12 10:05 AM
Hi ..
This code is working fine .. plz check
<b>parameters: pd1 type sy-datum, pd2 type sy-datum.
data d type i.
d = pd1 - pd2.
write: d.</b>
reward if helpful.
| User | Count |
|---|---|
| 3 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |