12-22-2014 4:57 AM
Hi Experts,
I am trying to create a WBS element under a proj definition using BAPI_PROJECT_MAINTAIN. I get error as : Fill in all the required fields.
I have filled I_PROJECT_DEFINITION with,
PROJECT_DEFINITION , DESCRIPTION , BUS_AREA.
I_METHOD_PROJECT WITH,
REFNUM OBJECTTYPE METHOD OBJECTKEY
0000001 WBS-ELEMENT CREATE "SOME VALUE
0000000 SAVE
I_WBS_ELEMENT_TABLE WITH,
WBS_ELEMENT PROJECT_DEFINITION DESCRIPTION BUS_AREA.
And when executed in SE37, I get error Fill in all the required fields.E055(00).
I have googled for missing field. Some said, to keep PROFIT_CTR as DUmmy.But when I do this I get : profit center 0010/dummy doesnt exist.
Any pointer, please help.
Thanks,
Anil
12-22-2014 6:48 AM
12-22-2014 7:00 AM
You can get all the required values of i_project_definition from BAPI BAPI_PROJECT_GETINFO.
Pass project number into BAPI_PROJECT_GETINFO and get e_project_definition. Pass e_project_definition to BAPI BAPI_PROJECT_MAINTAIN. This way you dont have to worry about the mandatory fields.
Regards,
Viraj.
12-22-2014 12:57 PM
Hi Viraj,
I have used BAPI_PROJECT_GETINFO and passed the values to BAPI BAPI_PROJECT_MAINTAIN.
I still get Fill in all the required fields.E055(00).
Thanks,
Anil
12-22-2014 10:14 AM
12-22-2014 12:58 PM
Hi KS,
When I used, BAPI_BUS2054_CREATE_MULTI., I get :
Individual check for creating the object WBS Element XXXXXXX-XX required.
Not able to pin point what is the consistancy, this BAPI is checking for.
Thanks,
Anil
12-22-2014 2:13 PM
Hi Anil,
Could you pls share your code for the structures of the FM and ist values, I can analyse and let you know.
Regards,
K.S
12-22-2014 2:20 PM
Hi ANil,
What is the sequence of the BAPI that you call?
Is this the sequence....
BAPI_PS_INITIALIZATION
BAPI_BUS2054_CREATE_MULTI
BAPI_PS_PRECOMMIT
BAPI_TRANSACTION_COMMIT
Pls chk what msg typ you get.
I suppose the PS_precommit is not done correctly. That can be the issue.
Pls chk this and if it does not resolve paste your code.
Rgds,
K.S
12-22-2014 2:39 PM
Hi KS,
I am Going through the same sequence of BAPIs in SE37.
for BAPI_BUS2054_CREATE_MULTI :
I_PROJECT_DEFINITION ; 30111 (which is already created from BAPI_PROJECT_MAINTAIN)
Thanks,
Anil
12-22-2014 2:43 PM
Hi Anil,
It will not work when you try it in SE37.Pls try passing the same parameters using a program as in SE37 and I am sure it will work. You can also check the message 004 will be type S.
Check for any errors after the BAPI call, if not call PS_PRECOMMIT. It will definitely work.
If still issues do let me know.
Regards,
K.S
12-23-2014 3:32 AM
Hi KS,
Thanks for helping me so far.
I have tried the code.
I get this message BAPI: Individual check for creating the object WBS Element 30112-01 required.
Message type is S. CNIF_PI(004).
Then I get a dump at BAPI_TRANSACTION_COMMIT, : pre commit did not run successfully.
BAPI should be rolled-back.
Here is the code.
CALL FUNCTION 'BAPI_PS_INITIALIZATION'.
L_PROJECT = '30112'.
* Lwa_WBS-WBS_UP = '30112-01'.
Lwa_WBS-WBS_LEFT = SPACE.
Lwa_WBS-WBS_ELEMENT = '30112-01'.
Lwa_WBS-DESCRIPTION = 'TEST'."PRPSS-POST1.
Lwa_WBS-PROJ_TYPE = '02'."PRPSS-PRART.
Lwa_WBS-WBS_PLANNING_ELEMENT = 'X'."PRPSS-PLAKZ.
Lwa_WBS-WBS_ACCOUNT_ASSIGNMENT_ELEMENT = space. "PRPSS-BELKZ.
Lwa_WBS-COMPANY_CODE = '0010'."PRPSS-PBUKR.
Lwa_WBS-CONTROLLING_AREA = '0010'."PRPSS-PKOKR.
Lwa_WBS-RESPSBL_CCTR_CONTROLLING_AREA = '0010'."PRPSS-FKOKR.
Lwa_WBS-RESPSBL_CCTR = '3000'."PRPSS-FKSTL.
Lwa_WBS-CURRENCY = 'GBP'."PRPSS-PWPOS.
Lwa_WBS-USER_FIELD_KEY = 'Z1'."PRPSS-SLWID.
APPEND lwa_wbs to LT_WBS.
CALL FUNCTION 'BAPI_BUS2054_CREATE_MULTI'
EXPORTING
I_PROJECT_DEFINITION = L_PROJECT
TABLES
IT_WBS_ELEMENT = LT_WBS
ET_RETURN = LT_RETURN.
READ TABLE LT_RETURN INTO lwa_return WITH KEY TYPE = 'E'.
IF SY-SUBRC EQ 0.
* MESSAGE E001 WITH LT_RETURN-MESSAGE.
MESSAGE 'PEEKINDI' TYPE 'E'.
ENDIF.
CALL FUNCTION 'BAPI_PS_PRECOMMIT'.
CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'.
This individual check, I am not understanding. Can you please comment if I had missed any fields?
Also can you please help with some code, if you have already.
Thanks,
Anil
Message was edited by: Anil Supraj
12-23-2014 7:49 AM
Hi Anil,
Pls uncomment the wbs_up and comment wbs_left(it cannot be space)
Documentation from SAP help
The WBS elements are created next to each other, in the same sequence as
in table "IT_WBS_ELEMENT_TABLE". A WBS element under which the new WBS
elements are to be created can be specified in parameter "I_WBS_UP". A
WBS element that is to be located directly to the left of the new WBS
elements can be specified with parameter "I_WBS_LEFT". If "I_WBS_LEFT"
is not specified, the new WBS elements are added on the left-hand side.
If I_WBS_UP is also not specified, the new WBS elements are added on the
left and on the first level.
Also when you read lt_return table chk for msg type 'E' or 'A'
if not sy-subrc is Initial.
call precommit & Transaction commit
else
rollback
endif.
Try this and let me know. if not working i can give a try ( will take some time to Login for me now)
Rgds,
K.S
12-23-2014 10:01 AM
Hi KS,
I have created an empty project definition.
there are no WBS elements created under that project definition.
As I understand, UP and LEFT parameters are for assigning one WBS element under/beside other.
But I am creating only one WBS element.
Can this not be achieved by this BAPI.
Thanks,
Anil
12-23-2014 10:14 AM
Hi Anil,
Pls comment both left & up.
Debug the FM from line 64
loop at it_wbs_element into ls_wbs_element.
see what happens in the below line.
call function 'CJ2054_CREATE'
in this call the sy-subrc is set as 0 and msg comes as mentioned by you.
Closely debug this fm and note what is missing in this call.
Hope this helps.
Rgds,
K.S