2008 Nov 04 11:35 AM
<<Moderator message: please use meaningful subjects>>
hai abapers,
general division of two fields.
how write the expression.
suposse example : c = ( a ) / ( b ).
i expect correct or not ?
2008 Nov 04 11:38 AM
ABAP does not support Complex arithematic operations
for example c = (A + B) * (C + D)). Like C language
you have to write the above statement in two different steps
And
As per your expression if you want to divide two intergers then use DIV operator a special operator of ABAP
if you want to divide two different types of numbers other than intergers then you can use /
<<Moderator message: please use meaningful subjects>>
hai abapers,
general division of two fields.
how write the expression.
suposse example : c = ( a ) / ( b ).
i expect correct or not ?
2008 Nov 04 11:38 AM
ABAP does not support Complex arithematic operations
for example c = (A + B) * (C + D)). Like C language
you have to write the above statement in two different steps
And
As per your expression if you want to divide two intergers then use DIV operator a special operator of ABAP
if you want to divide two different types of numbers other than intergers then you can use /
2008 Nov 04 11:38 AM
Hello Ram,
Yes it is correct. Please check the 'TYPE' you have declared the variables.
You can check this things by creating a sample program. Do not need to post for this.
Thanks,
Jayant
2008 Nov 04 11:38 AM
Hi,
Ya above is correct.
Also you need not specify brackets for above condition:
c = a / b.
Thanks & Regards,
Navneeth K.
2008 Nov 04 11:38 AM
2008 Nov 04 11:39 AM
HI
this is important during division..
if d <> 0.
a = n / d.
endif..
regards
Deepak
2008 Nov 04 11:40 AM
Hi Raj,
Have a look of the below site.
http://help.sap.com/saphelp_nw70/helpdata/en/fc/eb32e2358411d1829f0000e829fbfe/content.htm
DATA: pack TYPE p DECIMALS 4,
n TYPE f VALUE '+5.2',
m TYPE f VALUE '+1.1'.
pack = n / m.
WRITE pack.
pack = n DIV m.
WRITE / pack.
pack = n MOD m.
WRITE / pack.
Cheers!!
VEnk@
2008 Nov 04 11:44 AM
| User | Count |
|---|---|
| 3 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |