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: 

how to get all TPLNR for an EQUNR

Former Member
0 Kudos
3,005

Hello All,

I am trying to write an ALV, in which user wants to see the tplnr for equipment, I mean they want to know which user move the equipment to which location. Now I got all the parts running except that I can not seem to get the location (tplnr). If I try with the datbi (table equz) with datbi = '99991231', i get only the current location for the equipment. Is it possible to get all the location where this equipment been time by time? There is a field in equz "timbi" , but I can not seem to get the right logic to get the things done.

I inner join equi, equz, and iloa table together on equnr to get the location but so far only able to get only the current location.

Thanks.

6 REPLIES 6

Former Member
0 Kudos
609

Here is the select statement I am using:

SELECT DISTINCT mkpfusnam mkpfbudat mkpfcputm mkpfmblnr mkpfmjahr msegbwart msegwerks mseglgort objksernr objkmatnr

equi~equnr

INTO TABLE it_out

FROM mkpf AS mkpf

INNER JOIN mseg AS mseg ON ( msegmblnr = mkpfmblnr

AND msegmjahr = mkpfmjahr )

INNER JOIN ser03 AS ser03 ON ( ser03mblnr = mkpfmblnr

AND ser03mjahr = mkpfmjahr )

INNER JOIN objk AS objk ON ( objkobknr = ser03obknr )

INNER JOIN equi AS equi ON ( equimatnr = objkmatnr

AND equisernr = objksernr )

WHERE mkpf~usnam = p_userid

AND mkpf~budat IN p_date.

>>>>>>>>>>>>>

And trying to get the tplnr value

select equnr tplnr timbi into table it_tplnr from v_equi

where datbi = '99991231'.

sort it_tplnr by equnr.

loop at it_out.

read table it_tplnr with key equnr = it_out-equnr binary search.

if sy-subrc <> 0.

write: / 'No Data found: ' , sy-tabix.

elseif sy-subrc = 0.

it_out-tplnr = it_tplnr-tplnr.

modify it_out.

endif.

endloop.

Former Member
609

You can go via V_EQUI view.

EQUZ->ILOA->IFLOT


EQUI-EQUNR = EQUZ-EQUNR -> Equipment master data
EQUZ-ILOAN = ILOA-ILOAN -> Equipment time segment
ILOA-TPLNR = IFLOT-TPLNR -> IFLOT is table for function al Location

Or use this BAPI to get the Details of tyhe Equipment.

BAPI_EQUI_GETDETAIL

Amandeep.

kesavadas_thekkillath
Active Contributor
0 Kudos
609

Check view ITOB...it may help u........

kesavadas_thekkillath
Active Contributor
0 Kudos
609

Try this functional module....

pass the equipment no with leading zero,s

the output will bet the list of functional locations where the equipment is installed

EQUIPMENT_GET_INSTALL_HISTORY

reward if useful....

Former Member
0 Kudos
609

Thanks for all the help!

0 Kudos
609

Hi You can use V_EQUI providing the dates which you are looking and

you can use the function module EQUIPMENT_GET_INSTALL_HISTORY.