<?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: Commit work and wait with WS_REVERSE_GOODS_ISSUE problem in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/commit-work-and-wait-with-ws-reverse-goods-issue-problem/m-p/12786678#M2024124</link>
    <description>&lt;P&gt;It's simple. SY-SUBRC &amp;lt;&amp;gt; 0 means that one of the function modules in the update task fails. If that's the case, you have them listed in SM13.&lt;/P&gt;&lt;P&gt;Note that SY-SUBRC is set only for COMMIT WORK AND WAIT, not for COMMIT WORK without AND WAIT.&lt;/P&gt;&lt;P&gt;Otherwise, it's otpusk_tab.&lt;/P&gt;&lt;P&gt;Why don't you "add code in your program to help you analyze what's going on when running in background"? (as I said previously)&lt;/P&gt;</description>
    <pubDate>Thu, 23 Nov 2023 11:49:28 GMT</pubDate>
    <dc:creator>Sandra_Rossi</dc:creator>
    <dc:date>2023-11-23T11:49:28Z</dc:date>
    <item>
      <title>Commit work and wait with WS_REVERSE_GOODS_ISSUE problem</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/commit-work-and-wait-with-ws-reverse-goods-issue-problem/m-p/12786672#M2024118</link>
      <description>&lt;P&gt;Hi. i've got a problem with Commit work and wait.&lt;BR /&gt;I have a list of Distribution Document Number i need to storn.&lt;/P&gt;
  &lt;P&gt;And i have 2 tables for sy-subrc = 0 and sy-subrc ne 0 after calling 'WS_REVERSE_GOODS_ISSUE'&lt;/P&gt;
  &lt;P&gt;The programm starts in backround every working day, but in sm37 it shows that my task is rejected ( it shows that the programm had worked a few seconds, but in fact it had worked more ). &lt;/P&gt;
  &lt;P&gt;The table zstorn_mistakes is empty it means that for every material in a list sy-subrc = 0.&lt;/P&gt;
  &lt;P&gt;But NOT ALL of vbelns are shown in mine zstorn_logs table. And some of the vbelns will be in a list at next day.&lt;/P&gt;
  &lt;P&gt;So i think the problem is with connection WS_REVERSE_GOOD_ISSUE and COMMIT WORK AND WAIT. &lt;/P&gt;
  &lt;P&gt;so i have 2 questions :&lt;BR /&gt;1) Is i need to use commit work and wait here?&lt;BR /&gt;2) why at sm37 it shows that programm has worked a few second, but in fact it has worked much more?&lt;/P&gt; 
  &lt;PRE&gt;&lt;CODE&gt;  call function 'MESSAGES_INITIALIZE'
       exporting
            i_identification = sy-uzeit
       importing
            e_identification = ident
       exceptions
            others           = 0.
  CALL FUNCTION 'MESSAGES_ACTIVE'
       EXCEPTIONS
            OTHERS = 1.

loop at vbeln_user into ls_vbeln_user.
  CALL FUNCTION 'WS_REVERSE_GOODS_ISSUE'
    EXPORTING
      I_VBELN                   = ls_vbeln_user-vbeln
      I_BUDAT                   = ls_vbeln_user-budat
      I_COUNT                   = 1
      I_TCODE                   = 'VL09'
      I_VBTYP                   = ls_vbeln_user-vbtyp
    TABLES
      T_MESG                    = XMESG
    EXCEPTIONS
      ERROR_REVERSE_GOODS_ISSUE = 1
      OTHERS                    = 2.

  IF SY-SUBRC IS INITIAL.
    COMMIT WORK and WAIT.
    if sy-subrc = 0.
      loop at otpusk_tab into ls_otpusk WHERE vbeln = ls_vbeln_user-vbeln.
        MODIFY zstorn_logs from ls_otpusk.
      endloop.
      ls_user_msg-usnam = ls_vbeln_user-usnam.
      insert ls_user_msg into TABLE user_msg.
    endif.
  ELSE.
    CALL FUNCTION 'MESSAGES_GIVE'
      TABLES
        T_MESG = TMESG
      EXCEPTIONS
        OTHERS = 0.
    loop at tmesg into ls_tmesg.
      ls_mistakes-vbeln = ls_vbeln_user-vbeln.
       ls_mistakes-ZEILE = ls_tmesg.
       ls_mistakes-MSGTY = ls_tmesg-MSGTY.
       ls_mistakes-TEXT  = ls_tmesg-text.
       ls_mistakes-ARBGB = ls_tmesg-ARBGB.
       ls_mistakes-TXTNR = ls_tmesg-TXTNR.
       ls_mistakes-MSGV1 = ls_tmesg-MSGV1.
       ls_mistakes-MSGV2 = ls_tmesg-MSGV2.
       ls_mistakes-MSGV3 = ls_tmesg-MSGV3.
       ls_mistakes-MSGV4 = ls_tmesg-MSGV4.
       MODIFY zstorn_mistakes from ls_mistakes.

    endloop.

    CONTINUE.            "*--lТuft hier extern
  ENDIF.
endloop.&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 22 Nov 2023 09:52:28 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/commit-work-and-wait-with-ws-reverse-goods-issue-problem/m-p/12786672#M2024118</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2023-11-22T09:52:28Z</dc:date>
    </item>
    <item>
      <title>Re: Commit work and wait with WS_REVERSE_GOODS_ISSUE problem</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/commit-work-and-wait-with-ws-reverse-goods-issue-problem/m-p/12786673#M2024119</link>
      <description>&lt;P&gt;if otpusk_tab is empty, it's normal that nothing is written to zstorn_logs.&lt;/P&gt;&lt;P&gt;I don't understand how you can think that COMMIT WORK can be the culprit (NB: and wait can't be a problem in your case).&lt;/P&gt;&lt;P&gt;Only you can analyze and solve this problem.&lt;/P&gt;</description>
      <pubDate>Wed, 22 Nov 2023 16:36:46 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/commit-work-and-wait-with-ws-reverse-goods-issue-problem/m-p/12786673#M2024119</guid>
      <dc:creator>Sandra_Rossi</dc:creator>
      <dc:date>2023-11-22T16:36:46Z</dc:date>
    </item>
    <item>
      <title>Re: Commit work and wait with WS_REVERSE_GOODS_ISSUE problem</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/commit-work-and-wait-with-ws-reverse-goods-issue-problem/m-p/12786674#M2024120</link>
      <description>&lt;P&gt;It's not empty,and it's doesn't matter here&lt;/P&gt;&lt;P&gt; i've got like 100 vbelns inside vbeln_user.&lt;/P&gt;&lt;P&gt;And i've got a loop which need to storn them one by one and if sy-subrc = 0 it should write them to &lt;BR /&gt;zstorn_logs, otherwise to zstorn_mistakes.&lt;BR /&gt;But zstorn_mistakes is empty and NOT ALL of the vbelns inside of table vbeln_users are storning.&lt;BR /&gt;The problem is with 'commit work and wait' cause some of vbelns which should have been strorn are repeating at next day.&lt;BR /&gt;I think the problem is that some of vbeln are not in time and the programm starts the new vbeln when the previous is not storn yet.&lt;/P&gt;&lt;P&gt;Or mb 'commit work and wait' is not eq to 0 whe program runs in background&lt;/P&gt;&lt;P&gt;And i cannot analyze it cause the programm running in background job and if i start it as usual it would work well.&lt;/P&gt;</description>
      <pubDate>Thu, 23 Nov 2023 05:21:17 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/commit-work-and-wait-with-ws-reverse-goods-issue-problem/m-p/12786674#M2024120</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2023-11-23T05:21:17Z</dc:date>
    </item>
    <item>
      <title>Re: Commit work and wait with WS_REVERSE_GOODS_ISSUE problem</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/commit-work-and-wait-with-ws-reverse-goods-issue-problem/m-p/12786675#M2024121</link>
      <description>&lt;P&gt;So, the problem is about background versus not background.&lt;/P&gt;&lt;P&gt;Quick possibilities to check: different user (so different settings and different authorizations), or running in different application server (files and so on).&lt;/P&gt;&lt;P&gt;You must add code in your program to help you analyze what's going on when running in background.&lt;/P&gt;&lt;P&gt;I don't understand "which should have been ST(r)ORN", please use common terms like "inserted in the table", "updated in the table", etc.&lt;/P&gt;&lt;P&gt;I can only tell you for sure that COMMIT WORK AND WAIT is not responsible of your problem, it's something else, but I can't tell more because it seems you cannot or you are not willing to explain better.&lt;/P&gt;</description>
      <pubDate>Thu, 23 Nov 2023 09:39:23 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/commit-work-and-wait-with-ws-reverse-goods-issue-problem/m-p/12786675#M2024121</guid>
      <dc:creator>Sandra_Rossi</dc:creator>
      <dc:date>2023-11-23T09:39:23Z</dc:date>
    </item>
    <item>
      <title>Re: Commit work and wait with WS_REVERSE_GOODS_ISSUE problem</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/commit-work-and-wait-with-ws-reverse-goods-issue-problem/m-p/12786676#M2024122</link>
      <description>&lt;P&gt;The only potential impact of COMMIT WORK AND WAIT would be related to any process running in the update task, in connection to your logic, but we can't tell you anything about it, only you can check that on your system.&lt;/P&gt;</description>
      <pubDate>Thu, 23 Nov 2023 09:44:23 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/commit-work-and-wait-with-ws-reverse-goods-issue-problem/m-p/12786676#M2024122</guid>
      <dc:creator>Sandra_Rossi</dc:creator>
      <dc:date>2023-11-23T09:44:23Z</dc:date>
    </item>
    <item>
      <title>Re: Commit work and wait with WS_REVERSE_GOODS_ISSUE problem</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/commit-work-and-wait-with-ws-reverse-goods-issue-problem/m-p/12786677#M2024123</link>
      <description>&lt;P&gt;sry, i think in english there is no such notion like 'Storn' that means cancelled document, which are stored at LIKP table.&lt;/P&gt;&lt;P&gt;So i have an list of this LIKP-Vbeln deliveries.&lt;BR /&gt;And function 'WS_REVERSE_GOODS_ISSUE'alows to cancel them.&lt;/P&gt;&lt;P&gt;mine zstorn_mistakes table is empty and not all of the deliveries are inserting into zstorn_logs&lt;/P&gt;&lt;P&gt;That means that problem is smth here &lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;PRE&gt;&lt;CODE&gt;    COMMIT WORK and WAIT.
    if sy-subrc = 0.
      loop at otpusk_tab into ls_otpusk WHERE vbeln = ls_vbeln_user-vbeln.
        MODIFY zstorn_logs from ls_otpusk.
      endloop.
      ls_user_msg-usnam = ls_vbeln_user-usnam.
      insert ls_user_msg into TABLE user_msg.
    endif.&lt;/CODE&gt;&lt;/PRE&gt;&lt;BR /&gt;</description>
      <pubDate>Thu, 23 Nov 2023 10:17:08 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/commit-work-and-wait-with-ws-reverse-goods-issue-problem/m-p/12786677#M2024123</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2023-11-23T10:17:08Z</dc:date>
    </item>
    <item>
      <title>Re: Commit work and wait with WS_REVERSE_GOODS_ISSUE problem</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/commit-work-and-wait-with-ws-reverse-goods-issue-problem/m-p/12786678#M2024124</link>
      <description>&lt;P&gt;It's simple. SY-SUBRC &amp;lt;&amp;gt; 0 means that one of the function modules in the update task fails. If that's the case, you have them listed in SM13.&lt;/P&gt;&lt;P&gt;Note that SY-SUBRC is set only for COMMIT WORK AND WAIT, not for COMMIT WORK without AND WAIT.&lt;/P&gt;&lt;P&gt;Otherwise, it's otpusk_tab.&lt;/P&gt;&lt;P&gt;Why don't you "add code in your program to help you analyze what's going on when running in background"? (as I said previously)&lt;/P&gt;</description>
      <pubDate>Thu, 23 Nov 2023 11:49:28 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/commit-work-and-wait-with-ws-reverse-goods-issue-problem/m-p/12786678#M2024124</guid>
      <dc:creator>Sandra_Rossi</dc:creator>
      <dc:date>2023-11-23T11:49:28Z</dc:date>
    </item>
    <item>
      <title>Re: Commit work and wait with WS_REVERSE_GOODS_ISSUE problem</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/commit-work-and-wait-with-ws-reverse-goods-issue-problem/m-p/12786679#M2024125</link>
      <description>&lt;P&gt;Solved with this.&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;loop at vbeln_user into ls_vbeln_user.&lt;BR /&gt;    perform storn.&lt;BR /&gt;endloop.&lt;BR /&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;PRE&gt;&lt;CODE&gt;FORM storn.&lt;BR /&gt;  call function 'MESSAGES_INITIALIZE'&lt;BR /&gt;  EXPORTING&lt;BR /&gt;    i_identification = sy-uzeit&lt;BR /&gt;  IMPORTING&lt;BR /&gt;    e_identification = ident&lt;BR /&gt;  EXCEPTIONS&lt;BR /&gt;    others           = 0.&lt;BR /&gt;CALL FUNCTION 'MESSAGES_ACTIVE'&lt;BR /&gt;  EXCEPTIONS&lt;BR /&gt;    OTHERS = 1.&lt;BR /&gt;  CALL FUNCTION 'WS_REVERSE_GOODS_ISSUE'&lt;BR /&gt;    EXPORTING&lt;BR /&gt;      I_VBELN                   = ls_vbeln_user-vbeln&lt;BR /&gt;      I_BUDAT                   = ls_vbeln_user-budat&lt;BR /&gt;      I_COUNT                   = 1&lt;BR /&gt;      I_TCODE                   = 'VL09'&lt;BR /&gt;      I_VBTYP                   = ls_vbeln_user-vbtyp&lt;BR /&gt;    TABLES&lt;BR /&gt;      T_MESG                    = XMESG&lt;BR /&gt;    EXCEPTIONS&lt;BR /&gt;      ERROR_REVERSE_GOODS_ISSUE = 1&lt;BR /&gt;      OTHERS                    = 2.&lt;BR /&gt;&lt;BR /&gt;  IF SY-SUBRC IS INITIAL.&lt;BR /&gt;    commit work and wait.&lt;BR /&gt;&lt;BR /&gt;    if sy-subrc = 0.&lt;BR /&gt;      loop at otpusk_tab into ls_otpusk WHERE vbeln = ls_vbeln_user-vbeln.&lt;BR /&gt;        ls_otpusk-ztime = sy-uzeit.&lt;BR /&gt;        MODIFY zstorn_logs from ls_otpusk.&lt;BR /&gt;      endloop.&lt;BR /&gt;      ls_user_msg-usnam = ls_vbeln_user-usnam.&lt;BR /&gt;      insert ls_user_msg into TABLE user_msg.&lt;BR /&gt;    endif.&lt;BR /&gt;  ELSE.&lt;BR /&gt;    CALL FUNCTION 'MESSAGES_GIVE'&lt;BR /&gt;      TABLES&lt;BR /&gt;        T_MESG = TMESG&lt;BR /&gt;      EXCEPTIONS&lt;BR /&gt;        OTHERS = 0.&lt;BR /&gt;    loop at tmesg into ls_tmesg.&lt;BR /&gt;      ls_mistakes-vbeln = ls_vbeln_user-vbeln.&lt;BR /&gt;      ls_mistakes-ZEILE = ls_tmesg.&lt;BR /&gt;      ls_mistakes-MSGTY = ls_tmesg-MSGTY.&lt;BR /&gt;      ls_mistakes-ztime = sy-uzeit.&lt;BR /&gt;      ls_mistakes-TEXT  = ls_tmesg-text.&lt;BR /&gt;      ls_mistakes-ARBGB = ls_tmesg-ARBGB.&lt;BR /&gt;      ls_mistakes-TXTNR = ls_tmesg-TXTNR.&lt;BR /&gt;      ls_mistakes-MSGV1 = ls_tmesg-MSGV1.&lt;BR /&gt;      ls_mistakes-MSGV2 = ls_tmesg-MSGV2.&lt;BR /&gt;      ls_mistakes-MSGV3 = ls_tmesg-MSGV3.&lt;BR /&gt;      ls_mistakes-MSGV4 = ls_tmesg-MSGV4.&lt;BR /&gt;      MODIFY zstorn_mistakes from ls_mistakes.&lt;BR /&gt;&lt;BR /&gt;    endloop.&lt;BR /&gt;  ENDIF.&lt;BR /&gt;  clear tmesg.&lt;BR /&gt;endform.                    "storn&lt;BR /&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;I need to start 'MESSAGES_INITIALIZE'   'MESSAGES_ACTIVE'  &lt;/P&gt;&lt;P&gt;for every item in a loop.&lt;/P&gt;</description>
      <pubDate>Fri, 24 Nov 2023 09:28:22 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/commit-work-and-wait-with-ws-reverse-goods-issue-problem/m-p/12786679#M2024125</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2023-11-24T09:28:22Z</dc:date>
    </item>
    <item>
      <title>Re: Commit work and wait with WS_REVERSE_GOODS_ISSUE problem</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/commit-work-and-wait-with-ws-reverse-goods-issue-problem/m-p/12786680#M2024126</link>
      <description>&lt;P&gt;Well done, good to know that you have solved it. You may convert your comment into an answer, and then click on Accept (on the answer).&lt;/P&gt;</description>
      <pubDate>Fri, 24 Nov 2023 09:33:56 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/commit-work-and-wait-with-ws-reverse-goods-issue-problem/m-p/12786680#M2024126</guid>
      <dc:creator>Sandra_Rossi</dc:creator>
      <dc:date>2023-11-24T09:33:56Z</dc:date>
    </item>
  </channel>
</rss>

