Skip to Content
0
Former Member
Apr 07, 2009 at 04:10 PM

Selection Routine on DTP

127 Views

Hi Guys,

I have a problem to upgrade an OSD-ODS selection routine to the new ABAP version embedded on an autoloop DTP that allow to update particular data in the same ODS.

TABLES: /bic/azgr_od8800.

  DATA: l_idx LIKE sy-tabix.

  break-point.
  READ TABLE l_t_range WITH KEY
       fieldname = 'NOTIFICATN'.
  l_idx = sy-tabix.
*....
  SELECT * FROM  /bic/azgr_od8800     WHERE
  ( /bic/zgr_ch158 = 'I0068' OR
    /bic/zgr_ch158 = 'I0070' OR
    /bic/zgr_ch158 = 'I0072' OR
    /bic/zgr_ch158 = 'I0073' )
  AND  /bic/zflag01 = '1'.
    MOVE 'I'                              TO l_t_range-sign.
    MOVE 'EQ'                             TO l_t_range-option.
    MOVE  /bic/azgr_od8800-notificatn     TO l_t_range-low.
    IF l_idx <> 0.
      MODIFY l_t_range INDEX l_idx.
    ELSE.
      APPEND l_t_range.
    ENDIF.
  ENDSELECT.

  SELECT * FROM  /bic/azgr_od8800     WHERE
  ( /bic/zgr_ch158 = 'I0068' OR
    /bic/zgr_ch158 = 'I0070' OR
    /bic/zgr_ch158 = 'I0072' OR
    /bic/zgr_ch158 = 'I0073' )
    AND ausbs = '00000000'.
    MOVE 'I'                              TO l_t_range-sign.
    MOVE 'EQ'                             TO l_t_range-option.
    MOVE  /bic/azgr_od8800-notificatn     TO l_t_range-low.
    IF l_idx <> 0.
      MODIFY l_t_range INDEX l_idx.
    ELSE.
      APPEND l_t_range.
    ENDIF.

  ENDSELECT.
  " IF l_idx <> 0.
  "  MODIFY l_t_range INDEX l_idx.
  "  ELSE.
  "    APPEND l_t_range.
  "  ENDIF.
  p_subrc = 0.

The problem is that the code works over all records processed NOT ONLY over the records with ausbs = '00000000' that I need change.

I tried to debug the code and I saw that the code select rightly the data, but lost the data in the end if the loop.

Can anybody help me?

Thanks.