How can i create Organization Structure in sap

Hi Abaper/Basis Guys...
   I want To Create An Simple Basic Organization Structure for my  small Company..iam Abaper no basic guy is there in my office.
   pls send me step by step guidlines
Thank You.
Madhu Rao
Edited by: madhubabu rao on Jun 19, 2008 8:01 AM

Hi Madhu,
Kindly check the following links.
http://help.sap.com/saphelp_nw2004s/helpdata/en/4b/6a43cccafe11d2b49d006094b9c9b4/content.htm
http://help.sap.com/bestpractices/BBLibrary/html/J02_OrgStructure_EN_UK.htm
Dont forget to reward points if found useful.
Thanks,
Satyesh

Similar Messages

  • How can i create orgnsiation structure in sap

    Hi Guys
        Can anybody tell me how to craete an organsation strucuture first when first implimenting the sap in your company...step by step answer
    thankx
    Edited by: madhubabu rao on Jun 12, 2008 1:10 PM

    Hi,
    I have some code which I developed.
    *&      Form  Create_operation_unit
    *       This subroutine is for creation of Operating Unit
    FORM create_operation_unit .
    *  DATA:lv_valto TYPE datab.
      DATA:
    *  lv_desc TYPE bapiset_hier-descript,
           lv_gpname TYPE bapiset_hier-groupname,
          lv_legno TYPE cepc-zzleg_no.
      TYPES : BEGIN OF st_dept,
              ww007 TYPE t25f4-ww007,
              bezek TYPE t25f4-bezek,
              END OF st_dept.
      DATA: lt_dept TYPE TABLE OF st_dept.
      DATA: wa_dept LIKE LINE OF lt_dept,
            lv_lock_ind type cepc-lock_ind,
            lv_segment  type cepc-segment.
      DATA: lv_index TYPE sy-tabix.
      DATA: lv_index1 TYPE sy-tabix,
            lv_prctr  TYPE cepc-prctr,
            lv_zsgid TYPE zfpasgid,
            lv_zsgid_prev TYPE zfpasgid.
      DATA: lv_indicators TYPE bapi0015_8.
      IF p_sd_pct IS NOT INITIAL.                                           "For Profit Center Group.
        CLEAR: gt_hierarchy,gt_hierarchy[].
        CLEAR: gt_hierarchy1,gt_hierarchy1[].
        CLEAR: gt_value,gt_value[].
        CLEAR: gt_value1,gt_value1[].
        GET PARAMETER ID 'CAC' FIELD gv_p_kokrs.
        IF gv_p_kokrs IS INITIAL.
          CALL TRANSACTION 'OKKS'.
          GET PARAMETER ID 'CAC' FIELD gv_p_kokrs.
        ENDIF.
        lv_index = 1.
        lv_index1 = 2.
    * Get deatils of lower levels group from target.
        CALL FUNCTION 'BAPI_PROFITCENTERGRP_GETDETAIL'
          EXPORTING
            controllingarea = gv_p_kokrs
            groupname       = p_sd_pct
          TABLES
            hierarchynodes  = gt_hierarchy
            hierarchyvalues = gt_value.
    ***Get company code for profit center.
        IF gt_value[] IS NOT INITIAL.
          SELECT bukrs
                   FROM csks INTO TABLE gt_csks1
                   FOR ALL ENTRIES IN gt_value
                   WHERE prctr = gt_value-valfrom.
        ENDIF.
        LOOP AT gt_csks1 INTO wa_csks1.
          wa_co_code-comp_code = wa_csks1-bukrs.
          wa_co_code-assign_to_prctr = 'X'.
          APPEND wa_co_code TO gt_co_code.
        ENDLOOP.
        SELECT ww007 bezek FROM t25f4 INTO TABLE lt_dept
                          WHERE spras = sy-langu.
        LOOP AT lt_dept INTO wa_dept.
          READ TABLE gt_hierarchy INTO wa_hierarchy WITH KEY groupname+7(3) = wa_dept-ww007+5(3).
          IF ( wa_dept-ww007(4) = p_sd_pct AND wa_dept-ww007+5(3) = wa_hierarchy-groupname+7(3) ).
            lv_gpname = wa_hierarchy-groupname.
            wa_hierarchy-descript = wa_dept-bezek.
            MODIFY gt_hierarchy FROM wa_hierarchy
                   TRANSPORTING descript
                 WHERE groupname = lv_gpname.
          ENDIF.
        ENDLOOP.
    *   Get the Lock indicator and segmant from source Operting unit.
          SELECT lock_ind
                 segment
            FROM cepc
            INTO (lv_lock_ind,
                   lv_segment)
            BYPASSING BUFFER
            WHERE datbi GE sy-datum
              AND kokrs = gv_p_kokrs
              AND KHINR = p_sd_pct.   "cepc values for source group
          endselect.
        READ TABLE gt_hierarchy INTO wa_hierarchy WITH KEY groupname = p_sd_pct.
    *  gv_tgt_level = wa_hierarchy-hierlevel - 1.                           "chain level
        gv_src_level = wa_hierarchy-hierlevel.                              "Operating unit level
        gv_dep_level = wa_hierarchy-hierlevel + 1.                          "department level.
        LOOP AT gt_hierarchy INTO wa_hierarchy.
          IF wa_hierarchy-hierlevel = gv_src_level.                         "Opearing Unit node
            wa_hierarchy1-groupname = p_dsno.
    *        wa_hierarchy1-descript = wa_hierarchy-descript.
            wa_hierarchy1-descript = p_name.
            wa_hierarchy1-hierlevel = wa_hierarchy-hierlevel.
            APPEND wa_hierarchy1 TO gt_hierarchy1.
          ENDIF.
          IF wa_hierarchy-hierlevel = gv_dep_level.                         "Department node
            CONCATENATE p_dsno wa_hierarchy-groupname+7(3) INTO gv_ngrname.
            wa_hierarchy1-groupname = gv_ngrname.
    *        wa_hierarchy1-descript = wa_hierarchy-descript.
            wa_hierarchy1-descript = wa_hierarchy-descript.
            wa_hierarchy1-hierlevel = wa_hierarchy-hierlevel.
            APPEND wa_hierarchy1 TO gt_hierarchy1.
          ENDIF.
          CLEAR wa_hierarchy1.
        ENDLOOP.
        DELETE ADJACENT DUPLICATES FROM gt_hierarchy1
                     COMPARING groupname.
    *---BEGIN Create profit center group
        CALL FUNCTION 'BAPI_PROFITCENTERGRP_CREATE'
          EXPORTING
            controllingareaimp = gv_p_kokrs
          IMPORTING
            return             = wa_message
          TABLES
            hierarchynodes     = gt_hierarchy1
            hierarchyvalues    = gt_value1.
        IF wa_message IS INITIAL.
          CONCATENATE p_dsno text-020
                      INTO wa_message-message
                      SEPARATED BY space.
          APPEND wa_message TO gt_message.
    * Add node only if PCGroup is created successfully
    *---BEGIN Add node to profit center group
          CALL FUNCTION 'BAPI_PROFITCENTERGRP_ADDNODE'
            EXPORTING
              controllingarea = gv_p_kokrs
              groupname       = p_tg_pct
              subgroupname    = p_dsno
            IMPORTING
              return          = wa_message.
          IF wa_message IS INITIAL.
            CONCATENATE p_dsno text-021 p_tg_pct
                        INTO wa_message-message
                        SEPARATED BY space.
            APPEND wa_message TO gt_message.
    *---Create Profit Center ONLY if PCgroup and ADD node created.
            gv_pcgroup_created = 'X'.                                       "flag used while Creating Profit Centers
    *---Cost center group cration based on successful PC group creation.
          ELSE.
            CALL FUNCTION 'BAPI_TRANSACTION_ROLLBACK'.
            APPEND wa_message TO gt_message.
          ENDIF.
          PERFORM output CHANGING gt_message.
          CLEAR: gt_message,gt_message[],wa_message.
    *---END Add node
        ELSE.
          CALL FUNCTION 'BAPI_TRANSACTION_ROLLBACK'.
          APPEND wa_message TO gt_message.
        ENDIF.
        PERFORM output CHANGING gt_message.
        CLEAR: gt_message,gt_message[].
    *---END PC Group Create
      ENDIF.                                                                "end For Profit Center Group.
      IF p_sd_cct IS NOT INITIAL AND gv_pcgroup_created EQ 'X'.             "For Cost Center Group.ONLY when PC group creation is successful
        CLEAR: gt_hierarchy,gt_hierarchy[].
        CLEAR: gt_hierarchy1,gt_hierarchy1[].
        CLEAR: gt_value,gt_value[].
        CLEAR: gt_value1,gt_value1[].
    * Get deatils of lower levels group from target.
        CALL FUNCTION 'BAPI_COSTCENTERGROUP_GETDETAIL'
          EXPORTING
            controllingarea = gv_p_kokrs
            groupname       = p_sd_cct
          TABLES
            hierarchynodes  = gt_hierarchy
            hierarchyvalues = gt_value.
        READ TABLE gt_value INTO wa_value INDEX 1.
        IF sy-subrc = 0.
          SELECT SINGLE kokrs khinr bukrs kosar
                      FROM csks
                      INTO (gv_c_kokrs, gv_c_grpname, gv_c_bukrs, gv_kosar)
                      WHERE kokrs = gv_p_kokrs
                      AND   kostl = wa_value-valfrom
                      AND   datbi GE sy-datum.
        ENDIF.
        LOOP AT lt_dept INTO wa_dept.
          READ TABLE gt_hierarchy INTO wa_hierarchy WITH KEY groupname+7(3) = wa_dept-ww007+5(3).
          IF ( wa_dept-ww007(4) = p_sd_cct AND wa_dept-ww007+5(3) = wa_hierarchy-groupname+7(3) ).
            lv_gpname = wa_hierarchy-groupname.
            wa_hierarchy-descript = wa_dept-bezek.
            MODIFY gt_hierarchy FROM wa_hierarchy
                   TRANSPORTING descript
                 WHERE groupname = lv_gpname.
          ENDIF.
        ENDLOOP.
        READ TABLE gt_hierarchy INTO wa_hierarchy WITH KEY groupname = p_sd_cct.
    *  gv_tgt_level = wa_hierarchy-hierlevel - 1.                           "chain level
        gv_src_level = wa_hierarchy-hierlevel.                              "Operating unit level
        gv_dep_level = wa_hierarchy-hierlevel + 1.                          "department level.
        LOOP AT gt_hierarchy INTO wa_hierarchy.
          IF wa_hierarchy-hierlevel = gv_src_level.                         "Operating Unit node
            wa_hierarchy1-groupname = p_dsno.
    *        wa_hierarchy1-descript = wa_hierarchy-descript.
            wa_hierarchy1-descript = p_name.
            wa_hierarchy1-hierlevel = wa_hierarchy-hierlevel.
            APPEND wa_hierarchy1 TO gt_hierarchy1.
          ENDIF.
          IF wa_hierarchy-hierlevel = gv_dep_level.                         "Department node
            CONCATENATE p_dsno wa_hierarchy-groupname+7(3) INTO gv_ngrname.
            wa_hierarchy1-groupname = gv_ngrname.
    *        wa_hierarchy1-descript = wa_hierarchy-descript.
            wa_hierarchy1-descript = wa_hierarchy-descript.
            wa_hierarchy1-hierlevel = wa_hierarchy-hierlevel.
            APPEND wa_hierarchy1 TO gt_hierarchy1.
          ENDIF.
          CLEAR wa_hierarchy1.
        ENDLOOP.
    *Create Cost Center Group
    *---BEGIN of COSTCENTER Group CREATE
        CALL FUNCTION 'BAPI_COSTCENTERGROUP_CREATE'
          EXPORTING
    *dinesh
            controllingareaimp = gv_p_kokrs
          IMPORTING
            return             = wa_message
          TABLES
            hierarchynodes     = gt_hierarchy1
            hierarchyvalues    = gt_value1.
        IF wa_message IS INITIAL.
          CONCATENATE p_dsno text-022
                      INTO wa_message-message
                      SEPARATED BY space.
          APPEND wa_message TO gt_message.
    *Add node to cost center group ONLY if Cost Center Group creation is successful
    *---BEGIN of ADDNODE
          CALL FUNCTION 'BAPI_COSTCENTERGROUP_ADDNODE'
            EXPORTING
    *dinesh
              controllingarea = gv_p_kokrs
              groupname       = p_tg_cct
              subgroupname    = p_dsno
            IMPORTING
              return          = wa_message.
          IF wa_message IS INITIAL.
            CONCATENATE p_dsno text-023 p_tg_cct
                        INTO wa_message-message
                        SEPARATED BY space.
            APPEND wa_message TO gt_message.
    * Cost Center is created ONLY if Cost Center group and add node is successful
            gv_ccgroup_created = 'X'.                                       "flag used while crateing cost center
          ELSE.
    *Rollback if BAPI fails in Adding Node
            CALL FUNCTION 'BAPI_TRANSACTION_ROLLBACK'.
            APPEND wa_message TO gt_message.
          ENDIF.
          PERFORM output CHANGING gt_message.
          CLEAR: gt_message,gt_message[],wa_message.
    *---END of ADDNODE
        ELSE.
    *Rollback if BAPI fails in creating group
          CALL FUNCTION 'BAPI_TRANSACTION_ROLLBACK'.
          APPEND wa_message TO gt_message.
        ENDIF.
        PERFORM output CHANGING gt_message.
        CLEAR: gt_message,gt_message[],wa_message.
    *---END of COSTCENTER CREATE
      ENDIF.                                                                "End of Cost Center Group
      LOOP AT gt_hierarchy1 INTO wa_hierarchy1.
        CLEAR: wa_profitcenterid,wa_basicdata,wa_address.
        CLEAR: wa_costcenterlist,gt_costcenterlist,gt_costcenterlist[].
    ***Call function get_next_numbers to generate profit center no.
        CALL FUNCTION 'NUMBER_GET_NEXT'
          EXPORTING
            nr_range_nr             = '02'
            object                  = 'COPCA_OBJ'
          IMPORTING
            number                  = gv_number
          EXCEPTIONS
            interval_not_found      = 1
            number_range_not_intern = 2
            object_not_found        = 3
            quantity_is_0           = 4
            quantity_is_not_1       = 5
            interval_overflow       = 6
            buffer_overflow         = 7
            OTHERS                  = 8.
        IF sy-subrc <> 0.
          IF sy-subrc = 8.
            wa_message-id = sy-msgid.
            wa_message-type = sy-msgty.
            wa_message-number = sy-msgno.
            wa_message-message_v1 = sy-msgv1.
            wa_message-message_v2 = sy-msgv2.
            wa_message-message_v3 = sy-msgv3.
            wa_message-message_v4 = sy-msgv4.
            APPEND wa_message TO gt_message.
            PERFORM output CHANGING gt_message.
            CLEAR: gt_message,gt_message[],wa_message.
            CALL FUNCTION 'BAPI_TRANSACTION_ROLLBACK'.
          ELSEIF sy-subrc = 1.
            wa_message-message_v1 = text-043.
            APPEND wa_message TO gt_message.
            PERFORM output CHANGING gt_message.
            CLEAR: gt_message,gt_message[],wa_message.
            CALL FUNCTION 'BAPI_TRANSACTION_ROLLBACK'.
          ELSEIF sy-subrc = 2.
            wa_message-message_v1 = text-044.
            APPEND wa_message TO gt_message.
            PERFORM output CHANGING gt_message.
            CLEAR: gt_message,gt_message[],wa_message.
            CALL FUNCTION 'BAPI_TRANSACTION_ROLLBACK'.
          ELSEIF sy-subrc = 3.
            wa_message-message_v1 = text-045.
            APPEND wa_message TO gt_message.
            PERFORM output CHANGING gt_message.
            CLEAR: gt_message,gt_message[],wa_message.
            CALL FUNCTION 'BAPI_TRANSACTION_ROLLBACK'.
          ELSEIF sy-subrc = 4.
            wa_message-message_v1 = text-046.
            APPEND wa_message TO gt_message.
            PERFORM output CHANGING gt_message.
            CLEAR: gt_message,gt_message[],wa_message.
            CALL FUNCTION 'BAPI_TRANSACTION_ROLLBACK'.
          ELSEIF sy-subrc = 5.
            wa_message-message_v1 = text-047.
            APPEND wa_message TO gt_message.
            PERFORM output CHANGING gt_message.
            CLEAR: gt_message,gt_message[],wa_message.
            CALL FUNCTION 'BAPI_TRANSACTION_ROLLBACK'.
          ELSEIF sy-subrc = 6.
            wa_message-message_v1 = text-048.
            APPEND wa_message TO gt_message.
            PERFORM output CHANGING gt_message.
            CLEAR: gt_message,gt_message[].
            CALL FUNCTION 'BAPI_TRANSACTION_ROLLBACK'.
          ELSEIF sy-subrc = 7.
            wa_message-message_v1 = text-049.
            APPEND wa_message TO gt_message.
            PERFORM output CHANGING gt_message.
            CLEAR: gt_message,gt_message[],wa_message.
            CALL FUNCTION 'BAPI_TRANSACTION_ROLLBACK'.
          ENDIF.
        ELSE.
          IF p_sd_pct IS NOT INITIAL.                                       "For Profit Center create.
    *Create Profit Center only when Profit center group creation and add node is successful
            IF gv_pcgroup_created = 'X'.                                    "PCG flag check
              clear: wa_profitcenterid,
                     wa_basicdata,
                     wa_address,
                     lv_indicators.
              wa_profitcenterid-co_area = gv_p_kokrs.
              wa_profitcenterid-profit_ctr = gv_number.
              wa_basicdata-prctr_name = wa_hierarchy1-groupname.
              wa_basicdata-long_text = wa_hierarchy1-descript.
              wa_basicdata-in_charge = sy-uname.
              wa_basicdata-prctr_hier_grp = wa_hierarchy1-groupname.
              wa_basicdata-segment        = lv_segment.
              IF wa_hierarchy1-hierlevel = gv_src_level.                    "Address and locking only in Op.Unit
                lv_indicators-LOCK_IND = lv_lock_ind.
                wa_address-name       = p_name.
                wa_address-street     = p_strt.
                wa_address-city       = p_city.
                wa_address-postl_code = p_pcod.
                wa_address-country    = p_cont.
                wa_address-region     = p_reg.
              ENDIF.
    * Create Profit Center
    *          WAIT UP TO 2 SECONDS.
              CALL FUNCTION 'BAPI_PROFITCENTER_CREATE'
                EXPORTING
                  profitcenterid = wa_profitcenterid
                  validfrom      = p_date
                  validto        = c_validto
                  basicdata      = wa_basicdata
                  address        = wa_address
                  indicators     = lv_indicators
                IMPORTING
                  return         = wa_message
                TABLES
                  companycodes   = gt_co_code.
    *          WAIT UP TO 2 SECONDS.
              IF wa_message-type NE 'E' OR wa_message-type NE 'A'.
                CONCATENATE wa_profitcenterid-profit_ctr text-024
                            INTO wa_message-message
                            SEPARATED BY space.
                APPEND wa_message TO gt_message.
              ELSE.
                CLEAR gv_pcgroup_created.                                    "CEPC updation is based on this
                CALL FUNCTION 'BAPI_TRANSACTION_ROLLBACK'.
                APPEND wa_message TO gt_message.
              ENDIF.
              PERFORM output CHANGING gt_message.
              CLEAR: gt_message,gt_message[],wa_message.
            ENDIF .                                                         "end of flag check
          ENDIF.                                                            "end of profitcenter create
          IF p_sd_cct IS NOT INITIAL.                                       "For Cost Center Create.
    *Create Cost Center only when Cost center group creation and add node is successful
            IF gv_ccgroup_created = 'X'.                                    "CCG flag check
              IF wa_hierarchy1-hierlevel = gv_dep_level.                    "Cost Center only in Dept level
                READ TABLE gt_value INTO wa_value INDEX lv_index1.
                SELECT kostl kosar FROM csks
                        INTO TABLE gt_csks_cat
                        WHERE kostl = wa_value-valfrom.
                lv_index1 =  lv_index1 + 1.
                READ TABLE gt_csks_cat INTO wa_csks_cat WITH KEY kostl = wa_value-valfrom.
                wa_costcenterlist-costcenter       = gv_number.
                wa_costcenterlist-valid_from       = p_date.
                wa_costcenterlist-valid_to         = c_validto. "31.12.9999
                wa_costcenterlist-person_in_charge = sy-uname.
                wa_costcenterlist-comp_code        = gv_c_bukrs .
                wa_costcenterlist-costcenter_type  = wa_csks_cat-kosar.
                wa_costcenterlist-costctr_hier_grp = wa_hierarchy1-groupname.
                wa_costcenterlist-descript         = wa_hierarchy1-descript.
                wa_costcenterlist-name             = wa_hierarchy1-groupname.
                wa_costcenterlist-profit_ctr       = gv_number.
                APPEND wa_costcenterlist TO gt_costcenterlist.
    *---BEGIN Create Cost Center
                CALL FUNCTION 'BAPI_COSTCENTER_CREATEMULTIPLE'
                  EXPORTING
                    controllingarea = gv_p_kokrs
                  TABLES
                    costcenterlist  = gt_costcenterlist
                    return          = gt_message.
                READ TABLE gt_message INTO wa_message INDEX 1.
                CLEAR gt_message[].
                IF wa_message-type = 'E' OR wa_message-type = 'A'.
                  CALL FUNCTION 'BAPI_TRANSACTION_ROLLBACK'.
                  CONCATENATE wa_message-message wa_message-message_v1 text-050 p_dsno text-051
                      INTO wa_message-message
                      SEPARATED BY space.
                  APPEND wa_message TO gt_message.
                  CLEAR: gt_message,gt_message[],wa_message.
                ELSE.
    * Activate only if Cost center is created successfully
    *---BEGIN of ACTIVATION
                  CLEAR : wa_costcenterlist_act,gt_costcenterlist_act[].
                  wa_costcenterlist_act-co_area     = gv_p_kokrs.
                  wa_costcenterlist_act-costcenter     = gv_number.
                  wa_costcenterlist_act-name            = p_name.
                  wa_costcenterlist_act-descript     = wa_hierarchy1-descript.
                  wa_costcenterlist_act-act_state     = 'X'.
                  APPEND wa_costcenterlist_act TO gt_costcenterlist_act.
                  CALL FUNCTION 'BAPI_CTR_ACTIVATE_MULTIPLE'
                    EXPORTING
                      controllingarea = gv_p_kokrs
                    TABLES
                      costcenterlist  = gt_costcenterlist_act
                      return          = gt_message.
                  READ TABLE gt_message INTO wa_message INDEX 1.
                  IF wa_message-type = 'E' OR wa_message-type = 'A'.
                    CLEAR gv_ccgroup_created.                                 "CEPC updation is based on this condition
                    CALL FUNCTION 'BAPI_TRANSACTION_ROLLBACK'.
                    CONCATENATE p_dsno text-050
                                INTO wa_message-message
                                SEPARATED BY space.
                    APPEND wa_message TO gt_message.
                  ELSE.
                    CONCATENATE wa_profitcenterid-profit_ctr text-025 text-026
                                INTO wa_message-message
                                SEPARATED BY space.
                    APPEND wa_message TO gt_message.
                    CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'.                "COMMIT CC activation
                  ENDIF.
                  PERFORM output CHANGING gt_message.
                  CLEAR: gt_message,gt_message[],wa_message.
    *---END of ACTIVATION
                ENDIF.
                PERFORM output CHANGING gt_message.
                CLEAR: gt_message,gt_message[],wa_message.
    *---END Create Cost Center
              ENDIF.
            ENDIF.                                                          "end of CCG flag check
          ENDIF.                                                            "end of cost center create
    *--Updating CEPC Append Structure ZDSG_DATA and sales group table ZFPASALESGROUP
          IF gv_ccgroup_created = 'X' AND gv_pcgroup_created = 'X'.
            READ TABLE gt_hierarchy
                       INTO wa_hierarchy
                       WITH KEY hierlevel = wa_hierarchy1-hierlevel.          "source group
            IF sy-subrc = 0.
    *CEPC values for source group
              READ TABLE gt_value INTO wa_value INDEX lv_index.
              SELECT SINGLE * FROM cepc
                        INTO wa_cepc BYPASSING BUFFER
                        WHERE  kokrs   = gv_p_kokrs
                        AND datbi      GE sy-datum
                        AND prctr      = wa_value-valfrom.
    * For updating CEPC
              IF sy-subrc = 0.
                READ TABLE gt_hierarchy INDEX lv_index
                         INTO wa_hierarchy.
                lv_index = lv_index + 1.
                IF wa_hierarchy-hierlevel = 1.
                  CONCATENATE p_legacy wa_hierarchy-groupname+7(3) INTO lv_legno.
                  p_ztype = '05'.
                  p_zstype = ' '.
                ELSE.
                  lv_legno = p_legacy.
                ENDIF.
                wa_cepc-prctr        = gv_number.
                wa_cepc-datbi        = c_validto.
                wa_cepc-kokrs        = gv_p_kokrs.
                wa_cepc-zzleg_no  = lv_legno.
                wa_cepc-zztype        = p_ztype.
                wa_cepc-zzstype   = p_zstype.
                wa_cepc-zzfsdate  = p_sal_da.
                wa_cepc-zzdist        = p_zdist.
                wa_cepc-zzsvat    = p_zsvat.
                APPEND wa_cepc TO gt_cepc.
                PERFORM update_append_cepc TABLES gt_cepc.
                CLEAR:wa_cepc,gt_cepc[],gt_cepc,lv_prctr.
    * For updating ZFPASALESGROUP
                SELECT SINGLE prctr
                  INTO lv_prctr
                  FROM cepc
                 WHERE khinr = wa_hierarchy-groupname.
                IF sy-subrc = 0.
                  SELECT  * FROM zfpasalesgroup
                            INTO TABLE gt_salesgrp
                           WHERE zvalid_from GE p_date
                             AND zvalid_to LE c_validto
                             AND prctr = lv_prctr
                             AND zdeactive = ''.
                  IF sy-subrc = 0.
                    SELECT MAX( zsgid ) INTO lv_zsgid FROM  zfpasalesgroup.
                    IF lv_zsgid IS INITIAL.
                      lv_zsgid = '1000000000'.
                    ENDIF.
                    SORT gt_salesgrp BY zsgid zvalid_from.
                    LOOP AT gt_salesgrp INTO wa_salesgrp.
                      IF lv_zsgid_prev NE wa_salesgrp-zsgid OR lv_zsgid_prev IS INITIAL.
    *                      wa_salesgrp-zsgid = lv_zsgid.
    *                  else.
                        lv_zsgid = lv_zsgid + 1.
                        lv_zsgid_prev = wa_salesgrp-zsgid.
                        wa_salesgrp-zsgid = lv_zsgid.
                      ELSE.
    *                  lv_zsgid_prev = lv_zsgid.
                        wa_salesgrp-zsgid = lv_zsgid.
                      ENDIF.
                      wa_salesgrp-prctr = gv_number.
                      IF wa_salesgrp-zvalid_from LT p_date.
                        wa_salesgrp-zvalid_from = p_date.
                      ENDIF.
    *              wa_salesgrp-zvalid_to = c_validto.
    *                insert new entry in zfpasalesgroup for data entered on screen.
                      INSERT into zfpasalesgroup values wa_salesgrp.
    *                MODIFY zfpasalesgroup FROM TABLE gt_salesgrp .
    *                Message for output
                      IF sy-subrc = 0.
                        CONCATENATE  wa_salesgrp-zsgid text-102 'ZFPASALESGROUP'
                                    INTO wa_message-message
                                    SEPARATED BY space.
                        wa_message-type = 'S'.
                        APPEND wa_message TO gt_message.
                        PERFORM output CHANGING gt_message.
                        CLEAR: gt_message,gt_message[],wa_message.
                      ELSE.
    *                Message for output if its not successful
                        CONCATENATE text-103 'ZFPASALESGROUP'
                                    INTO wa_message-message
                                    SEPARATED BY space.
                        wa_message-type = 'E'.
                        APPEND wa_message TO gt_message.
                        PERFORM output CHANGING gt_message.
                        CLEAR: gt_message,gt_message[],wa_message.
                      ENDIF.
                      CLEAR wa_salesgrp.
                    ENDLOOP.
                    CLEAR: wa_salesgrp, gt_salesgrp[], gt_salesgrp,lv_zsgid_prev .
                  ENDIF.
                ENDIF.
              ENDIF.
            ENDIF.
          ENDIF.
        ENDIF.
      ENDLOOP.
      PERFORM display_log CHANGING gt_log.
      PERFORM clear_variables.
      gv_active_tab = 'SOS_TAB1'.
    ENDFORM.                    " Create_operation_unit
    <REMOVED BY MODERATOR>
    Regards
    Susheel
    Code Formatted by: Alvaro Tejada Galindo on Jun 12, 2008 4:31 PM

  • Regarding how to create organization structure in sap workflow

    hi Guru's
    i am new for wokflow i dont no how to create organization structure.
    pl any body help me
    regards
    vijay

    http://help.sap.com/saphelp_erp2005/helpdata/ru/05/dfba3692dc635ce10000009b38f839/frameset.htm

  • How can we creat web-dynpro in SAP 4.6c?

    Hi Gurus,
    I'm new to the Web-dynpro technology, please help me in creating a simple web-dynpro.
    My questions are:
    1. can we create web-dynpro in SAP version 4.6c?
    2. If yes then how?

    Hi Manjesh,
    You cannt develop Web Dynpro's in 4.6C version. Web Dynpro's are introduced from ECC6.0 onwords.
    Check this document about Web Dynpro for ABAP
    http://help.sap.com/saphelp_nw70ehp1/helpdata/en/77/3545415ea6f523e10000000a155106/content.htm
    Edited by: suman kumar chinnam on Oct 17, 2008 12:51 PM

  • How can we create cost centres in SAP B1

    please advise how we can create cost centres in SA P-B1 as we do in tally.

    Hi
    You can Download the e-learning File in SAP Customer portal regarding cost Accounting
    Go to [http://service.sap.com]
    Customer portal =>Education=>Release 2007 => Finance=> cost and Budgeting
    Regards
    Balaji

  • How can we create web shop in sap crm 4.0 version

    hi, crm gurus, plz anser my question.
    thanks in advance

    Hi!
    A good step-by-step guide is the Best Practices guides.
    The BP for CRM4 is available at help.sap.com or
    <a href="http://help.sap.com/bp_crmv340/CRM_DE/index.htm">here</a>
    rollo

  • How can mass creating production orders???

    In SAP ,we can use CO01,CO09,CO07 to create production order. But by these TOCDES,we only can create one production order for one finished product once a time.
    But we now need to create more then one ,may be more then 50 production orders once a time?
    It is possible in SAP?
    I know we could conver the production orders from plan orders after MRP run.But sometimes
    for some reasons we must create produciton orders manually.And I also know in SAP some TCODE can process many production orders once a time ,like COHV,CORM, can release ,TECO many production orders once a time.
    But how can mass creating production orders once a time,not by mrp run?
    How can batch create produciton orders in SAP?
    Thanks for any reply!

    Hi,
    Use the BAPI - BAPI_PRODORD_CREATE or for internal orders BAPI_INTERNALORDER_CREATE
    Take the help of your abaper, he / she can use the above BAPI to write a custom program to mass create production order.
    Hope the above helps.
    Regards,
    Vivek
    Added
    You can also use the below BAPI's in your custom program:
    BAPI_PRODORD_RELEASE to release the orders
    BAPI_PRODORD_CHECK_MAT_AVAIL for carrying out material availability
    Edited by: Vivek on Mar 22, 2009 8:27 PM

  • Step by step on how to create organizational structure(plan) for workflow?

    Hi Experts,
    Can anyone send me a step by step process on how to create organizational structure(plan) for workflow?
    Thanks a lot in advance.
    Rgds,
    TM

    Hi,
    You can use the following accessible transactions to process your organizational plan:
    Transaction     Name of Transaction
    PPO5                     Change Attributes
    PPO6                     Display Attributes
    PPOCE                      Create Organization and Staffing
    PPOCW                      Create Organization and Staffing (WF)
    PPOME                     Change Organization and Staffing
    PPOMW                     Change Organization and Staffing (WF)
    PPOSE                      Display Organization and Staffing
    PPOSW                      Display Organization and Staffing (WF)
    PP01                      Maintain Plan Data (Menu)
    PP01_DISP      Display Plan Data (Menu)
    PP03                       Maintain Plan Data (Actions)
    PP03                       Execute Action Directly
    Regards,
    Deepa Kulkarni

  • How can I create more than one main window in a page of SAP SCRIPT?

    How can I create more than one main window in a page of SAP SCRIPT? If anybody helps me I will be obliged.
    Regards,
    Subhasish

    Hi Ganguly,
    It is possible to have more than one main window in a same page.
    You create a main window and simply you copy and past it in the same page.. it will create first main window name as MAIN and other main windows as MAIN01,MAIN02.... up to MAIN99.
    Contets flow from MAIN , MAIN01, MAIN02.......................MAIN99. contents after filling the current window it flows to next window(by default, you skip as well with some keyword not sure could be NEW-WINDOW)
    you want print the main window data twice? or you want to create two main window in the same page ?
    1. give two copies in the no of copies in the output type screen ( Which pop up is coming after excute the program ).
    2. create two page with the same script form.
    3. you can write the coding inside the program to print twice the same page.
    Hope this information use full to you..

  • How can I create a Commercial Invoice or similar document in SAP ByD?

    How can I create a Commercial Invoice or similar document in SAP ByD?
    Our company has recently implemented ByD, but we can't figure out how to create a commercial invoice for shipping/customs purposes. I know that the German version of ByD allows for "Export Declarations" which is pretty much the same as a commercial invoice, but the U.S. version doesn't have this document/function.
    Any suggestions? I would appreciate any help.
    By the way, a commercial invoice contains:
    1. The shipperu2019s complete information: Contact name, company name, complete address and tax identification number.
       2. The recipientu2019s complete information: Contact name, company name, complete address and phone number.
       3. The buyeru2019s information (the person to whom the goods are sold by the seller) if different from the recipient: Contact name, company name, complete address and phone number.
       4. The shipment tracking number, air waybill number or bar-code label number.
       5. An accurate description of the contents in your shipment that includes the following details:
    What the product is
    What material the product is made of
    What the productu2019s Schedule B or HTS code is
    What the productu2019s intended use is
    What the productu2019s country of manufacture is
    What the productu2019s parts or serial numbers are (if applicable)
    What the productu2019s quantity and unit of measure are
    What the productu2019s value is, per unit and in total
    Thanks,
    Chris

    May I suggest that you ask this question in the customer forums in the Business Center at [http://sme.sap.com|http://sme.sap.com]
    Best regards, Christian

  • How can I create a new sales order template in SAP CRM 7.0

    Hello,
    how can I create a new sales order template in SAP CRM 7.0 (Web UI)? I want to use this sales order template in scenario ´'Mass Generation of Sales Orders via Marketing Projects'.
    Thanks for your support in advance.
    Best regards,
    anvan

    Hi,
    Did you set up this scenario? I want something similar, but I want an ERP order to be created. Do you know if that is possible? Do you have som tips?
    regards Camilla

  • How can we create a data source on structures

    Hi,
       How can we create a data source on structures.
    Regs,
    abdul

    Abdul,
        Welcome to SDN!
        We can't create Datasource using Strcutres. We need to have base tables.
        For Function Module Extractors, we will create strctures. We will use these strctures as Extract Structures. But, we will get the data from Base tables only not from Strcutures.
    Strctures won't contain data.
    all the best.
    Regards,
    Nagesh Ganisetti.

  • How can I create additional "Sent Mail" folders so that I can organize my sent mail along the same lines as the inbox? I use Mail v 4.5

    How can I create additional or sub "Sent Mail" folders so that I can organize my sent mail along the same lines as the inbox? I use Mail v 4.5.

    Thank you for your reply Don, but I had already gone through that procedure and it will only create new mailboxes for received mail. I want to create new mailboxes for sent mail, i.e. the first column being "to" not "from". Under the Mailbox menus there is an option "Use This Mailbox For" but all the options under that (including Sent) are greyed out. Unfortunately the View/Columns option to change from "From" to "To" changes all mailboxes not just the active one.

  • How can i create a Laptop like the ones use in SAP TecEd?

    How can i create a Laptop like the ones use in SAP TecEd hands on labs? with all the NW products install on it.

    Hi,
    Vague question, but to create a laptop with the solution installed - you need to order the solution and and then install it on the laptop. Or download trial versions from SCN and install those as well.
    Regards,
    Srikishan

  • How can I create a new Music Library?

    Had to buy new laptop which of course has Vista. The old unit was acting up(I think Windows XP was corrupt), so I saved my Library Files but it looks like the old machine only saved portions not the whole Library. I had approx. 13,000 tunes (35GB) in the LIbrary and all that was saved seems to be 319 tunes. I have all the music on an external HD and only the Library was on the laptop. My question is, how can I create a new Library from the external HD music? Is there a way or am I SOL? Any suggestions and help would be greatly appreciated.

    You need the entire libary on the external, not just media.
    What are the iTunes library files? - http://support.apple.com/kb/HT1660
    More on iTunes library files and what they do - http://en.wikipedia.org/wiki/ITunes#Media_management
    What are all those iTunes files? - http://www.macworld.com/article/139974/2009/04/itunes_files.html
    Where are my iTunes files located? - http://support.apple.com/kb/ht1391
    iTunes 9 [and later]: Understanding iTunes Media Organization - http://support.apple.com/kb/ht3847
    Image of folder structure and explanation of different iTunes versions (turingtest2 post) - https://discussions.apple.com/message/13025536 and https://discussions.apple.com/message/17457605
    Once you get a complete iTunes folder on the external drive, start iTunes with the option/alt key held down and select the iTunes Library.itl file on the external drive.  You will also need to do this with your main computer or the libraries will become unsynchronized.
    Alternatively you can make a separate library using the same media on the second computer. Start as you have been doing, let iTunes create a new, blank library file which will be on hte internal drive, set the media folder location in preferences to be the one on the external drive, then add the files to the new iTunes library. Unless you are a super-organized individual, or you don't care if your libraries do not have the same content, you are better off using a single library file that is on the external, not setting up separate library files.

Maybe you are looking for

  • Can't recording  Midi  and Audio at the same time

    I'm in GREAT need of help. I can't record midi and audio at the same time. I'm using an M AUDIO project mix I/O. I know this is VERY basic stuff but I can't seem to get it to work.I can record multiple audio at once. ANd I can record midi but not at

  • Transforming paths and layers together? Hopefully someday...

    This is on my wish list for the next Photoshop version: One day, I would like to have the ability to transform a group of layers and a path together - at once. There is no other frustration than to create a very complex clipping path only to zoom out

  • Full Optimize - Space needed in BW/Oracle

    Hi. This is kind of a SAP basis question, I think. We are doing full optimization, which eventually ends in an ABAP dump indicating that the Oracle database is running out of table space. We have had similar problems before, and just had the Oracle D

  • Too many shared computers

    I work for a University that has approximately 2,500 computers on its network. The "Shared" section in the Finder sees every one of those computers (a very large majority PC). The only systems I'm interested in are the Macs (15 total) used by the oth

  • When does the Image Processor perform actions?

    Let's say I use the image processor to convert a bunch of .psd files into JPEGs while also using the resize to fit (and convert to sRGB) option. I also want it to run an action which sharpens the image. When does that action/sharpening happen? Before