cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

Open Warehouse request quantity in EWM

dharmatejv
Explorer
0 Kudos
3,672

Dear All,

Can anyone please help me find Open warehouse quantity field while creating a task for an Inbound or an Outbound delivery in EWM.

We have a requirement where we need to display this open quantity in Fiori before creating a task using task creation FM. This quantity is calculated from Open WT and Confirmed WT. I want to know if any standard FM or Class/Method available to get this data for a DocID and ItemID.


Regards

Dharma Tej

Accepted Solutions (1)

Accepted Solutions (1)

sunil_mani
Active Participant

Hi Dharma,

Please use the below code snippet. I considered inbound delivery and took the open putaway quantity. You can leverage for outbound deliveries as well, just change the service provider reference to /scdl/cl_sp_prd_out and qty_role will be 'PI'. Get source docid and itemids as per your process and populate workarea l_wa_docid.

DATA lo_sp TYPE REF TO /scdl/cl_sp_prd_inb.

DATA: lt_sp_k_item TYPE /scdl/t_sp_k_item_addmeas,

l_wa_sp_k_item TYPE /scdl/s_sp_k_item_addmeas,

lt_a_item_addmeas TYPE /scdl/t_sp_a_item_addmeas,

lv_rejected TYPE boole_d,

lt_return_codes TYPE /scdl/t_sp_return_code.

l_wa_sp_k_item-docid = l_wa_docid-docid.

l_wa_sp_k_item-itemid = l_wa_docid-itemid.

l_wa_sp_k_item-qty_role = 'PU'.

l_wa_sp_k_item-qty_category = 'OPEN'.

APPEND l_wa_sp_k_item TO lt_sp_k_item.

CREATE OBJECT lo_sp.

lo_sp->select( EXPORTING inkeys = lt_sp_k_item

aspect = /scdl/if_sp_c=>sc_asp_item_addmeas

IMPORTING outrecords = lt_a_item_addmeas

rejected = lv_rejected

return_codes = lt_return_codes ).

Thanks

Sunil

dharmatejv
Explorer
0 Kudos

Hi Sunil,

Thank you so much for the code. Will implement this and get back to you with the result.

Thanks & Regards,

Dharma Tej

dharmatejv
Explorer
0 Kudos

Hi Sunil,

First of all Thank you so much for you response.

Tried to use the code and i can get the WR QTY only everytime.

My requirement is to fetch the Open qty every time i pass the DocID and ItemID.

Please let me know if I have to add anything else to get this working.

Regards,

Dharma Tej

Answers (1)

Answers (1)

sunil_mani
Active Participant

Hi Dharma,

Please pass quantity role as 'AQ' and keep rest of the code as is and try.

l_wa_sp_k_item-qty_role = 'AQ'.

Regards

Sunil

dharmatejv
Explorer

Hi Sunil,

Thank you for sharing the code solution! Finally got it working for both Inbound and Outbound.

Regards,

Dharma Tej.