cancel
Showing results for 
Search instead for 
Did you mean: 

pl solve this error

Former Member
0 Kudos

how to solve this error

Unreachable Statement After Jump Statement EXIT:

PERFORM get_item_category1

TABLES gt_comm_pr_frg_rel

gt_comm_prmat

USING ls_orderadm_i_wrk

CHANGING item_category_group1.

subsequent coding

IF lt_orderadm_i_wrk IS INITIAL.

SELECT SINGLE * FROM comm_pr_frg_rel

INTO lt_comm_pr_frg_rel

WHERE product_guid = ls_orderadm_i_wrk-product.

IF sy-subrc EQ 0.

SELECT SINGLE * FROM comm_prmat

INTO lt_comm_prmat

WHERE frg_guid = lt_comm_pr_frg_rel-fragment_guid.

IF sy-subrc EQ 0.

item_category_group1 = lt_comm_prmat-item_cat_group.

ENDIF.

ENDIF.

ENDIF.

EXIT.

Accepted Solutions (0)

Answers (2)

Answers (2)

Former Member
0 Kudos

hi

if u put exit in u r program it will terminate ur program and after exit no statement is executed

Former Member
0 Kudos

the error is beign thrown as I mentioned abov ein EPC.

it's nt terminating the program.

Former Member
0 Kudos

Exit will not terminate the program. Exit will terminate the processing of LOOP.

LOOP

IF CONDITION

EXIT.

ENDIF.

ENDLOOP.

stat1

Stat2

if the above mentioned condition satisfied then the program terminate the loop and execute stat1 stat2.

Former Member
0 Kudos

singh

i wl try

Former Member
0 Kudos

What exactly problem are you facing. If you want to terminate the program you can use STOP command also.

Can you please post the full code with exact requirement.

Former Member
0 Kudos

im getting the error in slin

.....the part of code is as folows

DATA: lt_comm_pr_frg_rel TYPE comm_pr_frg_rel,

lt_comm_prmat TYPE comm_prmat.

DATA item_category_group1 TYPE crmt_item_cat_group.

CLEAR item_category_group1.

  • Store the data into the global internal tables for the first time.

IF gt_comm_pr_frg_rel IS INITIAL.

SELECT * FROM comm_pr_frg_rel

INTO CORRESPONDING FIELDS OF TABLE gt_comm_pr_frg_rel

FOR ALL ENTRIES IN lt_orderadm_i_wrk

WHERE product_guid = lt_orderadm_i_wrk-product.

IF sy-subrc = 0.

SELECT * FROM comm_prmat

INTO CORRESPONDING FIELDS OF TABLE gt_comm_prmat

FOR ALL ENTRIES IN gt_comm_pr_frg_rel

WHERE frg_guid = gt_comm_pr_frg_rel-fragment_guid.

ENDIF.

ENDIF.

IF lt_orderadm_i_wrk IS INITIAL.

SELECT SINGLE * FROM comm_pr_frg_rel

INTO lt_comm_pr_frg_rel

WHERE product_guid = ls_orderadm_i_wrk-product.

IF sy-subrc EQ 0.

SELECT SINGLE * FROM comm_prmat

INTO lt_comm_prmat

WHERE frg_guid = lt_comm_pr_frg_rel-fragment_guid.

IF sy-subrc EQ 0.

item_category_group1 = lt_comm_prmat-item_cat_group.

ENDIF.

ENDIF.

ENDIF.

EXIT.

  • Get the Item category

PERFORM get_item_category1

TABLES gt_comm_pr_frg_rel

gt_comm_prmat

USING ls_orderadm_i_wrk

CHANGING item_category_group1.

item_category_group = item_category_group1.

ENDFUNCTION.

*& Form get_item_category

  • -->LT_COMM_PR_textREL

  • -->LT_COMM_PRMtext

  • -->LS_ORDERADMtextRK

  • -->ITEM_CATEGOtextROUP

----


FORM get_item_category1

TABLES lt_comm_pr_frg_rel STRUCTURE comm_pr_frg_rel

lt_comm_prmat STRUCTURE comm_prmat

USING ls_orderadm_i_wrk TYPE crmt_orderadm_i_wrk

CHANGING item_category_group1 TYPE crmt_item_cat_group.

DATA: ls_comm_pr_frg_rel TYPE comm_pr_frg_rel,

ls_comm_prmat TYPE comm_prmat .

  • Get item category group of product

LOOP AT lt_comm_pr_frg_rel INTO ls_comm_pr_frg_rel

WHERE product_guid = ls_orderadm_i_wrk-product .

READ TABLE lt_comm_prmat INTO ls_comm_prmat

WITH KEY frg_guid = ls_comm_pr_frg_rel-fragment_guid.

IF sy-subrc = 0.

item_category_group1 = ls_comm_prmat-item_cat_group.

EXIT.

ENDIF.

ENDLOOP.

ENDFORM. "get_item_category

Former Member
0 Kudos

hi Pex,

did u declare <b>SLIN</b> at the top ??? if not please declare the same..

Regards,

Santosh

nablan_umar
Active Contributor
0 Kudos

Hi Pex,

The error you see in SLIN may not actually cause problem when you activate it. SLIN will do further check but you should be able to run the program you shown. It just that it does not make sense to do an EXIT without any condition and you have more program logic after that EXIT command. So I think SLIN check for that. But the regular syntax check should pass.

Former Member
0 Kudos

If you look at the piece of code below, you will realize that you will never execute the code that is there after EXIT statement. That is what the extended syntax check is telling you.


 EXIT.
<i>
* Get the Item category
  PERFORM get_item_category1 TABLES gt_comm_pr_frg_rel
                                    gt_comm_prmat
                              USING ls_orderadm_i_wrk
                           CHANGING item_category_group1.
item_category_group = item_category_group1.</i>

The code in italics will never get executed. You will use EXIT if you want to exit the processing of the current processing block, but it will typically be used conditionally. Here you are exiting no matter what.

Srinivas

Message was edited by: Srinivas Adavi