Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

FUNC_LOCATION_HIERARCHY

Former Member
0 Likes
9,133

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

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
7,254

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

24 REPLIES 24
Read only

Former Member
0 Likes
7,255

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^

Read only

0 Likes
7,254

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

Read only

0 Likes
7,254

Plz reply me

Read only

0 Likes
7,254

Hi

Gurus plz provide me coding for Functional Hierarchy

Regards

Nanda

Read only

0 Likes
7,254

Hi

plz respond me

Read only

0 Likes
7,254

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.

Read only

0 Likes
7,254

Hi SKC

what is this S_TPLNR??

Have u used this coding in Bapi or in any FM to call it?????

Regards

Nanda

Read only

0 Likes
7,254

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

Read only

0 Likes
7,254

Hi

plz help me in correcting my errors

Read only

0 Likes
7,254

hi

Any body there to help me out in this??

Read only

0 Likes
7,254

Plz help me in solving this issue

Read only

0 Likes
7,254

Plz help me in solving this issue

Read only

0 Likes
7,254

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

Read only

0 Likes
7,254

Its the SELECT-OPTIONS (appears in the selection screen of the report ).

The syantax is -

tables : iflot.

select-options : s_tplnr for iflot-tplnr.

Read only

0 Likes
7,254

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

Read only

0 Likes
7,254

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

Read only

0 Likes
7,254

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

Read only

0 Likes
7,254

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

Read only

0 Likes
7,254

Nanda,

please let me know which report u r devleoping

Sakthi.K

Read only

0 Likes
7,254

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

Read only

0 Likes
7,254

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

Read only

0 Likes
7,254

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

Read only

Former Member
0 Likes
7,254

Hi

Plz help me in solving this issue

Read only

0 Likes
5,489

Can anyone suggest how to use it in cds view analytical query