Skip to Content
0
Former Member
Jul 23, 2009 at 09:07 AM

problem in loop

24 Views

Hi Experts....

I have my final table called it_final2

in my final table i jus want to show a status colum

as msg text1 or text2.

Below coding is for my final loop.....

i need to insert the coding for status which is as

if ( wa_bseg-hkont  = '0000207500' or  wa_bseg-hkont  = '0000207550' or wa_bseg-hkont  = '0000207555' ) and ( wa_bseg-augdt EQ '00000000' ).
wa_bseg-msg = 'text1'.
 when ( wa_bseg-hkont  = '0000207500' or  wa_bseg-hkont  = '0000207550' or wa_bseg-hkont  = '0000207555' ) and wa_bseg-augdt NE '00000000'
 wa_bseg-msg = 'text2'.
endif.

but now the problem is .....

either only one condition is getting satisfied like iam gettin only text1 and the else part not getting satisfied

and even in the first condition even if augdt EQ '00000000' it is not displaying the text1 msg.....

wat alteration to be made ....pls help....

thankx in advance

Rachel

LOOP AT it_bseg2 INTO wa_bseg.
 IF   wa_bseg-s_tax IS INITIAL AND  wa_bseg-ecess IS INITIAL  AND wa_bseg-hcess IS INITIAL.
        DELETE it_bseg2 WHERE belnr = wa_bseg-belnr.
      ELSE.
        w_t_amt = wa_bseg-t_p_amt + wa_bseg-s_tax + wa_bseg-ecess + wa_bseg-hcess.
        READ TABLE it_pos INTO it_pos WITH KEY belnr = wa_bseg-belnr.
        IF sy-subrc EQ 0.
          wa_bseg-blart = it_pos-blart.
       
          DATA: w_dat3 TYPE bseg-augdt.
          w_dat3 = wa_bseg-augdt.
          WRITE w_dat3+4(2) TO wa_bseg-monat1.

          IF wa_bseg-augdt IS NOT INITIAL.
            IF ( wa_bseg-monat1 >= 04 ) AND ( wa_bseg-monat1 <= 12 ).
              wa_bseg-monat1 = wa_bseg-monat1 - 03.
            ELSE.
              wa_bseg-monat1 = wa_bseg-monat1 + 09.
            ENDIF.
          ENDIF.
          MODIFY it_bseg2 FROM wa_bseg TRANSPORTING budat blart bldat xblnr monat monat1  .
        ENDIF.

        IF so_lifnr IS INITIAL.
          READ TABLE it_lifnr INTO wa_bseg WITH KEY belnr = wa_bseg-belnr.
          IF sy-subrc EQ 0.
            READ TABLE it_lfa1 INTO wa_lfa1 WITH KEY lifnr = wa_bseg-lifnr.
            IF sy-subrc EQ 0.
 CONCATENATE wa_lfa1-name1 wa_lfa1-name2  INTO wa_bseg-name SEPARATED BY space.

              READ TABLE it_regio WITH KEY bland = wa_lfa1-regio .

              wa_bseg-bezei = it_regio-bezei .
            
   MODIFY it_bseg2 FROM wa_bseg TRANSPORTING lifnr name bezei ort01 j_1isern  .
            ENDIF.

            MODIFY it_bseg2 FROM wa_bseg TRANSPORTING t_amt  .
          ENDIF.
        ENDIF.

        READ TABLE it_lfa1 INTO wa_lfa1 WITH KEY lifnr = wa_bseg-lifnr.
        IF sy-subrc EQ 0.
          CONCATENATE wa_lfa1-name1 wa_lfa1-name2  INTO wa_bseg-name.
          CONDENSE wa_bseg-name .

          READ TABLE  it_regio WITH KEY bland = wa_lfa1-regio .
          wa_bseg-bezei     =  it_regio-bezei .
         MODIFY it_bseg2 FROM wa_bseg TRANSPORTING name bezei ort01 j_1isern  .
        ENDIF.
      ENDIF.

      IF so_lifnr-low IS INITIAL.
        IF wa_bseg-blart = 'KH'.

       ENDIF.
   MODIFY it_bseg2 FROM wa_bseg TRANSPORTING t_amt   .
    ENDLOOP.

  ENDIF.