<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Programming posting change in EWM in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/programming-posting-change-in-ewm/m-p/5822031#M1315130</link>
    <description>&lt;P&gt;I had this same exact problem but specifically to update the stock type after a Goods receive what i used was the function module /SCWM/STOCK_CHANGE and /SCWM/GM_POST, i can provide the method i used for modification depending on the requirements.&lt;/P&gt;&lt;P&gt;If the following code adjusted to your requirements doesn't work i recommend opening the transaction SAAB and activate the break point /SCWM/GM, following that do your posting using the transaction /n/SCWM/POST and find the Function module /SCWM/STOCK_CHANGE and see what the Standart code is passing in the importing structures and tables regarding your example, i believe if you change to use just what standart uses as i did in my case it will work.&lt;/P&gt;&lt;P&gt;Good Luck,&lt;/P&gt;&lt;P&gt;Alex.&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;METHOD update_stock_type.
DATA lt_aqua TYPE STANDARD TABLE OF /scwm/aqua.
DATA it_item TYPE /scwm/tt_spitem.
DATA is_item TYPE /scwm/s_spitem.
DATA lt_bapiret TYPE bapiret2_t.
DATA lv_severity TYPE bapi_mtype.
DATA is_quan TYPE /scwm/s_quan.
DATA lt_ordim_c TYPE STANDARD TABLE OF /scwm/ordim_c.
DATA lv_cat TYPE /lime/stock_category.


"There will be necessary to exist a internal table with the HUs we want to update for my case and for the sake of just showing an example consider it is lt_hus

"gets information regarding the HU on aqua
SELECT *
FROM /scwm/aqua
INTO TABLE lt_aqua
FOR ALL ENTRIES IN lt_hus
WHERE lgnum EQ lv_lgnum
AND huident EQ lt_hus-huident.

IF sy-subrc &amp;lt;&amp;gt; 0.
"Implement your own logic when no data is found

ENDIF.

"Gets the item information updated
SELECT *
FROM /scdl/db_proci_i
INTO TABLE @DATA(lt_proci_update)
WHERE docid EQ @gs_screen_items-proci-docid.

IF sy-subrc &amp;lt;&amp;gt; 0.
CLEAR lt_proci_update.

"Implement your own logic when no data is found

ENDIF.

"Gets the task created for the HU by POSTING
SELECT *
FROM /scwm/ordim_c
INTO TABLE lt_ordim_c
FOR ALL ENTRIES IN lt_ewmt021
WHERE lgnum EQ gs_screen_header-lgnum
AND dguid_hu EQ lt_ewmt021-guid_hu.

IF sy-subrc &amp;lt;&amp;gt; 0.
CLEAR: lt_ewmt021, lt_proci_update, lt_ordim_c.

"Implement your own logic when no data is found

ENDIF.

LOOP AT lt_hus ASSIGNING FIELD-SYMBOL(&amp;lt;fs_hus&amp;gt;).

READ TABLE lt_aqua WITH KEY huident = &amp;lt;fs_hus&amp;gt;-huident ASSIGNING FIELD-SYMBOL(&amp;lt;fs_aqua&amp;gt;).

IF &amp;lt;fs_aqua&amp;gt; IS NOT ASSIGNED.
CONTINUE.
ENDIF.

READ TABLE lt_proci_update WITH KEY docid = &amp;lt;fs_hus&amp;gt;-docid
itemid = &amp;lt;fs_hus&amp;gt;-itemid ASSIGNING FIELD-SYMBOL(&amp;lt;fs_proci&amp;gt;).

IF &amp;lt;fs_proci&amp;gt; IS NOT ASSIGNED.
CONTINUE.
ENDIF.

READ TABLE lt_ordim_c WITH KEY dguid_hu = &amp;lt;fs_hus&amp;gt;-guid_hu ASSIGNING FIELD-SYMBOL(&amp;lt;fs_ordim_c&amp;gt;).

IF &amp;lt;fs_ordim_c&amp;gt; IS NOT ASSIGNED.
CONTINUE.
ENDIF.

"In this case the update will be to change the stock type from blocked to Unblocked
"Stock Type to be updated
MOVE &amp;lt;fs_aqua&amp;gt;-cat TO lv_cat.
REPLACE ALL OCCURRENCES OF 'B' IN lv_cat WITH 'F'.

"Gets QUAN information
SELECT SINGLE *
FROM /scwm/quan
INTO @DATA(ls_quan)
WHERE guid_stock EQ @&amp;lt;fs_aqua&amp;gt;-guid_stock
AND guid_parent EQ @&amp;lt;fs_aqua&amp;gt;-guid_parent.

"Sets the ID using the current line iterator
is_item-id = sy-tabix.
is_item-id_group = sy-tabix + 1.
is_item-direction = 'T'.
is_item-squant_set = abap_true.
is_item-procty = &amp;lt;fs_proci&amp;gt;-/scwm/procty.
is_item-guid_hu = &amp;lt;fs_hus&amp;gt;-guid_hu.
is_item-huident = &amp;lt;fs_hus&amp;gt;-huident.

"Quantity of stock saved on the HU
is_quan-unit = &amp;lt;fs_hus&amp;gt;-uom.
is_quan-quan = &amp;lt;fs_hus&amp;gt;-qty.
APPEND is_quan TO is_item-t_quan.

"Information regarding the HU in the Wharehouse
is_item-loc-lgnum = gs_screen_header-lgnum.
is_item-loc-lgtyp = &amp;lt;fs_aqua&amp;gt;-lgtyp.
is_item-loc-lgpla = &amp;lt;fs_aqua&amp;gt;-lgpla.

"Passes the current information of the HU
is_item-source_s-idx_stock = ls_quan-idx_stock.
is_item-source_s-guid_stock = &amp;lt;fs_aqua&amp;gt;-guid_stock.
is_item-source_s-matid = &amp;lt;fs_aqua&amp;gt;-matid.
is_item-source_s-cat = &amp;lt;fs_aqua&amp;gt;-cat.
is_item-source_s-owner = &amp;lt;fs_aqua&amp;gt;-owner.
is_item-source_s-owner_role = &amp;lt;fs_aqua&amp;gt;-owner_role.
is_item-source_s-entitled = &amp;lt;fs_aqua&amp;gt;-entitled.
is_item-source_s-entitled_role = &amp;lt;fs_aqua&amp;gt;-entitled_role.
is_item-source_s-qdoccat = &amp;lt;fs_proci&amp;gt;-doccat.
is_item-source_s-qdocid = &amp;lt;fs_proci&amp;gt;-docid.
is_item-source_s-qitmid = &amp;lt;fs_proci&amp;gt;-itemid.

"Passes the information with the modifications we want made to the stock
is_item-dest_s-matid = &amp;lt;fs_aqua&amp;gt;-matid.
is_item-dest_s-cat = lv_cat. "What we will want to modifiy
is_item-dest_s-matid = &amp;lt;fs_aqua&amp;gt;-matid.
is_item-dest_s-qdoccat = &amp;lt;fs_proci&amp;gt;-doccat.
is_item-dest_s-qdocid = &amp;lt;fs_proci&amp;gt;-docid.
is_item-dest_s-qitmid = &amp;lt;fs_proci&amp;gt;-itemid.
is_item-dest_s-owner = &amp;lt;fs_aqua&amp;gt;-owner.
is_item-dest_s-owner_role = &amp;lt;fs_aqua&amp;gt;-owner_role.
is_item-dest_s-entitled = &amp;lt;fs_aqua&amp;gt;-entitled.
is_item-dest_s-entitled_role = &amp;lt;fs_aqua&amp;gt;-entitled_role.

APPEND is_item TO it_item.
CLEAR is_item.

ENDLOOP.

"Calls Stock Change function module to proceed to update the HU
CALL FUNCTION '/SCWM/STOCK_CHANGE'
EXPORTING
is_header = VALUE /scwm/s_gmheader( lgnum = gs_screen_header-lgnum
created_by = &amp;lt;fs_ordim_c&amp;gt;-created_by
created_at = &amp;lt;fs_ordim_c&amp;gt;-created_at
code = '/SCWM/POST' )
it_item = it_item
IMPORTING
et_bapiret = lt_bapiret
ev_severity = lv_severity.

LOOP AT lt_bapiret ASSIGNING FIELD-SYMBOL(&amp;lt;fs_bapiret&amp;gt;).

IF &amp;lt;fs_bapiret&amp;gt;-type EQ 'E'.
CALL FUNCTION 'YOUR_MESSAGE_FUNCTION'
EXPORTING
iv_id = &amp;lt;fs_bapiret&amp;gt;-id
iv_number = &amp;lt;fs_bapiret&amp;gt;-number
iv_typ = &amp;lt;fs_bapiret&amp;gt;-type
iv_var1 = &amp;lt;fs_bapiret&amp;gt;-message_v1
iv_var2 = &amp;lt;fs_bapiret&amp;gt;-message_v2
iv_var3 = &amp;lt;fs_bapiret&amp;gt;-message_v3
iv_var4 = &amp;lt;fs_bapiret&amp;gt;-message_v4.
CLEAR: lt_proci_update, lt_ordim_c.
"implementar rotina de erro
ENDIF.

ENDLOOP.

"Will try to POST the changes and for that the function module will generate a new task 
TRY.
DATA lv_tanum TYPE /scwm/tanum.
CALL FUNCTION '/SCWM/GM_POST'
IMPORTING
ev_tanum = lv_tanum
et_bapiret = lt_bapiret
ev_severity = lv_severity.
CATCH /scwm/cx_core.

LOOP AT lt_bapiret ASSIGNING &amp;lt;fs_bapiret&amp;gt;.

IF &amp;lt;fs_bapiret&amp;gt;-type EQ 'E'.
CALL FUNCTION 'YOUR_MESSAGE_FUNCTION'
EXPORTING
iv_id = &amp;lt;fs_bapiret&amp;gt;-id
iv_number = &amp;lt;fs_bapiret&amp;gt;-number
iv_typ = &amp;lt;fs_bapiret&amp;gt;-type
iv_var1 = &amp;lt;fs_bapiret&amp;gt;-message_v1
iv_var2 = &amp;lt;fs_bapiret&amp;gt;-message_v2
iv_var3 = &amp;lt;fs_bapiret&amp;gt;-message_v3
iv_var4 = &amp;lt;fs_bapiret&amp;gt;-message_v4.
CLEAR: lt_proci_update, lt_ordim_c.
"Implement your own logic for when theres an error
ENDIF.

ENDLOOP.

ENDTRY.

COMMIT WORK AND WAIT.

ENDMETHOD.&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Thu, 02 Jul 2020 10:38:19 GMT</pubDate>
    <dc:creator>former_member688833</dc:creator>
    <dc:date>2020-07-02T10:38:19Z</dc:date>
    <item>
      <title>Programming posting change in EWM</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/programming-posting-change-in-ewm/m-p/5822019#M1315118</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi folks,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have the following requirement: create a function module that can perform a posting change in EWM (called up by a background program).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Now I have found the following function module: /SCWM/STOCK_CHANGE, but it is not clear to me how I can fill it up with data. Is there anyone here who knows what function module or method can be used to fill up the import parameters?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;When you do the posting change from the UI, all this happens in class /SCWM/CL_UI_POST, but I don't see how I can use parts of this class without the UI elements.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Rob&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 30 Jun 2009 07:03:32 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/programming-posting-change-in-ewm/m-p/5822019#M1315118</guid>
      <dc:creator>rob_smeets2</dc:creator>
      <dc:date>2009-06-30T07:03:32Z</dc:date>
    </item>
    <item>
      <title>Re: Programming posting change in EWM</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/programming-posting-change-in-ewm/m-p/5822020#M1315119</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I'm coming back to this question because it is becoming more pressing at this moment: I've identified a couple of likely candidate function modules to do this for me, but alas, neither of them is documented at all (or released, for that matter).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;there is /scwm/gm_create, /scwm/gm_post, /scwm/stock_change &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I'd be happy with any example code, hints on how to go about this,...&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 31 Jul 2009 09:37:44 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/programming-posting-change-in-ewm/m-p/5822020#M1315119</guid>
      <dc:creator>rob_smeets2</dc:creator>
      <dc:date>2009-07-31T09:37:44Z</dc:date>
    </item>
    <item>
      <title>Re: Programming posting change in EWM</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/programming-posting-change-in-ewm/m-p/5822021#M1315120</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Even I am struck with the same problem.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P dir="ltr"&gt; Can any one provide me a BAPI or a function module to do the Posting Change in eWM? &lt;/P&gt;&lt;P dir="ltr"&gt; The transaction for doing the Posting Change is /SCWM/POST or /SCWM/IM_PC.&lt;/P&gt;&lt;P dir="ltr"&gt; I am not able to do a call&amp;nbsp; transaction for these transactions. &lt;/P&gt;&lt;P dir="ltr"&gt; So, could some body provide me a BAPI&amp;nbsp; or function module for the same. &lt;/P&gt;&lt;P dir="ltr"&gt;&lt;/P&gt;&lt;P dir="ltr"&gt;I am not able to use the FMs /SCWM/STOCK_CHANGE.&lt;/P&gt;&lt;P dir="ltr"&gt;&lt;/P&gt;&lt;P dir="ltr"&gt;Thanks&lt;/P&gt;&lt;P dir="ltr"&gt;Madhavi&lt;/P&gt;&lt;DIV id="_dyhb23rg4374"&gt; &lt;/DIV&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 23 Jan 2013 12:36:10 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/programming-posting-change-in-ewm/m-p/5822021#M1315120</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2013-01-23T12:36:10Z</dc:date>
    </item>
    <item>
      <title>Re: Programming posting change in EWM</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/programming-posting-change-in-ewm/m-p/5822022#M1315121</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Rob,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;We have similar requirement to do posting change from RF&lt;/P&gt;&lt;P&gt;which is not there in standard&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Were you able to use the FM /SCWM/STOCK_CHANGE&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Roopendra&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 27 Mar 2014 13:46:53 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/programming-posting-change-in-ewm/m-p/5822022#M1315121</guid>
      <dc:creator>former_member1263543</dc:creator>
      <dc:date>2014-03-27T13:46:53Z</dc:date>
    </item>
    <item>
      <title>Re: Programming posting change in EWM</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/programming-posting-change-in-ewm/m-p/5822023#M1315122</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Have you guys figured out how to use this FM? I am facing exactly the same issue. Please provide any information that would help. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;thanks, Raj&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 12 Aug 2014 16:02:42 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/programming-posting-change-in-ewm/m-p/5822023#M1315122</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2014-08-12T16:02:42Z</dc:date>
    </item>
    <item>
      <title>Re: Programming posting change in EWM</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/programming-posting-change-in-ewm/m-p/5822024#M1315123</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;HI ,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; I know this is an old post.&amp;nbsp; Did any of you solve the issue?Can you please share any info if you have solved it?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Santosh&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 16 Mar 2016 13:53:45 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/programming-posting-change-in-ewm/m-p/5822024#M1315123</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2016-03-16T13:53:45Z</dc:date>
    </item>
    <item>
      <title>Re: Programming posting change in EWM</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/programming-posting-change-in-ewm/m-p/5822025#M1315124</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Santosh,&lt;/P&gt;&lt;P&gt;Sorry, we never did the posting change that way (the requirements changed before I completed my spec and therefore it was never programmed or tested).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I've looked but can't find anything relevant in my notes from that time.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Good luck!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Rob&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 16 Mar 2016 19:55:12 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/programming-posting-change-in-ewm/m-p/5822025#M1315124</guid>
      <dc:creator>rob_smeets2</dc:creator>
      <dc:date>2016-03-16T19:55:12Z</dc:date>
    </item>
    <item>
      <title>Re: Programming posting change in EWM</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/programming-posting-change-in-ewm/m-p/5822026#M1315125</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks anyways Rob&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 17 Mar 2016 08:28:25 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/programming-posting-change-in-ewm/m-p/5822026#M1315125</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2016-03-17T08:28:25Z</dc:date>
    </item>
    <item>
      <title>Re: Programming posting change in EWM</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/programming-posting-change-in-ewm/m-p/5822027#M1315126</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;HI All,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; I managed to solve the issue. I used the class&amp;nbsp; /SCWM/CL_UI_POST to do it.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The Steps are:&lt;/P&gt;&lt;OL&gt;&lt;LI&gt; instantiate /SCWM/CL_UI_POST ( object LR_UI_POST )&lt;/LI&gt;&lt;LI&gt;&amp;nbsp; Initialise /SCMB/CL_EES_DEFAULTS&lt;SPAN class="L0S70"&gt;=&amp;gt;init to populate the defaults( Warehouse etc.)&lt;/SPAN&gt;&lt;/LI&gt;&lt;LI&gt;&amp;nbsp; Populate the defaults using the esdus_manager received from step 2&lt;/LI&gt;&lt;LI&gt;&lt;SPAN class="L0S52"&gt;call &lt;SPAN class="L0S52"&gt;METHOD &lt;/SPAN&gt;lr_UI_post&lt;SPAN class="L0S70"&gt;-&amp;gt;&lt;/SPAN&gt;(&lt;SPAN class="L0S33"&gt;'QUERY'&lt;/SPAN&gt;&lt;SPAN class="L0S55"&gt;) to populate the internal table.&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/LI&gt;&lt;LI&gt;Change the internal table to your specifications/needs ( eg:process type ,destination bins etc)&lt;/LI&gt;&lt;LI&gt;&lt;SPAN class="L0S52"&gt;CALL &lt;SPAN class="L0S52"&gt;METHOD &lt;/SPAN&gt;lr_UI_post&lt;SPAN class="L0S70"&gt;-&amp;gt;&lt;/SPAN&gt;&lt;SPAN class="L0S52"&gt;UPDATE to update the details&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/LI&gt;&lt;LI&gt;&lt;SPAN class="L0S52"&gt;&lt;SPAN class="L0S52"&gt;&amp;nbsp; &lt;SPAN class="L0S52"&gt;call &lt;SPAN class="L0S52"&gt;METHOD &lt;/SPAN&gt;lr_UI_post&lt;SPAN class="L0S70"&gt;-&amp;gt;&lt;/SPAN&gt;(&lt;SPAN class="L0S33"&gt;'EXECUTE'&lt;/SPAN&gt;&lt;SPAN class="L0S55"&gt;)&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/LI&gt;&lt;LI&gt;&lt;SPAN class="L0S52"&gt;&lt;SPAN class="L0S52"&gt;&lt;SPAN class="L0S52"&gt;&lt;SPAN class="L0S55"&gt;&lt;SPAN class="L0S52"&gt;CALL &lt;SPAN class="L0S52"&gt;METHOD &lt;/SPAN&gt;lr_UI_post&lt;SPAN class="L0S70"&gt;-&amp;gt;&lt;/SPAN&gt;(&lt;SPAN class="L0S33"&gt;'SAVE'&lt;/SPAN&gt;&lt;SPAN class="L0S55"&gt;)&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/LI&gt;&lt;LI&gt;&lt;SPAN class="L0S52"&gt;&lt;SPAN class="L0S52"&gt;&lt;SPAN class="L0S52"&gt;&lt;SPAN class="L0S55"&gt;&lt;SPAN class="L0S52"&gt;&lt;SPAN class="L0S55"&gt;Commit work and wait&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/LI&gt;&lt;/OL&gt;&lt;P&gt;&lt;SPAN class="L0S52"&gt;&lt;SPAN class="L0S52"&gt;&lt;SPAN class="L0S52"&gt;&lt;SPAN class="L0S55"&gt;&lt;SPAN class="L0S52"&gt;&lt;SPAN class="L0S55"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="L0S52"&gt;&lt;SPAN class="L0S52"&gt;&lt;SPAN class="L0S52"&gt;&lt;SPAN class="L0S55"&gt;&lt;SPAN class="L0S52"&gt;&lt;SPAN class="L0S55"&gt;Hope this helps and please change the thread to answered.&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="L0S52"&gt;&lt;SPAN class="L0S52"&gt;&lt;SPAN class="L0S52"&gt;&lt;SPAN class="L0S55"&gt;&lt;SPAN class="L0S52"&gt;&lt;SPAN class="L0S55"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="L0S52"&gt;&lt;SPAN class="L0S52"&gt;&lt;SPAN class="L0S52"&gt;&lt;SPAN class="L0S55"&gt;&lt;SPAN class="L0S52"&gt;&lt;SPAN class="L0S55"&gt;Regards,&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="L0S52"&gt;&lt;SPAN class="L0S52"&gt;&lt;SPAN class="L0S52"&gt;&lt;SPAN class="L0S55"&gt;&lt;SPAN class="L0S52"&gt;&lt;SPAN class="L0S55"&gt;Santosh&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="L0S52"&gt;&lt;SPAN class="L0S52"&gt;&lt;SPAN class="L0S52"&gt;&lt;SPAN class="L0S55"&gt;&lt;SPAN class="L0S52"&gt;&lt;SPAN class="L0S55"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 17 Mar 2016 13:53:08 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/programming-posting-change-in-ewm/m-p/5822027#M1315126</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2016-03-17T13:53:08Z</dc:date>
    </item>
    <item>
      <title>Re: Programming posting change in EWM</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/programming-posting-change-in-ewm/m-p/5822028#M1315127</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Santosh&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;execute method fails at the check for OIP as it checks for /SCWM/POST. Can you please let me know how did you over come this.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks, Raj&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 26 Apr 2016 22:24:34 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/programming-posting-change-in-ewm/m-p/5822028#M1315127</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2016-04-26T22:24:34Z</dc:date>
    </item>
    <item>
      <title>Re: Programming posting change in EWM</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/programming-posting-change-in-ewm/m-p/5822029#M1315128</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Everything is easier. I like that implemented&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;CALL FUNCTION '/SCWM/STOCK_CHANGE'&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; EXPORTING&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; is_header&amp;nbsp;&amp;nbsp; = ls_header&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; it_item&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; = lt_item&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; IMPORTING&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; et_bapiret&amp;nbsp; = lt_bapiret&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ev_severity = lv_severity.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN lang="EN-US" style="background: white; color: blue; font-family: 'Courier New'; font-size: 10pt; mso-fareast-language: RU; mso-fareast-font-family: Calibri; mso-ansi-language: EN-US; mso-fareast-theme-font: minor-latin; mso-bidi-language: AR-SA;"&gt;CALL FUNCTION &lt;/SPAN&gt;&lt;SPAN lang="EN-US" style="background: white; color: #4da619; font-family: 'Courier New'; font-size: 10pt; mso-fareast-language: RU; mso-fareast-font-family: Calibri; mso-ansi-language: EN-US; mso-fareast-theme-font: minor-latin; mso-bidi-language: AR-SA;"&gt;'/SCWM/GM_POST'.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN lang="EN-US" style="background: white; color: #4da619; font-family: 'Courier New'; font-size: 10pt; mso-fareast-language: RU; mso-fareast-font-family: Calibri; mso-ansi-language: EN-US; mso-fareast-theme-font: minor-latin; mso-bidi-language: AR-SA;"&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN lang="EN-US" style="background: white; color: #4da619; font-family: 'Courier New'; font-size: 10pt; mso-fareast-language: RU; mso-fareast-font-family: Calibri; mso-ansi-language: EN-US; mso-fareast-theme-font: minor-latin; mso-bidi-language: AR-SA;"&gt;&lt;SPAN lang="EN-US" style="color: #1f497d; font-family: 'Calibri','sans-serif'; font-size: 11pt; mso-fareast-language: RU; mso-fareast-font-family: Calibri; mso-ansi-language: EN-US; mso-fareast-theme-font: minor-latin; mso-bidi-language: AR-SA;"&gt;commit&amp;nbsp; work and wait.&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 31 May 2016 14:46:17 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/programming-posting-change-in-ewm/m-p/5822029#M1315128</guid>
      <dc:creator>former_member267257</dc:creator>
      <dc:date>2016-05-31T14:46:17Z</dc:date>
    </item>
    <item>
      <title>Re: Programming posting change in EWM</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/programming-posting-change-in-ewm/m-p/5822030#M1315129</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Santosh,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Can you please share the sample code if you have for this. We are facing the same issue.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;P&gt;Srinivasa&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 03 Jun 2016 21:36:57 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/programming-posting-change-in-ewm/m-p/5822030#M1315129</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2016-06-03T21:36:57Z</dc:date>
    </item>
    <item>
      <title>Re: Programming posting change in EWM</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/programming-posting-change-in-ewm/m-p/5822031#M1315130</link>
      <description>&lt;P&gt;I had this same exact problem but specifically to update the stock type after a Goods receive what i used was the function module /SCWM/STOCK_CHANGE and /SCWM/GM_POST, i can provide the method i used for modification depending on the requirements.&lt;/P&gt;&lt;P&gt;If the following code adjusted to your requirements doesn't work i recommend opening the transaction SAAB and activate the break point /SCWM/GM, following that do your posting using the transaction /n/SCWM/POST and find the Function module /SCWM/STOCK_CHANGE and see what the Standart code is passing in the importing structures and tables regarding your example, i believe if you change to use just what standart uses as i did in my case it will work.&lt;/P&gt;&lt;P&gt;Good Luck,&lt;/P&gt;&lt;P&gt;Alex.&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;METHOD update_stock_type.
DATA lt_aqua TYPE STANDARD TABLE OF /scwm/aqua.
DATA it_item TYPE /scwm/tt_spitem.
DATA is_item TYPE /scwm/s_spitem.
DATA lt_bapiret TYPE bapiret2_t.
DATA lv_severity TYPE bapi_mtype.
DATA is_quan TYPE /scwm/s_quan.
DATA lt_ordim_c TYPE STANDARD TABLE OF /scwm/ordim_c.
DATA lv_cat TYPE /lime/stock_category.


"There will be necessary to exist a internal table with the HUs we want to update for my case and for the sake of just showing an example consider it is lt_hus

"gets information regarding the HU on aqua
SELECT *
FROM /scwm/aqua
INTO TABLE lt_aqua
FOR ALL ENTRIES IN lt_hus
WHERE lgnum EQ lv_lgnum
AND huident EQ lt_hus-huident.

IF sy-subrc &amp;lt;&amp;gt; 0.
"Implement your own logic when no data is found

ENDIF.

"Gets the item information updated
SELECT *
FROM /scdl/db_proci_i
INTO TABLE @DATA(lt_proci_update)
WHERE docid EQ @gs_screen_items-proci-docid.

IF sy-subrc &amp;lt;&amp;gt; 0.
CLEAR lt_proci_update.

"Implement your own logic when no data is found

ENDIF.

"Gets the task created for the HU by POSTING
SELECT *
FROM /scwm/ordim_c
INTO TABLE lt_ordim_c
FOR ALL ENTRIES IN lt_ewmt021
WHERE lgnum EQ gs_screen_header-lgnum
AND dguid_hu EQ lt_ewmt021-guid_hu.

IF sy-subrc &amp;lt;&amp;gt; 0.
CLEAR: lt_ewmt021, lt_proci_update, lt_ordim_c.

"Implement your own logic when no data is found

ENDIF.

LOOP AT lt_hus ASSIGNING FIELD-SYMBOL(&amp;lt;fs_hus&amp;gt;).

READ TABLE lt_aqua WITH KEY huident = &amp;lt;fs_hus&amp;gt;-huident ASSIGNING FIELD-SYMBOL(&amp;lt;fs_aqua&amp;gt;).

IF &amp;lt;fs_aqua&amp;gt; IS NOT ASSIGNED.
CONTINUE.
ENDIF.

READ TABLE lt_proci_update WITH KEY docid = &amp;lt;fs_hus&amp;gt;-docid
itemid = &amp;lt;fs_hus&amp;gt;-itemid ASSIGNING FIELD-SYMBOL(&amp;lt;fs_proci&amp;gt;).

IF &amp;lt;fs_proci&amp;gt; IS NOT ASSIGNED.
CONTINUE.
ENDIF.

READ TABLE lt_ordim_c WITH KEY dguid_hu = &amp;lt;fs_hus&amp;gt;-guid_hu ASSIGNING FIELD-SYMBOL(&amp;lt;fs_ordim_c&amp;gt;).

IF &amp;lt;fs_ordim_c&amp;gt; IS NOT ASSIGNED.
CONTINUE.
ENDIF.

"In this case the update will be to change the stock type from blocked to Unblocked
"Stock Type to be updated
MOVE &amp;lt;fs_aqua&amp;gt;-cat TO lv_cat.
REPLACE ALL OCCURRENCES OF 'B' IN lv_cat WITH 'F'.

"Gets QUAN information
SELECT SINGLE *
FROM /scwm/quan
INTO @DATA(ls_quan)
WHERE guid_stock EQ @&amp;lt;fs_aqua&amp;gt;-guid_stock
AND guid_parent EQ @&amp;lt;fs_aqua&amp;gt;-guid_parent.

"Sets the ID using the current line iterator
is_item-id = sy-tabix.
is_item-id_group = sy-tabix + 1.
is_item-direction = 'T'.
is_item-squant_set = abap_true.
is_item-procty = &amp;lt;fs_proci&amp;gt;-/scwm/procty.
is_item-guid_hu = &amp;lt;fs_hus&amp;gt;-guid_hu.
is_item-huident = &amp;lt;fs_hus&amp;gt;-huident.

"Quantity of stock saved on the HU
is_quan-unit = &amp;lt;fs_hus&amp;gt;-uom.
is_quan-quan = &amp;lt;fs_hus&amp;gt;-qty.
APPEND is_quan TO is_item-t_quan.

"Information regarding the HU in the Wharehouse
is_item-loc-lgnum = gs_screen_header-lgnum.
is_item-loc-lgtyp = &amp;lt;fs_aqua&amp;gt;-lgtyp.
is_item-loc-lgpla = &amp;lt;fs_aqua&amp;gt;-lgpla.

"Passes the current information of the HU
is_item-source_s-idx_stock = ls_quan-idx_stock.
is_item-source_s-guid_stock = &amp;lt;fs_aqua&amp;gt;-guid_stock.
is_item-source_s-matid = &amp;lt;fs_aqua&amp;gt;-matid.
is_item-source_s-cat = &amp;lt;fs_aqua&amp;gt;-cat.
is_item-source_s-owner = &amp;lt;fs_aqua&amp;gt;-owner.
is_item-source_s-owner_role = &amp;lt;fs_aqua&amp;gt;-owner_role.
is_item-source_s-entitled = &amp;lt;fs_aqua&amp;gt;-entitled.
is_item-source_s-entitled_role = &amp;lt;fs_aqua&amp;gt;-entitled_role.
is_item-source_s-qdoccat = &amp;lt;fs_proci&amp;gt;-doccat.
is_item-source_s-qdocid = &amp;lt;fs_proci&amp;gt;-docid.
is_item-source_s-qitmid = &amp;lt;fs_proci&amp;gt;-itemid.

"Passes the information with the modifications we want made to the stock
is_item-dest_s-matid = &amp;lt;fs_aqua&amp;gt;-matid.
is_item-dest_s-cat = lv_cat. "What we will want to modifiy
is_item-dest_s-matid = &amp;lt;fs_aqua&amp;gt;-matid.
is_item-dest_s-qdoccat = &amp;lt;fs_proci&amp;gt;-doccat.
is_item-dest_s-qdocid = &amp;lt;fs_proci&amp;gt;-docid.
is_item-dest_s-qitmid = &amp;lt;fs_proci&amp;gt;-itemid.
is_item-dest_s-owner = &amp;lt;fs_aqua&amp;gt;-owner.
is_item-dest_s-owner_role = &amp;lt;fs_aqua&amp;gt;-owner_role.
is_item-dest_s-entitled = &amp;lt;fs_aqua&amp;gt;-entitled.
is_item-dest_s-entitled_role = &amp;lt;fs_aqua&amp;gt;-entitled_role.

APPEND is_item TO it_item.
CLEAR is_item.

ENDLOOP.

"Calls Stock Change function module to proceed to update the HU
CALL FUNCTION '/SCWM/STOCK_CHANGE'
EXPORTING
is_header = VALUE /scwm/s_gmheader( lgnum = gs_screen_header-lgnum
created_by = &amp;lt;fs_ordim_c&amp;gt;-created_by
created_at = &amp;lt;fs_ordim_c&amp;gt;-created_at
code = '/SCWM/POST' )
it_item = it_item
IMPORTING
et_bapiret = lt_bapiret
ev_severity = lv_severity.

LOOP AT lt_bapiret ASSIGNING FIELD-SYMBOL(&amp;lt;fs_bapiret&amp;gt;).

IF &amp;lt;fs_bapiret&amp;gt;-type EQ 'E'.
CALL FUNCTION 'YOUR_MESSAGE_FUNCTION'
EXPORTING
iv_id = &amp;lt;fs_bapiret&amp;gt;-id
iv_number = &amp;lt;fs_bapiret&amp;gt;-number
iv_typ = &amp;lt;fs_bapiret&amp;gt;-type
iv_var1 = &amp;lt;fs_bapiret&amp;gt;-message_v1
iv_var2 = &amp;lt;fs_bapiret&amp;gt;-message_v2
iv_var3 = &amp;lt;fs_bapiret&amp;gt;-message_v3
iv_var4 = &amp;lt;fs_bapiret&amp;gt;-message_v4.
CLEAR: lt_proci_update, lt_ordim_c.
"implementar rotina de erro
ENDIF.

ENDLOOP.

"Will try to POST the changes and for that the function module will generate a new task 
TRY.
DATA lv_tanum TYPE /scwm/tanum.
CALL FUNCTION '/SCWM/GM_POST'
IMPORTING
ev_tanum = lv_tanum
et_bapiret = lt_bapiret
ev_severity = lv_severity.
CATCH /scwm/cx_core.

LOOP AT lt_bapiret ASSIGNING &amp;lt;fs_bapiret&amp;gt;.

IF &amp;lt;fs_bapiret&amp;gt;-type EQ 'E'.
CALL FUNCTION 'YOUR_MESSAGE_FUNCTION'
EXPORTING
iv_id = &amp;lt;fs_bapiret&amp;gt;-id
iv_number = &amp;lt;fs_bapiret&amp;gt;-number
iv_typ = &amp;lt;fs_bapiret&amp;gt;-type
iv_var1 = &amp;lt;fs_bapiret&amp;gt;-message_v1
iv_var2 = &amp;lt;fs_bapiret&amp;gt;-message_v2
iv_var3 = &amp;lt;fs_bapiret&amp;gt;-message_v3
iv_var4 = &amp;lt;fs_bapiret&amp;gt;-message_v4.
CLEAR: lt_proci_update, lt_ordim_c.
"Implement your own logic for when theres an error
ENDIF.

ENDLOOP.

ENDTRY.

COMMIT WORK AND WAIT.

ENDMETHOD.&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 02 Jul 2020 10:38:19 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/programming-posting-change-in-ewm/m-p/5822031#M1315130</guid>
      <dc:creator>former_member688833</dc:creator>
      <dc:date>2020-07-02T10:38:19Z</dc:date>
    </item>
  </channel>
</rss>

