Quantcast
Channel: SCN: Message List
Viewing all articles
Browse latest Browse all 9164

Re: How to get last 4 PO's from EKPO based on Material.

$
0
0

Hi Ganesh,

 

Don't find any FM to meet your requirement! Some extent you can refer the FM  WWG2_PURCHASE_ORDER_SELECT.

 

  Before that why you want to get the only last 4 purchase orders ( I mean it is for last open Po's or closed Po's or partially processed Po's )

 

However you can follow the below code.

 

* read purchase order positions

  select * from  ekpo into table pe_t_ekpo

      where matnr  = pi_matnr

 

SORT PE_T_EKPO[] BY EBELN DESCENDING

 

LOOP AT PE_T_EKPO  into WA_EKPO.

 

l_index = sy-tabix.

 

if l_index GT 4

EXIT.

else.

*collect the values into one more internal table with 4 PO's.

endif.

ENDLOOP.

 

 

 

NB: check your need once again!


Viewing all articles
Browse latest Browse all 9164

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>