2010 Feb 06 6:34 AM
HI abapers,
Am new to BAPI concept.I searched in sdn and came to know that BAPI_BUS2054_CHANGE_MULTI can update WBS elements.
can anybody provide a piece of sample code to update wbs header and details like actual start date,controlling area using this bapi.
Thank You.
2010 Feb 08 11:57 AM
Hello Himayatullah,,
i think this will help you...
*WBS element details
it_wbs_new-wbs_element = w_wbs_new .
it_wbs_new-wbs_planning_element = 'X'.
it_wbs_new-wbs_account_assignment_element = 'X'.
it_wbs_new-wbs_billing_element = 'X'.
it_wbs_new-wbs_up = w_wbs_old.
IF lv_auart = 'ZDSO'.
it_wbs_new-res_anal_key = 'ZXXXX'.
it_wbs_new-user_field_char20_1 = '30'.
ENDIF.
APPEND it_wbs_new.
*Initialize PS
CALL FUNCTION 'BAPI_PS_INITIALIZATION'.
*Create WBS element & set heierarchy
CALL FUNCTION 'BAPI_BUS2054_CREATE_MULTI'
EXPORTING
i_project_definition = w_project
TABLES
it_wbs_element = it_wbs_new
et_return = it_return2.
READ TABLE it_return2 WITH KEY type = 'S'.
IF sy-subrc EQ 0.
*Precommit the data for WBS element creation
CALL FUNCTION 'BAPI_PS_PRECOMMIT'.
*Commit data for WBS element creation.
CALL FUNCTION 'BAPI_TRANSACTION_COMMIT' .
Thanks,
Krishna.
2010 Feb 08 10:58 AM
Hi,
You can use BAPI_PROJECT_SAVEREPLICA for sending WBS data.
Regards,
Nitin
2010 Feb 08 11:51 AM
Hi Nitin,
As per the documentation of the BAPI which you have said , "The function module BAPI_PROJECT_SAVEREPLICA is only used internally as part of the ALE business processes for work breakdown structures, delivered by SAP"
My requirement is to update WBS element relevant data like person responsible ,act start date, controlling area etc which are under particular project defination.
2010 Feb 08 11:57 AM
Hello Himayatullah,,
i think this will help you...
*WBS element details
it_wbs_new-wbs_element = w_wbs_new .
it_wbs_new-wbs_planning_element = 'X'.
it_wbs_new-wbs_account_assignment_element = 'X'.
it_wbs_new-wbs_billing_element = 'X'.
it_wbs_new-wbs_up = w_wbs_old.
IF lv_auart = 'ZDSO'.
it_wbs_new-res_anal_key = 'ZXXXX'.
it_wbs_new-user_field_char20_1 = '30'.
ENDIF.
APPEND it_wbs_new.
*Initialize PS
CALL FUNCTION 'BAPI_PS_INITIALIZATION'.
*Create WBS element & set heierarchy
CALL FUNCTION 'BAPI_BUS2054_CREATE_MULTI'
EXPORTING
i_project_definition = w_project
TABLES
it_wbs_element = it_wbs_new
et_return = it_return2.
READ TABLE it_return2 WITH KEY type = 'S'.
IF sy-subrc EQ 0.
*Precommit the data for WBS element creation
CALL FUNCTION 'BAPI_PS_PRECOMMIT'.
*Commit data for WBS element creation.
CALL FUNCTION 'BAPI_TRANSACTION_COMMIT' .
Thanks,
Krishna.
2010 Feb 08 3:14 PM
Hi Krishna,
Thanks for ur reply. Am changing the existing WBS elements so am using BAPI_BUS2054_CHANGE_MULTI.
For this,I have checked with test sequence in SE37 like below
Call BAPI_PS_INITIALISATION
THEN BAPI_BUS2054_CHANGE_MULTI
BAPI_PRECOMMIT
BAPI_TRANSACTION_COMMIT
now for BAPI_BUS2054_CHANGE_MULTI I have passed project defination as import and some params in IT_WBS_ELEMENT
and checked the flags for the fields being updated in IT_UPDATE_WBS_ELEMENT (both are tables tab) and executed it.
The return throws an saying that WBS cannot be changed.
Plz help..
2010 Feb 10 9:10 AM
Hello,
Did you check doing the same (Changing the WBS element) from WBS element change screen..?(Not from FM)
Check the status of WBS element, some times WBS elements can not be changed at some statuses..might be WBS element you are using come under this catagory...
Thanks,
Krishna.
2010 Feb 10 10:38 AM
Hi Krishna,
I have done that. It is working fine.
Currently what am doing in my program is that - I have retrieved the relevant details of a wbs element using "BAPI_BUS2054_GETDATA". Once I got the details , now am trying to overwrite them with the information user want to change.
Say for example : for person responsible field -00000000
Now am updating it with - 10000005.
and then passing the updated internal table to "BAPI_BUS2054_CHANGE_MULTI"...it returns
Object wbs element 001 could not be changed
no update flags or extensions were set for wbs element.
plz help in this issue.
Thanks and Regards
Himayat
2010 Feb 11 7:04 AM
Hi ,
BAPI_BUS2054_change_MULTI is returning Sucess(individual checks are successful)
and now the BAPI BAPI_PS_PRECOMMIT is returning an error message that -
1) Final check of the project defination and the WBS elements : error
2)make an entry in all required
any idea on this?
2010 Feb 11 7:21 AM
First you call below bapi to get the details of the project WBS element wise:
BAPI_BUS2054_GETDATA
Then You call below BAPIS
BAPI_PS_INITIALISATION
BAPI_BUS2054_CHANGE_MULTI ->Pass data from BAPI_BUS2054_GETDATA
BAPI_PRECOMMIT
BAPI_TRANSACTION_COMMIT
Thanks and Regards,
Chandra
2010 Feb 11 7:33 AM
Hi chandra,
Am doing like the way u mentioned only.....
BAPI_PS_INITIALIZATION
Then BAPI_BUS2054_GETDATA - It is returning all the required data of wbs element.
Then BAPI_BUS2054_CHANGE_MULTI- It is returning individual checks are successful.
Then BAPI_PS_PRECOMMIT-it returns the errors which I mentioned in the previous post.
2010 Feb 11 8:41 AM
2010 Feb 19 6:33 AM
Hi experts,
Am able to update wbs elements relevant data at level 5 only . How to update the same at one level higher i. e level 4.
Please let me know.
Best Regards
Himayat
Edited by: Himayatullah on Feb 24, 2010 10:42 AM
2011 Dec 20 11:04 PM
How did you solve this problem? I am following the given below approach, and I am receiving the same error.
Error : 1.) Object WBS Element DS-11-1000-0058.01 could not be changed
2.) No update flags or extensions were set for WBS Element DS-11-1000-0058.01
gwa_bapi_bus2054_upd-wbs_element = 'X'.
gwa_bapi_bus2054_upd-description = 'X'.
gwa_bapi_bus2054_upd-responsible_no = 'X'.
gwa_bapi_bus2054_upd-applicant_no = 'X'.
gwa_bapi_bus2054_upd-company_code = 'X'.
gwa_bapi_bus2054_upd-business_area = 'X'.
gwa_bapi_bus2054_upd-profit_ctr = 'X'.
gwa_bapi_bus2054_upd-proj_type = 'X'.
gwa_bapi_bus2054_upd-wbs_planning_element = 'X'.
gwa_bapi_bus2054_upd-wbs_account_assignment_element = 'X'.
(I have marked all fields with 'X')
APPEND gwa_bapi_bus2054_upd TO git_bapi_bus2054_upd.
CALL FUNCTION 'BAPI_PS_INITIALIZATION'.
CALL FUNCTION 'BAPI_BUS2054_CHANGE_MULTI'
EXPORTING
i_project_definition = p_prj
TABLES
it_wbs_element = git_wbs_element_chg (manually populated)
it_update_wbs_element = git_bapi_bus2054_upd
et_return = et_return.
READ TABLE et_return INTO ev_ret WITH KEY type = 'E'.
IF sy-subrc NE '0'.
CALL FUNCTION 'BAPI_PS_PRECOMMIT'
TABLES
et_return = et_return2.
WAIT UP TO 3 SECONDS.
CLEAR ev_ret.
READ TABLE et_return2 INTO ev_ret WITH KEY type = 'E'.
IF sy-subrc NE '0'.
CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'.
WAIT UP TO 3 SECONDS.
ENDIF.
ENDIF.
I don't know what I am doing wrong. Please help!
2011 Dec 20 11:28 PM
I solved the issue occurred with BAPI_BUS2054_CHANGE_MULTI.
But now, BAPI_PS_PRECOMMIT is throwing an error.
Error # 1 : Final check of the project definition and the WBS elements: Error
Error # 2 : Fill in all required entry fields
2014 Jan 07 3:22 PM
Hi Dev,
Can you please share how you solved the errors in WBS change bapi.
2014 Apr 01 4:15 AM
Hi Kiran,
I just faced the same issue with BAPI_BUS2054_CHANGE_MULTI
I fixed it playing with conversion exits, use this CONVERSION_EXIT_ABPSN_INPUT to load the data to BAPI's WBS ELEMENT field.
About the issue with BAPI_PS_PRECOMMIT you just need to be sure that all mandatory fields are filled in for T-Code CJ20N.
These 2 errors are just data issues.
-----------------------------------------------------
Error # 1 : Final check of the project definition and the WBS elements: Error
Error # 2 : Fill in all required entry fields
-----------------------------------------------------
I hope this information helps.
Regards,
Ricardo
2016 Aug 31 1:30 PM