cancel
Showing results for 
Search instead for 
Did you mean: 

BPC NW - Validation Script Logic does not work

Former Member
0 Kudos

Hello,

I have defined a validation, which is successfully saved; I have included the provided example for the Validation script logic:

//For running validation rule

*RUN_PROGRAM VALIDATION

CATEGORY = %C_CATEGORY_SET%

CURRENCY = %GROUPS_SET%

TID_RA = %TIME_SET%

OTHER = [ENTITY=%ENTITY_SET%]

*ENDRUN_PROGRAM

However, when I run the package the process get cancelled; when I comment the logic, the process succeeds, so there is no technical error on the package side, but should be at the code level.

The logic gets saved and validated, however it is not getting the required result.

How can this logic be corrected?

Thanks&Kind regards,

Begonia

Accepted Solutions (0)

Answers (7)

Answers (7)

0 Kudos

Hello,

my problem is that I am thinking in SAP, not in cube. So I would like to pick up the credit and debit balance amount, that means; the amount of the one company, one fiscal year/period & one account. So the tipical check for debit amount = credit amount by company/period. So I don't know how to say that in BI.

Best Regards,

Felipe.

0 Kudos

Hello,

the process that I have in my mind it's just to check the credit and debit values are the same, in other case send a message error. I don't want to changes any value. I guess that is posible, isn't it?.

thank you for you help,

Felipe.

Former Member
0 Kudos

Hi Felipe,

Yes this is very possible.

Please take a look at the following code.


method if_uj_validation_rule_logic~do_validation_logic.

  field-symbols:
                 <field1> type any,
                 <field2> type any.

  assign component 'FIELD1' of STRUCTURE is_data to <field1>.
  assign component 'FIELD2' of STRUCTURE is_data to <field2>.

  if <field1> ne <field2>.
    es_message-message = 'Error in Validation'.
    es_message-recno = 1.
  endif.

endmethod.

It would look something like this.

Cheers, Scott

0 Kudos

Begonia,

thank you for your help... Just only one question, I am implementing the ABAP code of validation. One of me validation is that the active should be equal to pasive, How do you pick up the value of the account?.. I mean...

Assign component 'C_ACCT' of structure is_data to <C_ACCT>...

if <C_ACCT> = '100000'.

with these I have the accoount 100000 that is the active, but how I can pick up the value?.

thank you in advanced for your help.

Best Regards,

Felipe.

Former Member
0 Kudos

Hi Felipe,

To clarify, BPC NW Validations allows you to check or validate that there are appropriate combinations of members being posted to your application. In your example you are referencing the account on the IS_DATA structure correctly and your next step would be to check that it is in fact the value you wish it to be.

IF IT IS NOT, YOU CANNOT CHANGE THE VALUE.

You can issue an error message that the record being posted violates your validation rules and it will not be written to the cube.

Do you wish to change the value prior to the data being written to the cube?

Cheers, Scott

0 Kudos

Hello,

I have the following script logic for execute the validation:

*RUN_PROGRAM VALIDATION

CATEGORY_DIM = %C_CATEGORY_SET%

CURRENCY_DIM = %GROUPS_SET%

TIME_DIM = %TIME_SET%

OTHER = [ENTITY_DIM=%ENTITY_SET%]//For More than one other scope parameters: OTHER = [ENTITY=%ENTITY_SET%;INTCO=%INTCO_SET%...]

*ENDRUN_PROGRAM

the system is giving me the following error 'UJP_PROCESS_EXCEPTION:Time is not available in the application Legal'

Any help or clue about it?

thanks in advanced,

Felipe.

Former Member
0 Kudos

Hello Felipe,

Once I defined the validation in the admin console, copied the logic provided in the system library and defined the validations thorugh trx UJ_VALIDATION, the logic did work for me.

Could you please double check you did follow all the steps and check in the logic that the variants are defined according your dimension names.

Hope this helps!

Kind regards,

Begonia

0 Kudos

Hello,

I have changed the .LGF file and my error now is that the time is nos available in the Legal application...

Best regards,

Felipe.

Former Member
0 Kudos

Hi,

Even I faced the same problem when executing a custom package, when I was trying to run the package for all members of few dimensions.Try restricting the logic to be executed on few members.

Hope this may help,

Kranthi

pravin_datar
Employee
Employee
0 Kudos

Hi Begonia,

Have you tried BPC7NW validations? Go to transaction uj_validation on your SAP GUI and there you can maintain validations.

Regards

Pravin

Former Member
0 Kudos

Hello Pravin,

Thanks for your reply.

By trying the trx UJ_VALIDATION, I get the message that no validations have been defined for my application set.

However in the BPC Admin Console, both Validation rules and Validation rules details have been defined, as well as the script logic VALIDATION.LGF, which is successfully saved and validated correct.

But when I launch the created package for Validation (pointing to the correct VALIDATION program), the loading procedure gets cancelled.

However, when I "comment" the validation script logic, the package runs successfully, but of course, no action is taken.

What is missing in this validation process?

Thanks&Regards,

Begonia

pravin_datar
Employee
Employee
0 Kudos

Hi Begonia,

In BPC7NW, the validations work differently than in the Microsoft version. In BPC7NW, you need to set up validations through uj_validation transaction. They won't be automatically set up for you. In BPC7NW, you can't run validations by running lgf file.

Regards

Pravin

Former Member
0 Kudos

Hello Pravin,

Thanks for your response. I have defined a validation in trx UJ_VALIDATION, and when launching the DM has inserted only the correct records.

Validations here defined remind more of "technical" validations, whenever a field is missing, it is not allowed to save data in the cube.

I would like to clarify with you:

1.for defining functional validations, such as BS result = Net Revenue: needs to be defined at the BAPI level. If this is the case, we would need to create a custom package to run such process as part of our consolidation process

2.in the BPC Admin console we do have Validation Business Rules and Business Rules details, which seem to be defined for such functional validation purpose, but if, as you say, we do not run validations through lgf logic - how can these be used on BPC NW?

Thanks very much!

Kind regards,

Begonia

pravin_datar
Employee
Employee
0 Kudos

Hi Begonia,

The validations maintained through uj_validations are functional validations. You may feel so because you have to maintain them through SAP GUI. Hopefully in future we can maintain these validations from BPC front end instead of SAP GUI. As you might have noticed, we can easily maintain there validations between various dimension members. Also in uj_validation, you can have your own validation logic using BADI implementation. I would say that should be the way to maintain validations instead of a script logic function. Script logic will work on the records already saved in the cube whereas the validations in uj_validation will prevent any invalid record to be saved. Also you might have noticed that you can turn validations on or off for journals, manual planning and DM.

Regards

Pravin

Former Member
0 Kudos

Hello Pravin,

Thanks a lot for your helpfull answers, will investigate further on the validations side.

Kind regards,

Begonia

Former Member
0 Kudos

Hello,

by reading this topic, it seems that all validations are done only in SAP GUI? Can anyone tell me, why is the business rule still available in BPC frontend? Also logical validations should be maintained in BPC frontend and not using BADI in SAP GUI.

I will appreciate any information regarding how to setup validations in BPC.

Thanks

Jan