Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

BAPI_PROJECT_MAINTAIN not update on S4HANA

0 Kudos
334

I am currently using the BAPI_PROJECT_MAINTAIN method to update a PEP element of my project structure in SAP HANA. When executing the function, it neither updates nor returns errors, it doesn't work.

I want to update the checkboxes wbs_planning_element, wbs_planning_element, and wbs_account_assignment_element.

  DATA:
ls_project_definition TYPE bapi_project_definition,
ls_project_definition_upd TYPE bapi_project_definition_up,
ls_method_project TYPE bapi_method_project,
ls_wbs_element_table_update TYPE bapi_wbs_element_update,
ls_wbs_element_table TYPE bapi_wbs_element,
ls_return TYPE bapireturn1,
lt_method_project TYPE TABLE OF bapi_method_project,
lt_wbs_element_table_update TYPE TABLE OF bapi_wbs_element_update,
lt_wbs_element_table TYPE TABLE OF bapi_wbs_element,
lt_message_table TYPE TABLE OF bapi_meth_message.

ls_project_definition-project_definition = 'O/SAP/001'.
ls_project_definition-description = 'TEXT'.
ls_project_definition_upd-project_definition = 'X'.

ls_method_project-objecttype = 'WBS-ELEMENT'.
ls_method_project-method = 'UPDATE'.
ls_method_project-objectkey = 'O/SAP/001'.
ls_method_project-refnumber = '000001'.
APPEND ls_method_project
TO lt_method_project.

ls_wbs_element_table_update-wbs_element = 'I'.
ls_wbs_element_table_update-wbs_planning_element = 'X'.
ls_wbs_element_table_update-wbs_planning_element = 'X'.
ls_wbs_element_table_update-wbs_account_assignment_element = 'X'.
APPEND ls_wbs_element_table_update
TO lt_wbs_element_table_update.

ls_wbs_element_table-wbs_element = 'O/SAP/001.01.002'.
ls_wbs_element_table-project_definition = 'O/SAP/001'.
ls_wbs_element_table-wbs_planning_element = 'X'.
ls_wbs_element_table-wbs_account_assignment_element = 'X'.
APPEND ls_wbs_element_table
TO lt_wbs_element_table.

CALL FUNCTION 'BAPI_PROJECT_MAINTAIN'
EXPORTING
i_project_definition = ls_project_definition
i_project_definition_upd = ls_project_definition_upd
IMPORTING
return = ls_return
TABLES
i_method_project = lt_method_project
i_wbs_element_table_update = lt_wbs_element_table_update
i_wbs_element_table = lt_wbs_element_table
e_message_table = lt_message_table.

APPEND ls_return TO return.
ENDFUNCTION.
1 REPLY 1

raymond_giuseppi
Active Contributor
0 Kudos
272

You didn't post the call of BAPI_TRANSACTION_COMMIT, did you call it when no error in RETURN?