10-08-2007 11:11 AM
hi guys,
i'm having a issue where not able to get the data from selected_items below with
zero_count NE 'X'.
fact is we have data in the table, however for some unknown reason it doesn't pick up during the looping.
pleaase kindly advise. thanks.
IF NOT selected_items[] IS INITIAL.
LOOP AT selected_items INTO w_selected_items_temp
LOOP AT selected_items INTO w_selected_items_temp
WHERE material = wa_picount_items-material
AND batch = wa_picount_items-batch
AND zero_count = 'X'.
*
IF sy-subrc EQ 0.
wa_picount_items-zero_count = 'X'.
qty = 0.
v_flag = 'X'.
ENDIF.
ENDLOOP.
IF v_flag NE 'X'.
LOOP AT selected_items INTO w_selected_items_temp
WHERE material = wa_picount_items-material
AND batch = wa_picount_items-batch
AND zero_count NE 'X'.
*
IF sy-subrc EQ 0.
wa_picount_items-zero_count = ''.
v_flag = 'Y'.
ENDIF.
ENDLOOP.
ENDIF.
ENDIF.
10-08-2007 11:17 AM
Hi,
remove SY-SUBRC check inside the loop.
This will solve the problem
IF sy-subrc EQ 0. <b>" comment this</b>
wa_picount_items-zero_count = 'X'.
qty = 0.
v_flag = 'X'.
ENDIF. <b>"comment this</b>ENDLOOP.
10-08-2007 11:15 AM
I miss the loop where you fill wa_picount_items ??
is it filled somewhere ??
10-08-2007 11:15 AM
hi Boon,
LOOP AT selected_items INTO w_selected_items_temp
WHERE material = wa_picount_items-material
AND batch = wa_picount_items-batch
AND zero_count = 'X'.
1. are you sure that wa_picount_items-material and wa_picount_items-batch have proper values?
2. what is the definition of zero_count? (i. e. what is the data element behind?)
thanks
ec
10-08-2007 11:17 AM
Hi,
remove SY-SUBRC check inside the loop.
This will solve the problem
IF sy-subrc EQ 0. <b>" comment this</b>
wa_picount_items-zero_count = 'X'.
qty = 0.
v_flag = 'X'.
ENDIF. <b>"comment this</b>ENDLOOP.
10-08-2007 11:19 AM
hi,
i might made a mistake here.
what i'm trying to do is to check user input materialbatchzero_count indicator
whether exit in the internal table selected_items.
please correct me if i'm wrong in the code,thanks in advance.
10-08-2007 11:25 AM
i made a stupid mistake here...i should use read table to check...thanks for your time guys.
10-08-2007 11:26 AM
Hi boon
I found the following mistakes in ur code.
you updated the work area field but forgot to APPEND or MODIFY to the internal table. Do it and check once
10-08-2007 11:36 AM