Creation of WBS Element in level 2 for transation CJ01.

Hello All,
I am able to create WBS element for only one level for the transaction Cj01 through BAPI "BAPI_BUS2054_CREATE_MULTI"
Can anybody tell me how to create the WBS element in the level 2 below the first WBS element.
Thanks,

Hi
Check the link:
http://www.sdn.sap.com/irj/scn/weblogs;jsessionid=(J2EE3417800)ID0451304650DB10061726740868935361End?blog=/pub/wlg/9659
Regards,
Sreeram

Similar Messages

  • Find WBS element of level 3 for all WBS elements underneath

    Hello
    I need to find WBS element of level 3 for WBS underneath (level 4, 5, 6, 7........). What is the esiest way to do it?
    Shall I use WBS element structure CP-1061-01-01  ..... or a techinal id of wbs element.
    Thanks

    Hi,
    Check the below link it may help you
    http://help.sap.com/saphelp_dimp50/helpdata/EN/d3/a5112fe32311d1a6ab0000e83235d4/frameset.htm
    Regards,
    Marasa.

  • 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

  • Issue in BAPI_PS_PRECOMMIT in mass creation of WBS Elements

    Hi,
    I am facing a issue with BAPI_PS_PRECOMMIT.
    we have the following WBS Hierarchy:
    S - Proj, (level1)
    S-XXX WBS Element (level2)
    S-XXX-001 WBS Element (level3)
    I have created a program for mass creation of WBS elements creation
    which uses the following BAPI's
    BAPI_PS_INITIALIZATION
    BAPI_BUS2054_CREATE_MULTI
    BAPI_PS_PRECOMMIT
    BAPI_TRANSACTION_COMMIT
    The proj: 'S' and the level2 WBS element: 'S-XXX' already exist in the system.
    When I run the program for delta load, so as to create the following level3 WBS elements:
    S-XXX-001
    S-XXX-002
    S-XXX-003
    The system is throwing the following errors at the BAPI_PS_PRECOMMIT:
    1. Final Check of the project definition and WBS elements: Error
    2. Validation unsuccessful
    Pls help me on this.
    Thanks,
    Deepak

    Check the WBS elements doesn't exist already in your system.
    Here is what I coded some days back for deletion of Network Activities, most of the things are same.
    You are doing for WBS element.
    * Call to initialization BAPI Before Delete
          CALL FUNCTION 'BAPI_PS_INITIALIZATION'.
    * Call to Network Activity Deletion BAPI
          CALL FUNCTION 'BAPI_BUS2002_ACT_DELETE_MULTI'
            EXPORTING
              i_number           = t_bapi_activity-network
            TABLES
              it_delete_activity = l_t_del_vornr
              et_return = l_t_bapiret2.
          DELETE l_t_bapiret2 WHERE type <> 'E'.
          READ TABLE l_t_bapiret2 INDEX 1.
          IF sy-subrc EQ 0.                                      "If error in Deletion
            MOVE: f_idoc_contrl-docnum TO t_idoc_status-docnum,
                  l_t_bapiret2-type TO t_idoc_status-msgty,
                  'CNIF_PI' TO t_idoc_status-msgid,
                  l_t_bapiret2-number TO t_idoc_status-msgno,
                  l_t_bapiret2-message TO t_idoc_status-msgv1.
                  MOVE c_idoc_status_error TO t_idoc_status-status.
                  APPEND t_idoc_status.
                  ROLLBACK WORK.
                  EXIT.
          ELSE.                                                  "If Delete is successful COMMIT
    * Call to PreCOMMIT BAPI
            CALL FUNCTION 'BAPI_PS_PRECOMMIT'
             TABLES
               ET_RETURN       = l_t_bapiret3.
    * Call COMMIT BAPI
    *        CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'.
          ENDIF.
    The other solution is use BAPI_PROJECT_MAINTAIN.

  • WBS element field mandatory for specific sales order

    Hi Friends,
    I want to make the WBS element field in sale order line item to be mandatory for a specific sales order type. I am not able to add this field in incompletion log also. So can anyone let me know the solution for this.
    Ratna

    Hi,
    As solution suggest above is correct use VBAP table and Field is PS_PSP_PNR into ur incompletion log and assign this procedure to ur Item category. And If u want to WBS element check at header level the use VBAK table and field PS_PSP_PNR and assign this incompletion log to ur sales document type.
    Once more setting is required to stop the order from saving if incompletion check is unsucessful, for that you need to check a checkbox named "Incomplete. Message" in VOV8 tcode, for ur perticular sales document types.
    Hope this will resolve ur problem.
    rgds
    Dhiraj

  • Creation of WBS Element Hierarchy

    Hi Friends,
    I have input file like the below(1 Project definition and n WBS elements)
    Project Definition     WBS Element
    HE-000200     
                         HE-000200.01
                         HE-000200.01.00001
                         HE-000200.01.00002
                         HE-000200.02
                         HE-000200.02.00001
                         HE-000200.02.00002
                         HE-000200.03
                         HE-000200.03.00001
                         HE-000200.03.00002
                         HE-000200.04
                         HE-000200.04.00001
                         HE-000200.04.00002
    I created Project Definition HE-000200 by using BAPI_BUS2001_create.
    Now I want to create above WBS elements hierarchy for the above project.
    I am using the BAPI_BUS2054_create_multi.
    is it possitble to create wbs elemnents like the baove hierarchy by using BAPI_BUS2054_create_multi? if yes send me the code , it will help to me.
    !!!!! IT is very urgent.
    Waiting for your inputs
    Regards,

    Hi Raju,
    See this .,.,this might help u.,.,
    *& Include ZBAPIWBS
    *& Report Z_BAPI_CJ20N
    REPORT Z_BAPI_CJ20N.
    INCLUDE ZBAPICJ20NTOP.
    INCLUDE ZBAPICJ20NFILEUP.
    INCLUDE ZBAPICJ20NLOGIC.
    *& Include ZBAPICJ20NTOP
    DATA: BEGIN OF ITMAIN OCCURS 0,
    PROJECT_DEFINITION TYPE PS_PSPID,
    DESCRIPTION TYPE PS_POST1,
    PROJECT_PROFILE TYPE PROFIDPROJ,
    BUS_AREA TYPE GSBER,
    WBS_ELEMENT TYPE PS_POSID,
    WBS_DESCRIPTION TYPE PS_POST1,
    END OF ITMAIN,WA_MAIN LIKE LINE OF ITMAIN,ITWBS LIKE STANDARD
    TABLE OF ITMAIN WITH HEADER LINE, ITMAIN2 LIKE STANDARD TABLE OF
    ITMAIN.
    DATA: ITPRJDEF TYPE STANDARD TABLE OF BAPI_PROJECT_DEFINITION WITH
    HEADER LINE,WA_PRJDEF LIKE LINE OF ITPRJDEF.
    DATA: ITPRJDEFUP TYPE STANDARD TABLE OF BAPI_PROJECT_DEFINITION_UP WITH
    HEADER LINE, WA_PRJDEFUP LIKE LINE OF ITPRJDEFUP.
    DATA: ITMETPRJ TYPE STANDARD TABLE OF BAPI_METHOD_PROJECT,
    WA_METPRJ LIKE LINE OF ITMETPRJ.
    DATA: RETURN TYPE BAPIRETURN1,MSG TYPE STANDARD TABLE OF
    BAPI_METH_MESSAGE WITH HEADER LINE.
    DATA: LINES TYPE I,REFNO TYPE I VALUE 0.
    DESCRIBE TABLE ITMAIN LINES LINES.
    DATA: METTYPE TYPE STRING VALUE 'Create'.
    DATA: WA_DUPLI LIKE LINE OF ITMAIN.
    WA_DUPLI-PROJECT_DEFINITION = 'JB'.
    DATA: SPLIT1(50) TYPE C.
    DATA: PREVWBS TYPE PS_POSID VALUE ' ',
    LEFTWBS TYPE PS_POSID VALUE ' '.
    DATA: POS TYPE I VALUE 1.
    DATA: OFF TYPE I VALUE 0,MODE TYPE I,INDEX1 TYPE I VALUE 0,
    INDEX2 TYPE I VALUE 0,INDEX3 TYPE I VALUE 0,
    INDEX4 TYPE I VALUE 0,INDEX5 TYPE I VALUE 0,
    POS2 TYPE I VALUE 0,FLAG TYPE I VALUE 0.
    DATA: ITBUS TYPE STANDARD TABLE OF BAPI_BUS2054_NEW,
    WA_BUS LIKE LINE OF ITBUS, RET TYPE STANDARD TABLE OF BAPIRET2,
    WA_RET LIKE LINE OF RET, ITBUS2 LIKE STANDARD TABLE OF BAPI_BUS2054_NEW,
    WA_BUS2 LIKE LINE OF ITBUS, WA_BUS3 LIKE LINE OF ITBUS.
    DATA: BAPIRET TYPE BAPIRETURN1,
    PROJEX TYPE BAPI_PROJECT_DEFINITION_EX.
    *& Include ZBAPICJ20NFILEUP
    CALL FUNCTION 'UPLOAD'
    EXPORTING
    FILENAME = ' '
    FILETYPE = 'DAT'
    TABLES
    DATA_TAB = ITMAIN .
    *& Include ZBAPICJ20NLOGIC
    SORT ITMAIN BY PROJECT_DEFINITION WBS_ELEMENT.
    LOOP AT ITMAIN INTO WA_MAIN.
    IF WA_DUPLI-PROJECT_DEFINITION <> WA_MAIN-PROJECT_DEFINITION.
    WA_PRJDEF-PROJECT_DEFINITION = WA_MAIN-PROJECT_DEFINITION.
    WA_PRJDEF-DESCRIPTION = WA_MAIN-DESCRIPTION.
    WA_PRJDEF-PROJECT_PROFILE = WA_MAIN-PROJECT_PROFILE.
    WA_PRJDEF-BUS_AREA = WA_MAIN-BUS_AREA.
    WA_PRJDEFUP-PROJECT_DEFINITION = 'X'.
    WA_PRJDEFUP-DESCRIPTION = 'X'.
    WA_PRJDEFUP-PROJECT_PROFILE = 'X'.
    WA_PRJDEFUP-BUS_AREA = 'X'.
    WA_METPRJ-REFNUMBER = REFNO + 1 .
    WA_METPRJ-OBJECTTYPE = 'ProjectDefinition'.
    WA_METPRJ-METHOD = METTYPE.
    WA_METPRJ-OBJECTKEY = WA_MAIN-PROJECT_DEFINITION.
    APPEND WA_METPRJ TO ITMETPRJ.
    WA_METPRJ-REFNUMBER = ''.
    WA_METPRJ-OBJECTTYPE = ''.
    WA_METPRJ-METHOD = 'Save'.
    WA_METPRJ-OBJECTKEY = ''.
    APPEND WA_METPRJ TO ITMETPRJ.
    CALL FUNCTION 'BAPI_PROJECT_MAINTAIN'
    EXPORTING
    I_PROJECT_DEFINITION = WA_PRJDEF
    I_PROJECT_DEFINITION_UPD = WA_PRJDEFUP
    IMPORTING
    RETURN = RETURN
    TABLES
    I_METHOD_PROJECT = ITMETPRJ
    E_MESSAGE_TABLE = MSG.
    IF SY-SUBRC = 0.
    FLAG = 1.
    ENDIF.
    WA_DUPLI-PROJECT_DEFINITION = WA_MAIN-PROJECT_DEFINITION.
    COMMIT WORK.
    DELETE ITMETPRJ FROM 1 TO 2.
    INCLUDE ZBAPIWBS_ALL.
    ENDIF.
    ENDLOOP.
    *& Include ZBAPIWBS_ALL
    LOOP AT ITMAIN INTO WA_MAIN WHERE PROJECT_DEFINITION = WA_DUPLI-PROJECT_DEFINITION.
    APPEND WA_MAIN TO ITWBS.
    ENDLOOP.
    *Sort the table
    LOOP AT ITWBS INTO WA_MAIN.
    SPLIT1 = WA_MAIN-WBS_ELEMENT.
    POS = 0.
    LOOP AT ITWBS WHERE WBS_ELEMENT <> SPLIT1.
    IF STRLEN( ITWBS-WBS_ELEMENT ) = STRLEN( SPLIT1 ).
    IF POS = 0.
    APPEND WA_MAIN TO ITMAIN2.
    ENDIF.
    APPEND ITWBS TO ITMAIN2.
    DELETE ITWBS WHERE WBS_ELEMENT EQ ITWBS-WBS_ELEMENT.
    POS = 1.
    ELSE.
    IF POS = 0.
    APPEND WA_MAIN TO ITMAIN2.
    DELETE ITWBS WHERE WBS_ELEMENT EQ WA_MAIN.
    ENDIF.
    POS = 1.
    ENDIF.
    ENDLOOP.
    INDEX1 = INDEX1 + 1.
    ENDLOOP.
    *Define UP element
    LOOP AT ITMAIN2 INTO WA_MAIN.
    WA_BUS-WBS_ELEMENT = WA_MAIN-WBS_ELEMENT.
    WA_BUS-DESCRIPTION = WA_MAIN-WBS_DESCRIPTION.
    WA_BUS-WBS_UP = ''.
    WA_BUS-WBS_LEFT = ''.
    SPLIT1 = WA_MAIN-WBS_ELEMENT.
    LOOP AT ITMAIN2 INTO WA_MAIN WHERE WBS_ELEMENT <> SPLIT1.
    IF STRLEN( WA_MAIN-WBS_ELEMENT ) < STRLEN( SPLIT1 ) .
    FIND WA_MAIN-WBS_ELEMENT IN SPLIT1.
    IF SY-SUBRC = 0.
    WA_BUS-WBS_UP = WA_MAIN-WBS_ELEMENT.
    PREVWBS = WA_MAIN-WBS_ELEMENT.
    ENDIF.
    ENDIF.
    ENDLOOP.
    APPEND WA_BUS TO ITBUS.
    INDEX2 = INDEX2 + 1.
    ENDLOOP.
    PREVWBS = ''.
    LEFTWBS = ''.
    Define LEFT ELEMENT.
    LOOP AT ITMAIN2 INTO WA_MAIN.
    POS = 0.
    SPLIT1 = WA_MAIN-WBS_ELEMENT.
    READ TABLE ITBUS INTO WA_BUS2 WITH KEY WBS_ELEMENT = WA_MAIN-WBS_ELEMENT.
    WA_BUS-WBS_ELEMENT = SPLIT1.
    WA_BUS-DESCRIPTION = WA_MAIN-WBS_DESCRIPTION.
    WA_BUS-WBS_UP = WA_BUS2-WBS_UP.
    OFF = SY-TABIX.
    LOOP AT ITMAIN2 INTO WA_MAIN WHERE WBS_ELEMENT <> SPLIT1.
    READ TABLE ITBUS INTO WA_BUS3 WITH KEY WBS_ELEMENT = WA_MAIN-WBS_ELEMENT.
    IF STRLEN( WA_BUS2-WBS_ELEMENT ) = STRLEN( WA_BUS3-WBS_ELEMENT ) AND
    WA_BUS2-WBS_UP = WA_BUS3-WBS_UP AND POS = 0.
    IF STRLEN( LEFTWBS ) <> STRLEN( SPLIT1 ).
    LEFTWBS = ''.
    ENDIF.
    IF STRLEN( LEFTWBS ) = STRLEN( SPLIT1 ).
    FIND WA_BUS2-WBS_UP IN LEFTWBS.
    IF SY-SUBRC <> 0.
    LEFTWBS = ''.
    ENDIF.
    ENDIF.
    WA_BUS-WBS_LEFT = LEFTWBS.
    LEFTWBS = SPLIT1.
    POS = 1.
    MODIFY ITBUS INDEX OFF FROM WA_BUS.
    ENDIF.
    ENDLOOP.
    ENDLOOP.
    WA_BUS-WBS_ELEMENT = ''.
    APPEND WA_BUS TO ITBUS.
    Store WBS ELEMENTS.
    LOOP AT ITBUS INTO WA_BUS.
    SPLIT1 = WA_BUS-WBS_ELEMENT.
    APPEND WA_BUS TO ITBUS2.
    INDEX3 = 1.
    POS = 0.
    LOOP AT ITBUS INTO WA_BUS WHERE WBS_ELEMENT <> SPLIT1.
    IF STRLEN( WA_BUS-WBS_ELEMENT ) <> STRLEN( SPLIT1 ) AND POS = 0.
    POS = 1.
    INDEX4 = INDEX3.
    CALL FUNCTION 'BAPI_PS_INITIALIZATION' .
    CALL FUNCTION 'BAPI_BUS2054_CREATE_MULTI'
    EXPORTING
    I_PROJECT_DEFINITION = WA_DUPLI-PROJECT_DEFINITION
    TABLES
    IT_WBS_ELEMENT = ITBUS2
    ET_RETURN = RET .
    CALL FUNCTION 'BAPI_PS_PRECOMMIT'
    TABLES
    ET_RETURN = RET.
    CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'
    EXPORTING
    WAIT = 'X'
    IMPORTING
    RETURN = WA_RET.
    ENDIF.
    APPEND WA_BUS TO ITBUS2.
    INDEX3 = INDEX3 + 1.
    ENDLOOP.
    DELETE ITBUS2 FROM 1 TO INDEX3.
    DELETE ITBUS FROM 1 TO INDEX4.
    ENDLOOP.
    DELETE ITWBS FROM 1 TO INDEX1.
    CLEAR ITWBS.
    DELETE ITMAIN2 FROM 1 TO INDEX2.
    *At the end of all projects' processing
    IF FLAG = 1.
    CALL FUNCTION 'POPUP_FOR_INTERACTION'
    EXPORTING
    HEADLINE = 'PS Project & WBS Creation'
    TEXT1 = 'All the Projects have been created.Please check......'
    TICON = 'I'
    BUTTON_1 = 'OK'.
    ELSE.
    CALL FUNCTION 'POPUP_FOR_INTERACTION'
    EXPORTING
    HEADLINE = 'Deb Program'
    TEXT1 = 'No Projects were created...'
    TICON = 'I'
    BUTTON_1 = 'CANCEL'
    ENDIF.
    Regards
    Deb

  • Automatically PO creation from WBS element in a project

    Hi,
    Is it possible to create Purchase Order automatically from the project that has only WBS element (no network)?
    My project has only WBS element and my client want to trigger PO creation automatically for prorements to projects.
    I appreciate your replies.
    Regards,
    Ja

    Hi Ja,
    Sorry, but you cannot create a PO automatically for a project that has only WBS elements and no network or acitivites. Since materials can only be attached to activities in a project it is mandatory to have an activity to trigger a PO automatically from the project.
    You may have to create a PO manually and then assign the WBS as account assignment.
    Regards,
    Gokul

  • During creation of WBS element How to pass ACCount Assignment field as blnk

    Hi Experts,
    I am  creating of WBS element by using BAPI   ''BAPI_BUS2054_CREATE_MULTI'' .
    during creation, passed the ACCount Assignment field  as blank.
    but when i check that WBS in CJ20n that ACCount Assignment field in coming as checked.    Please suggest me how to pass this field as blank.
    Thanks
    Susant
    Edited by: Susanta22 on May 9, 2011 6:08 PM

    I have same issue. how you resolved it.

  • Creation of cost element or not for GBB-VAX,GBB-INV and UMB

    Dear Experts,
    I have few doubt regarding creation of cost element. Whether i will create Cost element or not.
    1) GBB-VAX - used in PGI(Vl02n)We have costing based COPA .whether we will create cost element or not.If i will create cost element then need to be bydefault in okb9 with PSG tick.
    2) GBB-INV- Used for Material taging(MI01,MI04,MI07)whether we will create cost element or not.If i will create cost element then what will be my cost object and how i will charge from my product costing.
    3) UMB- is used whenever standard price is changed. Shall i create cost element for the same
    If yes hen what will be my cost object and how i will charge from my product costing.
    Request you to help me on the same.
    regards
    RR

    1) GBB-VAX -  No, Goods Issue for sales order with no assignment object and hence without Cost Element
    2) GBB-INV- Yes to post expenditure/income from inventory differences
    3) UMB- Yes
    Regards
    KS

  • FM To Check if the WBS Element is blocked for posting.

    Hi,
    Is there any Function Module that would check if the WBS element entered for a NON PO invoice has been locked for posting.
    Regards,
    Vipin Rajan.

    try fm STATUS_READ_MULTI
    A.

  • Adding WBS element to level-2 in existing project

    Hi all,
    I have a new WBS Element created in a project which already has 2 wbs elements created in a level 2 hierarchy before . Now , this new element is created at level-1 by default .I want to modify the project hierarchy adding the newly created element in a level 2 . I'm trying to do this using BAPI_PROJECT_MAINTAIN but the function returns to me an error:
    hierarchy is not consistent Termination: Too many errors (more than 10% of methods) Data cannot be saved
    Please suggest .
    Thanks
    Deepika

    Hi Deepika..
       Check ur BAPI , I think u missed any Impot  and Export Parameter. In BAPI if u  missed anythink also it wont work..
       Share ur error , So i can  tel u the problem..
       CALL FUNCTION 'BAPI_PROJECT_MAINTAIN'
    EXPORTING
    i_project_definition = gs_project_definition
    i_project_definition_upd = gs_project_definition_upd
    IMPORTING
    return = gt_return
    TABLES
    i_method_project = gt_method_project
    i_wbs_element_table_update = gt_wbs_element_table_update
    i_wbs_element_table = gt_wbs_element_table
    i_wbs_hierarchie_table = gt_wbs_hierarchie_table
    e_message_table = gt_message_table.
    Regrads
    Prabu K

  • PR creation with WBS element

    Hi,
    I have a requirement in which I assign WBS element to sales order and later on when I run MRP for this materials it does not generate requirement for WBS element BUT generate requirement for general stock. could any body please suggest how to integrate the same. What are the setting need to be done in projects also to get this.
    regards
    Raj

    Hi,
    Are you looking for the option like, when you are running the MRP for stock items, PR should generate wrt to Project WBS Element not for plant stock.
    Regards
    N.Raju

  • Sales Order creation with WBS Element

    Hi Friends,
       I tried to create a sales order with each line item being associated with a WBS Element based on the material. But when i try to save the document its throwing an error saying that 'WBS element <elt_name> is not a billing element'. What does this mean?
    Prompt replies would be rewarded.
    Thanks in advance.
    Tamilarasan.

    Hi Tamilarasan,
    You must select the checkbox of "Billing element" in the frame "Operative indicators". If you don't see this check box, you must display it from SPRO PS customizing => Define field selection for WBS structures.
    Regards

  • While creation of wbs element system show ticks on Acc Asgn & Planning elem

    Dear All,
    In CJ20N Tcode i am creating Project Defn. & WBS Elements.
    I needed such functionality like when i enter TCode CJ20N & creating WBS Elements then, system should show the Ticks on Planning Element & Account Assignment Element which must appear on selecting the main screen of the WBS.
    Presently we have done it thru substitution. Thru this we are getting the result, but it is only after saving the WBS.

    Only way I can see the Planning element checked before saving is going to Edit - Validation/Substitution - Substituion...in CJ20N and the check box gets ticked before saving. Again its using the functionality of Substituion only but you can see the check box ticked before saving.
    Hope it helps.
    Arya

  • Billing Level WBS element

    Hi,
      Iam Running  a report.   If i key in Project # and  weekend dates  ,  The Report Should  fetch WBS element,  WBS element - Billing Level  , etc etc
    Suppose a project 13381  has  wbs elements  13381.001, 13381.101, 13381.501.  The WBS  Element Billing level for them  are  13381-B01, 13381-B02, 13381-B03.
    This  is  coming Properly  in the Report.
    But  When I  Key In  Project Number  as Select-options.
       Project #    13381   to 13382
    Iam  Not Getting  The Billing level  of 13382 ,  But Iam properly  getting The billing  level  for 13381.   If the execute  the  report  with  single Project  I get it properly  ,  But  The same thing with range   Iam not getting  Billing level  for the Other Projects  in the Range.
    Below is the Code  only  for Fetching  WBS level  2 .
    Plz  Tell me  ,  How  do i get  the billing level  for  the  all the projects  in Range.  What should  i change in the code
       DATA: TEMP_PSPNR    LIKE PRPS-PSPNR.
      DATA: BEGIN OF INT_PRHI OCCURS 0,
              LEVEL(1)    TYPE C,     "level in the hierarchy
              WBS         LIKE PRHI,  "Record for hierarchy
            END OF INT_PRHI.
      DATA: LEVEL2_INIT(1)     TYPE C.  "set to initial for each new proj
      DATA: BEGIN OF LEVEL2_PRPS OCCURS 0,
              POSNR       LIKE PRHI-POSNR,
              POSID       LIKE PRPS-POSID,
              POST1       LIKE PRPS-POST1,
       END OF LEVEL2_PRPS.
    IF PRPS-PSPNR <> TEMP_PSPNR.
        MOVE PRPS-PSPNR TO TEMP_PSPNR.
        MOVE PRPS-POSID TO ITAB-X_WBSELEMENT.
    ENDIF.
    PERFORM FIND_LEVEL_2
                USING      PROJ-PSPNR
                           TEMP_PSPNR.
    ITAB-X_WBS_LEVEL2TITLE =  LEVEL2_PRPS-POST1.
    ITAB-X_WBS_LEVEL2 = LEVEL2_PRPS-POSID.
    FORM FIND_LEVEL_2
        USING     PROJECT
                  WBS.
      DATA: TOP_POSNR    LIKE PRHI-POSNR,
            FIND_POSNR   LIKE PRHI-POSNR,
            SECOND_POSNR LIKE PRHI-POSNR.
      IF LEVEL2_INIT IS INITIAL.
        LEVEL2_INIT = 'X'.
        CLEAR INT_PRHI.
        REFRESH INT_PRHI.
        SELECT * FROM PRHI
              WHERE PSPHI = PROJECT.
          MOVE-CORRESPONDING PRHI TO INT_PRHI-WBS.
          APPEND INT_PRHI.
        ENDSELECT.
        SORT INT_PRHI BY WBS-POSNR.
        LOOP AT INT_PRHI WHERE WBS-UP = '00000000'.
          EXIT.
        ENDLOOP.
        TOP_POSNR = INT_PRHI-WBS-POSNR.
        LOOP AT INT_PRHI WHERE
              WBS-UP = TOP_POSNR.
          INT_PRHI-LEVEL = '2'.
          MODIFY INT_PRHI.
          SECOND_POSNR = INT_PRHI-WBS-POSNR.
          LOOP AT INT_PRHI WHERE
                WBS-UP = SECOND_POSNR.
            INT_PRHI-LEVEL = '3'.
            MODIFY INT_PRHI.
          ENDLOOP.
        ENDLOOP.
      ENDIF.
      FIND_POSNR = WBS.
      DO 10 TIMES.
        LOOP AT INT_PRHI
            WHERE WBS-POSNR = FIND_POSNR.
              ENDLOOP.
        IF INT_PRHI-LEVEL = '2'.
          SECOND_POSNR = INT_PRHI-WBS-UP.
          SELECT SINGLE * FROM PRPS WHERE PSPNR = FIND_POSNR.
              SELECT SINGLE * FROM PRPS WHERE PSPNR = SECOND_POSNR.
          LEVEL2_PRPS-POST1 = PRPS-POST1.
          LEVEL2_PRPS-POSID = PRPS-POSID.
          EXIT.
        ENDIF.
        FIND_POSNR = INT_PRHI-WBS-UP.
      ENDDO.
      SELECT SINGLE * FROM PRPS WHERE PSPNR = WBS.  "resets prps!!!
    ENDFORM.

    Hey Guys,
    I  Corrected  it Myself,  the problem  was  in the
    FORM FIND_LEVEL_2
    USING PROJECT
    WBS.
    <b>IF LEVEL2_INIT IS INITIAL. ]
    LEVEL2_INIT = 'X'.</b>        ]  
    These shud be taken off , if the Projects  are in range ,  The above works  only  for  a single project.

Maybe you are looking for

  • Firefox won't load homepage when launched and crashes when closed.

    Last night, while I was in Firefox, a notification popped up that updater.exe had been downloaded. I could easily take a guess: a new version of Firefox was out. I closed Firefox and then had the updater do its thing. When Firefox then launched & cam

  • Copy documents from one repository to another

    Hi all We have a scenario. We need to copy content from one repositoy to another when 1.  a new document is created. 2. the same document is updated. (replication should happen automatically, immediately) Is it possible? If yes, how? Regards Aparnna

  • How to receive a xml CDATA in string element when OSB calling a webservice?

    How to receive a xml CDATA in string element when OSB calling a webservice? I have a business service (biz) that route to operation of a webservice. A example of response to this webservice legacy: <soapenv:Envelope xmlns:soapenv="http://schemas.xmls

  • ITunes Opening Problems

    Hi All, My iTunes doesn't open. The weird thing is itunes.exe *32 and the helper appear in my processes, but iTunes does not appear in my running applications or on my desktop. The icon in my taskbar elimuminates the way running programs do for about

  • Looking at pictures in iPhoto 5

    I don't bother looking at all of my pics anymore, since it takes way too long. My desktop is uncluttered, no other windows are open, etc. I hit rotate, for example, and it takes 5-10 seconds to do it. I hit the right arrow to look at pictures, it tak