FPM - WD - LPD: POWL as Listpopup to choose a record and then return it

202 Views Asked by At

The situation is like this:

We have a POWL, where I added a toobar-button.

The click on that button opens a FPM-POWL, which I created with the help of this link

https://sapcodes.com/2016/03/25/powl-in-fpm/....

(INFO: This POWL takes it's data from a standard FBI View).

The new FPM-POWL is properly(??? I hope so, because it gets shown) maintained inside the LPD_CUST in order to start this popup inside the FPM-framework (flag that it should wait, is also set on caller and callee) .

Ok, let's proceed.--

The calling class (feeder class "A", implementing IF_POWL_FEEDER) calls the POPUP like this

  DATA(lt_lpd_content) = lr_lpd_handle->mt_content.
        READ TABLE lt_lpd_content
          REFERENCE INTO DATA(lr_lpd_content)
          WITH KEY application_alias = 'ZSRM_GP/BP_POPUP'.

  lr_lpd_handle->launch_application( iv_application_id = lr_lpd_content->application_id ).

The user shall simply be able to pick one business partner....

After the user picks a record, and hits a special toolbar-button of the "popup", its feeder class "B"(also implementing IF_POWL_FEEDER) does, what it needs to do inside handle_action and until now... I try to figure out, HOW to pass the record back to the caller class "A"...

Because, unlike expected (because both LPD_CUST entries have the flag set "Synch/await"), the class "A" proceeds processing any code I place after

      lr_lpd_handle->launch_application( iv_application_id = lr_lpd_content->application_id ).

And so I suppose, this is "works as designed" and is asynchroneous .

So, my current experiments assumed synchroneous, and I exported any picked business partner's number to a memory ID and closed the "popup".

But I never returned to the caller, where I wanted to start coding the rest of the requirement.

So, my second try is, that I created an event in feeder class "B" (called popup) and a handler for this inside feederclass "A" ( caller ).

Inside the ctor of class "A" I register via "SET HANDLER FOR ALL INSTANCES".... and the tests are just about to start.

But I really hate this approach,.... is there a best practice regarding this ?

I cannot imagine, that I am the only one with this kind of requirement, which, in simple terms, means:

"Listpopup"... and we all know, how simple this is in sapgui...but inside the FPM-POWL-LPD environment... I cannot get it...

EDIT: Maybe I should do something in here to FORCE a blocking popup call ?

enter image description here

Or can I somehow populate the exporting parameters of handle action of the callee to return to the callers handle_action ? Ala POWL_FORWARD_anything ?

0

There are 0 best solutions below