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

multiplying a field

Former Member
0 Likes
1,556

Select all the PRGRP, WERKS, ANTEI and NRMIT from table PGMI based on product group and plant from selection screen store into one internal while storing, Multiply ANTEI = ANTEI * 100 .

can any one tel me how can i multiply antei by 100

8 REPLIES 8
Read only

Former Member
0 Likes
1,007

Select all the PRGRP, WERKS, ANTEI and NRMIT from table PGMI based on product group and plant from selection screen store into one internal while storing, Multiply ANTEI = ANTEI * 100 .

Loop the ITAB

multiply the ANTEI = ANTEI * 100

endloop.

Narendra

Read only

Former Member
0 Likes
1,007

hi,

Use a select query to get all reqd fields in internal table itab.

then use following code.

loop at itab.

itab-antni = itab-antni * 100.

modify itab.

endloop.

Read only

Former Member
0 Likes
1,007

Hi

loop at itab.

multiply itab-ANTEI by '100'.

modify itab.

endloop.

Cheers,

Will.

Read only

Former Member
0 Likes
1,007

Hi

After the select statement.

loop at ANTEI = ANTEI * 100 .

ANTEI = ANTEI * 100 .

MODIFY ANTEI = ANTEI * 100 .

ENDLOOP.

Read only

0 Likes
1,007

Hi,

you can to it in this way too

SELECT F1

F2

F3

into wa from DDT WHERE XYZ.

WA-F1 = WA-F1 * 100.

APPEND wa to itab.

endselect.

Rewards if helpful,

GAURAV J.

Read only

Former Member
0 Likes
1,007

select PRGRP, WERKS, ANTEI , NRMIT from pgmi into table t_pgmi where prgrp and werks acording to the selection-screen .

Loop at t_pgmi into wa_pgmi.

wa_pgmi-antei = wa_pgmi-antei * 100.

modify t_pgmi from wa_pgmi transporting antei.

endloop.

Read only

former_member156446
Active Contributor
0 Likes
1,007

Hi

doing a loop at your internal table is mandatory.. so do it effeciantly..

internal table is itab.

work area of this itab is wa_itab.


field-symbols:<fs_itab> type wa_itab.

loop at itab assigning <fs_itab>.
<fs_itab>-ANTEI = <fs_itab>-ANTEI * 100.
"<<<<<<<<you are eliminating a modify itab statment here..by using <fs>
endloop.

Read only

Former Member
0 Likes
1,007

select PRGRP

WERKS

ANTEI

NRMIT

from PGMI

into <internal table>

where <Condition>

if sy-subrc eq 0.

<internal table>-antei = <internal table>-antei * 100

append <internal table>-antei .

endif.

endselect.

or

LOOP AT <internal table>.

<internal table>-antei = <internal table>-antei * 100.

MODIFY <internal table>FROM <internal table>

TRANSPORTING antei.

ENDLOOP.