Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

Version 1 Current »

Dynamic Selection allows you to dynamically adjust the selection of Extractor 1.0 Variant or Extractor 2.0 Process using SAP BAdi implementation. It enhances the possibilities to filter data during the extraction process. At its core, this functionality allows you to programmatically edit the internal table that holds the select options of Extractor 1.0 Variant or Extractor 2.0 Process at runtime. This option might be useful when some of the filtering parameters are dynamic or known only at run-time.

Please note that Dynamic data selection is an option for expert users, who may use it if the standard data selection isn't sufficient. This option requires ABAP knowledge.

In order to use this functionality you need to perform two steps
Firstly you need to implement the BAdi enhancement and then you have to use it in Extractor 1.0 Variant or Extractor 2.0 Process selection.

Implement the BAdi

  1. In ABAP workbench create a new class implementing interface /DVD/GL_IF_SELECTION_DEF.
    This interface is defined by Glue with the purpose to allow custom selection enhancement implementation.

  2. Implement your custom filtering logic inside the DEFINE_SELECTION method.

    Please be aware that you can adjust the whole selection for Extractor 1.0 or Extractor 2.0 process within this method. Therefore, make sure you know what you are doing.

  3. When your logic is implemented, navigate to package /DVD/GL_EXT_DATA in ABAP workbench.

  4. Expand Enhancements folder and then Enhancement Spots.
    You should be able to see /DVD/GL_EXT_VAR_SELOPT, as shown in the picture.

  5. Choose /DVD/GL_EXT_VAR_SELOPT from the context menu and select Implement. A pop-up window should appear.

  6. Fill in input fields named Enhancement Implementation and Short Text and confirm your selection by pressing.

    When completed, you should see the following screen:

  7. Fill in the required inputs and confirm.

    1. BAdi Implementation – Name of BAdi implementation you want to create

    2. Implementation Class – This is the name of the class you created at the beginning of this steplist

    3. BAdi Definition – Definition of the BAdi. You have to use value /DVD/GL_SELECTION_DEFINITION

  8. After confirmation of your selections, the new BAdi implementation is created. You should see the screen shown in the following image:

  9. In the next steps, you need to set up your BAdi implementation. Expand this BAdi implementation and double click on Filter Val.

  10. Press the Combination button as shown in the image below to create a new filter combination. A new combination will be added.

  11. Change filter value by double-clicking on filter definition, highlighted on the next image.

  12. Set the Comparator 1 to “=” and enter the id you want to use in the selection into filter Value 1 and confirm. This value will later be used in the selection as a placeholder in order to trigger this BAdi implementation.
    Correct configuration should look like this:

  13. Activate your BAdi by pressing Activate button or use the shortcut Ctrl+F3.

    After finishing this step your BAdi is ready to be used in the Glue filter.
    For more information, you can use the official SAP step list on How to Implement a BAdI.

Use your BAdi with Extractor

If you have your BAdi implemented, you can use it in Extractor 1.0 Variant or Extractor 2.0 Process.

The process is slightly different for Extractor 1.0 and Extractor 2.0 but the main principle remains the same.
Basically, you need to adjust the selection of Glue Extractor. For Extractor 1.0 you can do so by editing the Extractor Variant. For Extractor 2.0 you can fill these values when executing Extractor 2.0 Process or save them into standard SAP variant.

If you need further guide discussing Extractor 2.0 Process or Extractor 1.0 Variant, you should see the pages Variant and Extraction Process.

In the previous steps, you defined some value as the filtering option for your BAdi. This value can be used as a placeholder in Extractor 1.0 Variant or Extractor 2.0 Process by adding a special character $ before the filter value. Let’s say you set the value to ABAP_FILTER. Then you can use the value $ABAP_FILTER in the selection screen in order to trigger your BAdi during extraction.

The filter value e.g. $ABAP_FILTER affects the selection only by triggering your custom BAdi. Therefore you don’t have to worry about the particular field that should be used for the selection.

In order to use a placeholder within the selection, you need to have a field of character type with sufficient length present within the selection. If you haven’t, we suggest you add some fields from a source structure that will be used only for technical purposes.

The next images show the usage of dynamic filters in the Extractor 1.0 Variant and Extractor 2.0 Process.

Extractor 1.0 Variant

Extractor 2.0 Process

  • No labels