on 12-03-2013 4:21 AM
I am trying to get BAPI
BAPI_RSSRVAPS_CHANGEMULTI
to change the utilization rate in the resource header
I have created a test program as per below,
and have changed a few things a few different ways (eg using Commit E or 3)
and am not able to get the commit to work.
It gets to commit or rollback and does rollback.
Any ideas what I am doing wrong in this code?
REPORT ZZZ_RESOURCE_PERCENT.
DATA:
LV_UTILIZ TYPE /SAPAPO/CRES_UTILIZATION,
LV_RESOURCE TYPE BAPI10004EXT_RESNAME,
LV_VERSION TYPE BAPIGENFIELDS-VRSIOEX,
lv_system LIKE BAPIGENFIELDS-LOGSYSTEM,
lv_bussystem LIKE BAPIGENFIELDS-BUSGROUP,
lv_commit LIKE BAPI10004GENFIELDS-COMMCTRL,
lt_res TYPE TABLE OF bapi10004resheadchange,
ls_res LIKE LINE OF lt_res,
lt_resx TYPE TABLE OF bapi10004resheadxchange,
ls_resx LIKE LINE OF lt_resx.
SELECT-OPTIONS: lv_sys FOR lv_system DEFAULT 'BCX'.
SELECT-OPTIONS: lv_bus FOR lv_bussystem DEFAULT 'BSG1'.
SELECT-OPTIONS: lv_res FOR lv_resource DEFAULT 'WMRN_9996_001'.
SELECT-OPTIONS: lv_ver FOR lv_version DEFAULT '002'.
SELECT-OPTIONS: lv_util FOR LV_UTILIZ DEFAULT '100.000'.
lv_system = lv_sys-low.
lv_bussystem = lv_bus-low.
lv_resource = lv_res-low.
lv_version = lv_ver-low.
lv_utiliz = lv_util-low.
ls_res-RESOURCE = lv_resource.
ls_res-UTILIZATION = lv_utiliz.
ls_res-RESUID = 'JrF6pKTC2cRX08002W099m'.
ls_resx-RESOURCE = lv_resource.
ls_resx-UTILIZATION = 'X'.
ls_resx-RESUID = 'JrF6pKTC2cRX08002W099m'.
ls_resrange-LOW = lv_resource.
lv_commit = '3'.
APPEND ls_res to lt_res.
APPEND ls_resx to lt_resx.
CALL FUNCTION 'BAPI_RSSRVAPS_CHANGEMULTI'
EXPORTING
LOGICAL_SYSTEM = lv_system
BUSINESS_SYSTEM_GROUP = lv_bussystem
PLANNING_VERSION = lv_version
COMMIT_CONTROL = lv_commit
TABLES
RESOURCE_HEAD = lt_res
RESOURCE_HEAD_X = lt_resx.
Aha. removed the hard coded GUID I was practicing with and set back to E internal and it worked.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
8 | |
4 | |
3 | |
2 | |
2 | |
1 | |
1 | |
1 | |
1 | |
1 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.