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

any command for percentage calculation

Former Member
0 Likes
3,886

Hai..

Is there any command in ABAP for calculating percentage?

How to callculate percentage?

Hai..

Is there any command in ABAP for calculating percentage?

How to callculate percentage?

6 REPLIES 6
Read only

Former Member
0 Likes
1,590

Hello Hari,

I notice that this your first post on SDN. Welcome aboard, and hope you have a good time here.

Coming to your question, I'm afraid I don't understand it very well. what do you mean by a function for percentage? you just take a fraction and multiple it by 100 to get the percentage. For example, if you have two numbers , 4 and 5, and want to find out what percentage of 5 will be 4, you just do ( 4 / 5 ) * 100. Which will be 80.

Am I missing something here... ?

Regards,

Anand Mandalika.

Read only

0 Likes
1,590

Hi..tq for your reply.

Sorry for wrong question.

Actually i wnt to find the no.of records( we use this % symbol in the select query )

Is ther any such a option in the select query??

Just give me any syntax using select including % symbol.

Read only

0 Likes
1,590

Hi,

look F1 to select :

e.g.

SELECT COUNT( * ) FROM dd02l INTO sy-dbcnt

WHERE tabname = itab-tabname

AND tabclass = 'TRANSP'.

Andreas

Read only

Former Member
0 Likes
1,590

HI Hari Krishna

There is NO Standard COmmand or Keyword in SAP to Calculate Percentage

x/y * 100,is the only way to calculate percentage.

You can define your own Macro or Function module,if you want.

Cheers,

Vijay Raheja

Read only

Former Member
0 Likes
1,590

Hi Hari;

There is no Function for percentage calculation in SAP.

The below link will give you the Mathematical Functions and Arithmetic Operations supported in SAP.

http://help.sap.com/saphelp_erp2004/helpdata/en/fc/eb32e2358411d1829f0000e829fbfe/frameset.htm

Reward Points..

Cheers..

Afsal

Read only

Former Member
0 Likes
1,590

Syntax:

Select * from datatable

where Field1 = '%01'.

it will fetch all the records where field 1 ends with 01.

% wild card character.

which can take any no.of characters