Skip to Content
0
Former Member
Jan 08, 2013 at 02:47 PM

Scheduling on mass

57 Views

Hello ,

We created a program to be able to schedule Project in mass. Problem is that when
the second project is scheduled with BAPI_BUS2172_SCHEDULE the previous
and first project is used in BAPI_CPROJECTS_COMMIT_WORK. We tried to
use BAPI_BUS2172_FREE as below but it dumps.

Can someone help us here? Is the code wrong? Do we also need to use
BAPI_CPROJECTS_REMOVE_OBJECTS and how?

Thanks
in advance!

DATA: lv_profile TYPE bapi_ts_status_profile-status_profile,

lv_pguid TYPE bapi_ts_guid-project_definition_guid,

ls_stat TYPE bapi_ts_business_transaction,

lv_guid TYPE dpr_tv_entity_guid.



LOOP AT gt_link.



READ TABLE gt_guid WITH KEY project_id = gt_link-project_id.

IF sy-subrc = 0.

CLEAR: gs_dpr_proj.



lv_pguid = gt_guid-guid.



CALL FUNCTION 'BAPI_BUS2172_SCHEDULE'

EXPORTING

project_definition_guid = lv_pguid

TABLES

return = gt_return.



CALL FUNCTION 'BAPI_CPROJECTS_COMMIT_WORK'

TABLES

return = gt_return.



CALL FUNCTION 'BAPI_BUS2172_FREE'

EXPORTING

project_definition_guid = lv_pguid

iv_remove_changed = 'X'

TABLES

return = gt_return.



ENDIF.



ENDLOOP.