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

divide quantity field by a integer value

Former Member
0 Likes
2,242

i want to divide quantity field (vbrp-fkimg) by no of working days as entered by user.

how can i do it .please help.

points will be rewarded thanx

1 ACCEPTED SOLUTION
Read only

former_member196280
Active Contributor
0 Likes
1,215

Define a variable,

Data : qty type p decimals 2.

and move yout quantity field to above variable and divide with interger.

Ex: MOVE vbrp-fkimg TO qty.

Regards,

SaiRam

5 REPLIES 5
Read only

former_member196280
Active Contributor
0 Likes
1,216

Define a variable,

Data : qty type p decimals 2.

and move yout quantity field to above variable and divide with interger.

Ex: MOVE vbrp-fkimg TO qty.

Regards,

SaiRam

Read only

0 Likes
1,215

but my proggram is giving dump error .i write the follwing code

data : G_CHAR(16) type c.

parameters: p_code(2) type c .

plan type c.

Write final1-fkimg to G_CHAR.

final_int-plan = G_CHAR / p_code .

buton execution proogram is giving dump

can you explain why , please?

Message was edited by:

sarabjit kaur

Read only

0 Likes
1,215

instead of using char type variable u hav to use a variable of type p.its better u use

data::g_char type vbrp-fkimg.

parameters: p_code type i .

Read only

former_member188827
Active Contributor
0 Likes
1,215

parameters:zdays type i.

parameers:zvbeln type vbrp-vbeln.

select posnr from vbrp into zposnr where vbeln = zvbeln.

select fkimg from vbrp into zfkimg where vbeln = zvben and posnr = zposnr.

zsum = zfkimg + zsum.

endselect.

zsum = zsum / zdays.

plz reward points if it helps

Read only

Former Member
0 Likes
1,215

try this snippet

Paramters:zvbeln type vbrp-vbeln.

select

posnr from vbrp

into zposnr

where vbeln = zvbeln.

select fkimg

from vbrp

into zfkimg

where vbeln = zvben and posnr = zposnr.

zsum = zfkimg + zsum.

endselect.

zsum = zsum / zdays.

it works

regards

Giridhar