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

Control breaks in internal table

Former Member
0 Likes
616

Hi Friends,

I have to update my final table, I have my line item data in my lt_balance, I want to sum the field betrw and modify the final internal table. Can any one check this code.

loop at it_final into w_final.

at end of partner.

sum.

read table it_final into w_final index sy-tabix.

w_final-amount = lw_balance-betrw.

modify table it_final from w_final transporting amount.

endat.

endloop.

Thanx in advance,

Line

Hi Friends,

I have to update my final table, I have my line item data in my lt_balance, I want to sum the field betrw and modify the final internal table. Can any one check this code.

loop at it_final into w_final.

at end of partner.

sum.

read table it_final into w_final index sy-tabix.

w_final-amount = lw_balance-betrw.

modify table it_final from w_final transporting amount.

endat.

endloop.

Thanx in advance,

Line

5 REPLIES 5
Read only

Former Member
0 Likes
591

Hi,

Are you trying to update the same internal table with the final value.?

Do you have to update all the lines of the table which belongs to the same partner with the final value..

In that case

Try changing the code to the following,

DATA : final_amount type betrw.

loop at it_final into w_final.

at end of partner.

sum.

w_final-amount = lw_balance-betrw.

endat.

modify table it_final from w_final transporting amount.

endloop.

Please reward points if it helps

Regards

Read only

0 Likes
591

Hi,

I want to update only betrw value into the final internal table.

Line

Read only

0 Likes
591

Hi

You should use another work are to read again the internal table:

loop at it_final into w_final.
  
  w_final2 = w_final.  

  at end of partner.
    sum.
    w_final2-amount = w_final-betrw.
    modify table it_final from w_final transporting amount.
 endat.

endloop.

But in this you've update only the last record for a certain PARTNER, do you want this or you want to update all?

Max

Read only

RaymondGiuseppi
Active Contributor
0 Likes
591

Try

LOOP AT it_balance INTO w_balance.

AT END OF partner.

SUM.

READ TABLE it_final INTO w_final WITH KEY partner = w_balance.

w_final-betrw = w_balance-betrw.

MODIFY it_final FROM w_final INDEX sy-tabix.

ENDAT.

ENDLOOP.

Regards.

Read only

Former Member
0 Likes
591

Use the <b>ON CHANGE</b> command -:)

Greetings,

Blag.