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

multiplication

Former Member
0 Likes
495

this is internal table ITAB

F1 F2 F3

1 3

2 2

3 4

4 1

F1 is the field one ,F2 is the field two, both containing data like above ,

F3 is the field three it has no data

we want to add F1,F2 fields we have to store into F3 field

F! fied has row value "1" etc..

F2 fied has row value"3" etc..

1 * 3 = 3 this result will be stored into F3 field result of 3 will be first row of F3.

could u plz explain clearly with code and step by step with comments

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
450

Hi Rajesh,

I couldn't get whats your requiement, but it seems that you want to add two fields from the same row and place it into the third row. If so then see the code.

Loop at ITAB.
   ITAB-F3 = ITAB-F1 +ITAB-F2.
   Modify ITAB.
Endloop.

4 REPLIES 4
Read only

RichHeilman
Developer Advocate
Developer Advocate
0 Likes
450
Loop at itab.

   itab-fld3 = itab-fld1 * itab-fld2.
   modify itab.

endloop.

Regards,

Rich Heilman

Read only

rahulkavuri
Active Contributor
0 Likes
450

if itab[] is not initial

loop at itab.

itab-field3 = itab-field1 * itab-field2.

modify itab index sy-tabix.

endloop.

endif

award points if found helpful

Read only

Former Member
0 Likes
451

Hi Rajesh,

I couldn't get whats your requiement, but it seems that you want to add two fields from the same row and place it into the third row. If so then see the code.

Loop at ITAB.
   ITAB-F3 = ITAB-F1 +ITAB-F2.
   Modify ITAB.
Endloop.

Read only

Former Member
0 Likes
450

If you really only want to know ABAP arithmetical operators, then check this link:

http://de.geocities.com/rafaelreichle/abapkeywords.html

http://www.planetsap.com/thesap_abap_keywords.htm

Thanks,

Santosh