cancel
Showing results for 
Search instead for 
Did you mean: 

Endroutine question: Lookup DSO to DSO

Former Member
0 Kudos

Hi ABAP experts

At syntax check I get this error message:

E:Field "RESULT_PACKAGE" is unknown. It is neither defined in one of the tables nor in a "DATA"-statement.

Do you have an idea how to fix this issue?

Thank you.

*$*$ begin of 2nd part global - insert your code only below this line  *
... "insert your code here

TABLES: /BIC/AZFC_DS1700.
DATA: ITAB2 TYPE STANDARD TABLE OF /BIC/AZFC_DS1700 WITH HEADER LINE.
DATA: WA LIKE LINE OF ITAB2.

*$*$ end of 2nd part global - insert your code only before this line   *


$*$ begin of routine - insert your code only below this line        *-*
    ... "insert your code here
*--  fill table "MONITOR" with values of structure "MONITOR_REC"
*-   to make monitor entries
    ... "to cancel the update process
*    raise exception type CX_RSROUT_ABORT.

    DATA: ITAB_REFRESH TYPE STANDARD TABLE OF _TY_S_TG_1.
    DATA: ITAB_TARGET TYPE STANDARD TABLE OF _TY_S_TG_1.
    DATA: WA_TARGET LIKE LINE OF ITAB_TARGET.
    DATA : ICOUNT TYPE RSARECORD.


*$*$ end of routine - insert your code only before this line  


*$*$ begin of inverse routine - insert your code only below this line*-*
    ... "insert your code here

* Ensuring the source package is not empty


    IF RESULT_PACKAGE IS NOT INITIAL.
      ICOUNT = 1.
      REFRESH ITAB2.

* Selecting records from IBAN DSO for which
* BANKL and BANKN matches with the same of source package

      SELECT /BIC/ZIBAN FROM /BIC/AZFC_DS1700 INTO TABLE ITAB2
        FOR ALL ENTRIES IN RESULT_PACKAGE
        WHERE /BIC/ZBANKL = RESULT_PACKAGE-/BIC/ZBANKL AND
        /BIC/ZBANKN = RESULT_PACKAGE-/BIC/ZBANKN.

* Sorting for optimizing readaccess
      SORT ITAB2 BY /BIC/ZBANKL /BIC/ZBANKN.

* Processing Refresh itab_target.
      SORT RESULT_PACKAGE BY /BIC/ZBANKL /BIC/ZBANKN /BIC/ZIBAN.

      LOOP AT &RP& ASSIGNING <RESULT_FIELDS>.
        LOOP AT ITAB2 INTO WA WHERE /BIC/ZBANKL =
        <RESULT_FIELDS>-/BIC/ZBANKL AND
       /BIC/ZBANKN = <RESULT_FIELDS>-/BIC/ZBANKN.

          <RESULT_FIELDS>-/BIC/ZIBAN = WA-/BIC/ZIBAN.
          <RESULT_FIELDS>-RECORD = ICOUNT.

          ICOUNT = ICOUNT + 1.
          APPEND <RESULT_FIELDS> TO ITAB_TARGET.
        ENDLOOP.
      ENDLOOP.
      SORT ITAB_TARGET BY /BIC/ZBANKL /BIC/ZBANKN /BIC/ZIBAN.
      REFRESH RESULT_PACKAGE.
      RESULT_PACKAGE[] = ITAB_TARGET[].
    ENDIF.


*$*$ end of inverse routine - insert your code only before this line *-*

Accepted Solutions (1)

Accepted Solutions (1)

umashankar_poojar
Active Contributor
0 Kudos

Hi,

Put your code between redblock and try.

Thanks,

Umashankar

Answers (4)

Answers (4)

Former Member
0 Kudos

You have written the code in the inverse method, its better to put your code in the code area for endroutine method as suggested by umashankar. If still issue persists, do revert back...

yasemin_kilinc
Active Contributor
0 Kudos

Hi,

If it is in the start routine you need to use SOURCE_PACKAGE instead of RESULT_PACKAGE.

Hope it helps

Yasemin..

Former Member
0 Kudos

Were you able fix the issue???

Former Member
0 Kudos

does this flow is in 3.x?

Regards,

Ganesh

Former Member
0 Kudos

No, it is in 7.01.

Thanks

RamanKorrapati
Active Contributor
0 Kudos

Hi PC,

You placed code in wrong place.  place your code between these two lines.

$*$ begin of routine - insert your code only below this line        *-*

*$*$ end of routine - insert your code only before this line 

Below code you can place along with tables declaration area.

DATA: ITAB_REFRESH TYPE STANDARD TABLE OF _TY_S_TG_1.

    DATA: ITAB_TARGET TYPE STANDARD TABLE OF _TY_S_TG_1.

    DATA: WA_TARGET LIKE LINE OF ITAB_TARGET.

    DATA : ICOUNT TYPE RSARECORD.

Thanks