cancel
Showing results for 
Search instead for 
Did you mean: 

EWM Outbound delivery - how to update a custom status value?

Jelena_Perfiljeva
Active Contributor
580

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?

scn.jpg

View Entire Topic
Ajit_Routray
Active Contributor

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

Jelena_Perfiljeva
Active Contributor
0 Kudos

@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.
scn.jpg

Ajit_Routray
Active Contributor

@Jelena_Perfiljeva-  unfortunately there was not mention that custom status would not be add there. 

Now I see hard code -Screenshot 2025-04-24 at 11.11.48 AM.png

FYI- that method has the same code which you found in the example. Parameters are action code and Status...see the below example 

Screenshot 2025-04-24 at 11.17.25 AM.png

Here action_control = Activity = Your Custom Status (ZDOB) 

But standard and custom works differently. 

How standard works ? :

Assume Status Type : DWA in Outbound Delivery

 Screenshot 2025-04-24 at 11.26.24 AM.png

SAP Standard DWA1 -> Not Started ( if you F4 on Status Value, you would see 0,1,2,9...etc)

Screenshot 2025-04-24 at 11.03.24 AM.png

However in custom Status :Example Initial D1T0 - Object value => X ( set because of Initial checkbox) 

Screenshot 2025-04-24 at 11.01.08 AM.png

"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