ABUMN - WBS is refreshed

While doing settlement via transaction code ABUMN - the WBS element assigned to the now de-activated asset ( due to ABUMN ) is again refreshed. I've been going through SPRO since yesterday and still cant seem to point out the issue.

Not answered

Similar Messages

  • Issue creating WBS using BAPI_BUS2054_CREATE_MULTI

    Hi All,
    I am trying to create WBS elements under existing project (CJ20N) using “BAPI_BUS2054_CREATE_MULTI”. I am I am getting “ET_RETURN” with message type ‘S-W-I’, even after commit no WBS created. Type ‘S’ message says “Individual check for creating the object WBS Element XXX required”. Please find my code for more info. I am I using correct BAPI? Any hint or suggestion welcome. Thanks in advance.
    Regards,
    Trim
    LOOP AT gt_wbs_element .
        MOVE-CORRESPONDING gt_wbs_element to gt_wbs_element_bapi.
        MOVE : gt_wbs_element-mims_id    to gt_wbs_element_bapi-USER_FIELD_CHAR20_1.
        MOVE : gt_wbs_element-PROJECT_DEFINITION to gv_proj.
    *** Conert all dates
        split_date gt_wbs_element-WBS_BASIC_START_DATE gt_wbs_element_bapi-WBS_BASIC_START_DATE.
        split_date gt_wbs_element-WBS_BASIC_FINISH_DATE gt_wbs_element_bapi-WBS_BASIC_FINISH_DATE.
        split_date gt_wbs_element-WBS_FORECAST_START_DATE gt_wbs_element_bapi-WBS_FORECAST_START_DATE.
        split_date gt_wbs_element-WBS_FORECAST_FINISH_DATE gt_wbs_element_bapi-WBS_FORECAST_FINISH_DATE.
    *   split_date gt_wbs_element-WBS_ACTUAL_START_DATE gt_wbs_element_bapi-WBS_ACTUAL_START_DATE.
    *   split_date gt_wbs_element-WBS_ACTUAL_FINISH_DATE gt_wbs_element_bapi-WBS_ACTUAL_FINISH_DATE.
        APPEND gt_wbs_element_bapi.
    ****   Update Custome 'Z' Fields
        clear : BAPI_TE_WBS_ELEMENT, gv_error.
        BAPI_TE_WBS_ELEMENT-WBS_ELEMENT    = gt_wbs_element-WBS_ELEMENT.
        BAPI_TE_WBS_ELEMENT-ZZCP_APPRBUD   = gt_wbs_element-ZZCP_APPRBUD.
        BAPI_TE_WBS_ELEMENT-ZZCP_ELECT     = gt_wbs_element-ZZCP_ELECT.
        BAPI_TE_WBS_ELEMENT-ZZCP_AREA      = gt_wbs_element-ZZCP_AREA.
        BAPI_TE_WBS_ELEMENT-ZZCP_PROG      = gt_wbs_element-ZZCP_PROG.
        BAPI_TE_WBS_ELEMENT-ZZCP_SUBPR     = gt_wbs_element-ZZCP_SUBPR.
    **    BAPI_TE_WBS_ELEMENT-ZZCP_FINALDAT  = gt_wbs_element-ZZCP_FINALDAT.
        BAPI_TE_WBS_ELEMENT-ZZCP_TOTBUD    = gt_wbs_element-ZZCP_TOTBUD.
    **    BAPI_TE_WBS_ELEMENT-ZZCP_DADHC_REG = gt_wbs_element-ZZCP_DADHC_REG.
    **    BAPI_TE_WBS_ELEMENT-ZZCP_DADHC_CEP = gt_wbs_element-ZZCP_DADHC_CEP.
        BAPI_TE_WBS_ELEMENT-ZZCP_PREDBUD   = gt_wbs_element-ZZCP_PREDBUD.
        BAPI_TE_WBS_ELEMENT-ZZCP_CLIENT    = gt_wbs_element-ZZCP_CLIENT.
        BAPI_TE_WBS_ELEMENT-ZZCP_PM_NAME   = gt_wbs_element-ZZCP_PM_NAME.
        GT_EXTENSION_IN-STRUCTURE = 'BAPI_TE_WBS_ELEMENT'.
        GT_EXTENSION_IN-VALUEPART1 = BAPI_TE_WBS_ELEMENT+0(199).
        GT_EXTENSION_IN-VALUEPART2 = BAPI_TE_WBS_ELEMENT+199(171).
        APPEND GT_EXTENSION_IN.
        MOVE-CORRESPONDING gt_wbs_element to wa_wbs_elem.
        AT END OF PROJECT_DEFINITION.
    *** Inalise BAPI
          CALL FUNCTION 'BAPI_PS_INITIALIZATION'.
          clear gt_return[].
          CALL FUNCTION 'BAPI_BUS2054_CREATE_MULTI'
            EXPORTING
              I_PROJECT_DEFINITION       = gv_proj
            TABLES
              IT_WBS_ELEMENT             = gt_wbs_element_bapi
              ET_RETURN                  = gt_return
              EXTENSIONIN                = gt_extension_in
    *         EXTENSIONOUT               =
            EXCEPTIONS
              error_message              = 1
              others                     = 2.
    *** Check GT_RESULT for success
          LOOP AT gt_return where type co 'EA'.
            gv_error = 'X'.
          ENDLOOP.
          IF gv_error is initial.
            CALL FUNCTION 'BAPI_PS_PRECOMMIT'
              TABLES
                ET_RETURN = gt_return_pre.
            LOOP AT gt_return_pre where type co 'EA'.
              gv_error = 'X'.
            ENDLOOP.
          ENDIF.
          IF gv_error is INITIAL.
            CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'
              EXPORTING
                WAIT   = '1'
              IMPORTING
                RETURN = GT_RETURN_COMMIT.
            clear gv_write.
            format color 4.
            CONCATENATE 'Success: WBS Attached to Project' gv_proj '-'
                   into  gv_write.
            WRITE / gv_write. CLEAR gv_write.
            move-corresponding wa_wbs_elem to gt_wbs_suc.
            gt_wbs_suc-message      = gv_write.
            gt_wbs_suc-message_type = 'S'.
            append gt_wbs_suc.
            format reset.
          else.
            clear gv_write.
            format color 6.
            CONCATENATE 'Error: Attaching WBS to Project' space '-' space gv_proj
                    into  gv_write.
            WRITE / gv_write. CLEAR gv_write.
            move-corresponding wa_wbs_elem to gt_wbs_suc.
            gt_wbs_suc-message      = gv_write.
            gt_wbs_suc-message_type = 'E'.
            append gt_wbs_suc.
            format reset.
          ENDIF.
          CLEAR: gv_proj, gt_wbs_element_bapi, gt_extension_in, gt_return_pre, GT_RETURN_COMMIT.
          refresh: gt_wbs_element_bapi, gt_extension_in, gt_return_pre, GT_RETURN_COMMIT.
        endat.
      ENDLOOP.

    Hi Trim
    The message comes from (It is S004) in the BAPI_BUS2054_CREATE_MULTI (see below bold).  I would be placing a breakpoint at the point where the BAPI is calling the function PS_BAPI_PREPARE to see if the lv_subrc variable is being set at this stage.
    Cheers
    Gareth
          call function 'CJ2054_CREATE'
               exporting
                    i_pspid             = i_project_definition
                    i_wbs_element       = ls_wbs_element
               tables
                    extensionin         = extensionin
               exceptions
                    element_not_created = 1
                    dates_not_created   = 2.
        endif.
        if sy-subrc <> 0 or lv_subrc <> 0.
          message e007(cnif_pi) with text-wbs ls_wbs_element-wbs_element
                                into null.
          lv_error = con_yes.
        else.
    <b>      message s004(cnif_pi) with text-wbs ls_wbs_element-wbs_element
                                into null.</b>

  • For one Urgent Change during performing the Approval(chnging the status to 'To be Tested') system does not recognize any changes using the CTS WBS BOM in the development system. The transaction is therefore incorrect or the status was reset by the system.

    For one Urgent Change while performing the one of the Approval before changing the status to 'To Be Tested'
    We are getting below error.
    The system does not recognize any changes using the CTS WBS BOM in the development system. The transaction is therefore incorrect or the status was reset by the system.
    COuld anyone please help us to know, How it can be resolved?
    We also have this below error.
    System Response
    If the PPF action is a condition check, the condition is initially considered as not met, and leads to another warning, an error message, or status reset, depending on the configuration.
    If the PPF action is the execution of a task in the task list, and the exception is critical, there is another error message in the document.
    Procedure
    The condition cannot be met until the cause is removed. Analyze all messages in the transaction application log.
    Procedure for System Administration
    Analyze any other messages in the task list application log, and the entries for the object /TMWFLOW/CMSCV
    Additional Information:
    System cancel RFC destination SM_UK4CLNT005_TRUSTED, Call TR_READ_COMM:
    No authorization to log on as a trusted system (Tr usted RC=0).
    /TMWFLOW/TU_GET_REQUEST_REMOTE:E:/TMWFLOW/TRACK_N:107
    For above error Table /TMWFLOW/REP_DATA_FLOWwas refreshed as well but still the same error.

    If you are in Test System, you can use function module AA_AFABER_DELETE to totally delete the depreciation area (tcode SE37, specify chart of depreciation and depreciation area), After that recreate your depreciation area and run AFBN. But before you do that, have you created a retirement transaction type that limits the posting on your new depreciation area? If not create one.
    Hope this helps.
    Thanks!
    Jhero

  • Availability control on statistical WBS element

    Hi everybody,
    The issue deals with <i><b>availability control on statistical WBS element</b></i>.
    <u>Part 1</u> : I released 25000 as budget (CJ32) for a <b>statistical WBS element</b>.
    Availability control is active for this WBS element.
    We made a good receipt (MIGO) for 20000 on an AUC (asset under
    construction) - so we get the value as statistical value on the WBS
    element -, then invoice verification (MIRO) and finally the asset
    transfer (ABUMN) from asset under construction to fixed asset.
    On this statistical WBS element we get +20000 (MIRO) and -20000 (ABUMN).
    The problem is that the amount that is used for the availability check
    is 0, instead of 20000 as you can check !!!
    We set a budget on the statistical WBS element in order to have the
    availability check ... and this is not working as the system in the described case shows 25000 as available but for me we should have only 5000 (= 25000 - 20000).
    <u>Part 2</u> : This is working perfectly (I get the expected value for available) when we use a <b>"real" WBS element</b>, put an expense on it, then run the period end closing tranction CJ88 in order to transfer the cost on an AUC, and finally run CJ88 again in order to transfer from AUC to fixed asset.
    Did anybody already encountered this problem with statistical WBS element ? How did you solve this (we would like to keep our statistical WBS element) ?
    Thanks in advance for your help.
    Benjamin

    Hi Benjamin,
    Pl go through the link below :
    http://help.sap.com/saphelp_47x200/helpdata/en/3e/a98337dd34ca76e10000009b38f8cf/frameset.htm
    I have not faced this but as far as I remeber for AUC Statistical assignments have some limitations.
    Any specicfic reason for keeping the WBS Statistical? Are you able to see "0" zero on this WBS in CN41.
    Regards,
    Sudhanshu
    PS: Assign points as a way to say thanks.
    Cheers,
    Sudhanshu

  • Very  urgent- find parent-child relationship for wbs element

    Hi,
    There is a certain parent child heirachy in WBS elements.My requiremnet is to delete WBS element depending on certain field , say depending on some ""status"".If the status is active in some or any of the child then I am not suppose to delete its respective parent too. This parent-child relation can have say 5 levels.
    For this I require a logic /program which shall maintain the parent reference for that particular child whih I want/ dont want to delete.
    I am maintaining bottom- to -top approach.
    That is I shall be checking for the status of the lowest level of WBS and then  going to the highest.
    Please Help!
    Kshitija

    hi you can use following code....
    REPORT  zpmgmt_rpt_projinfo NO STANDARD PAGE HEADING LINE-SIZE  160.
    *& Includes
    INCLUDE <icon>.
    INCLUDE zdata_declare_n.  " include for data declaration
    INCLUDE zsubr_n.          " include for both subroutines
    DATA: gv_index LIKE sy-tabix,
          lv_index LIKE sy-tabix,
          date_index TYPE sy-tabix.
    *& Start of Selection ( Get Data )
    START-OF-SELECTION.
    For initial display cnt is set to X
      IF cnt EQ 'X'.
        PERFORM getdata.
        CLEAR it_final.
        PERFORM hierarchy.
        cnt = ''.
      ENDIF.
    *&      Form  GETDATA
    Fetches the data and logic for T1 and T2
    -->  p1        text
    <--  p2        text
    FORM getdata.
    Getting project header data
      SELECT * FROM proj
        INTO CORRESPONDING FIELDS OF TABLE it_proj
        WHERE pspid IN so_posid
        AND werks IN so_plant
        AND stort IN so_loc
        AND erdat IN so_date.
      IF sy-subrc <> 0.
        MESSAGE 'Enter the valid entry' TYPE 'I'.
        STOP.
      ENDIF.
      LOOP AT it_proj.
        PROJECT = it_proj-pspid.
    Get project & WBS element details
    BAPI used gives the output in some specific format
    which is used for roll-up logic.
        CALL FUNCTION 'BAPI_PROJECT_GETINFO'
         EXPORTING
            project_definition           = project
            with_activities              = 'X'
         IMPORTING
            e_project_definition         = e_project_definition
         TABLES
            e_wbs_hierarchie_table       = e_wbs_hierarchie_table.
    Appending all the projects in the e_wbs.
            LOOP AT e_wbs_hierarchie_table.
              MOVE-CORRESPONDING e_wbs_hierarchie_table TO e_wbs.
              APPEND e_wbs.
              CLEAR e_wbs.
            ENDLOOP.
        CLEAR PROJECT.
      ENDLOOP.
      SET COUNTRY 'US'.
      i_repid = sy-repid.
    Getting data into internal tables
    Getting project WBS element
      SELECT * FROM prps
        INTO CORRESPONDING FIELDS OF TABLE it_prps
        FOR ALL ENTRIES IN it_proj
        WHERE psphi = it_proj-pspnr.
    Getting project activities
      SELECT * FROM afvc
        INTO CORRESPONDING FIELDS OF TABLE it_afvc
        FOR ALL ENTRIES IN it_prps
        WHERE projn = it_prps-pspnr.
      SORT it_afvc BY vornr.
    Getting activities start & end dates from AFVV
      SELECT * FROM afvv
       INTO CORRESPONDING FIELDS OF TABLE it_afvv
       FOR ALL ENTRIES IN it_afvc
       WHERE aufpl = it_afvc-aufpl
       AND aplzl = it_afvc-aplzl.
    Getting plant name
      SELECT * FROM t001w
        INTO CORRESPONDING FIELDS OF TABLE it_t001w
        FOR ALL ENTRIES IN it_proj
        WHERE werks = it_proj-werks.
    Logic for passing data to final internal table
    Passing Project master data
      READ TABLE it_proj INDEX 1.
      IF sy-subrc EQ 0.
        CALL FUNCTION 'CONVERSION_EXIT_ABPSN_OUTPUT'
          EXPORTING
            input  = it_proj-pspid
          IMPORTING
            output = it_proj-pspid.
        it_final-posid = it_proj-pspid.
        it_final-post1 = it_proj-post1.
        APPEND it_final.
        CLEAR it_final.
      ENDIF.
    Passing WBS element to the final internal table IT_FINAL
      LOOP AT it_prps.
        CALL FUNCTION 'CONVERSION_EXIT_ABPSN_OUTPUT'
          EXPORTING
            input  = it_prps-posid
          IMPORTING
            output = it_prps-posid.
         CLEAR color.
    Get WBS element status ans color(T2)from OBJNR
        CALL FUNCTION 'ZGET_STATUS_N'
          EXPORTING
            objnr    = it_prps-objnr
          IMPORTING
            color    = color
          TABLES
            t_status = it_tj30t.
        IF     color = 'RED'.
          it_final-t2 = '@0A@'.
        ELSEIF color = 'YELLOW'.
          it_final-t2 = '@09@'.
        ELSEIF color = 'GREEN'.
          it_final-t2 = '@08@'.
        ENDIF.
        SORT it_tj30t DESCENDING.
    Getting User statuses of WBS element at component level.
        READ TABLE it_tj30t INDEX 1.
        IF sy-subrc EQ 0.
          CONCATENATE it_tj30t-txt04 '' INTO it_final-txt04 SEPARATED BY  space.
        ENDIF.
        READ TABLE it_tj30t INDEX 2.
        IF sy-subrc EQ 0.
          CONCATENATE it_tj30t-txt04 it_final-txt04 INTO it_final-txt04  SEPARATED BY space.
        ENDIF.
        MOVE-CORRESPONDING it_prps TO it_final.
        READ TABLE it_proj WITH KEY pspid = it_prps-posid.
        IF sy-subrc EQ 0.
          it_final-werks = it_proj-werks.
        ENDIF.
        APPEND it_final.
        CLEAR  it_final-txt04.
    Passing activity to the final internal table IT_FINAL
        LOOP AT it_afvc WHERE projn EQ it_prps-pspnr.
          CLEAR color.
    Getting user status and color(T2) for Activity from OBJNR
          CALL FUNCTION 'ZGET_STATUS_N'
            EXPORTING
              objnr    = it_afvc-objnr
            IMPORTING
              color    = color
            TABLES
              t_status = it_tj30t.
          IF     color = 'RED'.
            it_final-t2 = '@0A@'.
          ELSEIF color = 'YELLOW'.
            it_final-t2 = '@09@'.
          ELSEIF color = 'GREEN'.
            it_final-t2 = '@08@'.
          ENDIF.
          CLEAR: it_final-fsavd,
                 it_final-fssad.
          MOVE-CORRESPONDING it_afvc TO it_final.
    Getting User statuses of WBS element at activity level.
          SORT it_tj30t DESCENDING.
          READ TABLE it_tj30t INDEX 1.
          IF sy-subrc EQ 0.
            CONCATENATE it_tj30t-txt04 '' INTO it_final-txt04 SEPARATED  BY space.
          ENDIF.
          READ TABLE it_tj30t INDEX 2.
          IF sy-subrc EQ 0.
            CONCATENATE it_tj30t-txt04 it_final-txt04 INTO it_final-txt04  SEPARATED BY space.
          ENDIF.
          APPEND it_final.
          lv_index = sy-tabix.
          CLEAR it_final-txt04.
          CLEAR it_final-ltxa1.
          CLEAR it_tj30t.
          REFRESH it_tj30t.
    Start Date and End Date fetched from AFVV.
          LOOP AT it_afvv  WHERE   aufpl  EQ it_afvc-aufpl
                              AND   aplzl EQ it_afvc-aplzl.
            MOVE-CORRESPONDING it_afvv TO it_final.
            MODIFY it_final INDEX lv_index TRANSPORTING fsavd fssad.
          ENDLOOP.
          CLEAR it_afvc.
          CLEAR lv_index.
        ENDLOOP.
      ENDLOOP.
    Logic for T1.
    T1 is based on T2 and start date and end date of activities.
      LOOP AT it_final WHERE stufe = 3
                       AND ltxa1 IS NOT INITIAL.
        gv_index = sy-tabix.
        PERFORM date_difference.
        CASE it_final-t2.
          WHEN '@0A@'.     "  If Red
            IF sy-datum GT it_final-fssad.
              it_final-t1 = '@0A@'.
            ELSEIF sy-datum LE it_final-fssad AND
                   sy-datum GE it_final-fsavd.
              IF gv_diff > 1.
                PERFORM date_monitor.
              ENDIF.
              it_final-t1 = '@09@'.
            ELSEIF
              sy-datum LT it_final-fsavd.
              it_final-t1 = '@08@'.
            ENDIF.
          WHEN '@09@'.     " If Yellow
            IF sy-datum GT it_final-fssad.
              it_final-t1 = '@0A@'.
            ELSEIF sy-datum LE it_final-fssad AND
                   sy-datum GE it_final-fsavd.
              IF gv_diff > 1.
                PERFORM date_monitor.
              ENDIF.
              it_final-t1 = '@09@'.
            ELSEIF
              sy-datum LT it_final-fsavd.
              it_final-t1 = '@08@'.
            ENDIF.
          WHEN '@08@'.     " If Green
            it_final-t1 = '@08@'.
        ENDCASE.
        MODIFY it_final INDEX gv_index TRANSPORTING t1.
        CLEAR gv_index.
      ENDLOOP.
    ENDFORM.                    " GETDATA
    *&      Form  hierarchy
    Displays the data in ALV hierarchical manner.
    In coding 3 tables are used for roll-up functionality.
    FORM hierarchy .
      DATA: it_final1 LIKE it_final OCCURS 0 WITH HEADER LINE.
      DATA: it_final2 LIKE it_final OCCURS 0 WITH HEADER LINE.
      DATA: it_final3 LIKE it_final OCCURS 0 WITH HEADER LINE.
      DATA: count TYPE i VALUE 1.
      DATA: posid LIKE prps-posid.
      DATA: change,
            date_mask  TYPE c LENGTH 10,
            lv_index2 LIKE sy-tabix.
      DATA: index TYPE sy-tabix.
      DATA: up LIKE prps-posid.
    Deleting duplicate entries from the it_final.*****************
      DELETE ADJACENT DUPLICATES FROM it_final.
      LOOP AT it_final WHERE stufe EQ 2.
        IF posid NE it_final-posid.
          posid = it_final-posid.
        ELSE.
          DELETE it_final INDEX sy-tabix.
        ENDIF.
      ENDLOOP.
      CLEAR posid.
      LOOP AT it_final  WHERE stufe EQ 3
                        AND ltxa1 EQ space.
        IF posid NE it_final-posid.
          posid = it_final-posid.
        ELSE.
          DELETE it_final INDEX sy-tabix.
        ENDIF.
      ENDLOOP.
    Updating a new intrnal table for roll up functionality. ********
      it_final1[] = it_final[].
      CLEAR: lv_index2.
      LOOP AT it_final1 WHERE stufe =  3
                        AND ltxa1 IS NOT INITIAL.
        READ TABLE it_final WITH KEY  stufe = 3
                                      posid = it_final1-posid
                                      post1 = it_final1-post1.
       clear change.
        IF sy-subrc = 0.
          lv_index = sy-tabix.
          IF lv_index2 <> lv_index.
            CLEAR: change.
            lv_index2 = lv_index.
          ENDIF.
          IF it_final1-t1 = '@0A@'.
            it_final-t1 =  '@0A@' .
            MODIFY it_final INDEX lv_index TRANSPORTING t1.
            DELETE it_final1 WHERE posid = it_final-posid.
            CONTINUE.
          ENDIF.
          IF  it_final1-t1 = '@09@'.
            it_final-t1 = '@09@'.
            change = 'Y'.
            MODIFY it_final INDEX lv_index TRANSPORTING t1.
            CONTINUE.
          ENDIF.
          IF it_final1-t1 = '@08@'.
            it_final-t1 =  '@08@' .
            IF change IS INITIAL.
              MODIFY it_final INDEX lv_index TRANSPORTING t1.
            ENDIF.
            CONTINUE.
          ENDIF.
        ENDIF.
      ENDLOOP.
      it_final2[] = it_final[].
      CLEAR: lv_index2.
      LOOP AT it_final2 WHERE stufe = 3
                        AND ltxa1 IS INITIAL.
        READ TABLE e_wbs WITH KEY wbs_element = it_final2-posid.
        IF sy-subrc = 0.
          READ TABLE it_final WITH KEY stufe = 2
                                       posid = e_wbs-up.
          IF sy-subrc = 0.
            CHECK it_final-t1 <> '@0A@'.
            lv_index = sy-tabix.
            IF lv_index2 <> lv_index.
              CLEAR: change.
              lv_index2 = lv_index.
            ENDIF.
            IF   it_final2-t1 = '@0A@'.
              it_final-t1 =  '@0A@' .
              MODIFY it_final INDEX lv_index TRANSPORTING t1.
              CONTINUE.
            ENDIF.
            IF  it_final2-t1 = '@09@'.
              it_final-t1 = '@09@'.
              MODIFY it_final INDEX lv_index TRANSPORTING t1.
              change = 'Y'.
              CONTINUE.
            ENDIF.
            IF it_final2-t1 = '@08@'.
              it_final-t1 =  '@08@' .
              IF change IS INITIAL.
                MODIFY it_final INDEX lv_index TRANSPORTING t1.
              ENDIF.
              CONTINUE.
            ENDIF.
          ENDIF.
        ENDIF.
      ENDLOOP.
      it_final3[] = it_final[].
      CLEAR: lv_index2.
      CLEAR change.
      LOOP AT it_final3 WHERE stufe = 2.
        READ TABLE e_wbs WITH KEY wbs_element = it_final3-posid.
        CHECK sy-subrc = 0.
        READ TABLE it_final WITH KEY stufe = 1
                                     posid = e_wbs-up.
        IF sy-subrc = 0.
          CHECK it_final-t1 <> '@0A@'.
          lv_index = sy-tabix.
          IF lv_index2 <> lv_index.
            CLEAR: change.
            lv_index2 = lv_index.
          ENDIF.
          IF   it_final3-t1 = '@0A@'.
            it_final-t1 =  '@0A@' .
            MODIFY it_final INDEX lv_index TRANSPORTING t1.
            DELETE it_final3.   " WHERE stufe = 2.
            CONTINUE.
          ENDIF.
          IF  it_final3-t1 = '@09@'.
            it_final-t1 = '@09@'.
            MODIFY it_final INDEX lv_index TRANSPORTING t1.
            change = 'Y'.
            CONTINUE.
          ENDIF.
          IF it_final3-t1 = '@08@'.
            it_final-t1 =  '@08@' .
            IF change IS INITIAL.
              MODIFY it_final INDEX lv_index TRANSPORTING t1.
            ENDIF.
            CONTINUE.
          ENDIF.
        ENDIF.
      ENDLOOP.
    Building hierarchy table ***************
      LOOP AT it_final.
        IF it_final-stufe = '0'.
          node_tab-type = 'T'.
          node_tab-name = 'Project'.
          node_tab-tlevel = '01'.
          node_tab-nlength = '8'.
          node_tab-color = '4'.
          node_tab-text = it_final-post1.
          node_tab-tlength ='20'.
          node_tab-tcolor = 5.
          APPEND node_tab.
          it_final_hsk-node = node_tab.
          APPEND it_final_hsk. CLEAR it_final_hsk.
          CLEAR node_tab.
        ELSEIF it_final-stufe = '1'.
          node_tab-type = 'P'.
          node_tab-name = 'Project'.
          node_tab-tlevel = '02'.
          node_tab-nlength = '10'.
          node_tab-color = '1'.
          node_tab-kind2 = 'I'.
          node_tab-text3+0(4) = it_final-t1.
          node_tab-tlength3 = '5'.
          node_tab-tcolor3 = 1.
          node_tab-kind3 = ' '.
          node_tab-text4 = it_final-posid.
          node_tab-tlength4 ='20'.
          node_tab-tcolor4 = 3.
    Code added for plant name
          CALL FUNCTION 'CONVERSION_EXIT_ABPSN_INPUT'
            EXPORTING
              input  = it_final-posid
            IMPORTING
              output = it_final-posid.
          READ TABLE it_proj WITH KEY pspid = it_final-posid.
          CHECK sy-subrc = 0.
          READ TABLE it_t001w WITH KEY werks = it_proj-werks.
          CHECK sy-subrc = 0.
    Code End.
          node_tab-kind4 = ' '.
          node_tab-text5 = it_t001w-name1.   " Plant Name
          node_tab-tlength5 ='25'.
          node_tab-tcolor5 = 4.
          node_tab-kind5 = ' '.
          node_tab-text6 = it_proj-stort.
          node_tab-tlength6 ='15'.
          node_tab-tcolor6 = 4.
          node_tab-kind6 = ' '.
          node_tab-text7 = it_final-post1.
          node_tab-tlength7 ='25'.
          node_tab-tcolor7 = 4.
          APPEND node_tab.
          it_final_hsk-node = node_tab.
          APPEND it_final_hsk. CLEAR it_final.
          CLEAR node_tab.
        ELSEIF it_final-stufe = '2'.
          node_tab-type = 'P'.
          node_tab-name = 'Gate Id'.
          node_tab-tlevel = '03'.
          node_tab-nlength = '10'.
          node_tab-color = '1'.
          node_tab-kind2 = 'I'.
          node_tab-text3+0(4) = it_final-t1.
          node_tab-tlength3 = '5'.
          node_tab-tcolor3 = 1.
          node_tab-kind3 = ' '.
          node_tab-text4 = it_final-posid.
          node_tab-tlength4 ='20'.
          node_tab-tcolor4 = 3.
          node_tab-kind4 = ' '.
          node_tab-text5 = it_final-post1.
          node_tab-tlength5 ='25'.
          node_tab-tcolor5 = 4.
          APPEND node_tab.
          it_final_hsk-node = node_tab.
          APPEND it_final_hsk.
          CLEAR it_final.
          CLEAR node_tab.
        ELSEIF it_final-stufe = '3' AND it_final-ltxa1 EQ space.
          node_tab-type = 'P'.
          node_tab-name = 'Component'.
          node_tab-tlevel = '04'.
          node_tab-nlength = '11'.
          node_tab-color = '1'.
          node_tab-kind2 = 'I'.
          node_tab-text3+0(4) = it_final-t1.
          node_tab-tlength3 = '5'.
          node_tab-tcolor3 = 1.
          node_tab-kind3 = ' '.
          node_tab-text4 = it_final-posid.
          node_tab-tlength4 ='25'.
          node_tab-tcolor4 = 3.
          node_tab-kind4 = ' '.
          node_tab-text5 = it_final-post1.
          node_tab-tlength5 ='25'.
          node_tab-tcolor5 = 4.
    Code added for start date and end date for component level.
          SELECT SINGLE pstrm petrf INTO (v_pstrm, v_petrf)
               FROM prte WHERE posnr = it_final-pspnr.
          it_final-fsavd = v_pstrm.
          it_final-fssad = v_petrf.
          MODIFY it_final INDEX sy-tabix.
          WRITE it_final-fsavd TO date_mask MM/DD/YYYY.
          node_tab-tpos1 = '0'.
          node_tab-kind5 = ' '.
          node_tab-text6 = date_mask.
          node_tab-tlength6 ='10'.
          node_tab-tcolor6 = 3.
          CLEAR date_mask.
          WRITE it_final-fssad TO date_mask MM/DD/YYYY.
          node_tab-tpos1 = '0'.
          node_tab-kind6 = ' '.
          node_tab-text7 = date_mask.
          node_tab-tlength7 ='10'.
          node_tab-tcolor7 = 3.
          CLEAR date_mask.
          APPEND node_tab.
          it_final_hsk-node = node_tab.
          APPEND it_final_hsk.
          CLEAR it_final_hsk.
          CLEAR node_tab.
        ELSEIF it_final-ltxa1 IS NOT INITIAL.
          node_tab-type = 'P'.
          node_tab-name = 'Element'.
          node_tab-tlevel = '05'.
          node_tab-nlength = '11'.
          node_tab-color = '1'.
          node_tab-kind = 'I'.
          node_tab-text1+0(4) = it_final-t1.
          node_tab-tlength1 = '5'.
          node_tab-tcolor1 = 1.
          node_tab-kind2 = 'I'.
          node_tab-text3+0(4) = it_final-t2.
          node_tab-tlength3 = '5'.
          node_tab-tcolor3 = 1.
          node_tab-kind3 = ' '.
          node_tab-text4 = it_final-ltxa1.
          node_tab-tlength4 ='45'.
          node_tab-tcolor4 = 3.
          node_tab-kind4 = ' '.
          node_tab-text5 = it_final-txt04.
          node_tab-tlength5 ='10'.
          node_tab-tcolor5 = 3.
          WRITE it_final-fsavd TO date_mask .
          node_tab-kind5 = ' '.
          node_tab-text6 = date_mask.
          node_tab-tlength6 ='10'.
          node_tab-tcolor6 = 3.
          CLEAR date_mask.
          WRITE it_final-fssad TO date_mask.
          node_tab-tpos1 = '0'.
          node_tab-kind6 = ' '.
          node_tab-text7 = date_mask.
          node_tab-tlength7 ='10'.
          node_tab-tcolor7 = 3.
          CLEAR date_mask.
          APPEND node_tab.
          it_final_hsk-node = node_tab.
          APPEND it_final_hsk.
          CLEAR it_final_hsk.
          CLEAR node_tab.
        ENDIF.
      ENDLOOP.
      CALL FUNCTION 'RS_TREE_CONSTRUCT'
        TABLES
          nodetab = it_final_hsk.
      CALL FUNCTION 'RS_TREE_LIST_DISPLAY'
        EXPORTING
          callback_program      = i_repid
          callback_user_command = 'USER_COMMAND'
          callback_gui_status   = 'ZLD_TREE_N'
          screen_start_column   = 0
          use_control           = 'L'.
    ENDFORM.                    " hierarchy
    *&      Form  MYGUI
          text
         -->EX_TAB     text
    FORM zld_tree_n.
      SET PF-STATUS 'ZLD_TREE_N'.
    ENDFORM.                    "zld_tree.
    **&      Form  user_command
        Code for REFRESH button
    FORM user_command TABLES   node STRUCTURE seucomm
                               USING ucomm CHANGING exit
                                        list_refresh.
      CASE ucomm.
        WHEN 'REFR' .
          CLEAR it_final.
          REFRESH it_final_hsk.
          REFRESH it_final.
          PERFORM getdata.
          CLEAR it_final.
          PERFORM hierarchy.
        WHEN 'BACK1'.
          LEAVE TO TRANSACTION 'ZCN41_N'.
      ENDCASE.
    ENDFORM.                    "user_command
    include.....
    *&  Include           ZDATA_DECLARE
    *& Tables used for the report
    TABLES: proj, prps, aufk, afvc, jest, tj30t, afvv, prte.
    *& Type Pools used
    TYPE-POOLS: slis, icon, fibs, stree.
    *& Class & Data defination
    CLASS DEFINATION
    CLASS cl_gui_resources DEFINITION LOAD.
    DATA DECLARATION
    DATA: g_lights_name TYPE lvc_cifnm VALUE 'LIGHT',
          pspid LIKE proj-pspid,
          l_pos TYPE i VALUE 1,
          gs_layout TYPE slis_layout_alv,
          color TYPE zcn41_color_n-color.
    DATA : cnt VALUE 'X'.
    DATA : i_repid TYPE sy-repid.
    DATA : t_node TYPE snodetext.
    DATA : node_tab LIKE t_node OCCURS 0 WITH HEADER LINE.
    DATA : gv_diff TYPE p, stort LIKE proj-stort.
    CONSTANTS: st_formname_top_of_page TYPE slis_formname
                                  VALUE 'TOP_OF_PAGE-ALV'.
    *& Internal Table Declarations
    DATA it_proj   TYPE STANDARD TABLE OF proj WITH HEADER LINE.
    DATA it_prps   TYPE STANDARD TABLE OF prps WITH HEADER LINE.
    DATA it_afvc   TYPE STANDARD TABLE OF afvc WITH HEADER LINE.
    DATA it_tj30t  TYPE STANDARD TABLE OF tj30t WITH HEADER LINE.
    DATA it_afvv   TYPE STANDARD TABLE OF afvv WITH HEADER LINE.
    DATA it_jcds   TYPE STANDARD TABLE OF jcds WITH HEADER LINE.
    DATA it_t001w  TYPE STANDARD TABLE OF t001w WITH HEADER LINE.
    DATA: BEGIN OF it_final OCCURS 0,
              stufe  LIKE prps-stufe,
              pspnr  LIKE prps-pspnr,
              t1      TYPE icon-id,
              t2      TYPE icon-id,
              node    LIKE node_tab,
              posid  LIKE prps-posid,
              post1  LIKE prps-post1,
              ltxa1  LIKE afvc-ltxa1,
              txt04(20),
              objnr  LIKE afvc-objnr,
              vornr  LIKE afvc-vornr,
              aufpl  LIKE afvc-aufpl,
              aplzl  LIKE afvc-aplzl,
              fsavd  LIKE afvv-fsavd,  "Ear. Start date
              fssad  LIKE afvv-fssad,  "Ear. finish date
              werks  LIKE t001w-name1,     " added after update
              stort  LIKE proj-stort,     " added after update
         END OF it_final.
    DATA: BEGIN OF it_hsk OCCURS 0,
            t2      TYPE icon-id,
            t1      TYPE icon-id,
            posid  LIKE prps-posid,
            post1  LIKE prps-post1,
            objnr  LIKE afvc-objnr,
            stufe  LIKE prps-stufe,
          END OF it_hsk.
    DATA: BEGIN OF it_new OCCURS 0,
            objnr LIKE afvc-objnr,
            fsavd LIKE afvv-fsavd,
            fssad LIKE afvv-fssad,
            udate LIKE jcds-udate,
            t2(10),
          END OF it_new.
    CLEAR : node_tab, node_tab[].
    DATA  : entval TYPE prps-posid.
    DATA  : ct_fieldcat TYPE  slis_t_fieldcat_alv.
    DATA  : BEGIN OF it_final_hsk OCCURS 0,
              node LIKE node_tab,
            END OF it_final_hsk.
    DATA  : project LIKE bapipr-project_definition,
            e_project_definition LIKE bapi_project_definition_ex.
    DATA  : e_wbs_hierarchie_table TYPE STANDARD TABLE OF bapi_wbs_hierarchie
            WITH HEADER LINE.
    DATA  : e_wbs LIKE e_wbs_hierarchie_table OCCURS 0 WITH HEADER LINE.
    DATA:  v_pstrm LIKE prte-pstrm, v_petrf LIKE prte-petrf,
           v_posnr LIKE prps-pspnr.
    *& Selection Screen of the report
    SELECTION-SCREEN BEGIN OF BLOCK pms WITH FRAME TITLE text-001.
    SELECT-OPTIONS so_posid FOR proj-pspid OBLIGATORY.
    SELECT-OPTIONS so_plant FOR proj-werks.
    SELECT-OPTIONS so_loc FOR proj-stort.
    SELECT-OPTIONS so_date FOR sy-datum.
    SELECTION-SCREEN END OF BLOCK pms.
    *AT SELECTION-SCREEN .
    READ TABLE it_proj WITH KEY pspid = so_posid.
    IF sy-subrc <> 0.
       MESSAGE 'Project Name dose not exist' TYPE 'E.
    ENDIF.
    include..
    *&  Include           ZSUBR
    *&      Form  date_difference
          text
    -->  p1        text
    <--  p2        text
    FORM date_difference .
      CALL FUNCTION 'ZDATETIME_DIFFERENCE_N'
        EXPORTING
          date1                  = it_final-fsavd
          time1                  = '000000'
          date2                  = it_final-fssad
          time2                  = '000000'
       IMPORTING
         datediff               = gv_diff
       EXCEPTIONS
         INVALID_DATETIME       = 1
         OTHERS                 = 2
      IF sy-subrc <> 0.
         MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
            WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
      ENDIF.
    ENDFORM.                    " date_difference
    *&      Form  date_monitor
          text
    -->  p1        text
    <--  p2        text
    T1 for more than 1 days activities
    Subroutines result out the T1 on basis of 80% of activity ( Green )
    or if 20 % reamined. ( Yellow )
    FORM date_monitor .
      DATA: date TYPE string,
            temp_date TYPE string,
            lv_date LIKE afvv-fsavd,
            lv_date_final LIKE afvv-fsavd,
            lv_days LIKE  bseg-dtws1 VALUE 0.
      CONSTANTS: con TYPE f VALUE '0.8'.
    *lv_date = it_new-fsavd.
      IF gv_diff EQ 2.
        lv_days = 1.
        CALL FUNCTION 'ZCALC_DATE_N'
          EXPORTING
            date      = it_final-fsavd
            days      = lv_days
            months    = '00'
            sign      = '+'
            years     = '00'
          IMPORTING
            calc_date = lv_date_final.
        IF sy-datum LE lv_date_final.
          it_final-t1 = '@08@'.
        ELSEIF sy-datum GT lv_date_final AND
               sy-datum EQ it_final-fssad.
          it_final-t1 = '@09@'.
        ENDIF.
      ELSEIF gv_diff > 2.
        lv_days = con * gv_diff.
        CALL FUNCTION 'ZCALC_DATE_N'
          EXPORTING
            date      = lv_date
            days      = lv_days
            months    = '00'
            sign      = '+'
            years     = '00'
          IMPORTING
            calc_date = lv_date_final.
        IF sy-datum LE lv_date_final.
          it_final-t1 = '@08@'.
        ELSEIF sy-datum GT lv_date_final AND
               sy-datum EQ it_final-fssad.
          it_final-t1 = '@09@'.
        ENDIF.
      ENDIF.
    ENDFORM.                    " date_monitor
    this code will give you exact out put as you required from bootom to top functinality....with status....

  • Refresh tool and table name containing database name in Mysql

    Hi,
    when refreshing the database schema and my table name contains a database name (for example "my_other_db.my_other_table"), the refresh tool never sees weather "my_other_db.my_other_table" already exists or not. so it always generates a create-table-statement (which is syntactically correct, but of course fails, because that table exists already).
    Is there known workaround for it? I am using Mysql 5.0.x, jdbc driver 5.0.7, Kodo 4.1.4 (but this problem was there before).
    Right now i'm deleting the database names from my package.jdo-files, then doing the refresh command and after that i put back the database names. At runtime Kodo works very well with the database name before the table name.
    Thanks very much,
    Markus

    1. For WBS element under consideration, get OBJNR from PRPS table
    2. Get PO numbers from COEP where OBJNR = PRPS-OBJNR obtained in step 1

  • Settlement rules for WBS element

    Hi,
    I have a requirement to create WBS with settlement rules. Is there an FM or BAPI to call to create the settlement rule?
    Thanks.
    Lalyn

    hi
    good
    types: begin of ty_objnr,
      objnr    like prps-objnr,
    end of ty_objnr.
    *.COBRA-Buffer (see FM KOBS)
    types: begin of ty_cobra_buf.
            include structure cobra.
    types:   uflag like dkobr-upd_flag,
           end of ty_cobra_buf.
    types: ty_t_cobra_buf type ty_cobra_buf occurs 10.
    *.COBRB-Puffer mit Änderungsflag (see FM KOBS)
    types: begin of ty_cobrb_buf.
            include structure cobrb.
    types:   uflag like dkobr-upd_flag,
           end of ty_cobrb_buf.
    types: ty_t_cobrb_buf type ty_cobrb_buf occurs 10.
    Internal tables                                                    *
    data: it_abrechnug      type standard table of ty_abrechnung,
          it_objnr          type standard table of ty_objnr,
          it_cobra          like table of cobra with header line,
          it_cobrb          like table of cobrb with header line.
    Data                                                                *
    data: wa_cobra_buf      type ty_t_cobra_buf,
          wa_cobrb_buf        type ty_t_cobrb_buf,
          wa_objnr            like line of it_objnr,
          wa_urzuo            like cobrb-urzuo,
          l_mem_cobrb         like wa_cobrb_buf[],
          l_mem_cobra         like wa_cobra_buf[],
          l_mem_cobrb_zeile   like line of l_mem_cobrb,
          l_mem_cobra_zeile   like line of l_mem_cobra.
    form urzuo_aendern  using    p_objnr p_pspnr p_urzuo.
      data: c_objnr like prps-objnr,
            c_pspnr like prps-pspnr,
            c_urzuo like cobrb-urzuo.
      c_objnr = p_objnr.
      c_pspnr = p_pspnr.
      c_urzuo = p_urzuo.
      refresh: it_objnr,
               it_cobra,
               it_cobrb,
               l_mem_cobra,
               l_mem_cobrb.
      wa_objnr = c_objnr.
      append wa_objnr to it_objnr.
    Reas settlement rule from the DM
      call function 'K_SRULE_PRE_READ'
      exporting
        i_pflege               = ' '
      tables
        t_sender_objnr         = it_objnr
            T_COBRA                =
      exceptions
        wrong_parameters       = 1
        others                 = 2.
      if sy-subrc  0.
        perform error using c_pspnr sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
        exit.
      endif.
    Fill internal buffer with settlement rules
      call function 'K_SETTLEMENT_RULE_GET'
        exporting
          objnr     = c_objnr
          x_all     = ' '
        tables
          e_cobra   = it_cobra
          e_cobrb   = it_cobrb
        exceptions
          not_found = 1
          others    = 2.
      if sy-subrc  0.
        perform error using c_pspnr sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
        exit.
      endif.
    Save settlement rule in ABAP-Memory
      call function 'K_SRULE_EXPORT_IMPORT'
        exporting
          i_mode     = 'EX'
        exceptions
          wrong_mode = 1
          others     = 2.
      if sy-subrc  0.
        perform error using c_pspnr sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
        exit.
      endif.
    Read ABAP-Memory
      import l_mem_cobra l_mem_cobrb from memory id 'K_SRULE'.
    Change field URZUO and set Update-Flag
      loop at l_mem_cobrb into l_mem_cobrb_zeile where urzuo is initial.
        l_mem_cobrb_zeile-urzuo = p_urzuo.
        l_mem_cobrb_zeile-uflag = 'U'. "Update Kennzeichen
        modify l_mem_cobrb from l_mem_cobrb_zeile transporting urzuo uflag.
      endloop.
    Clear internal buffer
      call function 'K_SETTLEMENT_RULE_REFRESH'
        exporting
          objnr = c_objnr.
    Fill ABAP-Memory with new rules
      export l_mem_cobra l_mem_cobrb to memory id 'K_SRULE'.
    Fill internal buffer with new rules
      call function 'K_SRULE_EXPORT_IMPORT'
        exporting
          i_mode     = 'IM'
        exceptions
          wrong_mode = 1
          others     = 2.
      if sy-subrc  0.
        perform error using c_pspnr sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
        exit.
      endif.
    SAve new rules
      call function 'K_SETTLEMENT_RULE_SAVE'
        exporting
          dialog            = 'X'
          objnr             = c_objnr
          i_status_update   = ' '
        exceptions
          no_rule_for_objnr = 1
          others            = 2.
      if sy-subrc  0.
        perform error using c_pspnr sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
        exit.
      endif.
      commit work.
      perform erfolg using c_pspnr.
    endform.                    " URZUO_AENDERN
    Thanks
    mrutyun^

  • ABUMN code error

    Hi,
    I am posting a transfer using ABUMN code, within the same company code, but when i use the exisiting asset to be posted into, i  get an error msg which says the asset value date is earlier than capitlisation date.but the asset has already been capitalized and the asset value date is 6 months post the capitalisation date.
    thanks
    ganesh

    Dear:
                 Refer to OSS note  310515 which says
                  Symptom
    During the final settlement of an investment measure (order / WBS element) or during the capitalization of an independent AuC (Transaction AIBU), the system displays the following messages:
    AA322 "Posting not possible (Value date earlier than capitalization date)"
    AA352 "Posting not possible (Value date earlier than acquisition date)"
    Other terms
    KO88, KO8G, CJ88, CJ8G
    Reason and Prerequisites
    The first acquisition was posted to the AuC in the current year which means that the capitalization date and the original acquisition date were set in the AuC.
    During reposting of the AuC, you now want to settle to capitalized assets with an earlier asset value date.
    Solution
    In general, it is not permitted in FI-AA to transfer an asset being retired with a value date that is earlier than the capitalization or primary acquisition date. Due to an internal program change, stricter checks have occurred here since Release 4.6.
    You can avoid message AA322 by already setting the asset value date (for example, beginning of the year) for the first acquisition on the AuC or by manually resetting the capitalization date in the AuC.
    Since the FI-AA logic may cause handling problems of AuC repostings, you can allow reposting by making the following modification. This modification causes the system to generate messages AA322 and AA352 regarding the AuC only as warning messages.
    The modification is only effective for the reposting of AuC current-year acquisitions because this constellation can only occur in the capitalization year of the AuC. The AuC prior-year acquisitions cannot be reposted with an asset value date date earlier than the capitalization date or original acquisition date of the AuC because the asset value date and the posting date must not be in different fiscal years (if you specify an asset value date in the previous year after the capitalization date and the original acquisition date of the AuC, the system displays error message AA310 ("Enter asset value date in the same year as posting date &.
    Regards

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

  • Changing WBS element in copy routine.

    Hello All,
    I need to change WBS elemnet of specific sales order when i create this with treference to master sales order.
    I am changing in Routine FV45C151(Enhancement spot implementation), But while saving this routine is being triggered twice before save. Because of this what ever the value i am changing that is being refreshed with the old value ....
    How can i control this?
    My intension is i need to trigger my code which creates new WBS element and assigns this new value to the new documnet only Once..
    Any Idea..
    Regards,
    Krishna.

    I resolved it on my own..
    i created a z table and i am sending this data temporarily and deleting after succesful processing..
    Thanks.

  • WBS element from WBS group

    Hi
      I want to know if there is any FM or table which gives me all the WBS elements under WBS group?
    Thanks

    1) call the function module CALL FUNCTION 'G_SET_GET_ID_FROM_NAME' with the WBS group as input and the output will be setid.
    2) call the funtion module G_SET_FETCH' with the input as setid and the output will be two different internal tables values ans nodes.
    3) Loop at the values internal table that will have the WBS element range values, that means the range as from WBS element value to WBS element.
    4) Loop at the nodes internal table and for every loop value call the function module G_SET_FETCH again.So the output will be nodes and values are internal table, where the again you will be collecting the WBS element value,
    Below is the code.
    Types declaration
      TYPES: BEGIN OF ltype_wbs,
              value_fr   TYPE rgsbv-from,     " To hold WBS values
              value_to   TYPE rgsbv-to,       " To hold WBS values
             END OF ltype_wbs.
    Internal table declaration
      DATA : lt_values    TYPE STANDARD TABLE OF rgsbv,
             lt_nodes     TYPE STANDARD TABLE OF rgsb1,
             lt_nodes1    TYPE STANDARD TABLE OF rgsb1,
             lt_wbs     TYPE STANDARD TABLE OF ltype_prctr,
             lw_wbs     TYPE ltype_prctr,
    Work area declaration
             lw_values    TYPE rgsbv,
             lw_nodes     TYPE rgsb1,
    Local variable to store the set ID.
             lv_id        TYPE sethier-setid.
    Ranges                                                              *
    RANGES:      r_wbs               TYPE RANGE OF rgsbv-from,
          r_wbs_wa            LIKE LINE OF r_wbs.
    get the set ID from the name.
      CALL FUNCTION 'G_SET_GET_ID_FROM_NAME'
        EXPORTING
          shortname                = p_pcgrp
        IMPORTING
          new_setid                = lv_id
        EXCEPTIONS
          no_set_found             = 1
          no_set_picked_from_popup = 2
          wrong_class              = 3
          wrong_subclass           = 4
          table_field_not_found    = 5
          fields_dont_match        = 6
          set_is_empty             = 7
          formula_in_set           = 8
          set_is_dynamic           = 9
          OTHERS                   = 10.
      IF sy-subrc <> 0.
        MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
                WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
      ENDIF.
    Get the values from ID
      CALL FUNCTION 'G_SET_FETCH'
        EXPORTING
          setnr            = lv_id
        TABLES
          set_lines_basic  = lt_values
          set_lines_single = lt_nodes
        EXCEPTIONS
          no_authority     = 1
          set_is_broken    = 2
          set_not_found    = 3
          OTHERS           = 4.
      IF sy-subrc <> 0.
        MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
                WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
      ENDIF.
      IF lt_values IS NOT INITIAL OR lt_nodes IS NOT INITIAL.
        LOOP AT lt_values INTO lw_values.
          lw_wbs-value_fr = lw_values-from.
          lw_wbs-value_to = lw_values-to.
          APPEND lw_wbs TO lt_wbs.
        ENDLOOP.
        LOOP AT lt_nodes INTO lw_nodes.
          REFRESH lt_values.
    get the values from ID
          CALL FUNCTION 'G_SET_FETCH'
            EXPORTING
              setnr            = lw_nodes-setnr
            TABLES
              set_lines_basic  = lt_values
              set_lines_single = lt_nodes1
            EXCEPTIONS
              no_authority     = 1
              set_is_broken    = 2
              set_not_found    = 3
              OTHERS           = 4.
          IF sy-subrc <> 0.
            MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
               WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
          ENDIF.
          APPEND LINES OF lt_nodes1 TO lt_nodes.
          LOOP AT lt_values INTO lw_values.
            lw_wbs-value_fr = lw_values-from.
            lw_wbs-value_to = lw_values-to.
            APPEND lw_wbs TO lt_wbs.
          ENDLOOP.
          REFRESH lt_nodes1.
        ENDLOOP.
      ENDIF.
    Range for profit centers in the table t_prctr_cc
      LOOP AT lt_wbs INTO lw_wbs.
        r_prctr_wa-sign   = c_i.
        r_prctr_wa-option = c_eq.
        r_prctr_wa-low    = lw_wbs-value_fr.
        r_prctr_wa-high   = lw_wbs-value_to.
        APPEND r_wbs_wa TO r_wbs.
      ENDLOOP.
      DELETE ADJACENT DUPLICATES FROM r_wbs.

  • Error "InfoProvider was changed or activated at runtime" when refreshing WB

    Hello SAP gurus!
    Here's tricky case: we've got several workbooks with multiple queries in it based on one MP. After reactivating this MP in production, those workbooks began to fail with error "InfoProvider was changed or activated at runtime".
    Wierd thing is, that I can refresh each query separately, and I can refresh workbooks with only one query on that MP,
    I can execute queties in Web on this MP, - but I cannot refresh whole WBs with multile queries. This issue does not allow us using broadcasting, so it's a serious problem fo us.
    We're on SAP GUI 7.10 and 7.20 ( same error in both versons ). MP is checked to be active. RSRV for those queries doesn't show any errors.
    Please, if you have any hint what's happening, that would be really appreciated!
    Thanks guys,
    Daniil

    Hello Michael!
    thanks for your input! I've had similar idea, but I consider it as a final option. Our landscape and authorization policy does not allow to make changes in production systems directly, so we'll have to transport MP from development system, which is not easy due to lots of approvals I need to get, and no garantee that it'll work as we still don't know the root cause.
    I would really appreciate any input regarding ideas what can be the cause or how to fix it without reactivating MP in prod.
    Many thanks in advance!

  • WBS Commitments issue 0CO_OM_WBS_7 extractor - 0WBS_C11 cube

    Hi All,
    We have a problem with "WBS overview" report (on cube 0WBS_C11)
    displaying wrong "Commitment" values . The data flow is designed to 
    update from PSA directly to Cube . i.e Update rules are built from
    "commitments" info source
    0CO_OM_WBS_7---->0WBS_C11 cube directly .
    RSA3- extractor checker is showing correct "commitment" values but PSA is showing more entires whichis reflecting in the reports,since PSA feeds cube directly
    For example
    for a sample WBS :lsap-80751-100010
    RSA3 result:
    WBSelement               FY/Period   Amount    DocDate    User
    lsap-80751-100010        005/10     0            05/05/10    A
    lsap-80751-100010       008/10    3155         05/07/10   B
    Total value for Commitments in RSA3 is "3155" which should be the expected result in Query.
    PSA dispalying 3 entries instead of 2 and thus CUBE summarizing all the
    below 3 values showing commitment = "6310"
    WBSelement           FY/Period   Amount      RefDocNumber#          Sch.line deldate   DocDate    User
    lsap-80751-100010       005/10  0             0010131115(PR)           14/05/10        05/05/10    A
    lsap-80751-100010       008/10  3155          4700001009(PO)          06/08/10              05/07/10    B
    lsap-80751-100010       005/10  3155       0010131115(PR)          14/05/10        05/05/10    C
    Could you please advise as we are using standard extractor ,  and not sure why the
    commitment values are displaying incorrectly

    Hi Prabhu,
    If I am recalling it correctly, it uses the COOI table for commitment data.
    I hope the data issue is resolved, since we also tried to do it using delta, but didn't worked, then we use the full load option only.
    So for commitment data we placed a DSO in between PSA and cube and  they need to be refreshed before the actual full load.
    The DSO was used to reconcile the data with COOI table and also staged many more filed's which can be used for future reporting.
    Thank-You.
    Regards,
    VB

  • Projects/WBS elements with the editing mask A still exist.

    Hi All,
    I am trying to create a New Coding Mask with Project ID "A" in Dev client 100. ( Ex: A.0000.XX)
    But System is giving an error says that"There are still projects or WBS elements with edit mask A in the system. Therefore you cannot change them".
    But there is no WBS or PD's with this coding mask existing in development client 100.What to do?Is there anyone faced this problam earlier?Any refresh activity required for this?
    Thanks in Advance!
    Thanks
    Suresh Kumar.

    Hello,
    You need to check whether there are any projects in the system starting with "A" using CNS41.  If at all there are any project existing in the system which starts with "A" then the system wont allow to create coding mask which starts with "A"
    You can try to delete these project if possible and then try out if the system allows you to create the coding mask.
    Thanks and Regards,
    Anish

  • TREE Report for WBS Element

    hi gurus,
             can any one tell me how to generate the hierarchical (tree ) report for a purticular project.
    I should genarate a hierarchical report for all WBS (From top level to lower level WBS ).
    With Regards,
    Raj.

    Hi raj,
    check BCALV_TREE_02 for ALV TREE DISPLAY ( for more clarification debug it )
    * my final table structure
            BEGIN OF gty_fin ,
             posid TYPE ps_posid,
             pspnr TYPE ps_intnr,
             post1 TYPE ps_post1,
             ebeln TYPE ebeln,
             ebelp TYPE ebelp ,
             name1 TYPE name1,
             belnr TYPE mblnr ,
             cplan TYPE wtgxxx ,
             netpr TYPE ekpo-netpr ,
             dmbtr TYPE dmbtr ,
             obligo TYPE dmbtr,
             vefugt TYPE dmbtr,
             verfugbar TYPE dmbtr,
            END OF gty_fin ,
    * Coding starts here in ur PBO
    *do modification accordingly
    MODULE status_0100 OUTPUT.
        PERFORM init_tree.
    ENDMODULE.                 " STATUS_0100  OUTPUT
    FORM init_tree .
    * create container for alv-tree
      DATA: l_tree_container_name(30) TYPE c.
      l_tree_container_name = 'CCONTAINER1'.
      CREATE OBJECT g_custom_container
        EXPORTING
          container_name              = l_tree_container_name
    * create tree control
      CREATE OBJECT g_alv_tree
        EXPORTING
          parent                      = g_custom_container
          node_selection_mode         = cl_gui_column_tree=>node_sel_mode_single
          item_selection              = ' '
          no_html_header              = 'X'.
      DATA l_hierarchy_header TYPE treev_hhdr.
      PERFORM build_hierarchy_header CHANGING l_hierarchy_header.
    * Hide columns and sum up values initially using the fieldcatalog
      PERFORM build_fieldcatalog.
      CALL METHOD g_alv_tree->set_table_for_first_display
        EXPORTING
          is_hierarchy_header = l_hierarchy_header
        CHANGING
          it_fieldcatalog     = git_fieldcatalog
          it_outtab           = git_edit. "table must be empty !
      PERFORM create_hierarchy.
      PERFORM register_events.
      CALL METHOD g_alv_tree->update_calculations.
    * Send data to frontend.
      CALL METHOD g_alv_tree->frontend_update.
    ENDFORM.                    "init_tree
    " INIT_TREE
    *&      Form  BUILD_HIERARCHY_HEADER
    FORM build_hierarchy_header  CHANGING
                                     p_hierarchy_header TYPE treev_hhdr.
      p_hierarchy_header-heading = 'Project Definition'(002).
      p_hierarchy_header-tooltip = 'Project Definition'(002).
      p_hierarchy_header-width = 35.
      p_hierarchy_header-width_pix = ''.
    ENDFORM.                    " BUILD_HIERARCHY_HEADER
    *&      Form  exit_program
    *       free object and leave program
    FORM exit_program.
      CALL METHOD g_custom_container->free.
      LEAVE PROGRAM.
    ENDFORM.                    "exit_program
    *&      Form  build_fieldcatalog
    FORM build_fieldcatalog.
      DATA: lwa_fieldcatalog TYPE lvc_s_fcat.
    * The following function module generates a fieldcatalog according
    * to a given structure.
      REFRESH git_fieldcatalog.
      CALL FUNCTION 'LVC_FIELDCATALOG_MERGE'
        EXPORTING
          i_structure_name = 'ZDRK'       "  i created a structure same as final itab.
        CHANGING
          ct_fieldcat      = git_fieldcatalog.
      LOOP AT git_fieldcatalog INTO lwa_fieldcatalog.
        CASE lwa_fieldcatalog-fieldname.
    * hide columns which are already displayed in our tree
          WHEN 'POSID' OR 'PSPNR' OR 'EBELN' OR 'EBELP' OR 'POST1'.
            lwa_fieldcatalog-no_out = 'X'.
    ** Do some initial calculations:
    ** ALV Tree uses the field 'do_sum' to declare that a function
    ** for the corresponding column shall be calculated.
    ** Use 'h_ftype' to set the function type (MAX, MIN, SUM, AVG).
          WHEN 'DMBTR' OR 'OBLIGO'  OR 'VEFUGT' OR 'VERFUGBAR'. " 'CPLAN' OR
            lwa_fieldcatalog-do_sum = 'X'.
            lwa_fieldcatalog-h_ftype = 'SUM'.
          WHEN 'BELNR'.
            lwa_fieldcatalog-hotspot = 'X'.
            lwa_fieldcatalog-tooltip = 'Invoice Document Number'(003).
        ENDCASE.
        MODIFY git_fieldcatalog FROM lwa_fieldcatalog.
      ENDLOOP.
    ENDFORM.                               " build_fieldcatalog
    *&      Form  create_hierarchy
    FORM create_hierarchy.
      DATA: ls_fin TYPE gty_fin,
          lt_fin TYPE TABLE OF gty_fin,
          lv_posid1_last TYPE ps_posid,
          lv_ebeln TYPE ebeln,
          lv_post1 TYPE ps_post1,
          lv_ebeln_last TYPE ebeln,
          lv_ebelp TYPE ebelp.
      DATA: lv_ebeln_key TYPE lvc_nkey,
            lv_ebelp_key TYPE lvc_nkey,
            lv_last_key TYPE lvc_nkey,
            lv_top_key TYPE lvc_nkey,
            lv_node_text TYPE lvc_value,
            lv_text_psp TYPE char10 .
      lv_text_psp = 'Project'(004).
    * all my data is in final itab git_fin
      lt_fin[] = git_fin .
      lv_node_text = gv_proj.
      CALL METHOD g_alv_tree->add_node
        EXPORTING
          i_relat_node_key = ''
          i_relationship   = cl_gui_column_tree=>relat_last_child
          i_node_text      = lv_node_text
        IMPORTING
          e_new_node_key   = lv_top_key.
      LOOP AT lt_fin INTO ls_fin.
        lv_posid1 = ls_fin-posid.
        lv_post1  = ls_fin-post1.
        lv_ebeln  = ls_fin-ebeln.
        lv_ebelp  = ls_fin-ebelp.
        IF lv_posid1 <> lv_posid1_last.     " on change of posid
          lv_posid1_last = lv_posid1.
    * PO- ebeln nodes
          PERFORM add_ebeln USING  lv_posid1
                                   lv_post1
                                   lv_top_key
                            CHANGING lv_ebeln_key.
        ENDIF.
        IF lv_ebeln <> lv_ebeln_last.  " On change of lv_ebeln
          lv_ebeln_last = lv_ebeln .
          PERFORM add_ebelp USING ls_fin
                                  lv_ebeln_key
                                  lv_ebeln
                        CHANGING  lv_ebelp_key .
        ENDIF.
    * Leaf:
        PERFORM add_complete_line USING  ls_fin
                                         lv_ebelp_key
                                         lv_ebelp
                              CHANGING   lv_last_key .
      ENDLOOP.
    * expand first node initially
      CALL METHOD g_alv_tree->expand_node
        EXPORTING
          i_node_key = lv_top_key.
    ENDFORM.                               " create_hierarchy
    *&      Form  ADD_EBELN
    FORM add_ebeln  USING    p_lv_posid1 TYPE ps_posid
                             p_lv_post1 TYPE  ps_post1
                             p_lv_top_key TYPE lvc_nkey
                    CHANGING p_lv_ebeln_key TYPE lvc_nkey.
      DATA : ls_fin TYPE gty_fin,
             lv_node_text TYPE lvc_value ,
             lv_text_psp TYPE char11.
      lv_text_psp =  'WBS Element'(005).
      lv_node_text =  p_lv_posid1.
      CONCATENATE p_lv_post1 lv_node_text
             INTO lv_node_text
        SEPARATED BY space.
    * add node
      CALL METHOD g_alv_tree->add_node
        EXPORTING
          i_relat_node_key = p_lv_top_key
          i_relationship   = cl_gui_column_tree=>relat_last_child
          i_node_text      = lv_node_text  " 'WBS Element'
          is_outtab_line   = ls_fin
        IMPORTING
          e_new_node_key   = p_lv_ebeln_key.
    ENDFORM.                    " ADD_EBELN
    *&      Form  ADD_EBELP
    FORM add_ebelp  USING    p_ls_fin TYPE gty_fin
                             p_lv_ebeln_key TYPE lvc_nkey
                             p_lv_ebeln TYPE ebeln
                    CHANGING p_lv_ebelp_key TYPE lvc_nkey.
      DATA : ls_fin TYPE gty_fin ,
            lv_node_text TYPE lvc_value,
            lv_text_order TYPE char10 .
      lv_text_order = 'ORDER  '(006).
      lv_node_text = p_lv_ebeln  .
      CONCATENATE lv_text_order lv_node_text
             INTO lv_node_text
        SEPARATED BY space.
      CALL METHOD g_alv_tree->add_node
        EXPORTING
          i_relat_node_key = p_lv_ebeln_key
          i_relationship   = cl_gui_column_tree=>relat_last_child
          i_node_text      = lv_node_text " 'EBELN
          is_outtab_line   = ls_fin
        IMPORTING
          e_new_node_key   = p_lv_ebelp_key.
    ENDFORM.                    " ADD_EBELP
    *&      Form  ADD_COMPLETE_LINE
    *       text
    *      -->P_LS_FIN  text
    *      -->P_LV_EBELP_KEY  text
    *      <--P_LV_LAST_KEY  text
    FORM add_complete_line  USING    p_ls_fin TYPE gty_fin
                                     p_lv_ebelp_key TYPE lvc_nkey
                                     p_lv_ebelp TYPE ebelp
                            CHANGING p_lv_last_key TYPE lvc_nkey.
      DATA :  lv_text_pos TYPE char10,
              lv_node_text TYPE lvc_value,
              lv_node_layn TYPE lvc_s_layn.
      lv_text_pos = 'Position '(007).
      lv_node_text = p_lv_ebelp  .
      IF p_lv_ebelp IS INITIAL .
        lv_node_text = 'PLAN'(008) .
        lv_node_layn-hidden = 'X'.
      ELSE.
        CONCATENATE lv_text_pos lv_node_text
               INTO lv_node_text
          SEPARATED BY space.
      ENDIF.
      CALL METHOD g_alv_tree->add_node
        EXPORTING
          i_relat_node_key = p_lv_ebelp_key
          i_relationship   = cl_gui_column_tree=>relat_last_child
          is_outtab_line   = p_ls_fin
          is_node_layout   = lv_node_layn
          i_node_text      = lv_node_text " Position of item
        IMPORTING
          e_new_node_key   = p_lv_last_key.
        CLEAR : lv_node_layn .
    ENDFORM.                    " ADD_COMPLETE_LINE
    Regards,
    Aby
    hope this might be useful.

Maybe you are looking for