cancel
Showing results for 
Search instead for 
Did you mean: 

Script Logic - Calling BADI on Condition

Former Member
0 Kudos

Hi,

I have a requiremnt where we have a Forecast and Budget planning in the same application but the cost calculation is different and i am planning to create two different BADI to calculate the cost (one for Budget and one for Forecast).

The Idea is in the Default.LGF, just read the first record and if the Category is "BUDGET" the call the Budget calculation BADI and if the Category is "FORECAST" then call forecast BADI.

My question here is how to read the first record without reducing the scope in Script Logic??

Regards,

Meiyalagan

Accepted Solutions (1)

Accepted Solutions (1)

krishna_priya1
Contributor
0 Kudos

As far as i know we can not incorporate such conditions in script logic. You can implement same logic in BADI . At the start up of each BADIi read ct_data and check for category . For example category is forecast include the code & if category is not forecast do not include any code or write back any data .

Answers (2)

Answers (2)

Former Member
0 Kudos

Hi,

Thanks for the answers. We have already thought of bringing entire logic to BADI. However i just wanted to check if any options we have in Script logic.

Regards,

Meiyalagan

Former Member
0 Kudos

Hi,

I agree you can do something in the BADI itself. If the paramater is BUDGET then call a BADI method or the forecast.

As you already have separate BADIs for Budget and Forecast, is it not a feasible solution not to have anything about this in default logic. Let first users submit data (input schedule or data upload or fro BW) and schedule a package which calls the specific BADI by way of script logic. The package can have the required category selection.

Thanks,

Sreeni