Application Development and Automation 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: 
Read only

Pending Invoice Report Problem.

Former Member
0 Likes
2,463

hi gurus,

i have developed pending invoice report which tells for these many GR'S , IR'S not done (or Pending)..

and my report is showing correct output.. but in one case it fails to show accurate output..

the case is as described below:

1. The end_user has created PO

2. second he made GR.

3. he thinks that he made GR Wrongly..... and he does Reverse GR with same quantity and same price.

4. then again he creates the GR with Same Quantity and Same Price..

Now in case he totally creates 3 GR's(out of which one is reversed) and all 3 have same quantity and same price....

if i written logic like this:

for particular PO.

delete previous gr.      if (reverse_GR amount = previous_GR amount and reverse_GR quantity= previous_GR quantity).

According to this logic it is displaying that this PO has no pending invoices..

But actually the last GR(i e. 3rd GR) has not been invoiced that GR has still invoice Pending..

In this case the report is not working..

Need Your Suggestions..

thanks and Regards,

Nitin

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
1,974

using credit/debit indicator "SHKZG" and PO History Cat "BEWTP" it has to be added all correct GR's for particular Purchase order line item wise from ekbz table and also add all reverse GR's for the same Purchase Order Line item Wise there we will get sum of correct GR's for a PO Line Item and we will get Wrong GR's for the PO line item ,,, then we need to substract that wrong GR's amount from the Correct GR's that will give you Correct GR's Amount and Quantity for the po line item,,,, same procedure has to followed in IR's also,,,,,,,,,,,,,

Then Finally we will get correct gr and ir amount ,,

substract IR from GR you will get Pending Invoice,,,,

important tables
:ekbe purchasing history table

:ekbz transportation table

:mkpf material Document Header

10 REPLIES 10
Read only

kakshat
Product and Topic Expert
Product and Topic Expert
0 Likes
1,974

Maybe you can add all the GR (including GR and reverse GR) quantities for a given PO taking GR quantities as positive and reverse GR ones as negative. If the final sum comes out to be positive, it means the GR is pending invoicing.

Read only

Former Member
0 Likes
1,974

Hi

Y dont u try with movement type, hoping u are using different movement type for reversal.

Regards

Read only

RaymondGiuseppi
Active Contributor
0 Likes
1,974

Did you use EKBE-SHKZG to identify canceling documents (S= GR, H = GR cancel) ?

Regards,

Raymond

Read only

former_member194152
Contributor
0 Likes
1,974

you can check with entry date and entry time field for document creation(MKPF-CPUDT,MKPF-CPUTM), check with any 102 movement type exist in internal table and reverse it with corresponding 101, with non latest 101 movement.

Read only

0 Likes
1,974

Look out, 102 is not the only code that cancels/reverses a code 101 good movement, look also at code 122 (and code 123 that cancels code 122...)

Regards,

Raymond

Read only

Former Member
0 Likes
1,974

thank you all very much for your valuable suggestions.

Read only

Former Member
0 Likes
1,974

thank you for suggesting.

Read only

Former Member
0 Likes
1,975

using credit/debit indicator "SHKZG" and PO History Cat "BEWTP" it has to be added all correct GR's for particular Purchase order line item wise from ekbz table and also add all reverse GR's for the same Purchase Order Line item Wise there we will get sum of correct GR's for a PO Line Item and we will get Wrong GR's for the PO line item ,,, then we need to substract that wrong GR's amount from the Correct GR's that will give you Correct GR's Amount and Quantity for the po line item,,,, same procedure has to followed in IR's also,,,,,,,,,,,,,

Then Finally we will get correct gr and ir amount ,,

substract IR from GR you will get Pending Invoice,,,,

important tables
:ekbe purchasing history table

:ekbz transportation table

:mkpf material Document Header

Read only

0 Likes
1,974

Hi Nitin,

Can you pls tell me how to find the GR with invoice pending.
I am new to SAP and this is my first real time scenario.

Pls guide me.......

Thanks & Regards

Jesse

Read only

0 Likes
1,974

Hi Nitin / Jesse

Better remove the doc. with mvt type 102 and the reference doc. no. from field LFBNR of material document and exclude that document.

it will give you the correct report.

Regards,

Manish Jain