Skip to Content
0
Former Member
Mar 25, 2006 at 05:53 PM

I have a problem with a modify.

32 Views

Hi people:

I have tree selects and when I insert the data in my internal table t_regup the program insert the last line of payr in all line in the internal table and the selection is from one to many in payr. This is my code:

thanks for the help.

  SELECT empfb xblnr bldat dmbtr sknto qbshh zlsch laufd     
        laufi zbukr vblnr lifnr sknto belnr kunnr blart 
         bukrs shkzg
    FROM regup INTO CORRESPONDING FIELDS OF TABLE t_regup
   WHERE laufd EQ p_laufd
     AND laufi EQ p_laufi
     AND bukrs EQ p_absbu
     AND xvorl <> 'X'.

  LOOP AT t_regup INTO wa_regup.

   SELECT SINGLE  znme1 zbnkn laufd laufi hbkid waers      
                  zaldt hktid
                  lifnr  zland rzawe uzawe absbu
     FROM reguh INTO CORRESPONDING FIELDS OF wa_regup
     WHERE laufd = wa_regup-laufd
       AND laufi = wa_regup-laufi
       AND absbu = p_absbu
       AND vblnr = wa_regup-vblnr.

    IF wa_regup-rzawe = '1'.

      SELECT  laufd laufi zbukr hbkid waers zaldt hktid
              VBLNR chect zland rzawe uzawe voidr
       FROM payr INTO CORRESPONDING FIELDS OF  wa_regup
       WHERE laufd EQ wa_regup-laufd
         AND laufi EQ wa_regup-laufi
         AND zbukr EQ wa_regup-zbukr.

     ENDSELECT.


 MODIFY t_regup FROM wa_regup.

endloop.