Error in BAPI_PROJECT_MAINTAIN

There is a program ZI000206 which substitutes Plant in Projects from CC Master data. We are trying to substitute Plants in almost 5000 projects.
The problem is whenever we run the program it ends up with Error:
Fill in All Required Fields
though Substitution and Validations are carried out.
While debugging the program we found it is calling standard BAPI : BAPI_PROJECT_MAINTAIN.
The reason is that an OSS Note 1311030 which adds a call function CJWB_CHECK_BEFORE_COMMIT in from GENERAL_OBJECTS_MAINTAIN. This is causing a problem when it calls for the field PRPS-IZWEK(Investment Reason). Even though the field is hidden for projects it is calling as mandatory and throwing this error.
I checked in customizing of screen layouts for WBS wherein this field is maintained as an input field.
Will this change of field from input to hidden help in getting over this problem?
Additionally I also tried CNMASS functionality for PS which also throws the same error " Fill in All Required Fields".
input is highly appreciated.

HI Shubhan .
I solve my problem and in my case was the profirt cost center (profit_cctr), i write to sap and they tell me that this field is mandatory, so i use a profit  cost center "DUMMY" and i send it by default in the code, so that was my solution, i hope this help you with your problem.
Regards.
Alejandro

Similar Messages

  • BAPI_PROJECT_MAINTAIN error : Fill in all the required fields

    Hi All
    I am facing an error in BAPI_PROJECT_MAINTAIN in ECC 6.0. While creating WBS elemnts for existing project, I have disabled the field Responsible Cost center in the configuration.However it is still taking that field as mandatory and giving the error : Fill in all the required entry fields.
    It is working fine in 4.6C with the same configuration settings.
    Please let me know what configuration i missed in ECC 6.0 or how can I make the responsible Cost Centre as not a mandatory field.
    Please Note: I have checked the checkbox Accnt assignment Elem due to which the field Responsible Cost cnter becomes a mandatory field.
    Thanks
    Edited by: Pareekh on Apr 30, 2010 6:05 PM

    Hi
    Thanks for your response.
    I do not need to create a prject by BAPI as it is not the requirement. My query is why is the BAPI_PROJECT_MAINTAIN  in ECC 6.0 taking the field Responsible CC as mandatory field even when it has been disabled. Whereas it is working absolutely fine in 4.6C(Responsible CC has been disabled and is not mandatory anymore).
    Also, if I can get to know how can  i change the settings of Responsible CC to make it as a non-mandatory field.
    Thanks

  • BAPI_PROJECT_MAINTAIN

    I am getting an error in BAPI_PROJECT_MAINTAIN while trying to add an Activity to an existing Network.  The Activity number does not exist for the network so I am assuming that CREATE is the best Method to use.  Initially, this error was caused by a missing field UVORN, SubOperation, that is required to create an activity.  I do not see the connection of UVORN, a work order related field, to creating an Activity. 
    Now, I am getting an Object Key error from my input data using UPDATE with the same data.  I am new to the world of PS and could use some help in getting the input data coded correctly to add and Activity.  Any help I can get on this would be gratefully appreciated.
    Thank you in advance for your assistance.

    Hi Robert,
    It is rather the reverse way. BAPI_PROJECT_MAINTAIN has the functions of BAPI_NETWORK_MAINTAIN. Following is an extract from the documentation of the former BAPI:
    "With the Maintain BAPI of the WorkBreakdownStruct business object you can edit the objects of a project definition. You can also use all the functions of the Maintain BAPI of the Network business object.
    For more information, see Network.Maintain. With WorkBreakdownStruct.Maintain it is possible to edit the project definition, its WBS elements and their hierarchical relationships. The BAPI encapsulates a complete transaction in itself. As a result, several operations on project elements can be processed by only one call. The Project System determines in which order the operations are to be executed on the objects. The caller can choose the operations in any order."
    RGds
    Deepak

  • 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.

  • Not able to update the project using 'BAPI_PROJECT_MAINTAIN'.

    I  want to create a project , with reference to an already existing project.
    I am using 'BAPI_PROJECT_GETINFO' to get the data of the existing project.
      The bapi gives the following:
    1)     e_project_definition.
    2)     e_wbs_element_table.
    3)     e_wbs_hierarchie_table
    I am passing the u2018e_project_definitionu2019 to 'BAPI_PROJECTDEF_CREATE' to create project.The project is created successfully.
    But I am not able to update the project with u2018e_wbs_element_tableu2019
    and u2018e_wbs_hierarchie_tableu2019. I am using 'BAPI_PROJECT_MAINTAIN' to update the project.
    The program is not giving an error, but it is also not updating the E_WBS_ELEMENT_TABLE and E_WBS_HIERARCHIE_TABLE.
    I am attaching the code below.
    *& Report  ZTEST_PC.
    DATA: project_definition   TYPE  bapipr-project_definition,
          with_activities      TYPE  bapipr-with_activities,
          with_milestones      TYPE  bapipr-with_milestones,
          with_subtree         TYPE  bapipr-with_subtree,
          e_project_definition TYPE  bapi_project_definition_ex,
          return               TYPE  bapireturn1.
    DATA: i_wbs_element_table         TYPE TABLE OF     bapi_wbs_elements,
          e_wbs_element_table         TYPE TABLE OF     bapi_wbs_element_exp,
          e_wbs_milestone_table   TYPE TABLE OF bapi_wbs_milestone_exp,
          e_wbs_hierarchie_table  TYPE TABLE OF bapi_wbs_hierarchie,
          e_activity_table        TYPE TABLE OF bapi_network_activity_exp,
          e_message_table         TYPE TABLE OF bapi_meth_message.
    DATA: wa_wbs_element_table    TYPE      bapi_wbs_element_exp,
          wa_wbs_hierarchie_table TYPE  bapi_wbs_hierarchie.
    DATA: l_new_proj_no TYPE  prpss-posid.
    DATA: l_project_definition        TYPE  bapi_project_definition.
    DATA: l_project_definition_upd    TYPE  bapi_project_definition_up.
    DATA: l_project_definition_stru   TYPE  bapi_project_definition.
    DATA :l_pspnr      TYPE ps_intnr,
          l_pspid      TYPE ps_pspid,
          l_pro_def(9) TYPE c.
    DATA :l_proj  TYPE proj.
    DATA :l_len TYPE i VALUE '0'.
    DATA: lt_dd03l TYPE TABLE OF dd03l,
          ls_dd03l TYPE dd03l.
    DATA: fieldname(50), fieldname1(50) TYPE c.
    DATA: p_ddic_name(40), struc(40), fun_struc(50) TYPE c.
    FIELD-SYMBOLS: <struc>, <c>, <sc>, <def_field> TYPE any.
    DATA : i_method_project    TYPE TABLE OF bapi_method_project,
           wa_method_project   TYPE  bapi_method_project.
    DATA : l_index TYPE bapi_method_project-refnumber.
    DATA : it_wbs_element_table         TYPE TABLE OF bapi_wbs_element,
           it_wbs_hierarchie_table      TYPE TABLE OF bapi_wbs_hierarchie.
    DATA : wl_wbs_element_table         TYPE bapi_wbs_element,
           wl_wbs_hierarchie_table      TYPE bapi_wbs_hierarchie.
    DATA : l_wbs_element_table_update   TYPE bapi_wbs_element_update.
    DATA : i_wbs_element_table_update   TYPE TABLE OF bapi_wbs_element_update.
    Get the project info of the Project 'C01.10995'
    CALL FUNCTION 'CONVERSION_EXIT_ABPSN_INPUT'
      EXPORTING
        input  = 'C01.10995'
      IMPORTING
        output = project_definition.
    CALL FUNCTION 'BAPI_PROJECT_GETINFO'
      EXPORTING
        project_definition     = project_definition
      IMPORTING
        e_project_definition   = e_project_definition
        return                 = return
      TABLES
        i_wbs_element_table    = i_wbs_element_table
        e_wbs_element_table    = e_wbs_element_table
        e_wbs_milestone_table  = e_wbs_milestone_table
        e_wbs_hierarchie_table = e_wbs_hierarchie_table
        e_activity_table       = e_activity_table
        e_message_table        = e_message_table.
    Automate the process the process to get the next number for the func module 'CN_SUCHE_FREIE_NUMMER'.
    CLEAR : l_pspnr, l_pspnr, l_pspid, l_pro_def.
    SELECT MAX( pspnr ) FROM proj INTO l_pspnr.
    SELECT SINGLE * FROM proj INTO l_proj WHERE pspnr EQ l_pspnr.
    l_pspid = l_proj-pspid.
    CALL FUNCTION 'CONVERSION_EXIT_ABPSN_OUTPUT'
      EXPORTING
        input  = l_pspid
      IMPORTING
        output = l_pspid.
    l_pro_def = l_pspid+4(5) + 1.
    CONDENSE l_pro_def.
    CONCATENATE 'C01.' l_pro_def INTO l_pspid .
    function module to generate the nect free number between the given range.
    CALL FUNCTION 'CN_SUCHE_FREIE_NUMMER'
      EXPORTING
        search_imp = '2'
        prps_s_imp = l_pspid
        prps_e_imp = 'C01.29999'
        no_dialog  = 'X'
      IMPORTING
        prps_exp   = l_new_proj_no.
    IF sy-subrc <> 0.
      EXIT.
    ENDIF.
    Update the fields of 'l_project_definition_upd' as 'X' for the fields which has values in 'E_PROJECT_DEFINITION'.
    Get the New Project Number.
    MOVE-CORRESPONDING e_project_definition TO l_project_definition.
    l_project_definition-project_definition = l_project_definition-project_definition+0(3).
    l_new_proj_no = l_new_proj_no+4(5).
    CONCATENATE l_project_definition-project_definition '.' l_new_proj_no INTO l_project_definition-project_definition.
    TRANSLATE l_project_definition-project_definition TO UPPER CASE.
    MOVE-CORRESPONDING l_project_definition TO l_project_definition_stru.
    Create the New project with the New project Number.
    CALL FUNCTION 'BAPI_PROJECTDEF_CREATE'
      EXPORTING
        project_definition_stru = l_project_definition_stru.
    CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'
      EXPORTING
        wait = ' '.
    Populate internal table i_method_project for the bapi_project_maintain func module.
    CLEAR : wa_wbs_element_table,wl_wbs_element_table,wa_wbs_hierarchie_table,
            wl_wbs_hierarchie_table, it_wbs_element_table, it_wbs_hierarchie_table.
    CLEAR : wa_method_project, i_method_project, l_index .
    l_index = 0.
    LOOP AT e_wbs_element_table INTO wa_wbs_element_table.
      MOVE-CORRESPONDING wa_wbs_element_table TO wl_wbs_element_table .
      APPEND  wl_wbs_element_table  TO it_wbs_element_table .
      wa_method_project-objecttype = 'WBS_ELEMENT'.
      wa_method_project-method     = 'CREATE'.
      wa_method_project-objectkey  = wa_wbs_element_table-wbs_element.
      l_len = strlen( wa_wbs_element_table-wbs_element ).
    Setting Levels as reference number.
      CASE l_len.
        WHEN '9'.
          l_index = 1.
        WHEN '12'.
          l_index = 2.
        WHEN '15'.
          l_index = 3.
        WHEN '18'.
          l_index = 4.
      ENDCASE.
      wa_method_project-refnumber  =  l_index .
      TRANSLATE wa_method_project-objectkey TO UPPER CASE.
      APPEND wa_method_project TO i_method_project.
      CLEAR :wa_method_project, l_index.
    ENDLOOP.
    l_index = l_index + 1.
    wa_method_project-refnumber  = ' '.  "l_index .
    wa_method_project-objecttype = ' '.  "'WBS_ELEMENT'.
    wa_method_project-method     = 'SAVE'.
    wa_method_project-objectkey  = ' '.
    APPEND wa_method_project TO i_method_project.
    CLEAR wa_method_project.
    LOOP AT e_wbs_hierarchie_table INTO wa_wbs_hierarchie_table.
      MOVE-CORRESPONDING wa_wbs_hierarchie_table TO wl_wbs_hierarchie_table.
      APPEND wl_wbs_hierarchie_table TO it_wbs_hierarchie_table.
    ENDLOOP.
    Update the fields of 'l_project_definition_upd' as 'X' for the fields which has values in 'E_PROJECT_DEFINITION' respectively.
    CLEAR : l_project_definition_upd.
    p_ddic_name = 'BAPI_PROJECT_DEFINITION_UP'.
    struc       = 'l_project_definition_upd'.
    fun_struc   = 'E_PROJECT_DEFINITION'.
    TRANSLATE: p_ddic_name TO UPPER CASE,
               struc       TO UPPER CASE.
    SELECT * FROM dd03l INTO TABLE lt_dd03l WHERE tabname = p_ddic_name.
    LOOP AT lt_dd03l INTO ls_dd03l.
      ASSIGN ls_dd03l-fieldname TO <c>.
      fieldname = ls_dd03l-fieldname .
      CONCATENATE fun_struc '-' fieldname INTO fieldname.
      ASSIGN (struc) TO <struc>.
      ASSIGN COMPONENT <c> OF STRUCTURE <struc> TO <sc>.
      ASSIGN (fieldname) TO <def_field>.
      IF NOT <def_field> IS INITIAL  .
        <sc> = 'X'.
      ENDIF.
    ENDLOOP.
    Update the fields of 'l_wbs_element_table_update' as 'X' for the fields which has values in 'e_wbs_element_table' respectively.
    READ TABLE e_wbs_element_table INTO wa_wbs_element_table INDEX '1'.
    CLEAR : l_wbs_element_table_update, fieldname1, p_ddic_name, struc, fun_struc .
    p_ddic_name = 'BAPI_WBS_ELEMENT_UPDATE'.
    struc       = 'l_wbs_element_table_update'.
    fun_struc   = 'WA_WBS_ELEMENT_TABLE'.
    TRANSLATE: p_ddic_name TO UPPER CASE,
               struc       TO UPPER CASE.
    SELECT * FROM dd03l INTO TABLE lt_dd03l WHERE tabname = p_ddic_name.
    LOOP AT lt_dd03l INTO ls_dd03l.
      ASSIGN ls_dd03l-fieldname TO <c>.
      fieldname = ls_dd03l-fieldname .
      CONCATENATE fun_struc '-' fieldname INTO fieldname.
      ASSIGN (struc) TO <struc>.
      ASSIGN COMPONENT <c> OF STRUCTURE <struc> TO <sc>.
      ASSIGN (fieldname) TO <def_field>.
      IF NOT <def_field> IS INITIAL  .
        <sc> = 'X'.
      ENDIF.
    ENDLOOP.
    Append the value of l_wbs_element_table_update TO the table i_wbs_element_table_update for Bapi_project_maintain.
    CLEAR i_wbs_element_table_update.
    APPEND l_wbs_element_table_update TO i_wbs_element_table_update.
    CALL FUNCTION 'BAPI_PROJECT_MAINTAIN'
      EXPORTING
        i_project_definition       = l_project_definition
        i_project_definition_upd   = l_project_definition_upd
      TABLES
        i_method_project           = i_method_project
        i_wbs_element_table_update = i_wbs_element_table_update
        i_wbs_element_table        = it_wbs_element_table.
       i_wbs_hierarchie_table     = it_wbs_hierarchie_table.
    CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'
      EXPORTING
        wait = ' '.
    Please help me to solve the issue.

    I am not sure why it is not working??  Try for any other alternate function modules.
    But i see one issue with your coding, always check the return table message type and use commit work, instead of sy-subrc check. This fails for BAPI's

  • Error while doing multiple object updation from EP ! object lock error

    HI all,
    I am doing multiple  object updation using a standard RFC(BAPI_PROJECT_MAINTAIN). The RFC i am calling from Enterprise portal. I am sending data to RFC one by one. But the error i am getting is object is locked by user so data can't be save.
    Though i am using Lock and unlock method before and after calling RFC the project lock error comes up.
    What might be the reason
    regards
    sandeep

    Hi Sandeep,
    Is the RFC you use for locking in the same model as the bapi BAPI_PROJECT_MAINTAIN? If it is not then you are using two connections for communication with the sap R/3 backend.
    You can do 2 things.
    1. You could add the RFCs for locking in the same model as the BAPI_PROJECT_MAINTAIN
    2. Instead of adding the RFCs in one model synchronize the connections the models use as follows:
    IWDDynamicRFCModel model1 = (IWDDynamicRFCModel) WDModelFactory.getModelInstance(Model1.class);
    IWDDynamicRFCModel model2 = (IWDDynamicRFCModel) WDModelFactory.getModelInstance(Model2.class);
    model1.setConnectionProvider(model2);
    You can do this in the wdDoInit. This will make sure both models use the same connection but closing a connection will close both at the same time.
    The same problem applies to commit/rollback functionality.
    Regards,
    Jeschael

  • Issue with using call transaction CJ9F and F.M  BAPI_PROJECT_MAINTAIN

    Hello All,
    In my custom program for a given project in selection screen we are getting all the related data as shown in CJ20N, in this screen I first created the WBS element and during save we used F.M BAPI_PROJECT_MAINTAIN to update the data, and next called transaction CJ9F to update BLC, after this we are comming back to selection screen 1000.
    Now from selection screen if i enter again into that project details screen and try to create a new WBS it is showing below information msg.
    Changing the contents of the field is not permitted
    Message no. CJ727
    If i remove the call transaction CJ9F part during save i am not getting the above error msg.
    I think i am getting this error when we call the function module BAPI_PROJECT_MAINTAIN twice in the program.
    Please help me to resolve this issue, as this msg is not allowing to save or create anything. 
    But i found that if i come totally out of my custom transaction and enter once again into that Z transaction it is working fine with out that message
    Please help me to resolve this issue.

    Hi,
    Not sure, but if it is possible, complete your project update using the custom transaction and do the CJ9F afterwards seperately.
    Regards
    Sreekanth

  • Wbs element can no longer be shifted error while creating wbs

    i am trying to create wbs with bapi_project_maintain, i am facing an error with message no 418 WBS element 1899-CAP-10-100-001-1507 can no longer be shifted

    - You tried to change the hierarchy of the project, despite the fact that some budget has already been assigned. Try to add the WBS to another node or place in the project hierarchy.
    - You could also reset budget using transaction CJ30 and remove the availability control on the project using transaction CJBW.
    Regards,
    Raymond

  • Error while creating WBS through BAPI

    I am using BAPI_PROJECT_MAINTAIN to create WBS L2 & L3.
    There is only 1 WBS at both levels.
    For some cases it is running fine, but I am getting the following error in some cases:
    "WBS element 3UTWB_BSRHT_001 can no longer be shifted"
    What could be the reason?

    As you told you are creating WBS vai BAPI. This may not be  exact relevant Normally you cannot  change  hierarchy of WBS Elements after you have done some sort of execution / planning on it. If you are getting error than please share details of error message with no.
    With Regards
    Nitin P.

  • Error when create project definition and 2 wbs by bapi BAPI_PROJECT_MAINTAI

    Hello everyone,
    I have to create project definition and 2 wbs, I use function BAPI_PROJECT_MAINTAI but I have the error:
    "WBS element 0033.3332.01.R already exists" but that wbs it's created.
    This is my code.
    data:
             I_WBS_ELEMENT_TABLE type BAPI_WBS_ELEMENT occurs 0 with header line,
             I_WBS_ELEMENT_TABLE_UPDATE type BAPI_WBS_ELEMENT_UPDATE occurs 0 with header line,
             I_PROJECT_DEFINITION like BAPI_PROJECT_DEFINITION,
             I_PROJECT_DEFINITION_UPD like BAPI_PROJECT_DEFINITION_UP,
             I_METHOD_PROJECT type BAPI_METHOD_PROJECT occurs 0 with header line,
            E_MESSAGE_TABLE like BAPI_METH_MESSAGE occurs 0 with header line,
            RETURN type BAPIRETURN1,
            lv_index    LIKE bapi_method_project-refnumber.
    lv_index = 1.
    I_METHOD_PROJECT-OBJECTTYPE = 'ProjectDefinition'.
    I_METHOD_PROJECT-METHOD = 'Create'.
    I_METHOD_PROJECT-OBJECTKEY = '0033.3332'.
    I_METHOD_PROJECT-REFNUMBER = lv_index.
    append I_METHOD_PROJECT.
    lv_index = lv_index + 1.
    I_METHOD_PROJECT-OBJECTTYPE = 'WBS-Element'.
    I_METHOD_PROJECT-METHOD = 'Create'.
    I_METHOD_PROJECT-OBJECTKEY = '0033.3332.01'.
    I_METHOD_PROJECT-REFNUMBER = lv_index.
    append I_METHOD_PROJECT.
    lv_index = lv_index + 1.
    clear I_METHOD_PROJECT.
    I_METHOD_PROJECT-OBJECTTYPE = 'WBS-Element'.
    I_METHOD_PROJECT-METHOD = 'Create'.
    I_METHOD_PROJECT-OBJECTKEY = '0033.3332.01.R'.
    I_METHOD_PROJECT-REFNUMBER = lv_index.
    append I_METHOD_PROJECT.
    clear I_METHOD_PROJECT.
    I_METHOD_PROJECT-OBJECTTYPE = space.
    I_METHOD_PROJECT-METHOD = 'Save'.
    I_METHOD_PROJECT-OBJECTKEY = space.
    I_METHOD_PROJECT-REFNUMBER = space.
    append I_METHOD_PROJECT.
    I_PROJECT_DEFINITION-PROJECT_DEFINITION = '0033.3332'.
    I_PROJECT_DEFINITION-DESCRIPTION = 'Training project'.
    I_PROJECT_DEFINITION-PROJECT_PROFILE = 'ZAF0001'.
    I_PROJECT_DEFINITION-COMP_CODE = '0033'.
    I_PROJECT_DEFINITION-RESPONSIBLE_NO                  = 1.
    I_PROJECT_DEFINITION-APPLICANT_NO                    = 1.
    I_PROJECT_DEFINITION-PLANT  = '033A'.
    I_WBS_ELEMENT_TABLE-PROJECT_DEFINITION              = '0033.3332'.
    I_WBS_ELEMENT_TABLE-WBS_ELEMENT                     =  '0033.3332.01'.
    I_WBS_ELEMENT_TABLE-DESCRIPTION                     = 'WBS 1'.
    I_WBS_ELEMENT_TABLE-RESPONSIBLE_NO                  = 1.
    I_WBS_ELEMENT_TABLE-APPLICANT_NO                    = 1.
    I_WBS_ELEMENT_TABLE-COMP_CODE                       = '0033'.
    I_WBS_ELEMENT_TABLE-PROFIT_CTR                      = '0033A99999'.
    I_WBS_ELEMENT_TABLE-PLANT  = '033A'.
    append i_wbs_element_table.
    clear I_WBS_ELEMENT_TABLE.
    I_WBS_ELEMENT_TABLE-PROJECT_DEFINITION              = '0033.3332'.
    I_WBS_ELEMENT_TABLE-WBS_ELEMENT                     =  '0033.3332.01.R'.
    I_WBS_ELEMENT_TABLE-DESCRIPTION                     = 'WBS 2'.
    I_WBS_ELEMENT_TABLE-RESPONSIBLE_NO                  = 1.
    I_WBS_ELEMENT_TABLE-APPLICANT_NO                    = 1.
    I_WBS_ELEMENT_TABLE-COMP_CODE                       = '0033'.
    I_WBS_ELEMENT_TABLE-PROFIT_CTR                      = '0033A99999'.
    I_WBS_ELEMENT_TABLE-PLANT  = '033A'.
    append i_wbs_element_table.
    PERFORM fill_update_flags USING    'BAPI_PROJECT_DEFINITION_UP'
                              CHANGING I_PROJECT_DEFINITION_UPD.
    PERFORM fill_update_flags USING    'BAPI_WBS_ELEMENT_UPDATE'
                              CHANGING I_WBS_ELEMENT_TABLE_UPDATE.
    append I_WBS_ELEMENT_TABLE_UPDATE.
    append I_WBS_ELEMENT_TABLE_UPDATE.
    CALL FUNCTION 'BAPI_PROJECT_MAINTAIN'
      EXPORTING
        I_PROJECT_DEFINITION               = I_PROJECT_DEFINITION
        I_PROJECT_DEFINITION_UPD           = I_PROJECT_DEFINITION_UPD
      TABLES
        I_METHOD_PROJECT                   = I_METHOD_PROJECT
        I_WBS_ELEMENT_TABLE_UPDATE         = I_WBS_ELEMENT_TABLE_UPDATE[]
        I_WBS_ELEMENT_TABLE                = I_WBS_ELEMENT_TABLE[]
       E_MESSAGE_TABLE                    = E_MESSAGE_TABLE
    write: / 'Finish'.
    *&      Form  FILL_UPDATE_FLAGS
    FORM fill_update_flags USING    value(p_ddic_name)
                           CHANGING p_struc_upd.
      DATA: lt_dd03l LIKE dd03l OCCURS 0,
            ls_dd03l LIKE dd03l.
      DATA: s(40), c(40), sc(80) TYPE c.
      FIELD-SYMBOLS: <s>, <c>, <sc> TYPE ANY.
      TRANSLATE p_ddic_name TO UPPER CASE.
      SELECT * FROM dd03l INTO TABLE lt_dd03l WHERE tabname = p_ddic_name.
      s = 'P_STRUC_UPD'.
      ASSIGN (s) TO <s>.
      LOOP AT lt_dd03l INTO ls_dd03l.
        ASSIGN ls_dd03l-fieldname TO <c>.
        ASSIGN COMPONENT <c> OF STRUCTURE <s> TO <sc>.
        <sc> = 'X'.
      ENDLOOP.
    ENDFORM.                    " FILL_UPDATE_FLAGS
    Please help me!
    Thank you!
    Edited by: kishan P on Sep 10, 2010 9:37 AM

    Hi,
    Please try creating the project definition and then call the FM again to create the WBS.
    http://help.sap.com/erp2005_ehp_04/helpdata/EN/4c/226a7246e611d189470000e829fbbd/frameset.htm
    Hope it helps.
    Sujay

  • Getting the error while using bapi 'BAPI_PROJECTDEF_UPDATE'.

    Hi,
    All
    To fulfill a requirement of project definition update in PS module, I have been trying with bapi 'BAPI_PROJECTDEF_UPDATE' , but I am getting the error like 'The external key is not compatible with the internal key'.
    Following are the details of my source code:
    CALL FUNCTION 'BAPI_PS_INITIALIZATION'
       data: ls_def_strucure LIKE BAPI_PROJECT_DEFINITION,
           ls_def_update LIKE BAPI_PROJECT_DEFINITION_UP,
           ls_error like bapireturn1.
    ls_def_strucure-PROJECT_DEFINITION = '11011'.
    ls_def_strucure-DESCRIPTION = 'Indian Metro Updated by BAPI'.
    ls_def_update-DESCRIPTION = 'X'.
    CALL FUNCTION 'BAPI_PROJECTDEF_UPDATE'
       EXPORTING
         currentexternalproje          = '11011'       " Project Definition
         currentinternalproje          = '11011'
         project_definition_stru       = ls_def_strucure
         project_definition_up         = ls_def_update
      IMPORTING
        RETURN                        = ls_error
    * TABLES
    *   E_MESSAGE_TABLE               =
    CALL FUNCTION 'BAPI_PS_PRECOMMIT'.
    CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'.
    I have tried with 'BAPI_PROJECT_MAINTAIN' ,but there I am not getting any idea to usage of this bapi.
    please help me if you have any solution for this problem.
    Thanks in advanced.

    Thanks for your quick reply
    Actually i have a requirement to update the Project definition and other Project elements like WBS, Network , Activities and Milestone. I referred several documents and came to know that 'BAPI_PROJECT_MAINTAIN' can perform these all update tasks. But tried with that bapi but got the error. First help me please if you have any idea about this BAPI .
    Coming to BAPI_PROJECTDEF_UPDATE I got the error like Internal and exrternal keys  are not type compatible with each other.
    So , do you have any idea what would be the exact value of these two parameters.

  • Multiple milestone creation issue for WBS element  'BAPI_PROJECT_MAINTAIN'?

    Hi all,
    I am using 'BAPI_PROJECT_MAINTAIN' to  create Project definition,WBS element & milestone for WBS at once.
    The program is working fine if one wbs element have one milestone.
    But If any of the WBS elements have more than one milestone, the milestones are not creating properly.
    The bottom level WBS milestones are creating for some higher level  WBS. some milestones are not at all
    creating. I am not getting any error message.
    Code for mile stone section is :
    **fill milsestone data for WBS in BAPI structures
            lv_mlstno = lv_mlstno + 1.
            it_wbsmilestone-milestone_number = lv_mlstno.
            it_wbsmilestone-wbs_element  = it_wbsdata-ID.
            it_wbsmilestone-milestone_usage = it_wbsdata-mlstn.
            concatenate it_wbsdata-edatu+6(4) it_wbsdata-edatu+3(2) it_wbsdata-edatu(2) into it_wbsmilestone-FIXED_MILESTONE_DATE_BASIC.
            it_wbsmilestone-SALES_DOC_DATE_INIDICATOR = it_wbsdata-faktp.
            it_wbsmilestone-INVOICE_PERCENTAGE   = it_wbsdata-fproz.
            append it_wbsmilestone.
            clear it_wbsmilestone.
    **fill milsestone data for WBS in BAPI update structures
            it_wbsmilestoneupd-milestone_number = cs_x.
            it_wbsmilestoneupd-wbs_element  = cs_x.
            it_wbsmilestoneupd-wbs_element  = cs_x.
            it_wbsmilestoneupd-milestone_usage = cs_x.
            it_wbsmilestoneUPD-FIXED_MILESTONE_DATE_BASIC = cs_x.
            it_wbsmilestoneupd-SALES_DOC_DATE_INIDICATOR = cs_x.
            it_wbsmilestoneupd-INVOICE_PERCENTAGE   = cs_x.
            append it_wbsmilestoneUPD.
            clear it_wbsmilestoneUPD.
    **Fill bapi table method project1 for the creation of WBS milestone
    **milestone will be created only after the creation of WBS elements first
    **lv_refnum is  the link to wbs element, which is already appened to it_methodproject
              it_methodproject-refnumber   = lv_refnum.
              it_methodproject-objecttype  = 'WBS Milestone'.
              it_methodproject-method      = 'Create'.
              append it_methodproject.
              clear it_methodproject.
          endif.
    How to resolve the issue?
    Please help.
    Thanks,
    vamshi

    Hi Ravi,
    Thanks for your continuous reply.
    The problem is solved.
    I  have passed the, reference number of WBS element  creation to milestone creation  in the 'Method' table.
    Thatswhy it is picking wrongly.
    I have corrected this by passing different reference numbers to WBS and milestone creations
    based on their tables.
    Thanks,
    Vamshi

  • 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

  • Changes don't reflect using BAPI_PROJECT_MAINTAIN through RFC adapter

    Hi,
    I am working on a Integration Scenario in XI. In this I am executing BAPIs through RFC adapter. I am using BAPI_PROJECT_MAINTAIN to create WBS Elements in Project System. After creating WBS Elements when I try to define the hierarchy, the BAPI calls executes successfully but the hierarchy is not visible when viewed in the SAP WEB GUI.
    I am using following parameters to define WBS hierarchy:
    *IMethodProject
        OBJECTTYPE = WBS-HIERARCHY
        METHOD = CREATE
        OBJECTKEY =
        REFNUMBER =
        OBJECTTYPE =
        METHOD = SAVE
        OBJECTKEY =
        REFNUMBER =
    *IProjectDefinition
        PROJECT_DEFINITION = P-0300-00-04
    *IWbsHierarchieTable
        WBS_ELEMENT = WBS-001
        PROJECT_DEFINITION = P-0300-00-04
        UP =
        DOWN = WBS-002
        LEFT =
        RIGHT =
        WBS_ELEMENT = WBS-002
        PROJECT_DEFINITION = P-0300-00-04
        UP = WBS-001
        DOWN =
        LEFT =
        RIGHT =
    In normal case the WBS element 'WBS-002' should move below 'WBS-001', but when I execute BAPI with above parameters, the Hierarchy is not visible in the GUI the both WBS Elements remain at root level, even I get '000' as response with no errors.
    When I run the BAPI through transaction SE37 with same parameters as above, the changes are visible in the GUI.
    Can anyone please tell what am I missing here.
    Thanks & Regards,
    Ajay

    Hi Ajay,
    I understand the problem this way, when u do something thru XI you dont see the effect (even if the the transaction is successful), whereas when it done is directly in the R/3 you can see the output.
      look into the below
    - check if your XI user is having necessary authorisations (you can do this by enabling the trace in ur R/3 - back end system)
    - check if you are passing the input properly in the XI. (like field formats, padding characters, prefixes etc)
    Hope this helps to fix ur issue
    Regards
    Vishnu

  • 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

Maybe you are looking for

  • Address Book column width doesn't stick

    This is very annoying! I'm using Address Book in the "Card & Column" view with the Group, Name and Card columns. Unfortunately the Name column is very narrow, showing only a few characters, which is useless. I can adjust the column width, but wheneve

  • As you call the music on hold to call technical support ?

    as you call the music on hold to call technical support ?

  • Creating mailing labels from an excel worksheet

    I have been following the directions using data merge manager. but I only get the first row name in every label on the page. My excel document is a list of names in 1 column. I want to create 1 label for every name. What am I doing wrong?

  • Extraction for Cube 0PM_C05 requires customizing of table T_PMC05

    Hi can any body tell how to solve this error. Extraction for Cube 0PM_C05 requires customizing of table T_PMC05. Iam loading data to 0PM_C05 CUBE which has a datasource 0PM_PRM_PLCS_1 which is displaying as errors in source systems. This is a plant m

  • Safari crashes every time we open it

    Our Safari was fine until yesterday, but since then has been crashing every time we open it. Grateful for any advice on how to resolve this. Thanks! Madeline Process:     Safari [736] Path:        /Users/madelineroelofsma/Desktop/Safari.app/Contents/