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

Similar Messages

  • Extension structure for a bapi to create project definition and wbs element

    Hi,
    is there a bapi that have an extension structure for custom fields, that can be used to create a project with wbs elements.
    thanks for your help.

    i yhink BAPI_PROJECT_MAINTAIN  dont have extension structure, so i cant use it because i have custom fields.
    BAPI_BUS2054_CREATE_MULTI seems meet my requirement because it has extension structure,

  • How to block reusage of archived Project definition and WBS element numbers

    Dear All,
    We have archived our projects using the TC SARA and the Project definition and WBS elements numbers no more exist in tables PROJ and PRPS etc.. When I now try to create a new project, the system proposes the next open number or allows to enter a number which is the same as one of the archived projects. But in our organization we cannot reuse the Project definition and WBS element numbers (even if it is archived) as a rule.
    Can anybody guide me what are the possibilities to block or avoid the reusage of the numbers of archived project definition and WBS elements in a fool-proof way? 
    Thanks and regards

    One Workaround:
    Use T code OPSJ and lock the project coding mask. Doing this you can not use this mask any more.
    But you want to continue using the mask but with different numbers. Not sure how this can be acheived. lets wait for others view
    Regards
    Sreenivas

  • Creation of project definition and wbs element

    I want creation of project definition and wbs element upto 4 level using bapis.
    i am using transaction cj27,cj01,cj02
    which function module to use for this??

    Hi,
    to create project definition with customer fields the BAPI you should use is : BAPI_BUS2001_CREATE
    to create WBS elements with different levels and specific fields the BAPI you should use is BAPI_BUS2054_CREATE_MULTI
    these bapi must be used in the sequence of call :
    BAPI_PS_INITIALIZATION
    BAPI_BUS2001_CREATE / BAPI_BUS2054_CREATE_MULTI
    BAPI_PS_PRECOMMIT
    BAPI_TRANSACTION_COMMIT
    before using the bapi, you must apply OSS note :
    637345 - Syntax error with enhanced PS tables
    i sent you the oss note to your mail
    please reward points if helpfull.

  • ERROR When Create Project

    Hello,
    I receive this below error when create project 
    GeneralQueueJobFailed (26000) - CreateWssSite.CreateWssSiteMessage. Details: id='26000' name='GeneralQueueJobFailed' uid='c27f372b-2a35-e311-9420-00155d000806' JobUID='05a50b2a-2a35-e311-9420-00155d000806' ComputerName='cb123222-a0b2-4ad1-bd20-3e4809df7a4a'
    GroupType='CreateWssSite' MessageType='CreateWssSiteMessage' MessageId='1' Stage='' CorrelationUID='58b84c9c-8266-f0a7-f7a4-a41dcfc7411f'. For more details, check the ULS logs on machine
    cb123222-a0b2-4ad1-bd20-3e4809df7a4a for entries with JobUID
    05a50b2a-2a35-e311-9420-00155d000806

    Hi Khaleel,
    Do you see only this message or do you also see something like below:
    CreateWssSiteContent: Creating project site failed! Project Uid=8e180c10-5433-4424-a236-54ea989872fa, site URL=http://PROJECT.test.com/PWA/AAAtest1000, site name=AAAtest1000. Microsoft.SharePoint.SPException: The site template requires that the Feature {e8389ec7-70fd-4179-a1c4-6fcb4342d7a0}
    be installed in the farm or site collection. at Microsoft.SharePoint.Utilities.SPUtility.ThrowSPExceptionWithTraceTag(UInt32 tagId, ULSCat traceCategory, String ......
    So, if you see the above message, its a feature that is missing. How many servers do you have in the farm? Do you have a separate project application service server?
    In that case you will have to copy the feature under "14\TEMPLATE\FEATURES" features folder from WFE to application server also. This is because when creating a project workspace, PSI will refer to this feature on application
    server and since it is not present in application server, it fails creating the site.
    Happy troubleshooting.....
    Vikram Daruru - MSFT

  • Enhancement for project definition and WBS element.

    Hi Experts,
    I have a client requirement for creation of the custom specific fields for the project definition and the WBS element level called IT relevant and they need to use this fields for the purpose of structured reporting in PS.Can you please guide me as to how do in need to do this.
    When i go in to the transaction CMOD and SAP Program SAPMSMOD it says you are not authorised.Please let me know the process as to how it has to be done.
    Thanks for your cooperation.
    Shivkumar

    Refer the IMG documentation against the SPRO node 'Create Customer-Specific Fields in a Project Definition' and 'Create Customer-Specific Fields in a WBS'.
    Regards
    Sreenivas

  • Error when creating project for ESS

    I am getting the folowing error when creating a project in Dev Studio for the ESS leave application ess~lea. Pls help
    Failed to sync DC "sap.com/ess/lea(sap.com_SAP_ESS_1)" in configuration "JDI_XSSTrack_D". File "C:\Documents and Settings\User\.dtc\0\DCs\sap.com\ess\lea\_comp\.dcdef" does not exist locally after sync but it exists on the serve
    Regds
    Thirur

    Uninstalled and reinstalled the dev studio. Now it works.

  • BAPI/FM for setting the user status for the Project definition and WBS elem

    Hi,
    I have to set the User Status for the Project Definition and the WBS elements in that project.
    The User status to be set is the same for the project and wbs elements.
    Please let me know if there is any BAPI/FM to set the user status..
    Thanks in advance.
    Regards
    Shiva

    Hi Shkithija,
    There is a dump encoutered in the form "PS_FLAG_GET_GLOBAL_FLAGS" for 'chk_precommit_ok' in the "BAPI_PS_PRECOMMIT".
    But it is showing SY-SUBRC = 0 when used along with BAPI_TRANSACTION_COMMIT.
    May i know what are input parameters we need to pass it to "BAPI_PS_PRECOMMIT".
    Do you have any idea.
    Please let me know
    Regards
    vishnu

  • Grey field for project definition and WBS element

    Dear all,
    I have created a project and WBS element in CJ01. Now I go via CJ02 to the change mode and the project ID and WBS element ID is not greyed out. But I would like that the system shows these key fields as not changeable anymore, only fields like description should be changable. Can you please tell me, which customizing step I missed to get the grey field for project ID/WBS element ID?
    FYI  I do not use a project mask to create the project.
    Thanks for your answer.
    Heidi

    Hi Heidi ,
    I don't think you can grey out the Project Definition and the WBS Element fields after the creation .
    If you want to restrict the users to change the Proj definition and WBS , a better way is through
    Authorization objects and restricting only specified users to change the WBS
    Kish

  • How to use Classification Characteristics for project definition and WBS

    dear all:
    my step is below:
    1,  CT04, create "Characteristic"
    2,  CL02, create "Class". and class type is "14".
    3,  now how to customize to use the class in project definiton and WBS.
    Please explain me all the steps to be required.
    Thanks in advance!

    Hi
    Classification is only assigned for the network profile or in the activity.
    CJ20N  -
    > Extra ---> Classification --- > Classification
    Hope this will help you.
    Regds,
    Uddhab

  • CADO Report - Missing Project Definition and WBS elements

    While running CADO (time sheet data) report for employee, data is not being pulled up for the WBS Element and Project Definition. What could be the reason? Here time is entered against a network activity but for some entries WBS element and project definition is dispalyed and for remaining it is not.

    Yes....these activities are assigned to the WBS element in the project. As I mentioned earlier for the same activity in some cases WBS element is populated.

  • Error when creating project from template

    I'm getting an error when i try to create a project from template. It's the same error no matter which template i select.
    WebIDE: 1.9.3.1
    Is there a new setting i missed or...?

    Henrik Damhøj Andersen
    Problem has been resolved. Please check again.
    Regards,
    JK

  • Getting error when creat sales order and Stock Posting

    Hi
    I have created enterprise structure, xd01, mm01, ovkk but I count't post stock.
    When create sales order getting error is that
    1.This material is not defined for sales area 1000, 10, 00.
    And if i use this T.Code MB1C,
    2. Parameters for plant 1000 not maintained in Inventory Mgt.,
    *3. Unit *** is not created in language EN.*
    Thanks in advance

    Dear selvi sankaran
    1)  Compare the sales organization, distribution channel and division of customer and material.  In your case, either of that should have been created differently.  Maintain the same sales area and retry
    2)  Go to omi8 and maintain the required parameters to your plant
    3)  Go to Material Master, select "Additional data" and click on "Descriptions".  There maintain "EN" under language.
    thanks
    G. Lakshmipathi

  • VS15 + IoT: Error when creating project

    Hello everyone!
    I'm facing a problem that I don't know how to fix it when creating a project of type "Windows IoT Core":
    I followed step by step the program for IoT.
    Anyone have an idea?
    Thanks in advance.
    Mafyou.
    Cordialement, Mafyou.

    Figure out: install VS15 RC
    Cordialement, Mafyou.

  • Different profit center in Project definiton and  WBS

    Hi,
    Our client facing a problem for closing the project due to  different profit center. In Project definition  the assigned on profit center and WBS they assigned another different profit center . There is not data posted or planed .
    SAP won't allow me to change the Profit Center because it says the project is released.
    Now they try to  close the project but it showing error like different profit center in project definition and  wbs.
    Could you please anybody help to solve this issue?
    Thanks.
    V.K

    From the error message It seems there is a validation using Field exit. Ask your abaper to debug. Then would be able to know the logic behind it.
    Venkat

Maybe you are looking for

  • Since updating to itunes 11, Home Sharing is not working

    Since updating to itunes 11, Home Sharing is not working. I am running Windows 7, 64-bit. All mobile devices are up to date with ios, including 2 apple tvs (2 & 3), iphone 4s and 3gs, ipad1 & ipad2. I've rebooted twice, turned home sharing off, then

  • Invalid B-tree node and disk stuck

    Last night my 2 year old iMac froze up. When I re-started I received the flashing question-mark folder. I ended up inserting my OS X install disk and attempting to run the Disk Utility. I tried to repair the disk, but got the "Invalid B-tree node siz

  • Deleting files that TC has backed up

    I have a feeling this is going to be an incredibly stupid question, but ... once the T.C. has backed up my hard drive, is it safe to delete any and all files from my hard drive, at least all the ones that not essential to the OS and applications, etc

  • Recognising iPod Touch as Camera, however able to connect to iTunes

    I have a Vista laptop and a Windows XP desktop computer. At first, I used my iPod with my computer as it was the main scource of music. Unofrtunately my computer broke and we lost all files and programmes. Therefore I started using my laptop. However

  • No Scroll bars in Bridge cs5 Win7

    The title explains the issue.  I've searched the forum -- as in used the search tool -- and did not come up with an answer. I have far more thumbnails than the viewpane can show at a size I find acceptable and yet I'm fourced to use my scroll wheel t