‎2007 Jan 24 5:26 PM
Hi,
I am trying to get the equipment data and I have to link with asset. The only way I could find is through m_equia view. I select the equipment number from m_equia passing the key as asset no and from there i go to equi and get the other data.
But when i am trying to select from m_equia the database time is more. So, can some one suggest me a better option for this other than the m_equia to get the equipment details with asset as the key. I also have cost center details with me.
Thanks,
‎2007 Jan 24 5:41 PM
u need to create an index on the table..so that database access will be fast.
‎2007 Jan 24 5:46 PM
I am pushing everything to Ztable. Do you mean I have to create an index on Ztable ? Can you explain more in detail.
Thanks in advance.
Message was edited by:
lakshmi
‎2007 Jan 24 6:58 PM
Hi,
Try using FM 'AAPM_AA_READ_EQUIS_OF_ASSET'. You pass the Company code, Asset # & Sub Asset #. In return, you'll get the equipments linked to it.
Regards
Shantharam
‎2007 Jan 24 7:04 PM
‎2007 Jan 24 7:13 PM
Hi,
Please find the select on m_equia and further select on it.
Get asset related data from the view
IF NOT i_asset[] IS INITIAL.
SELECT anlnr
equnr
FROM m_equia
INTO TABLE i_asst_equi
FOR ALL ENTRIES IN i_asset
WHERE anlnr = i_asset-anln1 AND
anlun = i_asset-anln2 AND
bukrs = i_asset-bukrs.
IF sy-subrc = 0.
SORT i_asst_equi BY equnr.
ENDIF.
ENDIF.
*
Get Equipment related data
IF NOT i_asst_equi[] IS INITIAL.
SELECT equi~equnr
herst
typbz
eqart
mapar
serge
iwerk
FROM equi
INNER JOIN equz
ON equiequnr = equzequnr
INTO TABLE i_equipment
FOR ALL ENTRIES IN i_asst_equi
WHERE equi~equnr = i_asst_equi-equnr.
SORT i_equipment BY equnr.
ENDIF.
Thanks.
Message was edited by:
lakshmi
‎2007 Jan 24 7:19 PM
First lets try sorting the table.
** Get asset related data from the view
IF NOT i_asset[] IS INITIAL.<b>
sort i_asset ascending by anln1 anln2 bukrs.</b>
SELECT anlnr equnr
FROM m_equia
INTO TABLE i_asst_equi
FOR ALL ENTRIES IN i_asset
WHERE anlnr = i_asset-anln1 AND
anlun = i_asset-anln2 AND
bukrs = i_asset-bukrs.
IF sy-subrc = 0.
SORT i_asst_equi BY equnr.
ENDIF.
ENDIF.Regards,
Rich Heilman
‎2007 Jan 24 7:26 PM
Hi Rich,
This is how i am using the select now....do you think i should sort ascending ?
Select all the Asset/Kiosk Nos.
SELECT bukrs
anln1
anln2
anlkl
erdat
aedat
xloev
xspeb
ktogr
zujhr
zuper
aktiv
ivdat
txt50
FROM anla
INTO TABLE i_asset
where ANLKL = '00002000'.
IF sy-subrc = 0.
SORT i_asset BY anln1.
ENDIF.
Thanks.
Message was edited by:
lakshmi
‎2007 Jan 24 7:30 PM
Try selecting ILOA-ILOAN using your asset number (secondary index).
Then SELECT EQUUZ-EQUNR using ILOAN (also secondary index).
You can get whatever else you need using asset and equipment numbers.
Rob
‎2007 Jan 24 7:38 PM
Can i do an inner join on ILOA & EQUZ by any chance (Also how do i know if its a secondary index or ..) ?
Message was edited by:
lakshmi
‎2007 Jan 24 7:54 PM
M_EQUIA includes a join of ILOA and EQUUZ, so yes you can do your own join.
Click on the "Indexes" button in the data dictionary to see the secondary indexes of any table.
rob
‎2007 Jan 24 7:55 PM
Hi,
Can i do an inner join on ILOA & EQUZ?
Please try this.
SELECT ....
INTO ....
FROM ILOA as a inner join EQUZ as b on bILOAN = aILOAN
WHERE ...
Regards,
Ferry Lianto