Is there a Function module to get customer hierarchy data?

Howdy,
I'm writing a report where the user can, on the selection screen, enter a customer number or a hierarchy node and then the program has to get all the higher level nodes and  and lower level nodes for the selected Sales area.
eg. for the following hierarchy:
A
->B
--|-> D
--|-> E
-> C
---|-> F
---|-> G
if node b was selected it would pull back:
KUNNR     HKUNNR
A         blank
B         A
C         A
D         B
E         B
F         C
G         C
Anyone know if there is a Function module that can do this?
Thanks

Hi Victoria,
even i was using the same FM "RSNDI_SHIE_STRUCTURE_GET3"
my code goes like this...
i am passing hierarchy name and  node name...this is for cost element hierarchy.
please check the code and tell if i am missing anything.
o/p i am getting is all 0's.
report ztest5.
tables : ZREPCODMAP.
data: itab type standard table of ZREPCODMAP with header line.
TYPES: BEGIN OF STRUC,
         RESULT type RSSH_S_NODEBYNAMEWOL,
        ZREPCODMAP-REPDSELM,
        END OF STRUC.
DATA: itab1 type standard table of struc with header line.
data: w_hiesel like RSNDI_S_HIESEL.
w_hiesel = '1000KES'.
*data: w_nodebyname type RSNDI_T_NODENM.
data: tab type standard table of RSNDI_S_HTAB with header line.
data: lsubrc type SY-SUBRC.
select * from ZREPCODMAP into table itab where PROFIT_CTR <> ' '.
loop at itab.
concatenate itab-CO_AREA itab-REPDSELM INTO itab1-RESULT.
*write: itab1.
break-point.
CALL FUNCTION 'RSNDI_SHIE_STRUCTURE_GET3'
EXPORTING
I_S_HIEKEY =
i_s_hiesel = w_hiesel
i_s_subtreesel = itab1-result
I_T_NODENAME =
I_NO_NODENM_TABLE = w_flag
IMPORTING
E_S_HIEDIR =
e_subrc = lsubrc
TABLES
E_T_HIEDIRT =
e_t_hierstruc = tab.
E_T_MHIERNODE =
E_T_THIERNODE =
E_T_HIERINTVL =
E_T_NODENAMES = tab.
E_T_NODEATTR =
E_T_LEVEL =
E_T_MESSAGE =
write: tab.
*write: lsubrc.
endloop.
Thanks & Regards,
Vijaya

Similar Messages

  • Is there any function module for getting distribution list name

    Hi all,
    Is there any function module for getting distribution list name when there is same description for two distribution list name.
    or
    help me how to fetch the correct distribution name when there is same description.
    In order to send mails.
    Tell me ASAP.
    thanks
    sagar.

    http://www.sapbrainsonline.com/REFERENCES/FunctionModules/SAP_function_modules_list.html
    list of Fms

  • Is there any function module to get the variables used in a query?

    Hi experts
    Please, do you know if is there any function module to get the variables used in a query?
    Thanks and regards
    Luis

    Hi Srini
    Yes, I have checked the tables but I need a function module
    Thanks anyway!
    Luis

  • Functional module for Getting Material classification data.

    Please tell me Functional module for Getting Material classification data like class type , class, characteristics and characteristics values for material.

    Dear,
    FM:
    CLAF_CLASSIFICATION_OF_OBJECTS
    Table KLAH Class Header Data
    - KSML Characteristics of a Class
    Regards,
    R.Brahmankar

  • Function module to get customer balances

    Hello , is there a FM to get customer balances?

    hi Sooness,
      i am not sure but you can check with the BAPI:
    BAPI_AR_ACC_ GETKEYDATEBALANC E
    function module to get AR (customer balance).
      and also have a look in the link below:
    http://www.sapbapi.com/bapi-list/
    http://www.erpgenie.com/abap/functions.htm
    With luck,
    Pritam.

  • BAPI or Function Module to get MSEG table data based on PO Number (EBELN)

    Hi
    1. Is there any BAPI /  Function Module to get PO details based on Plant and PO date?
    2. Is there any BAPI / Function Module to get Material document details(MSEG data) based on PO number?
    Thanks
    Narendra

    Hi,
    check the Bapis Givem below
    BAPI_PO_GETITEMS
    http://abap.wikiprog.com/wiki/BAPI_PO_GETDETAIL1
    you will get the detail.
    Regards

  • Function Module for getting Payroll start date and end date

    Hi Gurus,
      If I give one date then is there any function module to find the payroll period start date and enddate for that given date?
    Points will be awarded
    Thanks
    Ravi

    Hi,
      Try these FMs
    HR_PAYROLL_PERIODS_GET
    HR_BEN_PAY_GET_PAYROLL_PERIODS
    HR_PAYROLL_PERIOD_GET
    HR_P06I_GET_PAYROLL_PERIOD
    Regards,
    PRashant

  • Function module to get customer's  PO box address?

    Hello friends,
    I want to display customer address in my report.
    When we execute XD03 and enter any customer number, address details displays in various sections..like..
    Name, Search Terms, Street Address,PO box address and Communication.
    I need function module which gives me the details of "PO box address".
    Is there any function available in abap?
    Thanks
    RH

    Hello,
    You can use the BAPI: BAPI_CUSTOMER_GETDETAIL2. In the EXPORT parameter you have a structure for Customer Addr. (CUSTOMERADDRESS LIKE BAPICUSTOMER_04).
    The PO BOX is in BAPICUSTOMER_04-PO_BOX.
    Hope this helps.
    BR,
    Suhas

  • Is there any function module to get vc characteristics and its value using material number?

    Hi Experts,
    I am using BAPI_CLASS_GET_CHARACTERISTICS, BAPI_OBJCL_GETCLASSES to get characteristics description and its values.
    Is there any other Function module to pull this values using material number?
    Thanks in Advance.
    Ramkumar

    Have you tried this BAPI_OBJCL_GETDETAIL
    Import parameters
    MATNR value in the OBJECTKEY
    MARA in OBJECTTABLE
    Class name in CLASSNUM
    '001' in CLASSTYPE
    You will get the Class Characteristics data into these tables:
    ALLOCVALUESNUM
    ALLOCVALUESCHAR
    Jogeswara Rao K

  • Is there any function module to get the no. of days in a month?

    hi all,
    if i have the month and year then is there any FM by which i can get the no. of dayz in that month?
    regards,
    shweta upadhyay.

    Hi swetha,
    i have written my own function module,may be it helps u.
    ""Local interface:
    *"  IMPORTING
    *"     VALUE(DAY_IN) LIKE  SY-DATUM
    *"  EXPORTING
    *"     VALUE(FIRST_DAY_OF_MONTH) LIKE  SY-DATUM
    *"     VALUE(LAST_DAY_OF_MONTH) LIKE  SY-DATUM
    *"     VALUE(NUMBER_OF_DAYS) TYPE  I
    *"  EXCEPTIONS
    *"      DAY_IN_NO_DATE
      DATA: BEGIN OF DATE,
              J(4),
              M(2),
              T(2),
            END OF DATE.
      DATA: ZAHL TYPE I.
      DATA: DAYS_SUBTRACT TYPE I.
      DATA: XDATUM TYPE D.
      XDATUM = DAY_IN.
      XDATUM+6(2) = '01'.
      XDATUM = XDATUM + 35.
      XDATUM+6(2) = '01'. XDATUM = XDATUM - 1.
      NUMBER_OF_DAYS = XDATUM+6(2).
      DATE = DAY_IN.
      IF DATE-M LT JANUARY OR DATE-M GT DECEMBER.             
        raise DAY_IN_NO_DATE.
      ENDIF.
      IF DATE-J LT LOWDATE.                 
        raise DAY_IN_NO_DATE.
      ENDIF.
      IF DATE-J EQ HIGHDATE-J AND
         DATE-M EQ HIGHDATE-M.
        LAST_DAY_OF_MONTH = HIGHDATE.
      ELSE.
        IF DATE-M EQ DECEMBER.
          ZAHL = DATE-J + 1.
          UNPACK ZAHL TO DATE-J.
          DATE-M = FRIST.
          DAYS_SUBTRACT =   NUMBER_OF_DAYS - 1.
        ELSE.
          ZAHL = DATE-M + 1.
          UNPACK ZAHL TO DATE-M.
          DAYS_SUBTRACT =   NUMBER_OF_DAYS - 0.
        ENDIF.
    First of the subsequent month
        DATE-T = FRIST.
        LAST_DAY_OF_MONTH = DATE.
        FIRST_DAY_OF_MONTH = DATE.
        SUBTRACT 1 FROM LAST_DAY_OF_MONTH.
        SUBTRACT DAYS_SUBTRACT FROM FIRST_DAY_OF_MONTH.
      ENDIF.
    ENDFUNCTION.
    regards,
    nagaraj

  • Is there any function module to get the data from st06?

    Hi,
    I'm new to this forum.
    I would like to know if there is a way (maybe some function modules) to collect information like system architecture, and databases as displayed in transaction st06?
    I would like to call it from external program in order to view part of the data available in st06.
    Thanks,
    Erez Gordon.

    have a look at function group SMON.
    Not sure if these are remote enabled, otherwise create a wrapper function module (RFC).
    Edited by: Micky Oestreich on Dec 11, 2008 9:37 AM

  • How to create function module for getting customer name

    Hi Experts,
                   How to create function module?  when in import parameter kunnr values to be passed it must give name1 details according to the customer number...
    how to write the logic in source code....
    Regards,
    Thiru. R

    1. First of all create function group.
    2. Create function module using this function group.
    3. If only one kunnr is needed at a time, create import parameter for it. But if many kunnr to be entered at a time,use table.
    4. Fetch name1 for each kunnr from KNA1 table.
    "->> if many kunnr
    if not t_kunnr[] is initial.
    select kunnr as kunnr name1 as name1
    into table t_kunnr_name1
    from kna1
    for all entried in table t_kunnr
    where kunnr = t_kunnr-kunnr.
    endif.       
    sort t_kunnr_name1 by kunnr name1.
    delete adjacent duplicates from t_kunnr_name1 comparing kunnr name1.
    table t_kunnr_name1 will contain kunnr and its name1.
    I hope logic is clear for you now.
    Regards,
    Aparna

  • Is there any function module to get the purchase order conditions from EONP

    Hi,
    I want to get the EONP and EONH table details for the purchase orders with the help of function module. Can anyone tell me any function module name which would give me those details.
    Thanks,
    Atanu

    Hi
    Check with BAPI function module BAPI_PO_GETDETAIL and BAPI_PO_GETDETAIL1.
    Regards
    Srilaxmi

  • Function module for getting periods for date range

    Hi,
    Can anybody tell me the function module which will return the periods along with the year, when we give a date range.
    e.g
    01011999 to 120112000
    so it shoud return peroids between these date with year. Its possible thru programatically, but i m checking if there is any FM, so i can use FM.
    Thanks,

    Hi,
    You can use function module which works exactly what you are expecting FIMA_DAYS_AND_MONTHS_AND_YEARS.
    please reward points to useful answers.
    Thanks,
    Sriram Ponna.

  • Function Module for getting the desired date

    Hi All,
    I need a function module where in get the date value from Current date - 540 days.
    i,e System Date - 540 days = ????
    Thanks
    Suresh

    previous FM works good , this is for ur info , to give in month, date and year instead of onlly days
    CALL FUNCTION 'RP_CALC_DATE_IN_INTERVAL'
        EXPORTING
          date      = sy-datum
          months    = '00'
          days      = '07'
          years     = '00'
          signum    = '-'
        IMPORTING
          calc_date = w_due_date.
    Message was edited by: chandrasekhar jagarlamudi
    Message was edited by: chandrasekhar jagarlamudi

Maybe you are looking for

  • HT201303 How do you reset the answers to your security questions in the iTunes store?

    I was trying to make a purchase on the iTunes store from my computer but forgot the answers to my security questions. I can log in with my Apple ID and password with no problems, it's just that when I am prompted to answer two security questions to c

  • How do I make a view object containing two entity objects updatable?

    I have a view object that contains attributes from two entity objects. The query looks like this SELECT AplCfgPartyEO.ID, AplCfgPartyEO.ID_HRM_BRW_JOB, HrmBrwJobEO.CREATED_BY, HrmBrwJobEO.CREATION_DATE, HrmBrwJobEO.ID AS ID1, HrmBrwJobEO.ID_HRM_BAS_J

  • Transferring MS office to a new macbook pro.

    I am trying to transfer MS office 2010 from an old macbook pro to a new one.  on starting the apps it asks for a product key. when i enter the key from the original office 2004 disks,  it does not work.  Any ideas on how to get the apps to work.

  • Oracle RDB Install on Itanium

    Pulled the RDB 7.2.1.2 for OpenVMS savesets down from the Oracle website to install on a HP Integrity rx6600 server running OpenVMS 8.3. Unzipped and copied (FTPed) savesets over to server. When I do the 4@sys$update:vmsinstal, I get following error

  • Windows 2012 FTPS erro 234 AUTH

    Hi Everybody, I used a Windows 2012 server with FTPS installed for a couple of weeks. My SSL certificate has expired and then I have replaced it. I can connect internally with FileZilla or WinSCP but externally I get 234 AUTH command ok. Expecting TL