Creating a WBS hierarchy using BAPI_PROJECT_MAINTAIN

Hi,
I am trying to create WBS hierarchy, but i am facing some problem in creating it. The code that i have written is :
DATA : I_PROJECT_DEFINITION LIKE BAPI_PROJECT_DEFINITION OCCURS 0 WITH HEADER LINE,
       I_PROJECT_DEFINITION_UPD LIKE  BAPI_PROJECT_DEFINITION_UP OCCURS 0 WITH HEADER LINE,
       RETURN LIKE  BAPIRETURN1 OCCURS 0 WITH HEADER LINE,
       I_METHOD_PROJECT LIKE BAPI_METHOD_PROJECT OCCURS 0 WITH HEADER LINE,
       I_WBS_ELEMENT_TABLE LIKE BAPI_WBS_ELEMENT OCCURS 0 WITH HEADER LINE,
       I_WBS_HIERARCHIE_TABLE LIKE BAPI_WBS_HIERARCHIE OCCURS 0 WITH HEADER LINE.
CLEAR I_PROJECT_DEFINITION.
I_PROJECT_DEFINITION-PROJECT_DEFINITION = 'TEST_2'.
APPEND I_PROJECT_DEFINITION.
CLEAR I_METHOD_PROJECT.
MOVE 'WBS-Element' TO I_METHOD_PROJECT-OBJECTTYPE.
MOVE  'Create' TO I_METHOD_PROJECT-METHOD.
MOVE 'T1' TO I_METHOD_PROJECT-OBJECTKEY.
MOVE '000001' TO I_METHOD_PROJECT-REFNUMBER.
APPEND I_METHOD_PROJECT.
CLEAR I_METHOD_PROJECT.
MOVE 'WBS-Element' TO I_METHOD_PROJECT-OBJECTTYPE.
MOVE  'Create' TO I_METHOD_PROJECT-METHOD.
MOVE 'T2' TO I_METHOD_PROJECT-OBJECTKEY.
MOVE '000002' TO I_METHOD_PROJECT-REFNUMBER.
APPEND I_METHOD_PROJECT.
CLEAR I_METHOD_PROJECT.
MOVE 'WBS-Element' TO I_METHOD_PROJECT-OBJECTTYPE.
MOVE  'Create' TO I_METHOD_PROJECT-METHOD.
MOVE 'T3' TO I_METHOD_PROJECT-OBJECTKEY.
MOVE '000003' TO I_METHOD_PROJECT-REFNUMBER.
APPEND I_METHOD_PROJECT.
CLEAR I_METHOD_PROJECT.
MOVE  'Save' TO I_METHOD_PROJECT-METHOD.
APPEND I_METHOD_PROJECT.
CLEAR I_WBS_ELEMENT_TABLE.
I_WBS_ELEMENT_TABLE-WBS_ELEMENT = 'T1'.
I_WBS_ELEMENT_TABLE-PROJECT_DEFINITION = I_PROJECT_DEFINITION-PROJECT_DEFINITION.
I_WBS_ELEMENT_TABLE-DESCRIPTION = 'T1'.
APPEND I_WBS_ELEMENT_TABLE.
CLEAR I_WBS_ELEMENT_TABLE.
I_WBS_ELEMENT_TABLE-WBS_ELEMENT = 'T2'.
I_WBS_ELEMENT_TABLE-PROJECT_DEFINITION = I_PROJECT_DEFINITION-PROJECT_DEFINITION.
I_WBS_ELEMENT_TABLE-DESCRIPTION = 'T2'.
APPEND I_WBS_ELEMENT_TABLE.
CLEAR I_WBS_ELEMENT_TABLE.
I_WBS_ELEMENT_TABLE-WBS_ELEMENT = 'T3'.
I_WBS_ELEMENT_TABLE-PROJECT_DEFINITION = I_PROJECT_DEFINITION-PROJECT_DEFINITION.
I_WBS_ELEMENT_TABLE-DESCRIPTION = 'T3'.
APPEND I_WBS_ELEMENT_TABLE.
CLEAR I_METHOD_PROJECT.
MOVE 'WBS-Hierarchy' TO I_METHOD_PROJECT-OBJECTTYPE.
MOVE  'Create' TO I_METHOD_PROJECT-METHOD.
APPEND I_METHOD_PROJECT.
CLEAR I_METHOD_PROJECT.
MOVE  'Save' TO I_METHOD_PROJECT-METHOD.
APPEND I_METHOD_PROJECT.
CLEAR I_WBS_HIERARCHIE_TABLE.
MOVE 'T1' TO I_WBS_HIERARCHIE_TABLE-WBS_ELEMENT.
MOVE I_PROJECT_DEFINITION-PROJECT_DEFINITION TO I_WBS_HIERARCHIE_TABLE-PROJECT_DEFINITION.
MOVE 'T2' TO I_WBS_HIERARCHIE_TABLE-DOWN.
APPEND I_WBS_HIERARCHIE_TABLE.
CLEAR I_WBS_HIERARCHIE_TABLE.
MOVE 'T2' TO I_WBS_HIERARCHIE_TABLE-WBS_ELEMENT.
MOVE I_PROJECT_DEFINITION-PROJECT_DEFINITION TO I_WBS_HIERARCHIE_TABLE-PROJECT_DEFINITION.
MOVE 'T1' TO I_WBS_HIERARCHIE_TABLE-UP.
MOVE 'T3' TO I_WBS_HIERARCHIE_TABLE-RIGHT.
APPEND I_WBS_HIERARCHIE_TABLE.
CLEAR I_WBS_HIERARCHIE_TABLE.
MOVE 'T3' TO I_WBS_HIERARCHIE_TABLE-WBS_ELEMENT.
MOVE I_PROJECT_DEFINITION-PROJECT_DEFINITION TO I_WBS_HIERARCHIE_TABLE-PROJECT_DEFINITION.
MOVE 'T1' TO I_WBS_HIERARCHIE_TABLE-UP.
MOVE 'T2' TO I_WBS_HIERARCHIE_TABLE-LEFT.
APPEND I_WBS_HIERARCHIE_TABLE.
CALL FUNCTION 'BAPI_PROJECT_MAINTAIN'
  EXPORTING
    i_project_definition               = I_PROJECT_DEFINITION
    i_project_definition_upd           = I_PROJECT_DEFINITION_UPD
  IMPORTING
    RETURN                             = RETURN
  tables
    i_method_project                   = I_METHOD_PROJECT
  I_WBS_ELEMENT_TABLE_UPDATE         =
    I_WBS_ELEMENT_TABLE                = I_WBS_ELEMENT_TABLE
  I_WBS_MILESTONE_TABLE              =
  I_WBS_MILESTONE_TABLE_UPDATE       =
    I_WBS_HIERARCHIE_TABLE             = I_WBS_HIERARCHIE_TABLE
  I_NETWORK                          =
  I_NETWORK_UPDATE                   =
  I_ACTIVITY                         =
  I_ACTIVITY_UPDATE                  =
  I_RELATION                         =
  I_RELATION_UPDATE                  =
  E_MESSAGE_TABLE                    =
  I_ACTIVITY_ELEMENT                 =
  I_ACTIVITY_ELEMENT_UPDATE          =
  I_ACTIVITY_MILESTONE               =
  I_ACTIVITY_MILESTONE_UPDATE        =
Please can anyone check and tell me what exactly is the problem?
Thank you.

Hi Poorvika,
I am facing same problem. If you find solution, can you please post it here?
Thanks
ABAPer

Similar Messages

  • WBS creation using BAPI_PROJECT_MAINTAIN

    Hi Gurus
    We are trying to create a WBS element with custom program. We are succesfully able to create the WBS element but facing errors in positioning the WBS element.
    The input for the program is project and parent under which the WBS has to be created. The program is working fine when we create the WBS under a parent which is in CRTD system status. But, when we try to create WBS under a parent which is in REL system status, it is terminating with errors. (Errors: CJ 467 - subhierarchy is not consistent, CJ 280 - Termination - too many errors, CJ 036 - Data cannot be saved). We are using BAPI_PROJECT_MAINTAIN for this.
    We have tried to remove all "custom" configuration and go with standard SAP configuration (like investment profile, status profile, field selection, etc).
    Can anybody suggest anything that can help us to get through the error?
    Thanks a lot in advance,

    Hi,
    I am using this BAPI without any problems but I don't have access to that system. So maybe you have some issue with data. What you can do is that you will create your project manually in CJ20N and the you will call BAPI BAPI_PROJECT_GETINFO to get info about your project. You can compare your BAPI call with structures for project created manually.  It may help you to find a reason for those error messages. You can also try to debug where you are getting those messages.
    Cheers

  • Can we create External & Service Activities using BAPI_PROJECT_MAINTAIN?

    <Subject changed>
    Hi All,
    Using Function module bapi_project_maintain, is that possible to create External activity & Service Activity in project system module?
    If Yes, Pls. provide me the way to do it.
    Regards
    Suresh
    Moderator Message: Please use a more meaningful subject in future.
    Edited by: Suhas Saha on Jan 6, 2012 11:57 AM

    Hi,
    Refer the bellow thread which may help you in using  BAPI_PROJECT_MAINTAIN.
    Facing Problem in BAPI_PROJECT_MAINTAIN
    Thanks & Regards,
    Goutam Kolluru.
    Edited by: goutam kolluru on Jan 6, 2012 5:35 AM
    Edited by: goutam kolluru on Jan 6, 2012 5:36 AM
    Edited by: goutam kolluru on Jan 6, 2012 5:40 AM
    Edited by: goutam kolluru on Jan 6, 2012 5:41 AM

  • How can i create Level Based Hierarchy using multiple logical table.

    Hi All,
    in my use case i have two master logical table.
    Division_Mst(divncd,DivnName)
    Department_Mst(deptcd,DeptName)
    and one logical table which contain both column Header (divncd,deptcd)
    and fact table detail where one measure column(empcd) using aggregation count on it.
    so i want to create levelbased hierarchy like this.
    DivnName
              |------DeptName
    which are come from(Division_Mst,Department_Mst) .
    so user can see no of employees division wise and drill down to Department wise.
    How can i achieved this?
    thanks
    Manish

    Check out Shay's blog https://blogs.oracle.com/shay/entry/adf_faces_dynamic_tags_-fora
    Timo

  • Creating one dimensional hierarchy using columns from 2 different dimension

    Hello guys
    I have a case here.. The way our business is set up is that we have one dim table called channel dim, and another one call customers. Customer ID should be the child of channel ID. In other words, the measures at each Customer ID level should rollup to its parent channel ID level..
    So I am creating a hierarchy in my BMM which is named channel sales Dim:
    channel sales Dim--
    -- Grand Total Level
    -- Channel parent
    channel ID (Key)
    --Customer Details
    Customer ID(Key)
    Account (Sum)
    Both channel_ID and Customer_ID are the primary keys of Channel Dim and Customer Dim, both dim are joined to the sales fact table..
    So the hierarchy is created in such way, however when I check consistency it is giving me errors: nqserror15003: missing most detailed table for dimension table (Channel_Dim, Customer_Dim)
    Any advice of how to deal with this error?
    Much thanks

    Hi,
    Yes the fact table has the keys to the date and customer dimension. Is there any other column or information needed to create the constraint prompt?
    Thanks.

  • Error in Creating Level2 WBS using BAPI_PROJECT_MAINTAIN

    Hi All,
    I am trying to Create a WBS-element at Level 2 of an already existing WBS-element using BAPI_PROJECT_MAINTAIN.
    I suppose the 'hierarchy table' has to be populated for positioning a WBS in the structure. But I am getting the error 'The transfered hierarchy is inconsistent. Too many errors.'.
    I desire to have the following WBS structure in place :
    Project Definition :   PROJ_DEF
    WBS for level 1   :   WBS1
    WBS for level 2   :   WBS2 (This has to be at a sub-node of WBS1,and NOT at the same level as  WBS1)
    Can some one give me solution to this error, and suggest a way to create the WBS in this pattern.
    Regards,
    Somil
    I have written the following code to populate the hierarchy table :
      l_hierarchy-wbs_element         = 'WBS1'.
      l_hierarchy-project_definition   = 'PROJ_DEF'.
      l_hierarchy-up                        = ' '.
      l_hierarchy-down                    = 'WBS2'.
      l_hierarchy-right                     = ' '.
      l_hierarchy-left                       = ' '.
      APPEND l_hierarchy TO t_hierarchy_table.
      l_hierarchy-wbs_element         = 'WBS2'.
      l_hierarchy-project_definition    = 'PROJ_DEF'.
      l_hierarchy-up                         = 'WBS1'.
      l_hierarchy-right                      = ' '.
      l_hierarchy-left                        = ' '.
      l_hierarchy-down                    = ''.
      APPEND l_hierarchy TO t_hierarchy_table.

    For create the network and the activity I use this:
    ***  NETWORK ACTIVITY
       wa_network-network = '000000000001'.
    *  wa_network-network_type = 'PS02'.
       wa_network-short_text = 'Network'.
       wa_network-wbs_element = ld_wbs.
       wa_network-project_definition = ld_projdef.
       APPEND wa_network TO it_network.
       wa_projmethod-objecttype = 'Network'.
       wa_projmethod-method = 'Create'.
       wa_projmethod-objectkey = ld_wbs.
       wa_projmethod-refnumber = '000001'.
       APPEND wa_projmethod TO it_projmethod.
       CLEAR wa_projmethod.
       d_refnumber = '000001'.
       wa_activity-network = wa_network-network.
       wa_activity-project_definition = ld_projdef.
       wa_activity-wbs_element = ld_wbs.
       wa_activity-activity = '0010'.
       wa_activity-control_key = 'PS02'.
       wa_activity-description = 'Activity 1'.
       wa_activity-plant = '1000'.
       wa_activity-cost_elem = '0000705003'.
       wa_activity-purch_org = '1000'.
       wa_activity-pur_group = '100'.
       wa_activity-matl_group = '90'.
       wa_activity-constraint_type_start = '5'.
       wa_activity-constraint_type_finish = '5'.
       APPEND wa_activity TO it_activity.
       CLEAR wa_activity.
       wa_projmethod-objecttype = 'NetworkActivity'.
       wa_projmethod-method = 'Create'.
       wa_projmethod-objectkey = ld_wbs.
       wa_projmethod-refnumber = d_refnumber.
       APPEND wa_projmethod TO it_projmethod.
       d_refnumber = d_refnumber + 1.
       CLEAR wa_projmethod.

  • Code to create WBS using BAPI_PROJECT_MAINTAIN

    Hi,
    I am creating a program for mass upload of project definition and WBS elements. I was able to create the project definition using BAPI_PROJECTDEF_CREATE. For the WBS, I am using BAPI_PROJECT_MAINTAIN. But I was not able to create WBS yet. Can you give me a sample code for the BAPI_PROJECT_MAINTAIN that can create a WBS? What should be the values to be populated in the table i_method_project, i_wbs_element_table, etc.
    Please help.. I will reward points.
    Thanks,
    Lalyn

    Hi Lalyn.
    Firstly, I would like to suggest you not to use "REWARD POINTS" which is againts the rules of engagement.
    Hope you take things positively.
    I would like to suggest a couple of references, which are similar to your issue,
    [SDN - Reference for Updating value of WBS element - BAPI_PROJECT_MAINTAIN|Update WBS element;
    [SDN - Reference for issues related to creation of WBS element using BAPI_PROJECT_MAINTAIN|Problems with BAPI_PROJECT_MAINTAIN;
    [SDN Wiki - Standard Reference for ABAP Program to Upload WBS ELEMENTS IN Hierarchy|https://www.sdn.sap.com/irj/sdn/wiki?path=/display/snippets/abap%2bprogram%2bto%2bupload%2bwbs%2belements%2bin%2bhierarchy ]
    Hope that's usefull.
    Good Luck & Regards.

  • How to create services using BAPI_PROJECT_MAINTAIN

    Hi Gurus,
    I wish to create services ( in Ext Processing tab in tcode CN22) using BAPI_PROJECT_MAINTAIN. Please help me.
    Regards
    Ajay
    Moderator message: please search for available information/documentation before asking, try solving problems yourself first.
    Edited by: Thomas Zloch on Dec 8, 2010 2:50 PM

    Hi Lalyn.
    Firstly, I would like to suggest you not to use "REWARD POINTS" which is againts the rules of engagement.
    Hope you take things positively.
    I would like to suggest a couple of references, which are similar to your issue,
    [SDN - Reference for Updating value of WBS element - BAPI_PROJECT_MAINTAIN|Update WBS element;
    [SDN - Reference for issues related to creation of WBS element using BAPI_PROJECT_MAINTAIN|Problems with BAPI_PROJECT_MAINTAIN;
    [SDN Wiki - Standard Reference for ABAP Program to Upload WBS ELEMENTS IN Hierarchy|https://www.sdn.sap.com/irj/sdn/wiki?path=/display/snippets/abap%2bprogram%2bto%2bupload%2bwbs%2belements%2bin%2bhierarchy ]
    Hope that's usefull.
    Good Luck & Regards.

  • WBS hierarchy not working in BAPI_PROJECT_MAINTAIN

    I have created the following code. Before I added the section for the hierarchy table the structure was created ok, but with all WBS elements at level 1.
    Now I have added the entries into the hierarchy table I am getting an error when I run BAPI_PROJECT_MAINTAIN.
    The error message is CN 189 E - A reference object cannot be entered for the method 'Update'
    I'd appreciate it if someone can see what I have done wrong.
    Many thanks
    Karen
    Code **
    wa_method_project-REFNUMBER = '00001'.
    wa_method_project-OBJECTTYPE = 'WBS-Element'.
    wa_method_project-METHOD     = 'Create'.
    wa_method_project-OBJECTKEY = wbs1.
    append wa_method_project to i_method_project.
    wa_method_project-REFNUMBER = '00002'.
    wa_method_project-OBJECTTYPE = 'WBS-Element'.
    wa_method_project-METHOD     = 'Create'.
    wa_method_project-OBJECTKEY = wbs2.
    append wa_method_project to i_method_project.
    wa_method_project-REFNUMBER = '00003'.
    wa_method_project-OBJECTTYPE = 'WBS-Element'.
    wa_method_project-METHOD     = 'Create'.
    wa_method_project-OBJECTKEY = wbs3.
    append wa_method_project to i_method_project.
    move-corresponding t_bid_definition to wa_WBS_ELEMENT_TABLE.
    wa_WBS_ELEMENT_TABLE-PROJ_TYPE = 'BD'.
    wa_WBS_ELEMENT_TABLE-WBS_ACCOUNT_ASSIGNMENT_ELEMENT = 'X'.
    wa_WBS_ELEMENT_TABLE-WBS_ELEMENT = wbs1.
    wa_WBS_ELEMENT_TABLE-PROJECT_DEFINITION =
                                      t_bid_definition-PROJECT_DEFINITION.
    wa_WBS_ELEMENT_TABLE-DESCRIPTION = t_bid_definition-DESCRIPTION.
    append wa_WBS_ELEMENT_TABLE to i_WBS_ELEMENT_TABLE.
    wa_WBS_ELEMENT_TABLE-WBS_ELEMENT = wbs2.
    wa_WBS_ELEMENT_TABLE-PROJECT_DEFINITION =
                                      t_bid_definition-PROJECT_DEFINITION.
    wa_WBS_ELEMENT_TABLE-DESCRIPTION = 'WBS description 1'.
    append wa_WBS_ELEMENT_TABLE to i_WBS_ELEMENT_TABLE.
    wa_WBS_ELEMENT_TABLE-WBS_ELEMENT = wbs3.
    wa_WBS_ELEMENT_TABLE-PROJECT_DEFINITION =
                                      t_bid_definition-PROJECT_DEFINITION.
    wa_WBS_ELEMENT_TABLE-DESCRIPTION = 'WBS Description 2'.
    append wa_WBS_ELEMENT_TABLE to i_WBS_ELEMENT_TABLE.
    clear wa_WBS_ELEMENT_TABLE.
    wa_project_definition_upd-project_definition =
                                        t_bid_definition-PROJECT_DEFINITION.
    append wa_project_definition_upd to i_project_definition_upd.
    wa_method_project-METHOD     = 'Save'.
    append wa_method_project to i_method_project.
    clear: wa_method_project.
    This is the section I added that stopped the thing working *****************
    Create correct WBS Hierarchy
    wa_method_project-OBJECTTYPE = 'WBS-Hierarchy'.
    wa_method_project-METHOD     = 'Create'.
    append wa_method_project to i_method_project.
    clear: wa_method_project.
    wa_wbs_hierarchie_table-WBS_ELEMENT = wbs1.
    wa_wbs_hierarchie_table-PROJECT_DEFINITION =
                                      t_bid_definition-PROJECT_DEFINITION.
    wa_wbs_hierarchie_table-DOWN = wbs2.
    append wa_wbs_hierarchie_table to i_wbs_hierarchie_table.
    clear wa_wbs_hierarchie_table.
    wa_wbs_hierarchie_table-WBS_ELEMENT = wbs2.
    wa_wbs_hierarchie_table-PROJECT_DEFINITION =
                                      t_bid_definition-PROJECT_DEFINITION.
    wa_wbs_hierarchie_table-UP = wbs1.
    wa_wbs_hierarchie_table-RIGHT = wbs3.
    append wa_wbs_hierarchie_table to i_wbs_hierarchie_table.
    clear wa_wbs_hierarchie_table.
    wa_wbs_hierarchie_table-WBS_ELEMENT = wbs3.
    wa_wbs_hierarchie_table-PROJECT_DEFINITION =
                                      t_bid_definition-PROJECT_DEFINITION.
    wa_wbs_hierarchie_table-LEFT = wbs2.
    append wa_wbs_hierarchie_table to i_wbs_hierarchie_table.
    clear wa_wbs_hierarchie_table.
    CALL FUNCTION 'BAPI_PROJECT_MAINTAIN'
      EXPORTING
        i_project_definition               = t_bid_definition
      tables
        i_method_project                   = i_method_project
        I_WBS_ELEMENT_TABLE                = I_WBS_ELEMENT_TABLE
        I_WBS_HIERARCHIE_TABLE             = i_wbs_hierarchie_table
        E_MESSAGE_TABLE                    = i_bapi_message.

    Here is the final code.
    The Project Definition is created before you do this bit using BAPI_PROJECTDEF_CREATE which is where the entries for t_bid_definition come from.
    I hope this helps
    Karen
    data: wbs1 type ps_posid,
          wbs2 type ps_posid,
          wbs3 type ps_posid.
    clear: wbs1, wbs2, wbs3.
    wbs1 = 'WBS1'.
    wbs2 = 'WBS2'.
    wbs3 = 'WBS3'.
    wa_method_project-REFNUMBER = '00001'.
    wa_method_project-OBJECTTYPE = 'WBS-Element'.
    wa_method_project-METHOD     = 'Create'.
    wa_method_project-OBJECTKEY = wbs1.
    append wa_method_project to i_method_project.
    clear: wa_method_project.
    wa_method_project-REFNUMBER = '00002'.
    wa_method_project-OBJECTTYPE = 'WBS-Element'.
    wa_method_project-METHOD     = 'Create'.
    wa_method_project-OBJECTKEY = wbs2.
    append wa_method_project to i_method_project.
    clear: wa_method_project.
    wa_method_project-REFNUMBER = '00003'.
    wa_method_project-OBJECTTYPE = 'WBS-Element'.
    wa_method_project-METHOD     = 'Create'.
    wa_method_project-OBJECTKEY = wbs3.
    append wa_method_project to i_method_project.
    clear: wa_method_project.
    move-corresponding t_bid_definition to wa_WBS_ELEMENT_TABLE.
    wa_WBS_ELEMENT_TABLE-PROJ_TYPE = 'XX'.
    wa_WBS_ELEMENT_TABLE-WBS_ACCOUNT_ASSIGNMENT_ELEMENT = 'X'.
    wa_WBS_ELEMENT_TABLE-WBS_ELEMENT = wbs1.
    wa_WBS_ELEMENT_TABLE-PROJECT_DEFINITION =
                                        t_bid_definition-PROJECT_DEFINITION.
    wa_WBS_ELEMENT_TABLE-DESCRIPTION = 'WBS 1 description'.
    append wa_WBS_ELEMENT_TABLE to i_WBS_ELEMENT_TABLE.
    wa_WBS_ELEMENT_TABLE-WBS_PLANNING_ELEMENT = ''.
    wa_WBS_ELEMENT_TABLE-WBS_ACCOUNT_ASSIGNMENT_ELEMENT = 'X'.
    wa_WBS_ELEMENT_TABLE-WBS_ELEMENT = wbs2.
    wa_WBS_ELEMENT_TABLE-PROJECT_DEFINITION =
                                      t_bid_definition-PROJECT_DEFINITION.
    wa_WBS_ELEMENT_TABLE-DESCRIPTION = ''WBS 2 description'.
    append wa_WBS_ELEMENT_TABLE to i_WBS_ELEMENT_TABLE.
    wa_WBS_ELEMENT_TABLE-WBS_ELEMENT = wbs3.
    wa_WBS_ELEMENT_TABLE-PROJECT_DEFINITION =
                                      t_bid_definition-PROJECT_DEFINITION.
    wa_WBS_ELEMENT_TABLE-DESCRIPTION = ''WBS 3 description'.
    append wa_WBS_ELEMENT_TABLE to i_WBS_ELEMENT_TABLE.
    clear wa_WBS_ELEMENT_TABLE.
    wa_project_definition_upd-project_definition =
                                        t_bid_definition-PROJECT_DEFINITION.
    append wa_project_definition_upd to i_project_definition_upd.
    Create correct WBS Hierarchy
    wa_method_project-OBJECTTYPE = 'WBS-Hierarchy'.
    wa_method_project-METHOD     = 'Create'.
    append wa_method_project to i_method_project.
    clear: wa_method_project.
    wa_method_project-METHOD     = 'Save'.
    append wa_method_project to i_method_project.
    clear: wa_method_project.
    wa_wbs_hierarchie_table-WBS_ELEMENT = wbs1.
    wa_wbs_hierarchie_table-PROJECT_DEFINITION =
                                      t_bid_definition-PROJECT_DEFINITION.
    wa_wbs_hierarchie_table-DOWN = wbs2.
    ppend wa_wbs_hierarchie_table to i_wbs_hierarchie_table.
    clear wa_wbs_hierarchie_table.
    wa_wbs_hierarchie_table-WBS_ELEMENT = wbs2.
    wa_wbs_hierarchie_table-PROJECT_DEFINITION =
                                      t_bid_definition-PROJECT_DEFINITION.
    wa_wbs_hierarchie_table-UP = wbs1.
    wa_wbs_hierarchie_table-RIGHT = wbs3.
    append wa_wbs_hierarchie_table to i_wbs_hierarchie_table.
    clear wa_wbs_hierarchie_table.
    wa_wbs_hierarchie_table-WBS_ELEMENT = wbs3.
    wa_wbs_hierarchie_table-PROJECT_DEFINITION =
                                      t_bid_definition-PROJECT_DEFINITION.
    wa_wbs_hierarchie_table-UP = wbs1.
    wa_wbs_hierarchie_table-LEFT = wbs2.
    append wa_wbs_hierarchie_table to i_wbs_hierarchie_table.
    clear wa_wbs_hierarchie_table.
    CALL FUNCTION 'ZBAPI_PROJECT_MAINTAIN'
      EXPORTING
        i_project_definition                =  t_bid_definition
      tables
        i_method_project                   = i_method_project
        I_WBS_ELEMENT_TABLE     = I_WBS_ELEMENT_TABLE
        I_WBS_HIERARCHIE_TABLE = i_wbs_hierarchie_table
        E_MESSAGE_TABLE            = i_bapi_message.
    Message was edited by:
            Karen Dean

  • Creating Proj Defn using BAPI_PROJECT_MAINTAIN

    Hi all,
    I ahve created Proj defn and an WBS element using BAPI_PROJECT_MAINTAIN...
    Now i want ot know the procedure to create network header and an activity...
    I have created an Network header also....
    and i got error while creating an activity
    the error reads as
    "Relationship type could not converted to the internal format..."
    Hw to overcome this error...
    thanx in advance

    Check this note
    Note 501332 - No type of relationship for BOR 'Network'
    if this note does not resolve your problem , then you may need to use conversion exit for Relationship Type.

  • Network - subnetwork hierarchy using std networks.

    I want to create network / subnetwork hierarchy using std. networks.
    How is it done in PS.

    Create standard Network > Create Activities in Standard Network > Assign Milestone in Std NW > Define Milestone functions/Parameters  > Now with the help of this Std network number you can create Sub Network as you wants [In CN21 Transaction code input Std NW number then automatically system will create all subnetwork from that Std Network
    Swapnil Kharul

  • How to use BAPI_PROJECT_MAINTAIN to create network activities under WBS elements ?

    Hello ABAPers,
    I have been using BAPI_PROJECT_MAINTAIN to create Project and WBS elements and I have done them without any errors.
    Now I need help on how to create network activities.
    Can anyone share on how to pass data to I_NETWORK table and I_ACTIVITY table and a brief description on what they are ?
    Thanks in advance,
    Kiran

    Hi Kiran,
    Do the following steps
    1.pass the following to i_method_project
    method_project-refnumber = lv_refnum.
    method_project-objecttype = 'NETWORK-ACTIVITY'.
    method_project-method = 'UPDATE'.
    concatenate aufnr(network nr) vornr(activity) into method_project-objectkey.
    2.Into i_activity
    activity-network = aufnr.
    activity-activity = vornr.
    3.i_activity_update
    activity_update-network = 'X'.
    activity_update-activity = 'X'.
    It should work.If not let me know.
    Rgds,
    K.S.

  • Creating WBS element using bapi BAPI_PS_INITIALIZATION

    Hi All,
    I have created Project definition successfully  using function module "BAPI_PROJECT_MAINTAIN" .
    But while trying to create Wbs-Element for the project definition using same function module  "BAPI_PROJECT_MAINTAIN"   we are getting the following error
    Key does not correspond to mask: TR.XXXXX.X.X.XXX
    Could any one help me out to resolve this issue.
    Thanks in advance.
    harsha p

    Hi harsha p,
    Error CJ609 "Key does not correspond to mask:TR.XXXXX.X.X.XXX" is always caused by an inconsistency between the project/WBS object number and the coding mask. Therefore, to solve the problem can you please try to run report ZZADJUSTPOSID from note 453280 attached?
    The report should be imported into your system manually by SE38.
    Please run it first in test mode to check the wrong entries and then correct them in update mode.
    Best Regards,
    Edna

  • Creating the WBS using bapis

    i am creating the WBS using thses bapis
    1. BAPI_PS_INITIALIZATION
    2. BAPI_BUS2001_CREATE
    3. BAPI_PS_PRECOMMIT
    4. BAPI_TRANSACTION_COMMIT/BAPI_TRANSACTION_ROLLBACK
    but i am getting the error
    Field COMPANY_CODE/Company code: Changing the contents of the field is not permitted
    Field BUSINESS_AREA/Business area: Changing the contents of the field is not permitted 
    Field WBS_ACCOUNT_ASSIGNMENT_ELEMENT/Acct asst elem.: Changing the contents of the field is not permitted         
    Field OBJECTCLASS/Object Class: Changing the contents of the field is not permitted     
    Please help to resolve this
    kanishak

    Hi,
    have you tried to look for corresponding OSS notes? I've never had any problems with this BAPI and according to BAPI documentation all fields from input structure can be used. It looks more like error. Or don't you have any validation for projects definitions? If you can find the reason you can still debug that code and see why it's failing.
    BTW your BAPI is for Project definition creation, not WBS element. You can maintain WBS elements form any project using BAPI BAPI_PROJECT_MAINTAIN.
    Cheers

  • Can't see newly created WBS Hierarchy

    When using info object 0WBS_ELEMT_WBSH_HIER we are not able to see a new wbs group/hierarchy created in our r/3 system. But for cost center hierarchy we see everything the users create. Is there a setting on 0WBS_ELEMT_WBSH_HIER that we missed to allow multiples?
    on the cost center hierarchy object it allows "intervals". Thats the only difference I see.
    Thanks
    Richard

    Yes, It works perfect if you just write a quick abap program.
    Here are the statements we used.
    declare the hierarchy catalog table
    tables roohiecat .
    write / '*******************' .
    Write / 'Before Table Update' .
    write / '*******************' .
      clear roohiecat .
      Select single * from roohiecat
       where oltpsource = '4R_PS_POSID_0000_HIER' and
              objvers = 'A'.
      Write: / roohiecat-OLTPSOURCE ,roohiecat-OBJVERS ,
              roohiecat-TYPEHC .
    this table holds the Hierarchy class code.
    after creating the generic hierarchy with class code 0000
    the update statement below will run and change the class code
    to 0110 which represents WBS group.
    You must then replicate the datasource to use it in BW.
    Clear sy-subrc.
    Update roohiecat
       set typehc = '0110'
        where oltpsource = '4R_PS_POSID_0000_HIER' and
              objvers = 'A'.
    if sy-subrc = 0 .
      write / '*******************' .
      Write / 'After Table Update' .
      write / '*******************' .
      clear roohiecat .
      Select single * from roohiecat
       where oltpsource = '4R_PS_POSID_0000_HIER' and
              objvers = 'A'.
    Write: / roohiecat-OLTPSOURCE ,roohiecat-OBJVERS ,
              roohiecat-TYPEHC .
    endif .

Maybe you are looking for

  • How do you add more than one song to library.....

    How do you add more than one song to the library using the "Add File to Library" option? I just upgraded to itunes 7.1.1.5 from an early version and used to be able to do this but now it want let me, it only lets me add one song at a time. I don't wa

  • Backing up external hard drive (connected to time capsule) using time machi

    hi. don't know if this is possible or not - am now using an external hard drive to store all my movies as my macbook pro's hard drive is filling up and i'm running out of space (it's 250gb). have created a separate itunes on the external hard drive a

  • Creative cloud on the web does not load my files

    When I go to creative cloud online (view files on the web) to see my files, it takes forever to load and it finally only shows a blank page even though on my desktop version I have files and folders, which seem to be synced (All files up to date)! Br

  • Running JNLP as administrator

    Hi, I have a JNLP that needs to invoked only by an administrator. Do we have any mechanism in webstart, if user launches application from non admin mode , it prompts the credentials for admin user and launches the application as admin. Thanks & Regar

  • Uptading Itunes 9.1

    I tried about 10 times already to update to 9.1 and keep getting an error message saying to try "Download only" and "update it manually". I even tried to download Itunes again and still doesn't work, but this time it says "invalid drive" and it show