12-11-2008 8:08 AM
HI
i write this join ,there is a better way to write it?
Regards
SELECT agr_hier~agr_name agr_hier~object_id agr_hier~parent_id agr_hier~sort_order
agr_hier~menu_level agr_hier~menu_level agr_hier~report agr_hiert~text
INTO CORRESPONDING FIELDS OF TABLE it_h
FROM ( ( agr_hier
INNER JOIN agr_hiert
ON agr_hier~agr_name = agr_hiert~agr_name
AND agr_hier~object_id = agr_hiert~object_id ) )
FOR ALL ENTRIES IN ct_agr_user
WHERE agr_hier~agr_name = ct_agr_user-agr_name
AND ( report = '_APPATION' OR report = 'APPION'22 ).
12-11-2008 8:36 AM
Also include AGR_HIERT-SPRAS in the ON- or WHERE-conditions (probably selecting SY-LANGU) to avoid duplicates due to possible multiple translations.
> report = 'APPION'22
Is this a typo?
Thomas
12-11-2008 8:36 AM
Also include AGR_HIERT-SPRAS in the ON- or WHERE-conditions (probably selecting SY-LANGU) to avoid duplicates due to possible multiple translations.
> report = 'APPION'22
Is this a typo?
Thomas
12-11-2008 1:07 PM
Hi,
One suggestion.
SELECT agr_hieragr_name agr_hierobject_id agr_hierparent_id agr_hiersort_order
agr_hiermenu_level agr_hiermenu_level agr_hierreport agr_hierttext
INTO CORRESPONDING FIELDS OF TABLE it_h
FROM agr_hier
INNER JOIN agr_hiert
ON agr_hieragr_name = agr_hiertagr_name
AND agr_hierobject_id = agr_hiertobject_id
FOR ALL ENTRIES IN ct_agr_user
WHERE agr_hier~agr_name = ct_agr_user-agr_name
AND agr_hier~report IN ('_APPATION' , 'APPION22u2019 ).
Regards,
Jisha.
12-15-2008 7:06 AM
Hi,
1. don't used INTO CORRESPONDING FIELDS OF TABLE it_h.
2. FROM agr_hier as 'TABLE NAME'
3. INNER JOIN agr_hiert as 'TABLE NAME'
Regards:
Mahesh
12-19-2008 10:43 AM
hi
use the following code:
SELECT agr_hier~agr_name
agr_hier~object_id
agr_hier~parent_id
agr_hier~sort_order
agr_hier~menu_level
agr_hier~menu_level
agr_hier~report
agr_hiert~text
INTO CORRESPONDING FIELDS OF TABLE it_h
FROM ( ( agr_hier as agr_hier
INNER JOIN agr_hiert as agr_hiert
ON agr_hieragr_name = agr_hiertagr_name
AND agr_hierobject_id = agr_hiertobject_id ) )
FOR ALL ENTRIES IN ct_agr_user
WHERE agr_hier~agr_name = ct_agr_user-agr_name
AND ( report = '_APPATION' OR report = 'APPION'22 ).
one more thing u can try u can cut the code in two selection
1- for innerjoin of two tables
2- for where condion on it_h and ct_agr_user