cancel
Showing results for 
Search instead for 
Did you mean: 

Selection popup for print preview in SAP SRM 7

matteo_montalto
Contributor
0 Kudos

Hello gurus,

I'm facing a task for a desired specification on SRM 7.0.

On Purchase Order and Contracts WD views, there's a button called "Print Preview" which triggers a smartform-generated function module.

In our scenario, a specific BADi implementation contains the logic that selects the specific smartform that will be triggered.

Now, the desiderata is as follows:

- for CERTAIN DOCUMENTS, e.g. the ones which refer to a specific organization, we should generate a selection popup in which the user can choose which type of smartform has to be triggered. This event (the selection popup) should be triggered by the pressure of the "Print Preview" button.

So far, lots of doubts... I hope someone could give an hint on the task:

- since "Print Preview" is a button that belongs to the WD "FPM_OIF_COMPONENT" (view CNR_VIEW), first of all, how can I check for condition on the document to determine whether the popup should be triggered or not? In other words: how can I check @FPM level data of the underlying document?

- what's the easiest way to trigger a popup after the button has been pressed?

I've seen that *any* button on FPM_OIF_COMPONENT triggers the method "ONACTIONBUTTON_PRESSED"; should I enhance the method by creating a pre-exit which checks against doc's data and eventually triggers a popup?

- How can I then propagate user's selection to the underlying layer? As far as I've seen, Smartform determination is performed AFTER the button has been pressed, so ... does the solution sketched above make sense, or there's another spot in which is useful to introduce my custom routines?

Thanks to anyone which would give me hints or suggestions on the task.

Kind regards,

M.

View Entire Topic
Former Member
0 Kudos

You should NOT modify or enhance the FPM standard components. Please spend some time reading the document Julia recommended and you will save yourself a LOT of time later.

For any FPM application there is a "master controlling WDA component" that you could enhance. This is NOT the FPM_OIF_COMPONENT/FPM_GAP_COMPONENT/FPM_OVP_COMPONENT.

matteo_montalto
Contributor
0 Kudos

Hello Abdullah, hello Julia,

I'm getting a bit lost on the documentation you suggested me, got some basic concepts about FPM and "how it works" but then, the Dev's Guide is quite tecnical and huge so it's not easy for me to get rid of all the information.

Hope you can direct me throu the basic steps I should perform (and also, eventually, sections of the dev guide which specifically can help me); now that something is a bit clearer, hope I can formulate the task a bit better.

SRM 7.0 shows information about Purchase Orders throu different WD Component/windows/views, but the "above" FPM toolbar has the following characterization:

/SAPSRM/WDA_L_FPM_OIF
FPM_OIF_COMPONENT
FPM_WINDOW
CNR_VIEW
/SAPSRM/WDCC_FPM_OIF_PO_PURCH

I have to modify a "standard" behaviour of the "Print preview" button:

PRINT_PREVIEW
BUTTON
STANDARD

So that, under certain assumptions based on the document's type, a popup window must be shown. User could then make his selection and press the "Ok" button, and in such a scenario, the normal "PRINT_PREVIEW" event should be processed. Obviously, if the user presses the "cancel" button, no event should be triggered.

I understood I will not have to modify/enhance directly FPM_OIF_COMPONENT, tried a bit to see FLUID but I'm a bit confused, I think I need some directions on how to proceed.

As MANY WD components share the same toolbar in the process and that one is characterized by a specific configuration_id, I presume I'll have to deal with that first.
Any suggestion/help/hint? Abdullah told there's a master controlling WDA Component that I could enhance, but I didn't understand how to locate that.

Thanks again

EDIT: this link seems interesting...

http://www.sdn.sap.com/irj/scn/index?rid=/library/uuid/30d28efa-54a5-2e10-0f85-902da5c147b1&override...

Following the above link, I tried to create an enhancement for the configuration /SAPSRM/WDCC_FPM_OIF_PO_PURCH of the component FPM_OIF_INTERFACE. But.. Once in Component Configuration I cannot add a "Dialog Box", as the option is not available from the dropdown menù. Only "Variant" and "Confirmation screen" are available.

Former Member
0 Kudos

What is the main WDA component defined in the FPM application configuration?

matteo_montalto
Contributor
0 Kudos

Hi Abdullah, thanks for your support

Where can I see that? Accessing to the Component Configuration /SAPSRM/WDCC_FPM_OIF_PO_PURCH leads me to the following screen:

https://dl.dropbox.com/u/26770376/Capture.PNG

in which multiple WD components are used as UIBB, each one under a tab of the main tabstrip ("Overview", "Header", "Items" and so on).

How can I find the main WDA component in component configuration?

Once again, thank you very much for your help.

Former Member
0 Kudos

On the left-hand side, you will see two radio buttons: Initial Screen & Variant. There are three buttons right below them with the display button being the only active one. When you click that button, there should be 3 options, one of them will tell you the main WDA component.

matteo_montalto
Contributor
0 Kudos

Hello Abdullah and thanks for your support,

That "display" button shows only 2 entries. Clicking for "Global Settings" I get the following info:

Application specific parameters:

Web Dynpro Component: /SAPSRM/WDC_FPM_OIF_CONF

Configuration Name: /SAPSRM/WDCC_FPM_APPCC_PO_PURCH

Configuration Type: 00

Configuration Variant: <blank>

Transient Parameters:

Transient state: N

I guess that /SAPSRM/WDC_FPM_OIF_CONF is the main WD Component we were looking for.

So I presume a right approach should be enhancing that WD Component, for example by making a pre-exit for the COMPONENTCONTROLLER->process_event method.

I tried (just to understand the call stack) BUT it seems that that method isn't triggered.

Is this approach correct ? Am I missing something?

Thanks in advance, really appreciate your support.

Matteo

matteo_montalto
Contributor
0 Kudos

Update... first of all, happy new year to everyone!

Tried to enhance /SAPSRM/WDC_FPM_OIF_CONF and in particular, I tried to make a pre-exit on the OVERRIDE_EVENT_OIF method (which seems to be triggered by *any* event of the application).

I tried to paste the following code just to test the functionality of event suppression: e.g.

   IF io_oif->mo_event->mv_event_id = 'FPM_PRINT_PREVIEW'.

* here I will insert my popup code, but for now, just trying to stop the current event

     io_oif->cancel_event( ).

   ENDIF.

and found that the above call sets the attribute  MV_EVENT_CANCELLED to 'X', which I suppose is going to be further evaluated by the standard code. However, I tried to follow in debug mode and even though FPM_PRINT_PREVIEW has been marked as cancelled, the event is anyway triggered.

I found no similar cases on SCN, am I supposing wrong or should I search for sap notes on the argument?

EDIT: adding some spice on the mistery... ... there should be something wrong as the PROCESS_EVENT method in the COMPONENTCONTROLLER of the wd appCC /SAPSRM/WDC_FPM_OIF_CONF is never triggered. Could this be related to the first problem ( the event cannot be cancelled )? I guess these two things are strictly binded.

Former Member
0 Kudos

Happy New Year to you too. Please note that the PROCESS_EVENT is called for every single event in the event queue for every single UIBB involved in the process. Now, having said that, you might cancel one event, but that does not mean other events in the event queue won't be called. In addition to marking the event as canceled, I believe you need to fill the return result as OK (meaning that you already handled that event). If you leave the return result field blank, the system will assume it is still not handled and could process it further.