3 weeks ago
Outbound delivery orders (/SCWM/PRDO transaction) have Status tab where different statuses are displayed. Based on the information online (Exhibit A), it appears that these statuses change value when something happens with the delivery. This is fine.
It is possible though to add a custom status profile and new custom status(es), which would be shown together with the standard ones in the same tab. This is what we have done and added a Z... status (see the screenshot below). (Tcode for custom statuses is BS02.)
Question: is it possible to set the value (e.g. active/inactive) of such custom status programmatically? We have an interface with 3rd party system where we'd like to change the status value to manage outbound delivery in a very specific scenario.
After searching Google and SAP Notes, I've found no information at all on how these custom statuses could be updated programmatically. The usual ODO update using /scdl/cl_sp_prd_out doesn't work for statuses. We can read the statuses but cannot update them: aspect /scdl/if_sp_c=>sc_asp_head_status has no update method. I'm guessing this is intentional for standard statuses, but this is a custom one, which we'd like to control. How can we do that?
Request clarification before answering.
Hi,
I do not remember if I ever implemented status change outside delivery change. Usually for small stuff it is easier to use eew header/item extension (if there are no filed control and operation dependencies based of the Z status). In case of EEW you have it directly visible in several transactions. But if you go with a status you can try following:
( /SCDL/CL_SP_PRD_OUT ) ->/SCDL/IF_SP1_ACTION~EXECUTE
aspect = /scdl/if_sp_c=>sc_asp_head
And you need to have proper inparam for the execution
you can find some examples in EWM in where used list of the /scdl/if_bo_action_c=>sc_set_status
Update:
And for activity you setup business transactions (here is the description https://community.sap.com/t5/enterprise-resource-planning-blogs-by-sap/configuring-user-status-manag... )
I found some time to check it , as I said sc_set_status and where used for example: (example from standard)
Report /SCWM/R_PRDI_SET_DWM
in your case I think you would need to create (BS32) add you Business Transaction to the object (BS12)
and set it in the BS02 to activate your status
I hope it helps,
BR,
Daniil
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi @Jelena_Perfiljeva ,
Please go through the document below...hope you are in correct software version
How to Access “Delivery – Warehouse Request” Objects in EWM in SAP S/4HANA Access Layers and APIs Including Coding Examples SAP S/4HANA 1709 and higher
https://d.dam.sap.com/a/KTtZ3az/How%20To%20Access%20Delivery%20Objects%20in%20S4H.pdf?rc=10
/SCWM/IF_API_WHR_OUTBOUND method: SET_HEADER_STATUS ( Since you are added status in header so need to change value into header status)
"Question: is it possible to set the value (e.g. active/inactive) of such custom status programmatically? We have an interface with 3rd party system where we'd like to change the status value to manage outbound delivery in a very specific scenario.
In that link, SAP is already provided the codes with example for EWM outbound delivery and use that method SET_HEADER_STATUS to set value activate or deactivate.
Please let us know if any questions.
Kind Regards,
Ajit
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
@Ajit_RoutrayThanks so much for a response! Unfortunately, that method only allows to set few specific statuses.
Documentation for the method says:
"You can set the following status for an outbound delivery:
Status Type Transit Status (DOY): Values In Yard (-) and Out of Yard (X)"
Just in case that was incorrect, I did try to use it with Z... status and found that it ends in a method that checks an internal table with specific statuses and an exception is raised if the status passed is not found there. Just in case someone else runs into this, here is a screenshot from debugger showing the specific allowed statuses and the code location.
@Jelena_Perfiljeva- unfortunately there was not mention that custom status would not be add there.
Now I see hard code -
FYI- that method has the same code which you found in the example. Parameters are action code and Status...see the below example
Here action_control = Activity = Your Custom Status (ZDOB)
But standard and custom works differently.
How standard works ? :
Assume Status Type : DWA in Outbound Delivery
SAP Standard DWA1 -> Not Started ( if you F4 on Status Value, you would see 0,1,2,9...etc)
However in custom Status :Example Initial D1T0 - Object value => X ( set because of Initial checkbox)
"Additionally, I've also looked at the interface /SCDL/IF_AF_STATUS_MANAGEMENT because the name sounded promising. There is no documentation for it in SE24 but it is used in a report /SCWM/POST_PROC_DLV_SET_DOY, so I looked there for an example. The problem with this option is that it has "Activity" as a mandatory parameter and it is not relevant (or even available) in my case." => Again here in custom, Status Type, Status and activity are same. In your case, Activity would be ZDOB. And I think we have set 2 values '- ' or 'X' .
Please let us know if further questions...
PS: accepted that its bit tricky 🙂
Kind Regards,
Ajit
User | Count |
---|---|
4 | |
3 | |
2 | |
1 | |
1 | |
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.