Dear experts I got it solved.
Basically it works as already suspected via sending a process code (not exception code). This can be reached by calling the service provider with the method EXECUTE to perform the action, e.g.
CALL METHOD lo_sp->/scdl/if_sp1_action~execute
EXPORTING
aspect = '/SCDL/S_SP_A_ITEM'
inkeys = <lt_keys_work>
inparam = <ls_inparam>
action = '/SCDL/ACT_EXECUTE_ACTION'
* relation_inkey =
* relation =
IMPORTING
outrecords = lt_outrecords
* rejected = lv_rejected
return_codes = lt_return_codes
* relation_outrecord = <ls_rel_outrecord>.
This will trigger an action for the delivery item. The type of action is then specified in the inparam which would look like this for the process code I002:
ls_inparam-action_code = '028'. "delivery change
CREATE DATA ls_inparam-action_control TYPE /scdl/bo_action_adjqty_str.
ASSIGN ls_inparam-action_control->* TO <ls_pcode>.
<ls_pcode>-prcode = 'I002'. "process code
It should run in this sequence:
- Set the warehouse number: /scwm/cl_tm=>set_lgnum( EXPORTING iv_lgnum = l_lgnum ).
- Create the service provider (in my case of type /scdl/cl_sp_prd_inb)
- Lock the delivery: CALL METHOD lo_sp->/scdl/if_sp1_locking~lock
- Select the aspect: CALL METHOD lo_sp->/scdl/if_sp1_aspect~select
- Call the method as shown above
- Save the transaction: CALL METHOD lo_sp->/scdl/if_sp1_transaction~save
- Unlock and clean-up: CALL METHOD lo_sp->/scdl/if_sp1_transaction~cleanup
I hope this might help anyone with a similar topic.
Gunter