Skip to Content

How to execute a DM to call a BADI using a .LGF

Hi gurus,

I calling a BADI thru a DM that we have modified to not ask the user any prompts. The .LGF within the DM that contains the *START/END_BADI is not the default one since we need to see the data saved in the system before we call the BADI to run its logic. The problem I have is that when I click on the Macros that runs the DM there is no parameters or variables passed since there is no prompts to select from. All the DM does is pretty much just execute the .LGF that calls the BADI and therefore the BADI takes all the members and all dimensions when running and we just want it to run for the parameters (members) from the current report context. How can I achieve this requirement? Please advise.

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

2 Answers

  • Best Answer
    Feb 13 at 07:31 PM

    "the BADI takes all the members and all dimensions when running and we just want it to run for the parameters (members) from the current report context" ??? - BADI know nothing about report context :-)

    "we have modified to not ask the user any prompts" - bad idea!

    You can use vba to call DM and to pass parameters to DM: https://blogs.sap.com/2017/06/16/simple-vba-function-to-pass-parameters-to-dm-packages/

    You can pass context scope using this VBA code (pass SELECTION variable).

    Then the script will have the report scope and BADI can read the current scope.

    P.S. Another option is to use PROMPT(SELECTINPUT... parameter to get a current scope, but the user will need to press extra keys.

    Add comment
    10|10000 characters needed characters exceeded

  • Feb 13 at 07:43 PM

    Hi Vadim, Thanks for the fast response. Do you have a different link than the one on your response, that one says "We are sorry, but the site you are looking for is temporarily out of service" Thanks

                  Please try again later!
    Add comment
    10|10000 characters needed characters exceeded