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: 

PR status on a particular date..

Former Member
0 Kudos

Gentlemen,

I have to develop this Report for Procurement for the buyer monthly Performance.

In this one of my requirement is to get all the PR's which were open before 1st of may..(or which ever month they like to see)

How can i get these PR's..?

Please suggest some solution...appreciate ur help..

thanks.

7 REPLIES 7

Former Member
0 Kudos

Hi Srinivas,

The Purchase Requisitions are in table EBAN.

You have two fields in this table that can help your selection:

- BADAT: date of the purchase requisition

- BANST: purchase requisition status, which has the following values

N Not edited

B PO created

A RFQ created

K Contract created

L Scheduling agreement created

S Service entry sheet created

Hope that helps.

Let us know if you need more information.

Cheers,

Brad

Former Member
0 Kudos

Hi,

Thanks for ur reply.

Yes,the status of the PR will be in the field "statu" in EBAN table.

But the requirement here is , i need to get the PR's which might have been in Open status on that particular date(in this case i took an example as 1st of may).

Now that PR,lets say on 15th of may is coverted to an RFQ or PO.so i cannot identify it thru this EBAN,unless i have some changes tracking FM or something.

Let me know,if you need any more clarification..

0 Kudos

Hi Srinivas,

One way that you could do this, is for each of the candidate purchase requisitions, do the following (you might have to watch performance on this):

- Select candidate EBAN records (you will have decide logic to keep the "candidate" list as small as possible

- For each EBAN record, select in the view M_MEKKE using BANFN and BNFPO to find whether there is any purchase order (or other subsequent documents) documents

- If there are no purchase order documents, the BANF record is still open, so will be open for your date

- If there are purchase order records, use the key (po number, etc.) to select the corresponding EKKO record

- Get the AEDAT field from EKKO to see when the purchase order was created

- if AEDAT is after the date specified by the user in the report (in your example 15th of May), then the purchase requisition was open on that date.

Clearly the logic would need to be tightened up to suit your requirements and business processes exactly, but this should give you the results you need.

Cheers,

Brad

Former Member
0 Kudos

Dear Brad,

Yes,we can do that, but you know checking for all the PR's(status 'p' or 'A' or 'K') in database(and they are thousands),and see if PO/RFQ is created,if yes check when was it created.

In my view its not a very good idea.Performance will go down like anything.

Message was edited by: srinivas kandla

0 Kudos

Hi Srinivas,

I did actually say in my post that performance would be an issue with this approach. But it appears that in standard functionality there is not much more you can do.

There are a lot of ways to be smart with the way you select your initial candidates, however. You dont need to select all PRs with status p,A,K. On the PR Eban table, you have ERDAT which is last changed date. You can exclude all p,A,K records whose last changed date is before your report date as they have not changed after the report date and hence will not have changed status after the report date. This is just one example, there will be many more you can choose (maybe a business rule is that PRs older than 2 months are not relevant, restrict by purchasing org, purchasing grp etc.).

If you still don't like this solution then you will have to do some enhancement of the PR/PO transaction. There are no standard change documents for PR status, so you can perhaps use a BADI/User exit to update a z table every time the PR status changes. Just record the PR number, the old status, the new status, the date, and the time.

Then your report can use the z table in its processing.

I thought your question was related to standard functionality. If you are prepared to enhance the PR transaction then clearly you will get a solution which performs better.

Cheers,

Brad

Former Member
0 Kudos

Hi Brad,

You r rite..the status changes of the PR's will not stored.

Anyways..i will have to check all the PO's ,RfQ's,Contracts created in this month,where i will find the reference PR's.(thankfully we only create all purchasing documents with reference to PR's).

thanks for you support...

0 Kudos

No problem srinivas.

Thanks for the points. For some strange reason I don't get them on my account, but its the thought that counts.

If any of your users complain about performance you can take the report away from them and let them produce the results manually. In a few weeks they will be begging to have it back...

Good luck with it!

Brad