Delete WBS Elements
Dear all,
I try to delete WBS Element and the system trigers this message:
The business transaction cannot be carried out.
and when i clicked the "status information" there was an error message tells that there is a Purchase Order still exists for this WBS element.
i deleted this Purchase Order and still the system gives me the same error message.
what should i do ???
Hi Syarein,
1. Block the PO & set status TECO, & set deletion flag.
2. Lock account assignment category. Edit > Status > Lock > Account Assignment.
Regards'
Syed
Similar Messages
-
Problems deleting WBS elements
Hi,
I'm trying to delete a number of WBS elements via CJ20N and I'm presented with an error message as follows:
"There are CATS records that have not yet been tran"
(Message no. CJ001)
I'm not sure exactly what this means or how to get around it (or even view the offending records) - Any ideas?
We are using WBS elements to capture project costs from Timesheets using CAT2.
I'm guessing that I need to transfer the postings against the WBS that I want to delete to another WBS - What transaction is used to do this?
Any pointers or advice will be appreciated.
Thanks in advance,Hi,
You can use transaction CJ88 to settel the wbs element.
Award points if useful.
Thanks & Best regards,
Subbu. -
Table name for WBS element deleted
If a WBS element is deleted , the corresponding object id which is internally created by the system is also deleted from the PRPS table,
Is there a way to find all the deleted WBS elements and what is the table name for the same.Hello
1. Goto table PRPS with PSPNR = WBS number. Get field OBJNR.
2. With PRPS-OBJNR goto table JEST. You will have all status for this WBS element.
3. Text for status - table TJ02T -
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!
Kshitijahi 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.... -
Function module to get the status of WBS elements IN Project Systems
Hi,
I am suppose to delete the WBS elements in PS depending on certain conditions. WBS elements that are to be deleted should satisfy the following conditions:
1. Status of WBS elements should not be AUC construction
2. WBS element, which have cost association, like PO association or internal order association shouldnt be deleted WBS element does not have confirmed activities.
3. WBS elements, which have confirmed activity in association with their networks, should not be deleted.
Either I can check for status of WBS for the above mentioned conditions or if u can suggest me some diff way I shall be grateful
Need help in this regards.
ThanksHi
Use the FM:
<b>JV_GET_WBS_ATTRIBUTES</b>
Regards,
Sreeram -
BAPI for settlement rules in WBS Elements
Hi,
Is there any standard bapi, method, or whatever... to create / modify settlement rules for WBS Elements?.
Rgds,
JoseLook at BAPI/FM of FG CJ2054
BAPI_BUS2054_CHANGE_MULTI Change WBS Elements by BAPI
BAPI_BUS2054_CREATE_MULTI Create WBS Elements by BAPI
BAPI_BUS2054_DELETE_MULTI Delete WBS Elements by BAPI
BAPI_BUS2054_GET_GUID_FROM_KEY Read the GUIDs Using the WBS Keys
BAPI_BUS2054_GET_KEY_FROM_GUID Read the WBS Keys Using the GUIDs
CJ2054_CHANGE
CJ2054_CREATE
CJ2054_DELETE
CJ2054_WBSELEMENT_CHANGE_STRU
MAP2I_BAPI_BUS2054_CHG_TO_PRPS
MAP2I_BAPI_BUS2054_NEW_TO_PRPS
MAP2I_BAPI_BUS2054_UPD_TO_PRPS
Regards -
Is there any BAPI for Upload Documents of WBS elements?
Hi Guys,
Can anbody tell me is there any BAPI for Uploading Documents of WBS elements ?
Thanks,
Gopi.hi
check these BAPI
Change WBS Elements Using BAPI
BAPI_BUS2054_CHANGE_MULTI
Create WBS Elements Using BAPI
BAPI_BUS2054_CREATE_MULTI
Delete WBS Elements Using BAPI
BAPI_BUS2054_DELETE_MULTI
Detail Data for WBS Elements
BAPI_BUS2054_GETDATA
Reading the GUIDs using the WBS Key
BAPI_BUS2054_GET_GUID_FROM_KEY
Reading the WBS Key using the GUIDs
BAPI_BUS2054_GET_KEY_FROM_GUID
Check Existence of a WBS Element
BAPI_PROJECT_EXISTENCECHECK
Element
thnks
sitaram -
List of WBS elements with Deletion Flags
Hi Gurus,
Please tell me, is there any report which gives me WBS elements which are deleted???
Please revert asap.
Thank YouHi gverma,
The master data is store in the PRPS table, if you like, you can write a simple report to show it. I think the field 'LOEVM' is the field, which store the information.
Kind regards,
Zhenbo -
I deleted some of the WBS elements a week ago.
Now I still see them under the search list,
Is it because they are marked for deletion and not deleted actually,
If yes what should I do to remove them.
Please reply.Hi Ramesh,
The scene is like this.
End users created WBS elements starting with H.****
Then after I assigned project code H for tht co.code.
after applying project coding mask [OPSJ] those WBS elements automatically got deleted, I m not sure if they are deleted or not but when i go to CJ02 and enter that WBS it says it does not exists. but it still shows those WBS elements under ths search criteria.
I reffered to OSS notes as per it they have corrected this problem in version I am using.
Please guide if you have any idea.
MIlind -
In what situation we can use a deletion Flag. Once we set a deletion Flag for the WBS element, what are the impacts, i mean what can be done and what cannot be for that particular project.
HI
The Deletion flag status designates work breakdown structures or WBS elements that have been flagged for deletion. This means that the objects are deleted logically, but not physically
for more clarity please refer to the sap HELP on System statuses on workbreak down structures.
Regards.
Vara prasad -
How to delete/close WBS elements
Hello Guys,
We are facing following issues - We have some WBS elements that has not been migrated from company code XX (now incative). Now we canot close those WBS and we are getting errors when posting Settlements (CJ8G/CJ88).
Error - Asset under construction not completely credited.
There are some old bookings on the WBS (total sum = 0) but SAP does not allow us to close it. As this is already closed company code we cannot create assets here anymore.
Do you know if there is a way to close or delete such WBS elements?
Thank you..Hi Tushar,
Following the screenshot sent by Tomas, there are many steps which needs to be carried out before setting the deletion flag for the WBS element. One is to ensure that the mandatory fields for the asset are filled as rightly pointed out, second is to ensure deactivating the asset, third is to delete the existing PO's/PR's associated with the project. This will ensure that the WBS element is back in its original state which will then allow us to mark the deletion flag or set the WBS element as deleted. However cant we close the WBS element and then try to set the deletion flag? Is this a wrong practice you feel?
Kindly advise
Regards
Varun -
WBS ELEMENT DELETED EVEN AFTER EXPENDITURE BOOKED
Hi Dear
I am facing a problem please help me out
the pb is one of my End user created a WBS element then budgeted & Parked an Invoice through FV50 screen using the Cost Center as well.
1)After parking the Document through FV50 screen the Wbs element deleted,
2)now deleting the park document is not possible ,
3)that require Wbs elem when i try to create the same wbs the system gives the message " WBS ELEMENT IS ALREADY EXIST "
4) WHEN I want to display the WBS THE SYSTEM message is wbs element is not Exist"
please help me out in this problem ........ in the following way
a) either to delete the wbs element
b) or to create the deleted wbs ,Hi sridhar,
Thanks you for your replay,
If the Project is locked we can pass transfer enteries or we have to unlock it and pass entries and again lock it.
Can you please advice me
Thanks
jaya -
If WBS element deleted expenses entries will show
Hi Gurus,
In my office one Project is deleted and new project is created with all WBS element. Before that new project creation some expenses are booked in old project now we have to delete all the expenses enteries which are all accounted in old project.
I have one doubt if we pass JV for the expenses enteries
Expenses A/C Dr. (New project)
To Expenses A/C Cr. (Old Project)
if we deleted the old project that expenses entry will show or it also deleted.
or how we can over come is issue.
Any suggestions or advice welcome its u r g e n t
thanks in advance
jayaHi sridhar,
Thanks you for your replay,
If the Project is locked we can pass transfer enteries or we have to unlock it and pass entries and again lock it.
Can you please advice me
Thanks
jaya -
Extract in a file all deleted PROJECTS and WBS element
hello everyone,
i need to create a file wich contain all projects and wbs element deleted by the transaction CJ20 , but i dont know how to pick those data once someone is trying to delete.
please help.
thank you.hello everyone,
i need to create a file wich contain all projects and wbs element deleted by the transaction CJ20 , but i dont know how to pick those data once someone is trying to delete.
please help.
thank you. -
WBS element deletion after project release
Hi,
getiing an error ,scenario is after deletion of WBS element if i try to add same wbs..throwing an error that WBS element XYZ version RELEASED already exists.
thanksHi,
You can refer this thread for more details;
Re: Restoration of original WBS code
Regards,
Kabir
Maybe you are looking for
-
Open saved draft report via API/UI
How could I open an saved Draft report via API/UI. I have draft an report via API/UI and now I would show this report on Desktop/SAP
-
In OC4J.What's the problem?
500 Internal Server Error oracle.classloader.util.AnnotatedNoClassDefFoundError: ???: javax.servlet.jsp.jstl.core.Config ???: com.sun.faces.application.ViewHandlerImpl ???: test.web.test:0.0.0 ???: /C:/oc4j/j2ee/home/applications/test/test/WEB-INF/li
-
Material Quantity Conversion - Base UOM to Sales UOM
Hi, Is there any SAP Function Modules to Convert a Matrial Quantity from Base UOM into Sales UOM? Appreciate Your Help!. Thanks, Kannan.
-
Having issue with CS5 on windows 7
every time i open photoshop whether it a new file or exsiting file the desktop only show the background grid. It started happening after i installed windows internet exlorer 9 beta. i have uninstalled it since then but im still having the issue. Have
-
10g Developer Preview (R2) -- too much reorganizing
There has been quite a lot of class re-shuffling in the upcoming release, which is going to cost me quite a lot of time and trouble to react to. In particular, we are very much affected by changes to the Descriptor object, since we not only generate