cancel
Showing results for 
Search instead for 
Did you mean: 

User defaults for multiple systems in one request

patrick_weyers
Participant
0 Kudos

Hi all,

On this thread, Madu explains how to setup user defaults in general:

I'm having difficulties understanding the logic if there are multiple line items in a request for multiple systems with different user default sets. The reason I'm having those difficulties is that the return value of the user default BRF+ function is a single text value only rather than a table to could deliver multiple results for different line items (compare this to the initiator BRF+ rule, where it is possible to return different result values for different line items).

Can you explain the logic of User Defaults for multiple line items with different systems?

If I set up the User Defaults and I have a request with two line items:

001    Role X   / System SYS1

002    Role Y   / System SYS2

and I have a decision table looping over the line items like:

System     User Default ID

SYS1          001

SYS2          002

the system will call the User Defaults BRF+ function. It will run through the loop for 2 iterations (as there are two line items). During the first iteration, it will set USER_DEFAULT_ID to 001. In the second iteration, it will overwrite USER_DEFAULT_ID from 001 to 002. Hence, the result from the first iteration will be lost.

The BRF+ function will report back to GRC only User Default ID = 002.

How do you deal with requests than contain multiple line items with different systems and make sure all the user defaults get assigned - rather than only one (the one valid for the last line item, incidentally)?

Thanks a lot and regards

Patrick

Accepted Solutions (0)

Answers (6)

Answers (6)

Former Member
0 Kudos

Hello, Patrick!

Have you had any new information?

Have SAP team replied to you incident?

Thank you in advance!

Best regards,

Julia

Former Member
0 Kudos

Patrick, you are welcome! I hope we will solve this problem soon. If I find something else I will share with you.

Former Member
0 Kudos

Hello, Patrick!

I have the same requirements as you had. Have you solved the issue?

I tried to enable "Return all matches found" in the result data object. It does return all the matches if loop is changed a little. But my request stuck in this case. There is no error in SLG1 or others logs and a request doesn't complete. It looks like the program code isn't adapted to handle multiple results for this decision table or I've made some serious mistake in the BRF configuration.

Thank you in advance for you reply!

Best regards,

Julia

patrick_weyers
Participant
0 Kudos

Hello Julia,

How are you - I hope you're doing well! I believe we've worked on the same project!

Unfortunately, I could not yet solve this problem.

I've also raised an incident with SAP, but so far, they haven't realized what the problem really is and keep referring me to the known SCN documentation on User Defaults, which obviously doesn't address this.

I agree with you: We can change the BRF loop alright (to accept multiple values), but if the code isn't prepared to receive an array of values, it's no use.

I'm a bit afraid SAP will say this is "not supported" and we should post a feature request rather than an incident.

Best regards

Patrick

Former Member
0 Kudos

Hello, Patrick!

I'm fine! Thank you! I hope you are doing well too! Yes, we've worked on the same project.

I’ve found an interesting behavior of the program code while debugging. Actually, no need to enable "Return all matches found" to assign different user default sets in different systems. But it works strange regarding to using line items attributes in the BRF rule. It looks like the code is focused only on a system level.

The method cl_grac_provisioning_engine=>provision_user_defaults for searching a user default set is run while operating the method CL_GRAC_PROVISIONING_ENGINE=> CREATE_USER. This method finds the proper user default set for a system and then a user is create in this system successfully. Then this method is called for another system. But I think the export parameter is_reqlineitm for the method provision_user_defaults is filled in a strange way.

For example, we want to assign different user default sets depend on added business roles.

We add three BR:

BR1 connector 1

BR2 connector 1

BR3 connector 2

System finds the number of unique connectors (in our case it’s two). Then it finds the last line item for each connector and transports this value to the method provision_user_defaults. The method will be called twice for BR2 and BR3.

Why is it work like this I haven’t found yet. Might you can ask SAP team as you raised an incident.

Best regards,

Julia

patrick_weyers
Participant
0 Kudos

Thank you, Julia! I will reference this SCN thead in the SAP incident!

Former Member
0 Kudos

Hi Plaban,

Is the user default working without using loop?Can you kindly guide?

alessandr0
Active Contributor
0 Kudos

Dear Patrick,

Loop is the function you are looking for. Please also check the following document that outlines how to set up a loop statement for user defaults:

http://scn.sap.com/docs/DOC-58703

Please keep us posted.

Regards,

Alessandro

patrick_weyers
Participant
0 Kudos

Hello Alssandro and thanks for your answer.

I'm familiar with loops and in fact I'm using a loop to iterate through the line items of the request, applying the decision table to each line item.

The problem I'm having is that the result type of the pre-defined BRF+ function for user defaults is a simple text string (rather than a table) and the application is expecting such a result.

Hence, when looping through the line items and applying the decision table and recording the result of the decision table in the result object of the user default BRF+ function (as provided by the context), always the previous iteration's result will be overwritten.

The BRF+ function (consisting of a ruleset, a loop and the underlying decision table) will always only report the last identified result from the last DT iteration of the loop. All other results are lost.

Do you see my point there?

Has anyone configured this sucsessfully?

Thanks and cheers

Patrick

Former Member
0 Kudos

Hi Patrick,

We have a similar setup but it never worked and always processed one system.

The result data object of user defaults can hold only one result and the binding type is to DDIC element.,

If you want multiple results to be stored and handled then you can try below options.,

- Enable "Return all matches found" in result data object (something similar to agent rule)

- Make the result data object as table to store and handle multiple results

Again I have only gotten this far and never proved it working.

Hope this helps.

Regards,

Muthu

Former Member
0 Kudos

hi Patrick,

i have not used Loop in User defaults, and it works well, for multiple systems.

fyi, you don't need a loop to run through a decision table.

So, could you try giving

Regards

Plaban

patrick_weyers
Participant
0 Kudos

Hello Plaban,

Thanks!

The loop is required if the conditions for the user defaults are based on the line items - such as the requested role or system. I.e. if the user defaults are system specific (parameter A in system X, parameter B in system Y), you need to loop through the line items.

If the user default criteria are only based on request header attributes (such as request type, business process etc.), no loop is needed. But in that case, of course you cannot have different user default sets for multiple systems anyway, which my question is about!

Best regards

Patrick