cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

UJ_VALIDATION BAdi from Script logic

Former Member
0 Likes
543

Hi,

I am facing an issue where I need to call UJ_VALIDATION BAdi from an script logic which on the other hand is getting called from a Data Manager Package.

Is there any way to call the validation BADI from script logic?

Regards,

Gaurav

Accepted Solutions (0)

Answers (1)

Answers (1)

former_member186338
Active Contributor
0 Likes

Hi Gaurav,

Looks, like you don't understand the idea of UJ_VALIDATION badi. It will be automatically executed  for any data send by DM package. Please read

Vadim

Former Member
0 Likes

Thanks Vadim for the reply.

I understand that validation BAdi executes automatically each time whenever data is sent.

Actually below code I am writing in script logic where at *REC I want validation BAdi to be triggered which checks if ACCOUNT is XYZ or not.

*XDIM_MEMBERSET ACCOUNT = ALL // All members of Account dimension

*WHEN TIME

*IS %TIME%

*DESTINATION_APP = Planning

*REC(FACTOR = 1, ACCOUNT=XYZ)

*ENDWHEN

Basically I want to remove *REC(FACTOR = 1, ACCOUNT=XYZ) and write *REC(FACTOR = 1) and do that ACCOUNT=XYZ assignment in the BAdi itself after doing some validation.

Regards,

Gaurav

former_member186338
Active Contributor
0 Likes

Sorry, but it's not the purpose of the validation badi!

Please explain the logic you want to achieve! What do you want to validate?

Former Member
0 Likes

Hi Vadim,

We have 2 different model, Planning and let's say ABC_Planning where in both the models we have a dimension called PL_ITEM. All the PL_Item are valid for Planning model whereas for ABC_Planning only those are valid whose property Open_flag is Y (Open_flag property is maintained in dimension PL_ITEM).

In ABC_Planning dimension, we are submitting the data for ACCOUNT=A,B,C and D only for PL_ITEM Open_flag property is Y. While moving data from ABC_Planning to Planning we are converting to ACCOUNT=F from A,B,C,D.

We have to make a validation that nobody can input anything directly in Planning model where ACCOUNT=F and Open_flag =Y for PL_Item.However, it always should be flown through ABC_Planning model only. We are using flat file upload and by using a data manager package we are submitting the numbers.

I have put the condition in the validation BAdi that ACCOUNT=F and Open_flag =Y for PL_Item records should be rejected if model is Planning and which is working perfectly. But it stops me when we move the data from ABC_Planning model. All those records also got rejected because we are saying the script logic that Account = A,B,C,D should get converted to Account=F.

Hope I am clear.

Regards,

Gaurav

former_member186338
Active Contributor
0 Likes

How do you move data from ABC_Planning to Planning? By some DM package or using default.lgf?

If it's DM package then:

Vadim

Former Member
0 Likes

Hi Vadim,

Yes, we are moving the data through DM packages and using Destination_App in script logic.

Data Manager option is ON for validation for the source and target model both.

But the problem is, record is not valid if directly inputted in Planning but it is valid if its moved from ABC_Planning. So I need to put some condition where when I run DM package from ABC_Planning to Planning the condition in BAdi should not execute and when someone directly input in Planning model then that condition should execute and records will get rejected.

Can we achieve this by passing a constant variable from script logic to BAdi without changing anything in script logic?

If yes, how can we write it so that we can put condition in BAdi based on that variable in order to know that this is not direct input instead its a DM Package that is running.

Regards,

Gaurav

former_member186338
Active Contributor
0 Likes

Just set Data Manager option to OFF! Direct input will be validated and DM write - will not!

"Can we achieve this by passing a constant variable from script logic to BAdi without changing anything in script logic?" - No, you can't do it like you think...

Vadim