on 12-15-2009 1:31 PM
Hi,
i written the below select statements.Can i wrote one inner joint for this below statements.
please help me regarding this
SELECT objid arbpl FROM crhd
INTO TABLE gt_chrd
WHERE arbpl in so_mdv01
AND werks in so_werks.
IF NOT gt_chrd[] IS INITIAL.
SELECT objnr ppsid FROM iflo
INTO TABLE gt_iflo
FOR ALL ENTRIES IN gt_chrd
WHERE ppsid = gt_chrd-objid.
ENDIF.
IF NOT gt_iflo[] IS INITIAL.
SELECT mpobj point FROM imptt
INTO TABLE gt_imptt
FOR ALL ENTRIES IN gt_iflo
WHERE mpobj = gt_iflo-objnr
and mptyp = 'P'.
ENDIF.
Hi,
Yes, you can use Joins.
Try something like this: (I didnt check for any syntax errors)
SELECT cobjid carbpl
I~objnr
m~point
INTO CORRESPONDING FIELDS OF TABLE ITAB1
FROM imptt as m
INNER JOIN
iflo as i
ON mmpobj = iobjnr
AND m~mptyp = 'P'
INNER JOIN
crhd as c
ON ippsid = cobjid
WHERE c~arbpl in so_mdv01
AND c~werks in so_werks.
Regards,
Swarna Munukoti
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You can use joints, but don't let your boss find out
Thomas
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
First do runtime analysis of existing code and also check the index used by ST05.
After this make a join between the tables ( between 2 or 3 tables) and then again do runtime analysis and check index.
You can then compare the results.
Also, you can check the where use list of these tables to find any view with these database tables.
If you get one , check the result for view also.
Hope it helps you.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
HI,
Use can use join.
Take an internal table with required fields and join.
Check the below SQL.
SELECT c~objid c~arbpl
I~objnr
m~mpobj
m~point
INTO TABLE IT_join
FROM crhd as c join
imptt as m
ON c~mandt = i~mandt and
c~ppsid = i~objid
JOIN
iflo as i
ON i~mandt = m~mandt
i~mpobj = m~objnr
WHERE c~arbpl in so_mdv01
AND c~werks in so_werks
AND m~mptyp = 'P'.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
You can test it of your own .
write two sample programs ans do sql trace in ST05.
Steps for ST05 are available in SCN,please search.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
78 | |
9 | |
9 | |
7 | |
7 | |
6 | |
6 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.