2008 Jan 24 2:39 PM
Hi
I'm using the FUNC_LOCATION_HIERARCHY Fm to get hierarchy of a functional location can u give me a sampel coding on this
along with internal tables declaration plz
Regards
Nanda
2008 Jan 24 2:55 PM
hi
good
Here is the code for displaying hierarchy of Functional locations -
code* Get the List of Func Locs.
SELECT TPLNR
FROM IFLOT
INTO TABLE T_FLOC
WHERE TPLNR IN S_TPLNR.
IF SY-SUBRC NE 0.
MESSAGE S515(IL).
LEAVE LIST-PROCESSING.
ENDIF.
Get the Functional Location Hierarchy List.
CALL FUNCTION 'FUNC_LOCATION_HIERARCHY'
EXPORTING
INCLUDING_ROOT = TRUE
TABLES
ROOT_TAB = T_FLOC "Starting Point
IFLO_TAB = T_IFLOT " returned Hierarchy tab.
EXCEPTIONS
ROOT_NOT_FOUND = 1
READ_ERROR = 2
STRUCTURE_NOT_POSSIBLE = 3
OTHERS = 4.
IF SY-SUBRC EQ 0.
SORT T_IFLOT BY TPLNR.
ENDIF.[/code]
Hope it helps.
thanks
mrutyun^
Hi
I'm using the FUNC_LOCATION_HIERARCHY Fm to get hierarchy of a functional location can u give me a sampel coding on this
along with internal tables declaration plz
Regards
Nanda
2008 Jan 24 2:55 PM
hi
good
Here is the code for displaying hierarchy of Functional locations -
code* Get the List of Func Locs.
SELECT TPLNR
FROM IFLOT
INTO TABLE T_FLOC
WHERE TPLNR IN S_TPLNR.
IF SY-SUBRC NE 0.
MESSAGE S515(IL).
LEAVE LIST-PROCESSING.
ENDIF.
Get the Functional Location Hierarchy List.
CALL FUNCTION 'FUNC_LOCATION_HIERARCHY'
EXPORTING
INCLUDING_ROOT = TRUE
TABLES
ROOT_TAB = T_FLOC "Starting Point
IFLO_TAB = T_IFLOT " returned Hierarchy tab.
EXCEPTIONS
ROOT_NOT_FOUND = 1
READ_ERROR = 2
STRUCTURE_NOT_POSSIBLE = 3
OTHERS = 4.
IF SY-SUBRC EQ 0.
SORT T_IFLOT BY TPLNR.
ENDIF.[/code]
Hope it helps.
thanks
mrutyun^
2008 Jan 24 3:00 PM
Hi Mrutyun
Thanks for your coding i have seen this coding earlier only but my problem is what is S_TPLNR how it is comparing values?? Do it selected any values before this select statement??
If yes plz provide that coding also
what is T_IFLOT here from where it is getting the values??
plz provide me the complete coding
Regards
Nanda
2008 Jan 24 3:10 PM
2008 Jan 24 3:22 PM
Hi
Gurus plz provide me coding for Functional Hierarchy
Regards
Nanda
2008 Jan 24 3:33 PM
2008 Jan 24 3:33 PM
DATA : BEGIN OF T_FLOC OCCURS 0,
TPLNR TYPE TPLNR,
END OF T_FLOC.
DATA : T_IFLOT TYPE IFLOT OCCURS 0 WITH HEADER LINE.
Check the Functional Locations.
SELECT TPLNR
FROM IFLOT
INTO TABLE T_FLOC
WHERE TPLNR IN S_TPLNR.
IF SY-SUBRC NE 0.
MESSAGE S515(IL).
LEAVE LIST-PROCESSING.
ENDIF.
Get the Functional location hierarchy for the selected Ones.
CALL FUNCTION 'FUNC_LOCATION_HIERARCHY'
EXPORTING
INCLUDING_ROOT = TRUE
TABLES
ROOT_TAB = T_FLOC
IFLO_TAB = T_IFLOT
EXCEPTIONS
ROOT_NOT_FOUND = 1
READ_ERROR = 2
STRUCTURE_NOT_POSSIBLE = 3
OTHERS = 4.
IF SY-SUBRC EQ 0.
SORT T_IFLOT BY TPLNR.
ENDIF.
2008 Jan 24 3:40 PM
Hi SKC
what is this S_TPLNR??
Have u used this coding in Bapi or in any FM to call it?????
Regards
Nanda
2008 Jan 24 3:49 PM
Hi
I got two errors
1) The IN operator with "S_TPLNR" is followed neither by an internal table nor by a Value list.
Then i commented the S_TPLNR as follows
SELECT TPLNR
FROM IFLOT
INTO TABLE T_FLOC.
*WHERE TPLNR IN S_TPLNR.
2) Field "TRUE" is unknown. It is neither one of the specified tables nor defined by a "DATA" statement. "DATA" statement.
Regards
Nanda
2008 Jan 24 3:58 PM
2008 Jan 24 4:27 PM
2008 Jan 24 5:10 PM
2008 Jan 24 7:20 PM
2008 Jan 25 6:10 AM
Can i put the coding like this to fetch the data of all other functional locations??
If t_floc-tplnr = iflot-tplma
select tplnr tplma from iflot into corresponding fields of table t_floc1.
or else can any one plz provide me the complete coding details of a function module which fetches the functional location hierarchy??
Regards
nanda
2008 Jan 25 6:23 AM
Its the SELECT-OPTIONS (appears in the selection screen of the report ).
The syantax is -
tables : iflot.
select-options : s_tplnr for iflot-tplnr.
2008 Jan 25 8:39 AM
Hi SKC
Then what is this TRUE option over there as i said earlier it was showing an error that it hasnt declared previously can i put as 'X'
Regards
Nanda
2008 Jan 25 8:48 AM
Hi SKC
This was my complete coding it was not fetching any values. I mean it was showing only one functional location which i had declared and its superior functional location but i want more functional locations but it should not be restricted to one functional location.
can u check it plz
DATA : BEGIN OF T_FLOC OCCURS 0,
TPLNR TYPE TPLNR,
END OF T_FLOC.
DATA : T_IFLOT TYPE IFLOT OCCURS 0 WITH HEADER LINE.
tables : iflot.
select-options : s_tplnr for iflot-tplnr.
Check the Functional Locations.
SELECT TPLNR TPLMA
FROM IFLOT
INTO TABLE T_FLOC
WHERE TPLNR IN S_TPLNR.
*IF SY-SUBRC NE 0.
*
*MESSAGE S515(IL).
*
*LEAVE LIST-PROCESSING.
*
*ENDIF.
Get the Functional location hierarchy for the selected Ones.
CALL FUNCTION 'FUNC_LOCATION_HIERARCHY'
EXPORTING
INCLUDING_ROOT = 'X'
TABLES
ROOT_TAB = T_FLOC
IFLO_TAB = T_IFLOT
EXCEPTIONS
ROOT_NOT_FOUND = 1
READ_ERROR = 2
STRUCTURE_NOT_POSSIBLE = 3
OTHERS = 4.
IF SY-SUBRC EQ 0.
SORT T_IFLOT BY TPLNR.
ENDIF.
WRITE: T_FLOC,
T_IFLOT-TPLNR,
T_IFLOT-TPLMA.
Edited by: nanda kishore on Jan 25, 2008 9:51 AM
2008 Jan 25 8:59 AM
Hi Nanda,
check this code,
DATA : BEGIN OF T_FLOC OCCURS 0,
TPLNR TYPE TPLNR,
TPLMA TYPE TPLMA,
END OF T_FLOC.
DATA : T_IFLOT TYPE IFLOT OCCURS 0 WITH HEADER LINE.
tables : iflot.
select-options : s_tplnr for iflot-tplnr.
*Check the Functional Locations.
SELECT TPLNR TPLMA
FROM IFLOT
INTO TABLE T_FLOC
WHERE TPLNR IN S_TPLNR.
*IF SY-SUBRC NE 0.
*MESSAGE S515(IL).
*LEAVE LIST-PROCESSING.
*ENDIF.
*Get the Functional location hierarchy for the selected Ones.
CALL FUNCTION 'FUNC_LOCATION_HIERARCHY'
EXPORTING
INCLUDING_ROOT = 'X'
TABLES
ROOT_TAB = T_FLOC
IFLO_TAB = T_IFLOT
EXCEPTIONS
ROOT_NOT_FOUND = 1
READ_ERROR = 2
STRUCTURE_NOT_POSSIBLE = 3
OTHERS = 4.
IF SY-SUBRC EQ 0.
SORT T_IFLOT BY TPLNR.
LOOP AT T_IFLOT.
WRITE:/ T_IFLOT-TPLNR.
ENDLOOP.
ENDIF.
Thanks
Lakshman
2008 Jan 25 9:13 AM
Hi Laxman
Thanks for your reply. I had already tried with the loop eventhough it was fetching only two values . i.e., the value which i specified as HYD and its superior functional location AP. Thats it but i want two more functional locations one functional location is above AP i.e., INDIA and other functional location which is below HYD which i specified as B in that so can you provide me coding according to that.
Regards
Nanda
2008 Jan 25 9:29 AM
Nanda,
please let me know which report u r devleoping
Sakthi.K
2008 Jan 25 9:44 AM
Hi Nanda,
In that case fetch data as per the Superior Functional Location.
Define select-option for Superior Functional Location and fetch data from IFLOT
DATA : BEGIN OF T_FLOC OCCURS 0,
TPLNR TYPE TPLNR,
TPLMA TYPE TPLMA,
END OF T_FLOC.
DATA : T_IFLOT TYPE IFLOT OCCURS 0 WITH HEADER LINE.
tables : iflot.
select-options : s_tplnr for iflot-tplnr.
select-options : s_tplma for iflot-tplma.
*Check the Functional Locations.
SELECT TPLNR TPLMA
FROM IFLOT
INTO TABLE T_FLOC
WHERE TPLNR IN S_TPLNR AND
TPLMA IN S_TPLMA.
*IF SY-SUBRC NE 0.
*MESSAGE S515(IL).
*LEAVE LIST-PROCESSING.
*ENDIF.
*Get the Functional location hierarchy for the selected Ones.
CALL FUNCTION 'FUNC_LOCATION_HIERARCHY'
EXPORTING
INCLUDING_ROOT = 'X'
TABLES
ROOT_TAB = T_FLOC
IFLO_TAB = T_IFLOT
EXCEPTIONS
ROOT_NOT_FOUND = 1
READ_ERROR = 2
STRUCTURE_NOT_POSSIBLE = 3
OTHERS = 4.
IF SY-SUBRC EQ 0.
SORT T_IFLOT BY TPLNR.
LOOP AT T_IFLOT.
WRITE:/ T_IFLOT-TPLNR.
ENDLOOP.
Thanks
Lakshman
2008 Jan 25 9:45 AM
Hi
Iwant to display the functional location hierarchy
If u give any functional location as specifying
CHENNAI then it have to show T.NAGAR which was declared below the CHENNAI in the transaction IL01 and it have to show the functional location above chennai also such as TAMILNADU & INDIA.
Regards
Nanda
2008 Jan 25 10:21 AM
Hi Lakshman
Sorry yar that code is not working fine. It is fetching all the data in that tplnr but i want only a particular node or particular functional location details
2008 Jan 25 9:29 AM
2025 Sep 11 9:03 AM
Can anyone suggest how to use it in cds view analytical query
| User | Count |
|---|---|
| 3 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |