Application Development and Automation 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: 
Read only

Loop at and update based on column number

Former Member
0 Likes
657

Hi ABAPers,

Need help,

LOOP AT i_final_r1 INTO w_final_r1.
   READ TABLE i_text1 INTO w_text1 WITH KEY w_final_r1-text1.
   IF sy-subrc eq 0.
   w_region1-werks = w_final_r1-werks.
   w_region1-sy-tabix = w_final_r1-netwr. " Sy-tabix = 6. (for example)
   append w_region1 to i_region1.
   ENDIF.
  ENDLOOP.

In the above code I want to input value to the column( 1 or 2 ..or 6..) based on the sy-tabix obtained from above read statement.

How do I acheive this in ABAP coding.

Regards,

Dep

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
615

Hi Dep,

I think what you need is:


ASSIGN COMPONENT sy-tabix of w_region1 to <fs>.
<fs> = w_final_r1-netwr.

Best regards,

Oliver

Hi ABAPers,

Need help,

LOOP AT i_final_r1 INTO w_final_r1.
   READ TABLE i_text1 INTO w_text1 WITH KEY w_final_r1-text1.
   IF sy-subrc eq 0.
   w_region1-werks = w_final_r1-werks.
   w_region1-sy-tabix = w_final_r1-netwr. " Sy-tabix = 6. (for example)
   append w_region1 to i_region1.
   ENDIF.
  ENDLOOP.

In the above code I want to input value to the column( 1 or 2 ..or 6..) based on the sy-tabix obtained from above read statement.

How do I acheive this in ABAP coding.

Regards,

Dep

3 REPLIES 3
Read only

Former Member
0 Likes
616

Hi Dep,

I think what you need is:


ASSIGN COMPONENT sy-tabix of w_region1 to <fs>.
<fs> = w_final_r1-netwr.

Best regards,

Oliver

Read only

0 Likes
615

Thank You Oliver,

I'll use your logic and get back.

Regards,

Dep

Read only

0 Likes
615

Thank You Oliver,

Issue Resolved.

Regards,

Dep