Skip to Content
0
Aug 03, 2011 at 03:49 AM

How to show recent 4 PO informations and rate on price, for each material?

25 Views

Dear All,

I am trying to get the Purchase orders(only last 4 on given date in Parameters) of an article and based on the prices related to PO, I have to calculate the transaction rate. The output will be like below.

   Material       PO	         Date	         QTY	    Unit Price	Prev Trans Rate
   mat1	   1001	       4/1/2010	   1	            2900	
	           1002	      24/8/2010      5	            1450	        0.5
	           1003	        8/3/2011  10	            1450	        1
	           1004	        9/5/2011   25	            1450	        1

       mat2	   1201	       3/1/2010	   1	            210	
	           1202	       4/8/2010    3	            185	        0.88
	           1203	        6/3/2011  20	            375	        2.03
	           1204	        9/5/2011   2	            375	        1

I need idea how to take only last 4 PO's of each material. I tried with sy-tabix in loop endloop , but this only fetches total of 4 rows not for article wise. I will be passing only Date range as parameter. Also need idea on , how to calculate this rate, which is mainly ,

rate = row 1 / row2. Please help me regarding this issue.

With regards,

Rosaline.