Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

Grouping

Former Member
0 Kudos

Hello all,

can someone please let me know what I am doing wrong.

Problem:

at loop the value of wa_delivery-rbtxt always changes from *HAZ* to ********.

Thus the case statements could not be executed.

What is wrong with my code and how can I change it that the case statements would be executed as I want.

LOOP AT GT_DELIVERY INTO WA_DELIVERY.

AT NEW VBELN.

**Count orders according to storage condition (section 1)

CASE WA_DELIVERY-RBTXT.

WHEN ' *HAZ* '.

ADD 1 TO SC1_ORDER.

AT NEW POSNR.

ADD 1 TO SC1_LINE.

ENDAT.

WHEN 'Storage condition 1'.

ADD 1 TO SC2_ORDER.

AT NEW POSNR.

ADD 1 TO SC2_LINE.

ENDAT.

ENDCASE.

ENDAT.

ENDLOOP.

<REMOVED BY MODERATOR>

Thanks

Blacky.

Edited by: Alvaro Tejada Galindo on Apr 21, 2008 1:04 PM

1 ACCEPTED SOLUTION

former_member194669
Active Contributor
0 Kudos

Check this


data : v_flag type c.
LOOP AT GT_DELIVERY INTO WA_DELIVERY.
AT NEW VBELN.
  move 'Y' to v_flag
endat.
if v_flag eq 'Y'.
  CASE WA_DELIVERY-RBTXT.
    WHEN ' **HAZ** '.
     ADD 1 TO SC1_ORDER.
     AT NEW POSNR.
       ADD 1 TO SC1_LINE.
     ENDAT.
    WHEN 'Storage condition 1'.
     ADD 1 TO SC2_ORDER.
     AT NEW POSNR.
       ADD 1 TO SC2_LINE.
     ENDAT.
  ENDCASE.
  clear v_flag.
endif.
ENDLOOP.

1 REPLY 1

former_member194669
Active Contributor
0 Kudos

Check this


data : v_flag type c.
LOOP AT GT_DELIVERY INTO WA_DELIVERY.
AT NEW VBELN.
  move 'Y' to v_flag
endat.
if v_flag eq 'Y'.
  CASE WA_DELIVERY-RBTXT.
    WHEN ' **HAZ** '.
     ADD 1 TO SC1_ORDER.
     AT NEW POSNR.
       ADD 1 TO SC1_LINE.
     ENDAT.
    WHEN 'Storage condition 1'.
     ADD 1 TO SC2_ORDER.
     AT NEW POSNR.
       ADD 1 TO SC2_LINE.
     ENDAT.
  ENDCASE.
  clear v_flag.
endif.
ENDLOOP.