{"id":7494,"date":"2025-08-19T18:13:49","date_gmt":"2025-08-19T12:43:49","guid":{"rendered":"https:\/\/www.sapewmhelp.com\/?post_type=question&#038;p=7494"},"modified":"2025-08-19T18:52:30","modified_gmt":"2025-08-19T13:22:30","slug":"query-tu-by-delivery-docid-and-warehouse-number-in-sap-ewm","status":"publish","type":"question","link":"https:\/\/www.sapewmhelp.com\/?question=query-tu-by-delivery-docid-and-warehouse-number-in-sap-ewm","title":{"rendered":"Query TU by Delivery (DOCID and Warehouse Number) in SAP EWM"},"content":{"rendered":"\n<div class=\"hcb_wrap\"><pre class=\"prism line-numbers lang-plain\"><code>*--Check BOL is assigned to TU or not, if not raise error message\n    DATA  lo_tu_query     TYPE REF TO  \/scwm\/cl_sr_tu_query.\n    DATA  lo_log          TYPE REF TO  \/scwm\/cl_log.\n\n*--Assign Warehouse and Delivery in range variable\n    DATA(ls_whse)   = VALUE \/scwm\/s_sel_whse( \n                      sign = \/scmb\/cl_search=&gt;sc_sign_i \n                      option = \/scmb\/cl_search=&gt;sc_eq \n                      low = iv_whse ).\n    DATA(ls_docid) = VALUE \/scwm\/s_sel_dlv_id( \n                      sign = \/scmb\/cl_search=&gt;sc_sign_i \n                      option = \/scmb\/cl_search=&gt;sc_eq \n                      low = iv_docid ).\n    lo_tu_query-&gt;add_whse( is_whse = ls_whse ).\n    lo_tu_query-&gt;add_dlv_id( is_sel_dlv_id = ls_docid ).\n\n*----------------------------------------------------------------------\n*- Read TU\n*----------------------------------------------------------------------\n    TRY.\n        DATA(lo_sr_bom) = \/scwm\/cl_sr_bom=&gt;get_instance( ).\n        lo_sr_bom-&gt;query(\n          EXPORTING\n            io_tu_query = lo_tu_query                     &quot; Class for Searches in Shipping\/Receiving\n          IMPORTING\n            et_bo_tu    = DATA(lt_bo_tu)                  &quot; Table of Business Objects for a Transportation Unit\n        ).\n      CATCH \/scwm\/cx_sr_error.                            &quot; Class for Exceptions in Shipping\/Receiving\n    ENDTRY.\n\n*--Get TU IDENT\n    LOOP AT lt_bo_tu INTO DATA(ls_bo_tu).\n      ls_bo_tu-bo_ref-&gt;get_ident(\n        IMPORTING\n          et_bo_tu_ident = DATA(lt_ident)                 &quot; Table for Seals for a Transportation Unit\n      ).\n    ENDLOOP.<\/code><\/pre><\/div>\n\n\n\n<p>Get TU from delivery (DOCID), from BO_TU object you can get all the TU details, for reference I am showing here to get the TU IDENT. you can get following details<br><br>GET_CONTAINERS<br>GET_DATA<br>GET_DLV_INCOMPLETNESS<br>GET_HU_ID<br>GET_ID<br>GET_IDENT<br>GET_MAX_SEAL_NUM<br>GET_MTR<br>GET_NUM<br>GET_NUM_EXT<br>GET_OBJ_STATE<br>GET_PLAN_YMOVE<br>GET_ROUTE<br>GET_SEAL<br>GET_SR_ACT_DIR<br>GET_SR_ACT_STATE<br>GET_STATUSES<br>GET_STATUS_BY_ID<br>GET_STATUS_CHANGE_BY_ID<br>GET_TIMES<br>GET_TU_DLV<br>GET_TU_DLV_DATA<br>GET_TU_DOOR<br>GET_TU_HU<br>GET_TU_VEH<br>GET_VEHICLE_BO<br><\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"976\" height=\"814\" src=\"https:\/\/www.sapewmhelp.com\/wp-content\/uploads\/2025\/08\/image.png\" alt=\"\" class=\"wp-image-7495\" srcset=\"https:\/\/www.sapewmhelp.com\/wp-content\/uploads\/2025\/08\/image.png 976w, https:\/\/www.sapewmhelp.com\/wp-content\/uploads\/2025\/08\/image-300x250.png 300w, https:\/\/www.sapewmhelp.com\/wp-content\/uploads\/2025\/08\/image-768x641.png 768w\" sizes=\"auto, (max-width: 976px) 100vw, 976px\" \/><\/figure>\n\n\n\n<p><\/p>\n\n\n\n<p><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"closed","template":"","question-category":[174],"question_tags":[350,347,178,349,348,351,177,352],"class_list":["post-7494","question","type-question","status-publish","hentry","question-category-ooabap","question_tags-scwm-cl_sr_bom","question_tags-scwm-cl_sr_tu_query","question_tags-abap","question_tags-read-tu-by-docid","question_tags-read-tu-data","question_tags-read-tu-identification","question_tags-sap","question_tags-tu-identification"],"_links":{"self":[{"href":"https:\/\/www.sapewmhelp.com\/index.php?rest_route=\/wp\/v2\/question\/7494","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.sapewmhelp.com\/index.php?rest_route=\/wp\/v2\/question"}],"about":[{"href":"https:\/\/www.sapewmhelp.com\/index.php?rest_route=\/wp\/v2\/types\/question"}],"author":[{"embeddable":true,"href":"https:\/\/www.sapewmhelp.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.sapewmhelp.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=7494"}],"wp:attachment":[{"href":"https:\/\/www.sapewmhelp.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=7494"}],"wp:term":[{"taxonomy":"question-category","embeddable":true,"href":"https:\/\/www.sapewmhelp.com\/index.php?rest_route=%2Fwp%2Fv2%2Fquestion-category&post=7494"},{"taxonomy":"question_tags","embeddable":true,"href":"https:\/\/www.sapewmhelp.com\/index.php?rest_route=%2Fwp%2Fv2%2Fquestion_tags&post=7494"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}