on 04-18-2014 10:15 AM
Hello,
I have implemented data input validations (for manual input and journals), I first tried with the Write-Back Badi, but then realised that the UJ_VALIDATION would have been a better option, because it gets executed on journal saves). I have implemented both solutions (sequence of checks are identical and I realised that on larger data sends (couple of thousands of records), there was a huge performance difference between the two approaches, the write-back Badi is performing much better (this comment is of course only valid for manual input, not an issue for journals)
My validation are based on properties, so I need to read couple of properties from 6 different dimensions and then perform my validations. In the write-back Badi, I read out all the master data once and then loop through the ct_array table and perform my checks.
But in UJ_VALIDATION Badi, I need to read the master data individually for each record in the IS_DATA table (I of course only need the specific record I need, not the whole table like in the Write-back Badi). Is there a way to centrally read all the master data at the beginning of the validation process (put it in internal hash tables) and then look it for each IS_DATA instead of reading it separately for each record ?
Regards,
Marcel
Hi Marcel,
You performance issue is due to the fact that write back badi receives all changed/inserted records at once in one table and the validation badi is executed by single record. I recommend you to use write back badi. It's working also with data posted by journals.
Vadim
P.S. What do you mean by "validation process"? Validation is done record after record individually...
Message was edited by: Vadim Kalinin P.S. added
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Vadim,
The validation are done row by row, but the Write-back code only get executed when a journal is acutally posted, not when it is saved (which is much better for end-users)
I guess I will have to stay with the current solutions, using the UJ_VALIDATION for the journal module and the Write-back for data input. I do however have to to duplicate some coding, which I would have preferred to avoid (coding for checks is already in a helper class), but the master data read (only for current record vs. all master data) and data processsing (only current records vs. looping through a table) are different
Regards,
Marcel
Hi Vadim,
I considered that Badi, but I believe that it can only be uses to generate additional records, I do anything on the existing ones.
I will go for the write-back part on the Manual Data Input, but I cannot find a proper solution for the journal module. I have noticed that UJ_VALIDATION Badi gets when the default logic posts data (which I don't want, as I want to post records to combinations not allowed on input), is there a way to avoid having UJ_VALIDATION executed after default logic ? This causes be problems with my journal.lgf logic...
I have not activated UJ_VALIDATION for Data Manager, so I was not expecting the default logic records to be processed in UJ_VALIDATION
Regards,
Marcel
Hi Marcel,
As far as I remember with write back it was possible to distinguish between data originally sent by input schedule and the data generated by default.lgf (we have validation in write back - it's prohibited to write directly to some members, but default.lgf can write). Never tested it with validation badi. Look on write back incoming parameters - may be it will help you with validation.
Vadim
I finally found a solution to do what I wanted in the first place.
I use the CLASS_CONSTRUCTOR method to read all my master data (class constructor is only called once for all the validations) and store them in CLASS level variables.
To distinguish between the first execution of the UJ_VALIDATION BADI and subsequent calls from the Script Logic, I check the content of the ABAP CallStack. It's not a perfect solution, but it seems to work well.
Even the UJ_CUSTOM_LOGIC does not have the parameter to find the source of the call whether its called from DM or input schedule. But I used the static attribute g_module_id of class cl_ujk_model (cl_ujk_model=>g_module_id) which has the values DM or MAN to identify the source call. I guess, the value should be JRN for Journals but I have never tested the validation BAdI though.
-Prabhu
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
15 | |
3 | |
2 | |
1 | |
1 | |
1 | |
1 | |
1 | |
1 | |
1 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.