How do I pass multiple parameters to a subroutine? - abap

I am trying to pass multiple parameters to a subroutine, but I get the following error:
Incorrect nesting: before the statement "FORM", the structure introduced by "FORM" must be concluded with "ENDFORM"
Here is my code:
CASE p_choose.
WHEN 'UMK'.
PERFORM umk USING: p_modul,
p_e_pal,
p_vbeln,
p_e_umk.
"some other cases
ENDCASE.
FORM umk USING: p_modul,
p_e_pal,
p_vbeln,
p_e_umk.
ENDFORM.
Where is my mistake? How can I pass multiple parameters? Or isn't it possible at all? Thanks!

I already found the solution by myself.
The mistakes are the "," after every parameter.
The correct code would be:
CASE p_choose.
WHEN 'UMK'.
PERFORM umk USING p_modul
p_e_pal
p_vbeln
p_e_umk.
"some other cases
ENDCASE.
FORM umk USING p_modul
p_e_pal
p_vbeln
p_e_umk.
ENDFORM.

To complete your own answer which is the correct solution, let me explain the reason of the error which is due to a misunderstanding of how the chained statements work, by showing the equivalent code without the chained statements.
Your old code with chained statements (symbols : and ,):
FORM umk USING: p_modul,
p_e_pal,
p_vbeln,
p_e_umk.
ENDFORM.
is exactly equivalent to this code without chained statements:
FORM umk USING p_modul.
FORM umk USING p_e_pal.
FORM umk USING p_vbeln.
FORM umk USING p_e_umk.
ENDFORM.
Hence the obvious syntax error.

Related

How to check in robotframework if the page has an element and netx to take a condition?

Example:
In Ruby/capybara I would do:
if page.has(element)?
do somenthing
elsif page.has(element2)?
do another thing
else
print "Do nothing"
How could i do it in robotframework ?
*** Keywords ***
given I need to verify some conditions
Seems you want to implement conditional logics. For that there is keyword called "Run Keyword If" in Robotframework. Please try to look documentation for that.
Here is a link that might be helpful.
https://blog.codecentric.de/en/2013/05/robot-framework-tutorial-loops-conditional-execution-and-more/

How to pass custom arguments along with standard arguments in a Documentum job method

I configured a job correctly by passing the custom arguments successfully.
Now I want to use the custom as well as standard arguments. But the issue is either standard arguments(job id, user name, docbase name and trace level) are getting passed or the custom arguments only. I am unable to get both types of arguments together.
Could anyone suggest any ways to get that done?
Send standard arguments as custom arguments, i.e. just add it with your custom arguments. Did this before and it work.
In the job properties editor in Documentum Composer select the "Standard Arguments" radio button!
Even if you are using custom attributes, the "Standard Arguments" radio button has to be selected.
I tried to do the same using the custom argument using the Job artifcats and then checking the checkbox "pass standard argument" in DA. But still I was unable to get the custom and standard arguments together.
For resolving this, I first retrieved the job ID from the standard arguments and then fetched the custom arguments using the following code:
IDfId idfJobId = new DfId(stringJobId);
IDfSysObject jobObject = (IDfSysObject) session.getObject(idfJobId);
CustArgument1 = jobObject.getRepeatingString(ATTR_METHOD_ARGS, 0);
if there are multiple arguments we can get it using a for loop by incrementing index i
CustArgument1 = jobObject.getRepeatingString(ATTR_METHOD_ARGS, i);

how to add condition to not execute code for given user

I want to pass some abap code without executing according to sap user.
Here an example:
if userName is John Then
pass this code block without executing...
endif
Is it possible?
Is it possible to debug it so that when we add break <user_name>, the debug runs only for that user?
Yes you could if it is absolutely necessary . The system stores the user alias executing the program under the variable sy-uname and you can use this to do your condition check . But I wouldn't recommend this approach as it is not immediately visible why a certain block of code is being executed for some users and is bypassed for others. This would/should never pass a stringent quality check during code analysis .
Just for completeness, the technical solution would be:
IF sy-uname NE 'JOHN'.
* Code that is not executed for SAP user 'JOHN'
ENDIF.

Use Xpcom.CreateInstance<IType>(String); in VB.NET

I want to use such a CreateInstance-Function as the following one for GeckoFx in VB.NET.
Xpcom.CreateInstance<nsILoginManager>("#mozilla.org/login-manager;1");
The code above works fine for C-Sharp but not for VB.NET, what should I use instead?
If I try Xpcom.CreateInstance(nsILoginManager)("#mozilla.org/login-manager;1") I get an Error for as the following one :
"This [nsILoginManager] is a type and cannot be used as Expression"
What else should I write/use?
The reason why I try this is to activate the historisation for fields in the webbrowser-component.
VB.NET uses of keyword to specify type.
Try this:
Xpcom.CreateInstance(Of nsILoginManager)("#mozilla.org/login-manager;1")

Regular expression in While Controller Jmeter

I am using While Controller with Condition:
${_javaScript("${DONE}" ! = "Resolved and Downloaded";)}
where initially DONE="Not Assigned yet".
After few iterations DONE changes and has value Resolved and Downloaded (which I check in Debug Sampler) but loop continues and doesn't quit.
What did I do wrong,What should I do to make it work?
Check syntax of your condition expression first: should be double __ before function name and , instead of ; after condition in function's params list:
${__javaScript("${DONE}"!="Resolved and Downloaded",)}
This can break your test case.
As well you can look into jmeter.log for possible issue details.
${__javaScript("${DONE}"!="Resolved and Downloaded")}
You can try the following using while controller:
${__javaScript(${DONE} !="Resolved and Downloaded")}
You may use if controller.Keeping the if controller as a child of runtime controller.Specify max time in runtime controller.
Under If controller specify the following:
"${DONE}" !="Resolved and Downloaded"