<?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 How to pass control back ? in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/how-to-pass-control-back/m-p/2010546#M410299</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;Given below three block and question below that :&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;lt;b&amp;gt;=BLOCK 1===============================================&amp;lt;/b&amp;gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;LOOP AT wt_inputrec WHERE typecode = 'O'.&lt;/P&gt;&lt;P&gt;*--Create STOs and Sales Orders&lt;/P&gt;&lt;P&gt;      PERFORM create_sos_stos_rtvs.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ENDLOOP.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;lt;b&amp;gt;=BLOCK 2===============================================&amp;lt;/b&amp;gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;FORM create_sos_stos_rtvs .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;If transaction type = 1 than create sales orders&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;  IF wt_inputrec-trans = 1.&lt;/P&gt;&lt;P&gt;    PERFORM load_so_bapi_fields.&lt;/P&gt;&lt;P&gt;    PERFORM call_so_bapi_process.&lt;/P&gt;&lt;P&gt;*If transaction type = 2 and 3 than create RTV PO / Stock Transport&lt;/P&gt;&lt;P&gt;*Orders&lt;/P&gt;&lt;P&gt;  ELSEIF wt_inputrec-trans = 2 OR&lt;/P&gt;&lt;P&gt;         wt_inputrec-trans = 4.&lt;/P&gt;&lt;P&gt;    PERFORM load_po_sto_bapi_fields.&lt;/P&gt;&lt;P&gt;    PERFORM call_po_sto_bapi_process.&lt;/P&gt;&lt;P&gt;  ENDIF.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ENDFORM.                    " CREATE_SOs_STOs_RTVs&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;lt;b&amp;gt;=BLOCK 3===============================================&amp;lt;/b&amp;gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;FORM call_so_bapi_process .&lt;/P&gt;&lt;P&gt;IF lm_tora = 'T' and wt_zmwerks_mu-werks NOT IN s_solct.    &lt;/P&gt;&lt;P&gt;    -&lt;/P&gt;&lt;HR originaltext="----" /&gt;&lt;P&gt;SOME Calculation----&lt;/P&gt;&lt;HR originaltext="-----" /&gt;&lt;P&gt;ELSEIF lm_tora = 'A' and wt_zmwerks_mu-werks NOT IN s_solct. &lt;/P&gt;&lt;P&gt;     -&lt;/P&gt;&lt;HR originaltext="----" /&gt;&lt;P&gt;SOME Calculation----&lt;/P&gt;&lt;HR originaltext="-----" /&gt;&lt;P&gt;ELSEIF ( lm_tora = 'A' OR lm_tora = 'T' )              &lt;/P&gt;&lt;P&gt;              AND wt_zmwerks_mu-werks IN s_solct.            &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;           SELECT SINGLE z_return                            &lt;/P&gt;&lt;P&gt;           INTO   wa_return                                  &lt;/P&gt;&lt;P&gt;           FROM   ZZVAR                                      &lt;/P&gt;&lt;P&gt;           WHERE  z_key = wt_zmwerks_mu-werks                &lt;/P&gt;&lt;P&gt;           AND    z_name = 'DEPLOYMENT_SOSTO_LINECNT'.       &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;           IF SY-SUBRC = 0.                                  &lt;/P&gt;&lt;P&gt;               IF lm_count &amp;gt;= wa_return.                     &lt;/P&gt;&lt;P&gt;                   MOVE 'A' TO lm_ind.                       &lt;/P&gt;&lt;P&gt;               ELSE.                                         &lt;/P&gt;&lt;P&gt;                   MOVE 'U' TO lm_ind.                       &lt;/P&gt;&lt;P&gt;               ENDIF.                                        &lt;/P&gt;&lt;P&gt;           ELSE.                                             &lt;/P&gt;&lt;P&gt;               MOVE text-e18 TO message.                     &lt;/P&gt;&lt;P&gt;               MOVE wa-sourceloc TO paramater.               &lt;/P&gt;&lt;P&gt;               PERFORM map_error USING wt_zmwerks_mu-werks   &lt;/P&gt;&lt;P&gt;                                     message                 &lt;/P&gt;&lt;P&gt;                                     paramater.              &lt;/P&gt;&lt;P&gt;&amp;lt;b&amp;gt;               CONTINUE / BREAK / STOP.                                     &amp;lt;/b&amp;gt;           ENDIF.                                             &lt;/P&gt;&lt;P&gt;ELSE.&lt;/P&gt;&lt;P&gt;        MOVE 'A' TO lm_ind.&lt;/P&gt;&lt;P&gt;ENDIF.                  "Tools or Accessories.&lt;/P&gt;&lt;P&gt;============================================================&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;After PERFORM MAP_ERROR, I want that program control should go back to BLOCK 1 and continue with remaining reocrds from wt_inputrec.&lt;/P&gt;&lt;P&gt;Program execution should not stop. How can I do that?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 21 Mar 2007 18:32:57 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2007-03-21T18:32:57Z</dc:date>
    <item>
      <title>How to pass control back ?</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/how-to-pass-control-back/m-p/2010546#M410299</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;Given below three block and question below that :&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;lt;b&amp;gt;=BLOCK 1===============================================&amp;lt;/b&amp;gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;LOOP AT wt_inputrec WHERE typecode = 'O'.&lt;/P&gt;&lt;P&gt;*--Create STOs and Sales Orders&lt;/P&gt;&lt;P&gt;      PERFORM create_sos_stos_rtvs.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ENDLOOP.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;lt;b&amp;gt;=BLOCK 2===============================================&amp;lt;/b&amp;gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;FORM create_sos_stos_rtvs .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;If transaction type = 1 than create sales orders&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;  IF wt_inputrec-trans = 1.&lt;/P&gt;&lt;P&gt;    PERFORM load_so_bapi_fields.&lt;/P&gt;&lt;P&gt;    PERFORM call_so_bapi_process.&lt;/P&gt;&lt;P&gt;*If transaction type = 2 and 3 than create RTV PO / Stock Transport&lt;/P&gt;&lt;P&gt;*Orders&lt;/P&gt;&lt;P&gt;  ELSEIF wt_inputrec-trans = 2 OR&lt;/P&gt;&lt;P&gt;         wt_inputrec-trans = 4.&lt;/P&gt;&lt;P&gt;    PERFORM load_po_sto_bapi_fields.&lt;/P&gt;&lt;P&gt;    PERFORM call_po_sto_bapi_process.&lt;/P&gt;&lt;P&gt;  ENDIF.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ENDFORM.                    " CREATE_SOs_STOs_RTVs&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;lt;b&amp;gt;=BLOCK 3===============================================&amp;lt;/b&amp;gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;FORM call_so_bapi_process .&lt;/P&gt;&lt;P&gt;IF lm_tora = 'T' and wt_zmwerks_mu-werks NOT IN s_solct.    &lt;/P&gt;&lt;P&gt;    -&lt;/P&gt;&lt;HR originaltext="----" /&gt;&lt;P&gt;SOME Calculation----&lt;/P&gt;&lt;HR originaltext="-----" /&gt;&lt;P&gt;ELSEIF lm_tora = 'A' and wt_zmwerks_mu-werks NOT IN s_solct. &lt;/P&gt;&lt;P&gt;     -&lt;/P&gt;&lt;HR originaltext="----" /&gt;&lt;P&gt;SOME Calculation----&lt;/P&gt;&lt;HR originaltext="-----" /&gt;&lt;P&gt;ELSEIF ( lm_tora = 'A' OR lm_tora = 'T' )              &lt;/P&gt;&lt;P&gt;              AND wt_zmwerks_mu-werks IN s_solct.            &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;           SELECT SINGLE z_return                            &lt;/P&gt;&lt;P&gt;           INTO   wa_return                                  &lt;/P&gt;&lt;P&gt;           FROM   ZZVAR                                      &lt;/P&gt;&lt;P&gt;           WHERE  z_key = wt_zmwerks_mu-werks                &lt;/P&gt;&lt;P&gt;           AND    z_name = 'DEPLOYMENT_SOSTO_LINECNT'.       &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;           IF SY-SUBRC = 0.                                  &lt;/P&gt;&lt;P&gt;               IF lm_count &amp;gt;= wa_return.                     &lt;/P&gt;&lt;P&gt;                   MOVE 'A' TO lm_ind.                       &lt;/P&gt;&lt;P&gt;               ELSE.                                         &lt;/P&gt;&lt;P&gt;                   MOVE 'U' TO lm_ind.                       &lt;/P&gt;&lt;P&gt;               ENDIF.                                        &lt;/P&gt;&lt;P&gt;           ELSE.                                             &lt;/P&gt;&lt;P&gt;               MOVE text-e18 TO message.                     &lt;/P&gt;&lt;P&gt;               MOVE wa-sourceloc TO paramater.               &lt;/P&gt;&lt;P&gt;               PERFORM map_error USING wt_zmwerks_mu-werks   &lt;/P&gt;&lt;P&gt;                                     message                 &lt;/P&gt;&lt;P&gt;                                     paramater.              &lt;/P&gt;&lt;P&gt;&amp;lt;b&amp;gt;               CONTINUE / BREAK / STOP.                                     &amp;lt;/b&amp;gt;           ENDIF.                                             &lt;/P&gt;&lt;P&gt;ELSE.&lt;/P&gt;&lt;P&gt;        MOVE 'A' TO lm_ind.&lt;/P&gt;&lt;P&gt;ENDIF.                  "Tools or Accessories.&lt;/P&gt;&lt;P&gt;============================================================&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;After PERFORM MAP_ERROR, I want that program control should go back to BLOCK 1 and continue with remaining reocrds from wt_inputrec.&lt;/P&gt;&lt;P&gt;Program execution should not stop. How can I do that?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 21 Mar 2007 18:32:57 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/how-to-pass-control-back/m-p/2010546#M410299</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-03-21T18:32:57Z</dc:date>
    </item>
    <item>
      <title>Re: How to pass control back ?</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/how-to-pass-control-back/m-p/2010547#M410300</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Try this:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Use EXIT after  PERFORM map_error.  The control tries to to execute the statement followed by  PERFORM call_so_bapi_process. Here, based upon some condition you should use again an EXIT which returns to BLOCK 1.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Santosh&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 21 Mar 2007 19:07:16 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/how-to-pass-control-back/m-p/2010547#M410300</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-03-21T19:07:16Z</dc:date>
    </item>
    <item>
      <title>Re: How to pass control back ?</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/how-to-pass-control-back/m-p/2010548#M410301</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Simply declare flag and proceed further if the flag is set.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
DATA: v_proceed_further TYPE c.
=BLOCK 1===============================================

LOOP AT wt_inputrec WHERE typecode = 'O'.
*--Create STOs and Sales Orders
  v_proceed_further = 'Y'.
  PERFORM create_sos_stos_rtvs.
  CHECK v_proceed_further = 'Y'.
ENDLOOP.

=BLOCK 2===============================================

FORM create_sos_stos_rtvs .

* If transaction type = 1 than create sales orders
  IF wt_inputrec-trans = 1.
     PERFORM load_so_bapi_fields.
     PERFORM call_so_bapi_process.
     CHECK v_proceed_further = 'Y'.
*If transaction type = 2 and 3 than create RTV PO / Stock Transport
*Orders
  ELSEIF wt_inputrec-trans = 2 OR
     wt_inputrec-trans = 4.
     PERFORM load_po_sto_bapi_fields.
     PERFORM call_po_sto_bapi_process.
  ENDIF.

ENDFORM. " CREATE_SOs_STOs_RTVs

=BLOCK 3===============================================

FORM call_so_bapi_process .
  IF lm_tora = 'T' and wt_zmwerks_mu-werks NOT IN s_solct. 
-----SOME Calculation----------
  ELSEIF lm_tora = 'A' and wt_zmwerks_mu-werks NOT IN s_solct. 
-----SOME Calculation----------
  ELSEIF ( lm_tora = 'A' OR lm_tora = 'T' ) 
    AND wt_zmwerks_mu-werks IN s_solct. 

  SELECT SINGLE z_return 
  INTO wa_return   
  FROM ZZVAR  
  WHERE z_key = wt_zmwerks_mu-werks 
  AND z_name = 'DEPLOYMENT_SOSTO_LINECNT'. 

  IF SY-SUBRC = 0. 
    IF lm_count &amp;gt;= wa_return. 
      MOVE 'A' TO lm_ind. 
    ELSE. 
      MOVE 'U' TO lm_ind. 
    ENDIF. 
  ELSE. 
    MOVE text-e18 TO message. 
    MOVE wa-sourceloc TO paramater. 
    PERFORM map_error USING wt_zmwerks_mu-werks 
   message paramater. 
    v_proceed_further = 'N'.
    EXIT.
   ELSE.
     MOVE 'A' TO lm_ind.
     v_proceed_further = 'Y'.
  ENDIF. "Tools or Accessories.
============================================================
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 21 Mar 2007 19:18:19 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/how-to-pass-control-back/m-p/2010548#M410301</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-03-21T19:18:19Z</dc:date>
    </item>
  </channel>
</rss>

