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: 

help

Former Member
0 Kudos

i've a select-options for materials.. and accroding to the mat nos given i need to fetch the last movement for each materials from MSEG. How can i do it? which tcode is used to view data in the application server??

1 ACCEPTED SOLUTION

Former Member
0 Kudos

Dear Biju,

>Get the data for the material from selection screen from MSEG, also get the movement type and date of creation in internal table.

>Sort itab by MATNR BUDAT descending.

>Delete adjacent duplicates from ITAB comparing MATNR.

This internal table will have all the movement type done most recently.

I would advise you to take the material documents for a period, else the select on MSEG table will kill the performance..

Give BUDAT select option and fetch the DATA from MKPF table and for all the AUFNR found from MKPF table get MSEG data...

Best Regards,

Rajesh.

Please reward points if helpful.

2 REPLIES 2

former_member195698
Active Contributor
0 Kudos

You can use the Document Creation Date in MKPF and MSEG-EBELN (document number).

The Document with the highest date and the Highest document number will be the latest document.

AL11 - Tcode to view data in the application server

Former Member
0 Kudos

Dear Biju,

>Get the data for the material from selection screen from MSEG, also get the movement type and date of creation in internal table.

>Sort itab by MATNR BUDAT descending.

>Delete adjacent duplicates from ITAB comparing MATNR.

This internal table will have all the movement type done most recently.

I would advise you to take the material documents for a period, else the select on MSEG table will kill the performance..

Give BUDAT select option and fetch the DATA from MKPF table and for all the AUFNR found from MKPF table get MSEG data...

Best Regards,

Rajesh.

Please reward points if helpful.