cancel
Showing results for 
Search instead for 
Did you mean: 

SAP BW Endroutine: Short Dump GETWA_NOT_ASSIGNED on Select Statement

renliu
Explorer
0 Kudos

Dear Profis,

am getting the shortdump GETWA_NOT_ASSIGNED on the endroutine. Can you please help me sort it out?

Here below the source code:

TYPES: BEGIN OF ty_dso1,

/bic/zoi_ebeln TYPE /bic/oizoi_ebeln,
oi_ebelp TYPE /bi0/oioi_ebelp,
/bic/zlfdnr_3 TYPE /bic/oizlfdnr_3,
/bic/zmm_chgnr TYPE /bic/oizmm_chgnr,
/bic/zmm_chgin TYPE /bic/oizmm_chgin,
/bic/zmm_aldtm TYPE /bic/oizmm_aldtm,

END OF ty_dso1.

DATA: it_tab1 TYPE SORTED TABLE OF ty_dso1
WITH UNIQUE KEY /bic/zoi_ebeln oi_ebelp /bic/zlfdnr_3
/bic/zmm_chgnr,
wa_tab1 LIKE LINE OF it_tab1.

IF NOT RESULT_PACKAGE[] IS INITIAL.
SELECT /bic/zoi_ebeln oi_ebelp /bic/zlfdnr_3 /bic/zmm_chgnr
/bic/zmm_chgin /bic/zmm_aldtm
UP TO 1 ROWS
INTO TABLE it_tab1
FROM /bic/ammawcdp011
WHERE /bic/zoi_ebeln = <result_fields>-oi_ebeln AND
oi_ebelp = <result_fields>-oi_ebelp AND
/bic/zmm_chgin = 'U'.

ENDIF.

LOOP AT RESULT_PACKAGE ASSIGNING <result_fields> WHERE
/bic/zmm_chgin = 'U'.
CLEAR wa_tab1.
READ TABLE it_tab1 INTO wa_tab1 WITH KEY
/bic/zoi_ebeln = <result_fields>-oi_ebeln
oi_ebelp = <result_fields>-oi_ebelp BINARY SEARCH.

IF sy-subrc = 0.

<result_fields>-/bic/zmm_inldm = wa_tab1-/bic/zmm_aldtm.
ENDIF.

ENDLOOP.

Thank you and regards,

Novice L

matt
Active Contributor

Post your code using the code button in the editor. Like this.

TYPES: BEGIN OF ty_dso1,
         /bic/zoi_ebeln TYPE /bic/oizoi_ebeln,
         oi_ebelp TYPE /bi0/oioi_ebelp,
         /bic/zlfdnr_3 TYPE /bic/oizlfdnr_3,
         /bic/zmm_chgnr TYPE /bic/oizmm_chgnr,
         /bic/zmm_chgin TYPE /bic/oizmm_chgin,
         /bic/zmm_aldtm TYPE /bic/oizmm_aldtm,
       END OF ty_dso1.

DATA: it_tab1 TYPE SORTED TABLE OF ty_dso1
          WITH UNIQUE KEY /bic/zoi_ebeln oi_ebelp /bic/zlfdnr_3
                          /bic/zmm_chgnr,
       wa_tab1 LIKE LINE OF it_tab1.

IF NOT RESULT_PACKAGE[] IS INITIAL.
  SELECT /bic/zoi_ebeln oi_ebelp /bic/zlfdnr_3 /bic/zmm_chgnr
         /bic/zmm_chgin /bic/zmm_aldtm
      UP TO 1 ROWS
      INTO TABLE it_tab1
      FROM /bic/ammawcdp011
      WHERE /bic/zoi_ebeln = <result_fields>-oi_ebeln AND
            oi_ebelp = <result_fields>-oi_ebelp AND
            /bic/zmm_chgin = 'U'.
ENDIF.

LOOP AT RESULT_PACKAGE ASSIGNING <result_fields> WHERE
      /bic/zmm_chgin = 'U'.
  CLEAR wa_tab1.
  READ TABLE it_tab1 INTO wa_tab1 WITH KEY
      /bic/zoi_ebeln = <result_fields>-oi_ebeln
      oi_ebelp = <result_fields>-oi_ebelp BINARY SEARCH.
  IF sy-subrc = 0.
    <result_fields>-/bic/zmm_inldm = wa_tab1-/bic/zmm_aldtm.
   ENDIF.
ENDLOOP.

It would also be helpful if you'd point out the line where the dump happens. It's listed in the dump.

Btw, since it_itab1 (which is a terrible variable name - why not use a meaningful one) is already sorted, so no need for binary search. And result_package isn't defined with occurs so no need for result_package[]. Result_package is fine.

renliu
Explorer
0 Kudos

Gentlemen thank you for all the advices!

The next question (Should I open another thread though it is related?) is:

In such an ascending sorted table below with the first 4 fields from the left as keys, how could I select the first row of each group by the fields OI_EBELN and OI_EBELP as group keys?

Thank you! Novice L

View Entire Topic
Torsten_
Advisor
Advisor

Hi,

you are using the field symbol <result_fields> in the where condition before you assign it.

You assign it later in the LOOP.

Therefore you get an error in the select statement.

Torsten

renliu
Explorer
0 Kudos

That is right. That is where the dump from.