Skip to Content

Archived discussions are read-only. Learn more about SAP Q&A

Enhancing 0ASSET_ATTR issue

Hi Experts,

   I have written the below code at t-code CMOD at INCLUDE ZXRSAU02 in FUNCTION EXIT_SAPLRSAP_002 to enhance 0Asset_attr datasource by looking up into ANLZ table for RAUMN field and copy it to BWFIAA_ASSETMASTER, which is the structure for 0asset_attr.

*&---------------------------------------------------------------------*

*&  Include           ZXRSAU02

*&---------------------------------------------------------------------*

DATA: A_S_INFOSTRU LIKE BWFIAA_ASSETMASTER,

       cocd type c LENGTH 4,

       m_asset_no type c LENGTH 12,

       a_sub_no type c LENGTH 4,

       DAT_E  type DATS,

       it_data type STANDARD TABLE OF ANLZ,

       wa_data type anlz.

CASE I_DATASOURCE.

  WHEN '0ASSET_ATTR'.

  LOOP AT I_T_DATA INTO A_S_INFOSTRU.

  IF A_S_INFOSTRU-Z_ROOM = ''.

* CLEAR L_STAT.

* L_STAT = A_S_INFOSTRU-BWSTZCRZHED.

    "clnt = '100'.

    cocd = a_s_infostru-BUKRS.

    m_asset_no = a_s_infostru-ANLN1.

    a_sub_no = a_s_infostru-ANLN2.

    DAT_E = a_s_infostru-DATETO.

   "Go to ECC table ANLZ and select the record for room

*Select all fields of a SAP database table into in itab

SELECT *

   FROM anlz

   INTO TABLE it_data.

     LOOP at it_data into  wa_DATA

                     WHERE MANDT = '100'

                     AND BUKRS = cocd

                     AND ANLN1 = m_asset_no

                     AND ANLN2 = a_sub_no

                     AND BDATU = dat_e.

      A_S_INFOSTRU-Z_ROOM = wa_data-RAUMN.

      endloop.

      delete i_t_data.

      APPEND a_s_infostru to i_t_data.

    ENDIF.

    endloop.

* L_TABIX = SY-TABIX.

ENDCASE.


When I execute the code at RSA3 with loop in the code, I go into infinite loop. Also, is the data in I_T_DATA written back to the datasource ?


Thanks in advance,


Regards,

Draksh

Former Member
Not what you were looking for? View more on this topic or Ask a question