cancel
Showing results for 
Search instead for 
Did you mean: 

UI refresh when changing data in cross-derivation BADi

Former Member
0 Kudos

We have the following scenario:

We created a Z-Entity for a material. Using the standard insert/delete options for this entity works fine and creates the new entities for this material in the data model and shows them in a table in the UIBB.

Then we enhanced the UIBB with two extra buttons. Depending on which button is pressed, an entity should be created/copied from another material. This implementation is done in the cross-entity derivation BADi.

We enhanced method /PLMU/IF_FRW_G_ACTIONS~PROCESS_ACTION_EVENT in order to recognize which button is pressed.

Then we implemented the cross-entity derivation BADi, which gets triggered and changes the data model and creates the entry we need in the model. This works fine and the new entity is available in the model data.

Our problem with this approach is, that the UI isn't refreshed when one of these buttons is pressed and the new entry does not appear in the entity's table.

If we change a material's standard field (e.g. material type) afterwards, another roundtrip is triggered and the UI is refreshed including the update of our entity table.

We have already tried to raise a roundtrip event when the button is pressed and also have tried to change a field manually using the convenience API with no luck so far.

Does somebody know how we can trigger a complete roundtrip or something that also updates the UI component?

Kind regards,

Sebastian

umar_faraz
Explorer
0 Kudos

Hi,

I am also into similar phase of my development. On pressing of custom global button I need to trigger the cross entity badi. Could you share me how did you fix it.

Accepted Solutions (0)

Answers (2)

Answers (2)

Former Member
0 Kudos

When you configured the new buttons, did you select the option where the button triggers a round-trip? It is in one of the attributes of any FPM button.

Former Member
0 Kudos

Each button needs to trigger a custom event in order to recognize in the onAction Enhancement which button was pressed.

Former Member
0 Kudos

You might have to enhance the PROCESS_EVENT method of the feeder class. Basically, capture your new event and then raise the refresh event. This will force a standard round-trip.

Former Member
0 Kudos

Hello Sebastian,

why is the CE Derivation BAdi called?

Normally this BAdi is called by the SAP Standard when the MDG data model gets changed. But you wrote that the BAdi gets triggered and creates the new entity. So where exactly is the model change happening that triggers the CE Derive?

Kind regards

Jürgen

Former Member
0 Kudos

Hello Jürgen,

thanks for your reply. We implemented our business rules in the derivation BAdi, therefore each time something is changed in the model, as you said, the derivation BAdi is triggered and our rules are executed.

In the case described, a reference to an existing material (Z-Field in the data model) is changed. If one of our (Z-)buttons is now pressed, the derivation BAdi should be triggered to process our logic to create an entity.

We did this by either manually changing a dummy value in the model or by flushing the model buffer (with the same result).

This will trigger the derivation BAdi and process that reference field and based on which button it was and what's entered in the reference field, it will create a new entity.

The entity after this is in the data model, but will not be displayed in the UI table for that entity.

Former Member
0 Kudos

Can you try a simpler case already to see if there is a problem / bug?

  1. Have your dummy attribute (I suppose a MATNR?) as an input field on a Form (like "Basic data").
  2. Bind the onEnter property to event ROUNDTRIP, provided by the MDG-M SPI Feeder
  3. Change your code so that the rules is executed whenever dummy field is changed, e.g. the "Copy with reference" rule
  4. Be sure that your code writes the changed data to the out_buffer object in your DERIVE() implementation

I have this scenario working in our project (derive material description from some Z-Field) w/ MDG-M v7SP03. If this is not working for you, then I suppose you have a bug and should open an OSS message.

Former Member
0 Kudos

Yes, we have done these steps for multiple other fields and this works fine.

We only have this problem regarding the roundtrip and UI update when using buttons that trigger custom events.

Thanks for your help

Former Member
0 Kudos

Which SPI action is your button invoking? Have you extended the SPI layer using the BAdis?

You don't just write to the io_model with flush, do you? Because that wouldn't suffice.