Application Development 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: 

How to Subtract Date for Pending Order Aging.

Former Member
0 Kudos

Hi Gurus,

This Report is for Purchase Requistion .

In my report

I want to subtract sy-datum with ekko-bedat.

for calculating Pending Order Aging .

can anyone help me with this ?

Regards,

Vinoth.

1 ACCEPTED SOLUTION

Former Member
0 Kudos

U can directly subtract.

1.bring all dates inthe format of yyyymmdd

now subtract.

Ex.

20071225-20071221 = 04.

Thanks and Regards,

4 REPLIES 4

Former Member
0 Kudos

U can directly subtract.

1.bring all dates inthe format of yyyymmdd

now subtract.

Ex.

20071225-20071221 = 04.

Thanks and Regards,

Former Member
0 Kudos

Hi,

You can subtract 2 dates directly difference = date2 - date1, because the date is always stored in internal format.

Cheers,

Bujji

Former Member
0 Kudos

just subtract as u do for other fields.

days = sy-datum - ekko-bedat.

Reward if useful.

Regards

ANUPAM

Former Member
0 Kudos

Hi,

Try like this:

TABLES: EKKO.

DATA: EDAYS LIKE VTBBEWE-ATAGE,

EMONTHS LIKE VTBBEWE-ATAGE,

EYEARS LIKE VTBBEWE-ATAGE.

PARAMETERS: FROMDATE LIKE ekko-bedat,

TODATE LIKE VTBBEWE-DBERBIS DEFAULT SY-DATUM.

call function 'FIMA_DAYS_AND_MONTHS_AND_YEARS'

exporting

i_date_from = FROMDATE

i_date_to = TODATE

  • I_FLG_SEPARATE = ' '

IMPORTING

E_DAYS = EDAYS

E_MONTHS = EMONTHS

E_YEARS = EYEARS.

WRITE:/ 'Difference in Days ', EDAYS.

WRITE:/ 'Difference in Months ', EMONTHS.

WRITE:/ 'Difference in Years ', EYEARS.

INITIALIZATION.

FROMDATE = SY-DATUM - 60.

Regards,

Bhaskar