Skip to Content
0

Write back BADI with 2 filters

Dec 09, 2016 at 02:22 PM

45

avatar image

Hi , I want to call the Write back BADI for Input schedule and only imports to the cube. Thinking if this is possible I added 2 filters to the BADI . But the problem is when i input the data through input form the BADI is triggered , not triggered when i run the import package.

capture.png

capture.png (12.9 kB)
10 |10000 characters needed characters left characters exceeded
* Please Login or Register to Answer, Follow or Comment.

2 Answers

Vadim Kalinin Dec 09, 2016 at 02:54 PM
0

Sorry, but it's working with DM! Just insert the endless loop at the beginning of your badi code and in SM50 you can debug the triggered badi code.

  DATA i_d TYPE C. " for bg debug.
  WHILE i_d IS INITIAL.
  ENDWHILE.
Show 1 Share
10 |10000 characters needed characters left characters exceeded

Hi Vadim,

Thanks for replying. I don't see anything in the SM50. I guess the WB BADI is not executed at all if start the import Package.

0
Vadim Kalinin Dec 09, 2016 at 03:31 PM
0

It's executed! Just checked in my system :) And can see and debug with endless loop using SM50.

Please check other filter values, may be some error here...

Model and Environment names are case sensitive!

Show 11 Share
10 |10000 characters needed characters left characters exceeded

The BADI is triggered for both via imports and input schedule? . Or the BADI is triggered for every DM run. Because the requirement is to trigger the BADI only for Input form and imports.

I have added only 2 filters and both of them are same/correct(case sensitive). Please see the screenshot .

capture.png

capture.png (21.8 kB)
0

"Or the BADI is triggered for every DM run." - the badi is triggered each time when the data is written to the cube based on filter values! If DM is set in the filter then all DM writes will trigger badi.

Just tested with simple import of transactional data from the text file!

Inside badi you can use different logic based on I_MODULE_ID parameter. You can't differentiate "import" and other DM packages. Only if you use custom chains for import with memory variable setting...

0

Meaning the BADI will be triggered when any DM or Custom BADI that writes the data to the model. Right?.

My requirement is to trigger the WB only for input form and imports. So would that be a good idea to put some logic in WB for input schedule and put something in the default logic for imports.

0

Sorry, but your requirements are not clear! What do you mean by "imports"???

If you are talking about importing of transactional data you can perform some logic in another badi type - Routine badi.

Your idea in not good... default logic is a very special case :)

0

yes it import of transactional Data. Yes I know about the Routine BADI can handle the data coming in via imports but i was trying to do it one place that is WB BADI. So I think i have to put the logic in 2 places - WB for input forms and Routine BADI for Imports :). ?

0

It depends on the logic!

In the real life you import transactional data with some dedicated AUDITTRAIL ID!

And you don't change this data later.

Using this AUDITTRAIL ID you can always understand that the data written is "import"

Then you can use only write back for everything.

1
Show more comments

P.S. Just repeating the same:

Write back badi is triggered on any data write to the cube checking Module filter!

Data sent by input form directly - MAN

Data calculated by default.lgf as a result of data sent by input form - MAN with IF_DEFAULT_LOGIC=abap_true

Data written by DM package (including data written by custom logic badi in the script of DM package) - DM

Data written by default.lgf launched by the option in DM package - DM

...

0

Thank you for your comments.

0