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: 

a doubt on the internal table

Former Member
0 Kudos

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.

1 ACCEPTED SOLUTION

Former Member
0 Kudos

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.

7 REPLIES 7

former_member186143
Active Contributor
0 Kudos

I miss the loop where you fill wa_picount_items ??

is it filled somewhere ??

JozsefSzikszai
Active Contributor
0 Kudos

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

Former Member
0 Kudos

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.

Former Member
0 Kudos

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.

Former Member
0 Kudos

i made a stupid mistake here...i should use read table to check...thanks for your time guys.

Former Member
0 Kudos

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

Former Member
0 Kudos

thank you guys for your time....my mistake here...