on 01-28-2016 4:51 AM
Hi Experts
Is there any specific standards for Naming Convention for the scripting in Personas2.0 / 3.0 which we could follow?
Thanks!
Hi,
Agree with Steve, in Personas 2.0 (unlike Personas 3.0 where one can really write a long REAL JS code), script button consists of a lot SAP-privide "command" by clicking the icons, the REAL JS code is only in one of the command. Thus the JS code in a script button is normally small - contribute to single functionality (like a function), we tended to create a lot of buttons to do each job and have a main buttton to call them - that's why I mentioned the hidden button naming.
If you really are looking for naming for script, it does not sound so importatnt in Personas 2.0 (my opinion) and for JS code I follow the JS convention. But as Steve said, if there are better ways of doing things, we'd like to hear. With better rules people from all over the world can understand eachother's codes, that's great!
Dong
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
We do understand the Naming convention for the script file name but i also want to understand the Naming Convention to be used in the code that we are writing within the script
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Ah, OK!
Again, the answer is no, aside from the usual JavaScript capitalisation conventions. Scripts tend to be small and self-contained, and so there's generally no need for a lot of structure to the names. There often aren't many objects created in a script in any case.
Of course, if you are writing more complex scripts it might help to have some naming conventions. I've never felt the need, personally. This might make a good blog, if you wanted to do some experimentation and write it up for the rest of us .
Steve.
Thanks Everyone!!
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Just my experiences for script buttons:
I use to give those hidden buttons with name like
H1:call some tcode
Then all the visible buttons that call the hidden buttons to do something, are named as
ACT: fetch data
So by looking at the name, I can see what they are used for. Also in JS, I will add comment like call button H1. Then it will be easier to find which buttons are called.
Br,
Dong
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I personally preferred to save my scripts as local files in a central directory available to other developers. So we used <tcode>_<descriptive_name> as naming convention. Though, as Steve already stated, there is no need to do so because scripts are mostly bound to specific transactions. You could think of a few scripts like "back" or "exit" which you could save at a central directory to perform actions you would need on a lot of flavors due to your ui guideline e.g.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
There isn't.
In Personas 2, scripts don't have names - they are simply attached to script buttons - so there's no need for one anyway!
In personas 3, scripts do have names, but the names aren't relevant outside the flavour in which they live and typically you don't have more than a handful of scripts in a flavour so for both of those reasons name management isn't a big deal. I just give my scripts reasonably descriptive names, and don't think too hard about it.
Steve.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
93 | |
11 | |
10 | |
9 | |
9 | |
7 | |
6 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.