cancel
Showing results for 
Search instead for 
Did you mean: 

Macro Help: % of Total and Growth Rate

Former Member
0 Kudos

Dear Experts,

1) I need to calculate in a macro the % of total quantity.

Selection: Char1=A

Row1: Cell 1C = 50

Selection Char1= All

Row1: Cell 1C = 500

In Row2 Cell below 2C, I need a value of 10% when I select Char1= A

What should be the macro syntax ?

2) Another Macro help

Irrespective of the selection.

In another row3 cell 3C, I need a value based on Char1 = All at all times.

I am calling this macro "Industry growth rate" which is the year on year growth rate of TOTAL market share value for display purposes at any selection. Market share is another key figure I have.

How to do this ?

Accepted Solutions (1)

Accepted Solutions (1)

rajkj
Active Contributor
0 Kudos

Hi Guru,

Please check the following thread for macros (10 - 15 screenshots).

http://scn.sap.com/thread/3152747

While it answers your first question directly and might give you an idea to solve the second issue.

However, due to complex nature of the macros, it would be difficult to get them work as expected in background.

Thanks,

Rajesh

Former Member
0 Kudos

Thank you Rajesh,

In fact I landed on your earlier post soon after I posted this. I was able to make the first one work with the syntax you provided (VEC_DIV and VEC_LAYOUTVARIABLE_SET and AGG_LEVEL functions). Second one is in a sense similar to the first one VEC_LAYOUTVARIABLE_SET. Let me test and publish the same.

Many Thanks Once again

Regards

Guru

Former Member
0 Kudos

Hi Rajesh

Given the kind of SAP interface for writing macros complemented with equally verbose help documentation that takes more to read than to do and do no more than primary school arithmetic, could you advise a non-copyright document on macros with examples explaining what each function does and where is it appropriate to use and the alternate ways of doing it. Google didnt return anything.

I seem to be wasting 50% of the time on figuring out the correct syntax, even if I land on the right function that takes another 50% of the time. I would assume it is true for any first timer who has to write any macro above adding two rows and putting it in third row. The syntax check messages are not just useless but bogus.

I believe this is a criminal waste of time and a pseudo skill to be boast off 🙂 with no offence meant to any one. In fact I consider it is a economic crime to charge 1000 dollars to write a couple of first time macros for a humle customer. In excel I could write 10 times more complex macros in a jiffy incl. the add-in functions of higher order mathematics without ever having to attend a 2 day training at 16500 rupees a day.

Many Thanks

Pardon my frustration but I believe everyone went through this at somepoint or other.

Guru

rajkj
Active Contributor
0 Kudos

Hi Guru,

Sorry for the delay in response.

You mentioned it correctly on macros. I feel this is one of the areas where SAP left the job unfinished. The feature is quite powerful but not that user friendly as there was not much information or documentation available especially when it comes to use of complicated macro functions. The documentation on macro function API and error messages are quite esoteric.

Well, to speed up the learning curve or understand the error message, you may enter the function code 'ADVA' in command field to check the underlying ABAP code of your macro where you can set break points and debug the macro. It definitely requires help and support from your ABAP expert.

The following SAP note may also be useful for further details on macro debugging.

https://service.sap.com/sap/support/notes/333243

Thanks,
Rajesh

Former Member
0 Kudos

Thanks Rajesh for concurring.

Esoteric is the right word 🙂 to descrobe these error messages of macros.

I will take take a look at ADVA.

I will try and see if I can write a document with 100 + macros with examples and screenshots, explanation and restrictions of execution in fg and bg etc but that I shall do after I am done with my current project where I will stick to lip service and copy paste.

The last thing I hate to do is to DISCOVER things that been invented, tested, done and dusted by some smart folks long long ago. This kind of discovery and intellectual adventures on basic maths is a colossal waste of time.

If I happen to write one I will publish it here for every one to refer

How about some collaboration to have people publish their macros and someone compile it with some more additions? I can take charge. Not sure in what taste other members of this forum may take thiis agenda.I do note many people have posted the same question of macro help earlier.

To begin with I have about 20 advanced macros (using functions) from a production system. I dont think this should constitute any copyright violaiton as no actual data or business strategy is apparent from the syntax.

Many Thanks once again

Guru

Answers (0)