2007 Mar 21 6:32 PM
Hi All,
Given below three block and question below that :
<b>=BLOCK 1===============================================</b>
LOOP AT wt_inputrec WHERE typecode = 'O'.
*--Create STOs and Sales Orders
PERFORM create_sos_stos_rtvs.
ENDLOOP.
<b>=BLOCK 2===============================================</b>
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.
*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
<b>=BLOCK 3===============================================</b>
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 >= 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.
<b> CONTINUE / BREAK / STOP. </b> ENDIF.
ELSE.
MOVE 'A' TO lm_ind.
ENDIF. "Tools or Accessories.
============================================================
After PERFORM MAP_ERROR, I want that program control should go back to BLOCK 1 and continue with remaining reocrds from wt_inputrec.
Program execution should not stop. How can I do that?
Thanks
2007 Mar 21 7:07 PM
Try this:
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.
Thanks,
Santosh
2007 Mar 21 7:07 PM
Try this:
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.
Thanks,
Santosh
2007 Mar 21 7:18 PM
Simply declare flag and proceed further if the flag is set.
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 >= 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.
============================================================