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

code to get latest purchase requisition

Former Member
0 Likes
886

hello,

i have to built a report for purchase requisition i got stuck while finding the latest purchase order so how i can solve this problem

5 REPLIES 5
Read only

tarangini_katta
Active Contributor
0 Likes
857

Hi,

Waht do you mean by latest purchese order.

U can get purchase order based on date created.

EKKO-ERDAT.

Can you please explain u r question clearly.

Thanks

Read only

0 Likes
857

hiiiiii,

i want the latest PO OF PARTICULAR ITEM.

IT MEANS IF AN ITEM HAVING THREE PO WITH BWART - 101 101 102(REVERSAL) OF SAME DATE 04.04.2009 SO MY CODING WILL OF THAT TYPE THROUGH THAT I SHOULD GET LATEST PO MEANS IF 102 IS LATEST THEN IT SHOULD BE DISPLAY WITH ITS QUANTITY RATE AND SUPPLIER NAME.BUT RIGHT NOW ACCORDING TO MY PROGRAM IT SHOWING 1ST BWART-101 VALUES IS IT NEED TO SORT IF SO THEN WHICH TABLE I HV TO SORT??

IAM USING TABLES - EBAN FOR PR, MSEG,EKBE, LFA1.

Read only

0 Likes
857

Hello

You have purchase requisition. So, EBAN-BANFN and EBAN-BNFPO.

1. Goto EKET with EBAN-BANFN and EBAN-BNFPO and get all EKET-EBELN and EKET-EBELP for particular position.

2. Select from EKBE into internal table all records with EBELN = EKET-EBELN and EBELP = EKET-EBELP and BWART between '101' and '102'.

3. Sort this internal table by EBELN and BELNR. Last record will have latest PO number.

Read only

Former Member
0 Likes
857

go to cdhdr table sort internal table with date and time in decending order,

Read only

Former Member
0 Likes
857

pick the first one. give the respective object class