‎2008 Jan 28 11:33 AM
Hi
here i'm getiing all the values perfectly except for one field. Actually i have a requirement like this. I have to fetch the funclocation from a custom table and its related description from other table so i made a join query between those tables now everything is getting fine but i'm getting the description of 1st location only but i want to get all details for every functional location
TABLES: zfuncloc,iflotx.
DATA BEGIN OF iflot_l OCCURS 0.
INCLUDE STRUCTURE ifloth.
DATA END OF iflot_l.
DATA: BEGIN OF pltxu OCCURS 0,
pltxu TYPE iflotx-pltxu,
tplnr TYPE iflotx-tplnr,
END OF pltxu.
DATA: l_hilev LIKE impth-hilev.
SELECT bfuncloc apltxu
INTO CORRESPONDING FIELDS OF TABLE t_floc
FROM iflotx AS a
INNER JOIN zfuncloc AS b
ON atplnr = bfuncloc
WHERE user_id = user.
DELETE ADJACENT DUPLICATES FROM t_floc.
*SELECT FUNCLOC FROM ZFUNCLOC INTO
TABLE T_FLOC WHERE USER_ID = USER.
*delete adjacent duplicates from t_floc.
Get the Functional location hierarchy for the selected Ones.
CALL FUNCTION 'FUNC_LOCATION_HIERARCHY'
EXPORTING
tabstructure = 'IFLOTH'
IMPORTING
level_found = l_hilev
TABLES
root_tab = t_floc
iflo_tab = iflot_l
EXCEPTIONS
root_not_found = 1
read_error = 2
structure_not_possible = 3
OTHERS = 4.
IF sy-subrc EQ 0.
SORT iflot_l BY tplnr.
*PERFORM PLTEXT TABLES PLTEXT LIKE IFLOTX-PTXT
USING T_FLOC-PLTEXT.
LOOP AT iflot_l.
MOVE: iflot_l-tplnr TO t_floc-funcloc,
iflot_l-tplma TO t_floc-sfuncloc,
iflot_l-hilev TO t_floc-hilev,
iflot_l-rbnr TO t_floc-rbnr.
APPEND t_floc.
ENDLOOP.
ENDIF.
ENDFUNCTION.
Regards
Nanda
‎2008 Jan 28 11:42 AM
‎2009 May 19 2:05 PM