BAPI's for creating of Project and WBS elements in SAP system.

Hi Guys,
             I was able to use a Wrapper FM for creating the
We have a FM which combines 5 different BAPIs
FM/Wrapper: "Z_LEED_PROJ_WBSELEMT_CREATE"
1)      BAPI_PS_INITIALIZATION
2)      BAPI_BUS2001_CREATE
3)      BAPI_BUS2054_CREATE_MULTI
4)      BAPI_PS_PRECOMMIT
5)      BAPI_TRANSACTION_COMMIT
Requirement: To automate the process of creation of Project and WBSE(Tasks) and create an entries in the PS tables based on the user inputs from the user interface in Visual Composer.
Basically user should be able to create the Projects and WBSE.
Issue: We were able to create the Project with the FM (BAPI_BUS2001_CREATE) but having the issue with the creation of WBSE(Tasks), the user will be entering the inputs for Project Definition, Project Profile and WBSE which are to be created in the UI.
The problem is we are not able to create the WBS elements using  BAPI     BAPI_BUS2054_CREATE_MULTI .i will send u the code below .Can anybody correct
   CLEAR it_return.
  CALL FUNCTION 'BAPI_BUS2054_CREATE_MULTI'
    EXPORTING
      I_PROJECT_DEFINITION = i_project_definition-project_definition
    TABLES
      IT_WBS_ELEMENT = it_wbs_element
      ET_RETURN = it_return.
  APPEND LINES OF it_return[] TO et_return[].
Thanks,
Gopi.

Hi Ramiro,
               This is the entire FM code which is below.
""Local Interface:
*"  IMPORTING
*"     VALUE(I_PROJECT_DEFINITION) LIKE  BAPI_BUS2001_NEW STRUCTURE
*"        BAPI_BUS2001_NEW
*"  TABLES
*"      IT_WBS_ELEMENT STRUCTURE  BAPI_BUS2054_NEW
*"      ET_RETURN STRUCTURE  BAPIRET2 OPTIONAL
*"      EXTENSIONIN STRUCTURE  BAPIPAREX OPTIONAL
*"      EXTENSIONOUT STRUCTURE  BAPIPAREX OPTIONAL
  DATA: it_return LIKE STANDARD TABLE OF BAPIRET2 WITH HEADER LINE,
        v_error TYPE boolean VALUE IS INITIAL.
  CLEAR: et_return, it_return.
  CALL FUNCTION 'BAPI_PS_INITIALIZATION'.
Do checks for creating project definition
  CALL FUNCTION 'BAPI_BUS2001_CREATE'
    EXPORTING
      I_PROJECT_DEFINITION = i_project_definition
    TABLES
      ET_RETURN = it_return.
  APPEND LINES OF it_return[] TO et_return[].
  LOOP AT it_return.
    IF it_return-type CA 'EAX'.
      CALL FUNCTION 'BAPI_TRANSACTION_ROLLBACK'.
      v_error = 'X'.
      EXIT.
    ENDIF.
  ENDLOOP.
  IF v_error = 'X'.
    EXIT.
  ENDIF.
Do checks for creating WBS elements
  CLEAR it_return.
  CALL FUNCTION 'BAPI_BUS2054_CREATE_MULTI'
    EXPORTING
      I_PROJECT_DEFINITION = i_project_definition-project_definition
    TABLES
      IT_WBS_ELEMENT = it_wbs_element
      ET_RETURN = it_return.
   APPEND LINES OF it_return[] TO et_return[].
  LOOP AT it_return.
    IF it_return-type CA 'EAX'.
      CALL FUNCTION 'BAPI_TRANSACTION_ROLLBACK'.
      v_error = 'X'.
      EXIT.
    ENDIF.
  ENDLOOP.
  IF v_error = 'X'.
    EXIT.
  ENDIF.
  CALL FUNCTION 'BAPI_PS_PRECOMMIT'
    TABLES
      ET_RETURN = it_return.
   APPEND LINES OF it_return[] TO et_return[].
  LOOP AT it_return.
    IF it_return-type CA 'EAX'.
      CALL FUNCTION 'BAPI_TRANSACTION_ROLLBACK'.
      v_error = 'X'.
      EXIT.
    ENDIF.
  ENDLOOP.
  IF v_error = 'X'.
    EXIT.
  ENDIF.
  CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'
    EXPORTING
      WAIT = 'X'.
ENDFUNCTION.
  can u please look at the code and let me know the changes?
Thanks,
Gopi.

Similar Messages

  • CJ20N: handle Z table's related to project and wbs element

    Hi there,
    The requirement is to handle Z table for project and wbs element.
    Example:
    ZTAB1 has fields: pspnr | field1 | field2 (for projects)
    ZTAB2 has fields: pspnr | field3 | field4 (for wbs element)
    I found an enhancement that can read z table into internal table, i read it into screen and no problem.
    I use it for wbs element too.
    The problem is when the project has several wbs element's in tree, and the user navigate and change them.
    I can't control the data in internal tables, since the user is swithcing.
    How does the standard sap control the memory from each wbs element and project?
    How can i read and save it separatelly?
    Thanks in advance,
    Edited by: orgasmics on Nov 22, 2010 9:37 PM

    Hi,
    try table <b>jest</b> with key = prps-objnr
    Andreas

  • Extract in a file all deleted PROJECTS and WBS element

    hello everyone,
    i need  to create a file wich contain all projects and wbs element  deleted by the transaction CJ20 , but i dont know how to pick those data once someone is trying to delete.
    please help.
    thank you.

    hello everyone,
    i need  to create a file wich contain all projects and wbs element  deleted by the transaction CJ20 , but i dont know how to pick those data once someone is trying to delete.
    please help.
    thank you.

  • Locking of  the Project and WBS Elements at a single step.

    Hi Experts,
                    My client requirement is to lock the complete project and wbs elements so as not to allow any further postings to the project, I knew that we can lock the project or WBS individually by setting the lock status, but i want to lock the complete project  at one step, Is there any possible standard setting to sort out my Issue if not give me the solution.
    Thanks & Regards,
    RAM.

    V RAM PRADEEP REDDY wrote:
    it is possible to set a lock for Project Definition & WBS Elements at a single shot or not.
    >
    >
    may be the below explanation will be helpful.
    You can open the project in CJ20N for example and can set the lock for project definition and also you can set the lock for WBS element without saving and exiting from CJ20N, after setting the lock for both project definition and WBS Element you can save and exit.
    It is not possible to select more than one object and set lock with one click.

  • How to find the Project and wbs Element System Status

    Hi all,
      How to find the Project and wbs Element System Status.
      We can find the system status in the CJ20n transaction but I want the table and field name where it is stored.
    Regards
    Raghavendra

    Hi,
    try table <b>jest</b> with key = prps-objnr
    Andreas

  • Creating projects and wbs elements

    I am running a conversion and for the upload portion I need to create projects and the relevant wbs elements in the system.  I have been looking over the forums etc and have seen many notes regarding BAPI_BUS2001_SET_STATUS, BAPI_PROJECTDEF_CREATE, and BAPI_PROJECT_MAINTAIN.
    My problem is this.
    I need to update the APPR and PREP system statuses of the projects I create and I can find no way to do this with a BAPI.  I also need to update the location of the project (stort) and the only BAPI I can find that will allow me to do this is BAPI_PROJECT_SAVEREPLICA which seems incorrect to use in this manner.
    in short:
    How do I update project system status of PREP and APPR?
    How do I update project location (stort)?
    Having no luck finding solutions so any help is appreciated.

    Hi,
    I've used these BAPIs but not for your fields. But maybe I can help you. There is no field LOCATION in the project definition but there is field LOCATION on WBS level. So have you tried to change this field on all WBS elements for your project?
    Unfortunately your system statuses are not supported by this BAPI. All supported statuses are mentioned in BAPI documentation. There is a FM STATUS_UPDATE_PROJECT which might help you but you need to be careful what you do. There are some additional FM STATUS_* for generic object status modification but again, you have to be sure that you can set up that system status without any additional checks.
    Good luck

  • Is it possible for creating draft BOM and fix approvals in SAP BI

    Can we create draft BOM and set approval for BOM ? If any changes are made in BOM after approval this can be set as amendment to the original BOM.

    Actually to which of the infocpackage it will give priority. 3.5 or 7.3?
    Also I just want to ask that , as in your first reply you said that the cubes cannot be upgraded .... but why?
    And if I am doing new fresh implementation ...........will there be any prerequisites?

  • Standard network not creating project and WBS automatically

    Hi,
    I have a standard network with a standard WBS assignment at BOTH header and activity levels.
    I created a link to a material in CN08 with this standard network.
    Assembly processing has been configured.
    When creating a sales order, entering the material... the network create screen appears and the system requests a WBS element.
    At this point the system should have created the WBS element.
    When I insert an existing active WBS element as a test..., the system message indicates that the network is already assigned to a Std WBS element.
    Why is the system not using this assignment to create a project and WBS element form the standard structure?
    Thanks

    Hi,
    As a test...
    I've removed the linking of the material and standard network in CN08 - and the system now displayed a screen asking for standard network details.
    I create the material and standard network link again in CN08 - and I'm back to the original issue of the network create screen appearing, but the WBS field is blank. The system is not generating the WBS.
    So - the system is recognizing the link of the material entered in the sales order and the standard network via CN08. But its not using the Standard WBS used in the standard network AND CN08 setup....
    Note: The Std WBS has the planning and  billing indicator ticked.
    Once again, when creating the sales order, I get the network create screen asking for a WBS element. If I insert an existing WBS element I get the message below. The issue is - I know the standard WBS assignment exists, why isn't the system generating a new operative WBS at this point?
    An assignment to a standard WBS element already exists
    Message no. CN044
    Diagnosis
    You have created a network by copying from a standard network. The standard network is assigned to a standard WBS.
    However, at the same time, you have made your own assignments to WBS elements.
    System Response
    When you manually make assignments to WBS elements, the system does not necessarily take the asignments in the standard stuctures into account.
    Procedure
    When you call up the function replace standard WBS or when you save the network you decide whether the manually created WBS assignments or those fronm the standard structures are copied.

  • 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

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

  • BAPI for Production order creation against wbs element

    dear all,
    I am using BAPI (BAPI_PRODORD_CREATE) for Production order creation against wbs element.I am putting following input paramters in this
    material no,
    order type
    plant
    qty
    basic start dt & end dt
    wbs
    But during GRN it is not taking the account assignment as project stock i.e. its picking movement type 101 but it should be 101Q.
    For this what changes are required.
    regards
    ravi arora

    Hi,
    2 options i can think of:
    1. Create a BDC program by recording co10
    2. Create a planned order with order type PR using BAPI_PLANNEDORDER_CREATE, specify the WBS element & other details. Now use BAPI_PRODORD_CREATE_FROM_PLORD to create a production order with reference to the planned order created earlier.
    I believe option 2 should meet your need. Check & revert.
    Regards,
    Vivek

  • Finding Project and WBS status

    Hello Abap experts,
    I want to get a downloaded list of the status of each project or WBS element in the system. I cannot find this information in any of the project or WBS tables nor can I find a FM or BAPI to do this.
    Does anybody out there know how this can be done?
    Thank you

    Hi,
    As you may already know, WBS Elements are stored in table PRPS.  To get a WSV status, you have to read the table JEST with field OBJNR = PRPS-OBJNR.  This will give you all status codes of a WBS element.  If you need the status texts, also read the TJ02T table.
    Eric

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

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

  • 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

Maybe you are looking for

  • How do I fix this error?

    I have this pop-up as you can see in the image, but I cannot click any buttons (Allow/Deny) with my arror/mouse. I'm using Google Chrome, Windows 7, 64-bit, and the latest version of Flash. I think the problem may be because I have increased the font

  • Entry in SLD for SAP delivered software component contents

    Hi    I have a predelivered software component version ( SWCV )  ESA ECC-SE 602 which I imported into IR  ( by setting the *tpz file in the appropriate folder and the imported from IR ) This worked ok. Now I have a custom SWCV - that I created in SLD

  • How do I fix this problem with my iTunes?

    I've been having problems with my iTunes for over a week now - since I tried to update to iOS 5 - and I've tried everything. I've had to uninstall iTunes multiple times and each time I have reinstalled it, there has been some form of error, the list

  • Trouble with Airport Extreme Installation

    I also posted this on the Emac forum but decided it'd be best to spread the question around. I just bought an Airport Extreme card 802.11g. I'm following the instructions, but when I turn it on it doesn't connect to a network nor does it even show up

  • XI3.0 and Performance Managment

    All, I have downloaded and installed XI3.0 in a local virtual machine using the Performance Manager BOE Premium Bundle license key from ESD. It all installs fine but I get no EPM demo dashboards (Total Electronics). I do however have in C:\Program Fi