on 12-30-2013 11:44 PM
I looked through the help documentation and couldn't find any reference/example to define a custom action that accepts parameters.
I want to create a custom action FooBar(), which can accept parameters such as ID, Type
I would assume that when I call the action it would be CustomBO.FooBar(12, "AB");
The custom action definition would then use 12 and "AB" parameters as variables in the custom action script.
There are no examples of calling an action with parameters and defining an action with parameters , so does this mean this is not possible or it is, but not documented?
You can try something funky with Reusable libraries though and let us know the results if you need it so badly.
Consider the primary key of your CustomBO as UUID.
Call ReUseLib.FooBar(UUID,12, "AB") and "Retrieve" your customBO's instance with UUID in the library's action FooBar and perform your operations there. I am going ahead and taking a wild guess that as this is happening in the same session, user whoever is performing actions should not get any lock messages.
But, I believe SAP would be providing this feature very soon as this is something being asked from long time.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Rei,
That is possible, use a Reuse Library and there you can create functions with parameters.
You can define an Import (with parameters) or a Return (returns something) method.
In order to call in ABSL, you use YourReuseLibrary.YourMethod(Params here).
There are a few restrictions with Reuse Libraries as mentioned by Daniel.
Best regards,
Fernando Giroleti
SAP Cloud Service Center AMEA
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
As far as i've seen, this isn't possible, at least as of 1308. I haven't really read through the 1311 documentation, though.
There are ways around it. You can use elements (regular or transient) and use these within the Business Object action.
Then within CustomBO.FooBar() (without parameters) you can use these elements.
Alternately, you can make a Reuse Library function, which DOES allow for parameters to be passed in - however, the Reuse Library functions don't let you raise messages as part of the function. I've used it in a few circumstances where i'd pass parameters in to a reuse function that would return a Code data type, and based on the code returned i'd take further action.
Generally i'd do this if i need to have validations in multiple locations within a SAP Business Object.
What does this requirement stem from? That'd help use recommend the best alternative.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hello Horst,
The action is define under Root as given below:
Business Object SPR{
[Label("Customer")] element AccountPartyID : PartyID ;
action Calculation;
}
action absl code
var Request: Library::SPRCalcEWSI.SI_Calc_Send.Request;
Request.MT_Calc_Send.Customer = this.AccountPartyID;
this.AccountPartyID cannot be accessed.
Regards,
Sangeeta
User | Count |
---|---|
88 | |
23 | |
11 | |
9 | |
8 | |
5 | |
5 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.