2007 Dec 14 7:36 PM
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.
2007 Dec 14 7:41 PM
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.
2007 Dec 14 9:42 PM
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.
2007 Dec 15 3:27 AM
2007 Dec 15 3:30 AM
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....
2008 Jan 03 12:05 AM
2008 Jan 03 3:53 AM
Hi You can use V_EQUI providing the dates which you are looking and
you can use the function module EQUIPMENT_GET_INSTALL_HISTORY.