Display Cost Element Groups linked to a Cost Element.

Hi ABAP Gurus,
I am creating a program which displays a list of Cost Element Groups (maximum 10 levels) linked to a Cost Element(s) entered by the user at the selection screen.
What I did was selecting first at SETLEAF and then at SETNODE.
But when I was about to create the final internal table which will be used to display the data, I found out looping 10 times which is not good.
Can you suggest as to what needs to be done on this?
Thank you so much for your help.
Regards,
Onyx

try fm K_KKB_SET_DISSOLVE
grx
Andreas

Similar Messages

  • How to find cost element group linked to account number

    Hi all,
    I have following scenario.
    I have account number and i want to find out it's cost element group.
    In t-code KAH3 when i enter cost element group i get all the account number in that group.
    But the problem is that i have account number and i want to find out in which cost element group this
    account number belongs.
    Is there is any fuction module from which i can get cost element group from account number or from which table i can fetch cost element group depending upon the account number.
    Thanks in advance.
    sachin

    hi,
    check this function module.
    BAPI_COSTCENTERGROUP_GETDETAIL
    table - SETLEAF.

  • Sender Cost Element Group role in Assessment Cost Element Cycle

    Hello,
    We have an assessment cycle as below:-
    Assessment Cost Element - 6000000
    Sender Rule - Fixed Amount
    Receiver Rule - Variable Portions
    Sender Cost Center - 1000
    Sender Cost Element Group - ABCD
    Receiver Order Group - XYZS
    Sender Values - 2,00,000 USD - Cost Center 1000
    Cost Element Group in Receiver Tracing Factor tab - EFGH,
    When I see the line item report of sender cost center 1000, I am able to see the total value as 2.00,000 USD credited, but I am not sure about the role of Sender cost element group ABCD in this situation.
    Also what is the role of receiver cost element group EFGH?
    Please advise.
    Thanks
    Tapan

    Hi Tapan,
    When you have selected in sender rule fixed amount then the system will transfer that amount to the receiver cost center specified irrespective of the total amount of cost element group existing in the sender cost center. There is no significance of cost element group mentioned in the sender rule then.
    The role of the receiver cost element group in the tracing factor is used to apportion the amount of the sender according to the expenses existing on the orders in your case.
    Regards,
    Divraj

  • Cost center Group associated with a Cost center

    Hi Experts ,
    I have a requirement , where I need to find the cost center group of given cost center.
    Is there any FM to do the same?
    I have Cost center in the Input and should get Cost Center group associated with it.
    Thanks !!

    BAPI_COSTCENTER_GETDETAIL

  • Transport of  Cost element groups

    Hello SAP Gurus,
    We have a requirement wherein the client wants to know what is the correct way to move a cost element group (see KDH1, KDH2 and KDH3) to different clients and systems?
    That is, how to make sure that the transport donu2019t overwrite the existing groups in production?
    Thanks & regards,
    Murali.S

    Dear Murali,
    Creation CE Group/ Change CE Group/Display  CE Group : KAH1,KAH2& KAH3.
    Follow below Steps for removing / Deleting Cost Element Groups.
    1 - Remove Cost element assignments
    2 - Execute T.cde:KSH3
    Regards,
    Viswa

  • Delete Cost element group

    Hi Gurus,
    I would like delete a cost element group by KAH2. When I try to delete it, the program tells me that is being used in a report.
    I use the feature "Extras -> Where-Used list for group" to find the report in which I am using the cost element group.
    I go to modify the report painter by GRR2 to see in what line is using this cost element group, but I can`t find any line of the report, or in General options of this report, where is using this cost element group.
    It seems that the report is not using this cost element group, however I can not erase, because it always brings me to this report.
    Someone can help me?
    Thank you very much.

    Hi
    You  can remove the cost elements from Cost Element Group just select the cost element Group(Tcode:KAH2) then select the cost element that time the cost element becomes in red colour then right click on it & click on remove (F5).
    Then you can reassign the cost element if required
    Please check & confirm the same
    Hope this will solve your problem
    Regards
    Praveen PC

  • Planning at cost element group level

    Is it possible to plan values  at cost element group level instead of at cost element level in CCA?
    Thanks

    Hello,
    Yes it is possible. In t-code-KP06 Cost Center/Activity Input planning, we can select input values in the combination of individual Cost Center-wise OR Cost Center Group-wise and  individual Cost Element-wise OR Cost Element-wise. Here if you give Cost Element Group as your input value, you can plan cost for each Cost Element.
    Regards
    appalas

  • Cost center group report

    Can I run cost center report referencing two cost center groups and two cost element groups. I know we can do multiple selection for cost centers and cost elements but that will not help my cause.
    Lets say we have cost center groups A & B and cost element group 1& 2. We would like a report that shows us Sum of A1 + Sum of B2. This explains why we cant simply use multiple selction for cost center and cost element group. It will also give you an idea of what kind of output we are looking for.
    Any help in this regard will be highly appreciated and points duely assigned.
    Nik

    Hello nik,
            what is the cost center hirearchy you are using. If you are using alternative hierarchy then you can do this by selecting higher level of the A&B.
    regards,
    sankar

  • Change in the cost center group

    Hi,
    Can we change the cost center from one cost center group to another group, when there are some postings in the cost center? If yes, how to go about it?
    help me out

    Yes you can!
    If you are planning to change within the standard hierarchy, Goto OKEON, drag, drop and save.
    Or you can go to KS02 for the cost center, in the basic data, you can give the new cost center group under the hierarchy area.
    If it is just non hierarchy cost center group, then go to KSH2 enter the old group, select the cost center, delete save, then go to the new cost center group and include the cost center.
    It does not matter whether it has been posted or not. It is just a grouping. But caution must be exercised. and there shall be a valid justification for doing so. Because the cost center may be used in various cycles. So better to check where and all the cost center is being used and then do the change.

  • Extract expense for a designated cost center group

    Hi,
    There is a problem that we want get expense for a designated cost center group instead of cost center and store in the cube. We can get the cost center group but it is a node in a hierachy. I don't know how to map cost center to it's group.
    Thanks in advance.

    >
    rahul dsnr wrote:
    > Hi,
    >  Thanks for ur reply, but those FM's are not providing Cost center group for a cost center.
    >
    >  Can u provide me a  better solution to find cost center group for a cost center.
    >
    > Regards,
    > Rahul
    Do you mean that you want to read the cost centre group hierarchy for a cost centre?  So that instead of entering a cost centre group and reading down the hierarachy until you get to the cost centre codes at the bottom, you want to enter a cost centre and then read up the hierarchy until you get to the cost centre group at the top of the hierarchy.  If so, I don't think there is a function module to do what you want.  The cost centre group hierarchy data is held in table SETNOTE, so you could have a look at that.

  • Can 2 cost center group share same cost center?

    Dear Experts,
    Can 2 cost center group share the same cost center? 
    Basically I'm looking at MATRIX structure where one cost center, say an Equipment shared by 2 different cost center groups (say one in "Location-A" cost center group, and the other one is in "Process-A" cost center group).  This is to enable the management to be able to see the costs incurred in either by "Location" cost center group or "Process" cost center group.
    The "Location-A" cost center group may tied to Cost center 101, Cost Center 102 and Cost Center 103.  The "Process-A" cost center group may only tied to Cost Center 101, and other cost center 201 (which is also tied to other "Location-B" cost center group).
    Please advise.
    regards,
    Abraham

    Hi Abraham,
    its not possible to assign a cost center to several cost center groups in the standard hierarchy. Otherwise, the standard hierarchy would be inconsistent.
    As stated in the online documentation under http://help.sap.com/erp2005_ehp_05/helpdata/EN/25/908fc66d8411d194f000a0c93031df/frameset.htm
    'You can assign each cost center to only one group in the standard hierarchy, but to as many alternative groups as you require.!
    Regards,
    Greta

  • Can a cost center reassign to another cost center group

    Dear Expert,
    Does SAP allow a cost center reassign from one cost center group to another cost center group in this scenario the particular cost center which going to reassign to another cost center group have posting into the cost center?
    Please advise how to reassign and what is the impact?
    Please help
    Regards,
    Karen

    Hi,
    Thank you for the prompt reply.
    Would like to seek for your advise.
    The cost center that we need to reassign to other cost center group will it carry the cost from the previous cost center group to a new cost center group?
    Please advise.
    Thank you.
    Regards,
    KH

  • Cost Element Group & Cost Element

    Hi Friends,
    Can you please tell me how cost element groups are linked with individual cost elements(Primary and Secondary).
    Is there any standard cost element groups are there. Please let me know.
    Priya

    Hi,
    Cost element groups, like any other group for master data, is used for reporting purpose. By creating a group you unite certain objects and make it possible to present it as one entity in the reporting or use it in allocation processes. There is no such a thing as standard group, as the user chooses for himself how he wants uniting the elements.
    Regards,
    Eli

  • Cost Element group table

    Can anyone tell me which table contains the cost element groups and which cost elements are related to them

    Please.... Help!
    I want to write data there can fix it ....!
    ---------      I want to record this record in the edit field -----------------------
    code is:
    REPORT NO STANDARD PAGE HEADING LINE-SIZE 100 LINE-COUNT 60
                                    MESSAGE-ID zin.
    TYPE-POOLS: gset, gseth, slis, kkblo.
    TABLES: aufk.
    TYPES: BEGIN OF t_datam.
            INCLUDE STRUCTURE GRPOBJECTS.
    TYPES: END OF t_datam.
    DATA: it_datam TYPE STANDARD TABLE OF t_datam WITH HEADER LINE.
    DATA: gwa_datam TYPE t_datam,
          GRPOBJECTS TYPE t_datam.
    DATA: pt_node TYPE gseth_node_tab,           "Nodos
          pt_valu TYPE gseth_val_tab,            "Valores
          pt_mast TYPE gseth_md_tab.             "Descripciones
    DATA: ls_node LIKE LINE OF pt_node,
          ls_valu LIKE LINE OF pt_valu.
    DATA:
          p_layout     TYPE slis_layout_alv,              " Layout inicial
          t_sortcat    TYPE slis_sortinfo_alv OCCURS 1,   " Orden ALV
          t_fieldcat   TYPE slis_t_fieldcat_alv,          " Atributos a mostrar
          t_events     TYPE slis_t_event,                 " Lista de eventos
          t_top_page   TYPE slis_t_listheader,            " Write ini pagina
          w_sort       LIKE LINE OF t_sortcat.
    DATA: l_repid TYPE sy-repid.
    SELECTION-SCREEN BEGIN OF BLOCK b01 WITH FRAME TITLE text-b01.
    PARAMETERS:     p_kokrs LIKE aufk-kokrs       OBLIGATORY DEFAULT '300',
                    p_class LIKE setnode-setclass OBLIGATORY DEFAULT '0101',
                    p_subcl LIKE setnode-subclass DEFAULT '300',
                    p_setnm LIKE setnode-setname  OBLIGATORY DEFAULT '300MPR2'.
    SELECTION-SCREEN: END OF BLOCK b01.
    PARAMETERS:     p_expor NO-DISPLAY,
                    p_nivel NO-DISPLAY. "@01
    *Initialization
    INITIALIZATION.
      l_repid = sy-repid.
    START-OF-SELECTION.
       PERFORM 1pro_data.
    IF p_expor = 'X'.
        IF p_nivel = 'X'.                                       " @01
          EXPORT it_datam TO MEMORY ID 'T_DATAM'.
        ENDIF.
       ELSE.
        PERFORM 0_layout USING p_layout.
        PERFORM a_haz_alv.
        PERFORM c_haz_eventos CHANGING t_events.
        PERFORM d_call_alv.
      ENDIF.
    END-OF-SELECTION.
    FORM 1pro_data.
    PERFORM obt_jerarquia  USING  p_kokrs      "Sociedad         (intput)
                                   p_class      "Clase de set     (intput)
                                   p_subcl      "Subclase
                                   p_setnm.     "Nombre del set
    * LLenado de datos del master
      LOOP AT pt_node INTO ls_node.
        it_datam-shortname = ls_node-shortname.
        it_datam-hlevel = ls_node-hlevel.
        it_datam-descript = ls_node-descript.
        it_datam-credate = ls_node-credate. "Fecha creada
        it_datam-creuser = ls_node-creuser. "usuario creador
        it_datam-ref_set = ls_node-ref_set. "Email
        APPEND it_datam.
      ENDLOOP.
    sort it_datam by hlevel ascending.
    ENDFORM.
    FORM obt_jerarquia USING  pi_kokrs                      "Sociedad         (intput)
                              pi_class                      "Clase de set     (intput)
                              pi_subcl                      "Subclase         (intput)
                              pi_setnm.                     "Nombre de set    (intput)
      DATA:
        lf_info       LIKE grphinfo,
        lf_over       LIKE sy-datar,
        lf_class      LIKE sethier-setclass,
        lf_setid      LIKE sethier-setid,
        lf_kokrs      LIKE sethier-kokrs,
        lf_mandt      LIKE sy-mandt,
        lf_mast_datax LIKE grphp1,
        lf_structurex LIKE grphp2,
        lf_repl_class LIKE sethier-setclass,
        lf_repl_unitx LIKE sethier-kokrs,
        lf_repl_table LIKE sethier-fieldname,
        lf_repl_field LIKE sethier-tabname,
        lf_repl_suffi LIKE grpdynp-suffix,
        lf_nros_level LIKE sethier-level.
      DATA lf_strlen TYPE i.
    * Data
      lf_class = pi_class.
    *              CONCATENAMOS CLASE + SUBCLASE + NOMBRE DE GRUPO
    *Si hay subclase (Centro de beneficio, clase de costo, centro de costo)
      IF pi_subcl NE space.
    * Cargamos la clase de set con la subclase
        CONCATENATE lf_class pi_subcl INTO lf_setid.
        lf_strlen = STRLEN( pi_subcl ).
      ELSE.
    * Si no hay subclase (orden interna), cargamos solo la clase de set
        lf_setid  = lf_class.
        lf_strlen = 0.
      ENDIF.
    *Obtenemos cuántos espacios en blanco habrá entre la subclase y el nombre del set
      lf_strlen = 4 - lf_strlen.
      IF lf_strlen < 0. lf_strlen = 0. ENDIF.
      lf_strlen = 0.
    *Si es > 0 concatenamos caracter para ser reemplazado por espacio en blanco
      DO lf_strlen TIMES.
        CONCATENATE lf_setid '&' INTO lf_setid.
      ENDDO.
    *Cargamos nombre de set
      IF p_class = '0106' OR p_class = '0101'.
        CONCATENATE lf_setid '&' pi_setnm INTO lf_setid.
      ELSE.
        CONCATENATE lf_setid pi_setnm INTO lf_setid.
      ENDIF.
    *Reemplazamos & por espacios en blanco
      TRANSLATE lf_setid USING '& '.
      lf_kokrs         = pi_kokrs.
      lf_mandt         = '100'.
      lf_mast_datax    = '   '.   "Los espacios evita mensaje verificación de datos maestros
      lf_structurex    = 'X  X0200'.
      lf_repl_class    = ' '.
      lf_repl_unitx    = ' '.
      lf_repl_table    = ' '.
      lf_repl_field    = ' '.
      lf_repl_suffi    = ' '.
      lf_nros_level    = '1'.
      REFRESH: pt_node, pt_valu, pt_mast.
    *Obtiene lista de sub estaciones de la tabla objetos
      CALL FUNCTION 'K_HIERARCHY_TABLES_READ'
        EXPORTING
          e_class                     = lf_class
          e_setid                     = lf_setid
          e_kokrs                     = lf_kokrs
          e_mandt                     = lf_mandt
          e_master_data               = lf_mast_datax
          e_structure                 = lf_structurex
          e_replace_class             = lf_repl_class
          e_replace_unit              = lf_repl_unitx
          e_replace_table             = lf_repl_table
          e_replace_field             = lf_repl_field
          e_suffix                    = lf_repl_suffi
          e_old_line_level            = lf_nros_level
        TABLES
          t_nodes                     = pt_node         "Nodos
          t_values                    = pt_valu         "Valores
          t_master_data               = pt_mast         "Textos
        CHANGING
          c_info                      = lf_info
          c_overwrite                 = lf_over
        EXCEPTIONS
          no_controlling_area         = 1
          no_chart_of_account         = 2
          different_controlling_areas = 3
          different_chart_of_accounts = 4
          set_not_found               = 5
          illegal_field_replacement   = 6
          illegal_table_replacement   = 7
          fm_raise                    = 8
          convert_error               = 9
          no_overwrite_standard_hier  = 10
          no_bukrs_for_kokrs          = 11.
    ENDFORM. 
    FORM 0_layout USING ls_layout TYPE slis_layout_alv.
      CLEAR: ls_layout.
      ls_layout-zebra                 = ''.
      ls_layout-colwidth_optimize     = 'X'.
      ls_layout-box_fieldname         = space.
      ls_layout-no_input              = 'X'.
      ls_layout-no_vline              = ' '.
      ls_layout-no_colhead            = ' '.
      ls_layout-lights_condense       = 'X'.
      ls_layout-confirmation_prompt   = 'X'.
      ls_layout-detail_popup          = 'X'.
      ls_layout-detail_initial_lines  = 'X'.
      ls_layout-detail_titlebar       = 'Centro de Benef. vs Centro Costo'.
    ENDFORM.  
    FORM a_haz_alv.
      REFRESH: t_fieldcat.
      CLEAR:   t_fieldcat.
      PERFORM define_campo USING:
      'SHORTNAME' '' '' '25' 'GRPOBJECTS' '' '' 'ID Corto'       '' '' '' '' '',
      'HLEVEL' ''    '' '04' 'GRPOBJECTS' '' '' 'Nivel'          '' '' '' '' '',
      'DESCRIPT' '' ''  '35' 'GRPOBJECTS' '' '' 'Descripción'    '' '' '' '' '',
      'CREDATE' '' ''   '12' 'GRPOBJECTS' '' '' 'Fec.Creada'     '' '' '' '' '',
      'CREUSER' '' ''   '08' 'GRPOBJECTS' '' '' 'Usu.Creador'    '' '' '' '' 'X',
      'REF_SET' '' ''   '34' 'GRPOBJECTS' '' '' 'Correo E-mail asig.' 'Cor.Email' 'E-mail' '' '' 'X'.
    ENDFORM.
    FORM define_campo  USING fieldname        "Nombre de campo
                             emphasize        "Color
                             hotspot          "Evento click
                             outputlen        "Longitud
                             ref_tabname      "Tabla referencia
                             cfieldname       "Campo referencia
                             datatype         "Tipo de dato
                             seltext_l        "Texto largo
                             seltext_m        "Texto mediano
                             seltext_s        "Texto corto
                             do_sum           "Campo para suma
                             no_out           "No se visualiza
                             pi_edit  TYPE c. "Editar campos
      DATA: ls_fieldcat TYPE slis_fieldcat_alv.
      CLEAR ls_fieldcat.
      ls_fieldcat-fieldname   = fieldname.
      ls_fieldcat-tabname     = 'T_AUFK2'.
      ls_fieldcat-ref_tabname = ref_tabname.
      ls_fieldcat-outputlen   = outputlen.
      ls_fieldcat-emphasize   = emphasize.
      ls_fieldcat-hotspot     = hotspot.
      ls_fieldcat-cfieldname  = cfieldname.
      ls_fieldcat-datatype    = datatype.
      ls_fieldcat-seltext_l   = seltext_l.
      ls_fieldcat-seltext_m   = seltext_m.
      ls_fieldcat-seltext_s   = seltext_s.
      ls_fieldcat-do_sum      = do_sum.
      ls_fieldcat-no_out      = no_out.
      ls_fieldcat-edit        = pi_edit.
      APPEND ls_fieldcat TO t_fieldcat.
    ENDFORM.                    "define_campo
    FORM c_haz_eventos CHANGING lt_events TYPE slis_t_event.
      CONSTANTS:
        c_top_of_page  TYPE slis_formname VALUE 'TOP_OF_PAGE',
        c_end_of_page  TYPE slis_formname VALUE 'END_OF_PAGE',
        c_user_command TYPE slis_formname VALUE 'USER_COMMAND'.
      DATA: ls_event TYPE slis_alv_event.
      CALL FUNCTION 'REUSE_ALV_EVENTS_GET'
        EXPORTING
          i_list_type = 0
        IMPORTING
          et_events   = lt_events.
    * tope de pagina
      READ TABLE lt_events WITH KEY name =  slis_ev_top_of_page INTO ls_event.
      IF sy-subrc = 0.
        MOVE c_top_of_page TO ls_event-form.
        APPEND ls_event TO lt_events.
      ENDIF.
    * fin de pagina
      READ TABLE lt_events WITH KEY name =  slis_ev_top_of_page INTO ls_event.
      IF sy-subrc = 0.
        MOVE c_top_of_page TO ls_event-form.
        APPEND ls_event TO lt_events.
      ENDIF.
    * eventos de usuario
      READ TABLE lt_events WITH KEY name = slis_ev_user_command INTO ls_event.
      IF sy-subrc = 0.
        MOVE c_user_command TO ls_event-form.
        APPEND ls_event TO lt_events.
      ENDIF.
    ENDFORM.
    FORM d_call_alv.
      CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
        EXPORTING
          i_callback_program       = l_repid
          i_callback_pf_status_set = 'SET_STATUS'
          i_callback_user_command  = 'USER_COMMAND'
          is_layout                = p_layout
          it_fieldcat              = t_fieldcat[]
          i_save                   = 'X'
          it_sort                  = t_sortcat
    *   is_variant               = g_variant_1
        TABLES
          t_outtab                 = it_datam
        EXCEPTIONS
          program_error            = 1
          OTHERS                   = 2.
    ENDFORM. 
    FORM set_status USING rt_extab  TYPE  slis_t_extab.
      SET PF-STATUS  'ALV_STATUS'.
    ENDFORM.
    FORM user_command USING r_ucomm     LIKE sy-ucomm
                            r_selfield TYPE slis_selfield.
      PERFORM sr_upd_alv.
    DATA: wa_alv  LIKE it_datam.
    r_selfield-refresh = 'X'.
      CASE r_ucomm.
        WHEN 'SAVE'.
          LOOP AT it_datam INTO gwa_datam.
      "Here you should go, because I have not created anything but just reads the data helps.
          ENDLOOP.
    ENDFORM.

  • Repot cost center groups,cost element groups and quantities

    Hi
    Is there any report displays only costcenter groups, costelement groups and quantities. No line items are required this is for management purpose.
    thanks in advance
    prasad

    Hi Sunitha,
    Thanks for your immd. reply
    But my requirement is not that
    I need cost center groups, cost element groups and quantities in the same report
    regards
    hariprasad reddy
    accenture - 9963411136

Maybe you are looking for

  • JMS Sender Channel: Linked Error

    Hi All, I'm working on a synchronous JMS to Proxy scenario. I have created Sender JMS channel. In RWB, the status of the channel is error. The error is: Channel Error occured. Detailed error (if any): JMS error: MQJMS1024: session closed, Linked erro

  • Right Click in Windows Vista (Bootcamp)

    the two finger tapping works GREAT in OSX, but can I do something similar while running vista? The two finger gesturing seems to work nice for scrolling, what about the right click? Or Is there atleast a 3rd party program that will allow me to map th

  • Apple Bluetooth Keyboard Not Pairing

    Hello, My sister in law's bluetooth apple keyboard is not working. Last night it kept loosing its signal. This morning it stopped working. She has reset it and put new batteries in. It sees the keyboard and the mouse is working, but it gives the foll

  • Latest PhotoShop CC upgrade causes display driver problem. How can it be solved?

    Things were working fine until I committed to the upgrade this morning, and then I got this message when I opened Ps CC: How can this be resolved? Thanks, Anna

  • My photoshop element s 4 has a differant identity than my internet account

    FIX NEEDED I had a crash and when Staples finished fixing it ????? My name was misprinted so that I now have 2 names for one program, thecomputor and the internet! I am worried that it will be implossible to upgrade    The name on the computer is Ell