‎2008 Jul 02 8:17 AM
Hi Experts,
I am doing aging report. In the for the days i should subtract duedate from document date.
days = duedate - document date.
Here the problem is some times bcoz of the wrong data.. im getting -days(minus ) . so in order to avaoid this i want to skip the document number.. when ever - or * anything come like this.
How to solve this problem.
<removed by moderator>
Regards,
Sunita.
Edited by: Craig Cmehil on Jul 3, 2008 3:30 PM
‎2008 Jul 02 8:22 AM
Hi Sunita ,
Check if Document date is less than duedate before Subtracting.
If Doc date is Greater than due date the use the FM to subtract two dates..
FIMA_DAYS_AND_MONTHS_AND_YEARS -- u2013 Calculates the difference between two dates
<removed by modertor>
Regards,
Sachin M M
Edited by: Jan Stallkamp on Jul 2, 2008 12:59 PM
‎2008 Jul 02 8:20 AM
Hi
please use the FM..HR_SGPBS_YRS_MTHS_DAYS
DATA: l_day TYPE i,
l_month TYPE i.
IF p_dper = c_check.
CALL FUNCTION 'HR_SGPBS_YRS_MTHS_DAYS'
EXPORTING
beg_da = s_budat-low
end_da = s_budat-high
IMPORTING
no_day = l_day
no_month = l_month
EXCEPTIONS
dateint_error = 1
OTHERS = 2.
IF sy-subrc <> 0.
MESSAGE e000 WITH
'Date range can not be calculated'(037).
ENDIF.
‎2008 Jul 02 8:22 AM
Hi Sunita ,
Check if Document date is less than duedate before Subtracting.
If Doc date is Greater than due date the use the FM to subtract two dates..
FIMA_DAYS_AND_MONTHS_AND_YEARS -- u2013 Calculates the difference between two dates
<removed by modertor>
Regards,
Sachin M M
Edited by: Jan Stallkamp on Jul 2, 2008 12:59 PM
‎2008 Jul 02 8:28 AM
data : wf_char type char10.
wf_char = days.
if wf_char+0(1) eq '-'.
skipp the rest of the logic.....
Try the above...it will work..
<removed by modertor>
Edited by: Jan Stallkamp on Jul 2, 2008 12:59 PM
‎2008 Jul 02 9:41 AM
Hey Prasana,
Thanks For your help. Issue completed.
Regards
Sunita.
‎2008 Jul 02 8:29 AM
hi sunitha, check due date & doc. date
LOOP AT wa_tab INTO itab.
IF wa_tab-duedate GT wa_tab-Docdate.
days = w_tab-duedate - wa_tab-document date.
ELSE.
CONTINUE.
ENDIF.
ENDLOOP.
or in else part u can delete that record before continue.
Edited by: venkat reddy on Jul 2, 2008 9:29 AM
‎2008 Jul 02 9:46 AM