SAP for Utilities Discussions
Connect with fellow SAP users to share best practices, troubleshoot challenges, and collaborate on building a sustainable energy future. Join the discussion.
cancel
Showing results for 
Search instead for 
Did you mean: 

How to fetch last 12 months posting date from DFKKOP table

Former Member
0 Kudos

I am selected document number , posting date and amount from dfkkop table based contract account no and palced in an internal table , now have to display only last 12 months data instead of all the data. how should i write the logic to fetch only 12 months posting date data.

2 REPLIES 2

Former Member
0 Kudos

Hi Sarfaraz !

U have to write logic about fetching data based on current month posting date from DFKKOP table. i.e system should calculate last 12 month posting date based on the current month posting date of Invoice .

Thanks,

AnUrAg

ivor_martin
Active Contributor
0 Kudos

Hi,

Use system date as your current date.

Then select documents from DFKKOP where (System date minus BUDAT in days <=366).

I am not an ABAPer, so you will have to use appropriate ABAP statement to calculate the difference in days between the above 2 2 dates.

You will have to confirm with your user/s what they mean by "Documents in DFKKOP". DFKKOP is the open items table.

If there were items that were paid, you will have to look at the clearing reason 01, and retrieve based on the Clearing Posting date.

Also, check if they want to retrieve documents that have been reversed.

I hope this helps.

Regards,

Ivor Martin