cancel
Showing results for 
Search instead for 
Did you mean: 

Creation of Interactive SAP widgets

Former Member
0 Kudos

Hi experts,

I have created some of the Widgets by calling RFCs and these are simple widgets displaying data from the table.

Now I want to create the interactive widget that will take the parameter from user and then will display related information in Widget format.

Eg. A parameter on the screen will be seen first to allow user to enter airline...

If user enters "AA " , then only flight information for "AA" will be shown.

Is it possible to update a database table through widget events..

Do we have any blogs or code explaining this / similar kind of widget creation ?

Thanks,

Omkar.

Accepted Solutions (0)

Answers (2)

Answers (2)

Former Member
0 Kudos

Hi Omkar,

I am also trying to create the same kind of widget which you are talking about. and i am stuck at the same place.

I have created a search input field and button for the search functionality. But am not about the code to be written in the event of the button.

Kindly clarify.

Regards,

Vibha

jaideeps
Advisor
Advisor
0 Kudos
Former Member
0 Kudos

Hi jaydeep,

I have gone throgh PDF available on the link...

Actually there are separate files already available Main folder which is ultimately under Widget folder.

Do we need to add our code here or se[arately 3 files with Controller, Main, View to be created...I am new to Javascript....will you please explain it ?

I am us Eclipse Plug-in for the developmetn and the whole mentioned in the PDF is already present in Conroller, Main, View files., with small difference.........Do we still create different files ?

My main question is basicaly this....

.How to hande event on display button and then call the table read function .......where code to be added..........?

Also will tou please explain the code flow for this ?

Please clarify...

Thanks,

Omkar

Edited by: Omkar Nakhate on Nov 27, 2008 11:59 AM

Edited by: Omkar Nakhate on Nov 27, 2008 12:06 PM

jaideeps
Advisor
Advisor
0 Kudos

Hi Omkar,

This widget is created from the widget development environment (similar to eclipse environment ).It purely follows the MVC pattern .

There is predefined methods to handle button click events (refer the widget Dev guide)...

Also you can download the same widget from the widget gallery to see how it works.

Thanks

Jaideep Srinivasan

Former Member
0 Kudos

Hi Jaideep,

Thank you so much for this quick and usefulresponses.

I have already donloaded the Widget from Widget Gallery...

But the Widget is showing only initial screen where table name to be entred

.Also there is no hotspot on "Display" button. so the actual data is not showing up..........

Am I making mistake while running Widget ?

I have configured Widget Foundation Tool for my server..and all my widgets are running fine......

Do I need to modify some settings to run this Data Browser Widget ?

regards,

Omkar

Edited by: Omkar Nakhate on Nov 27, 2008 2:07 PM

Former Member
0 Kudos

Hi Omkar,

Since you've already developed the widget through the Dev Tools, you should have a Controller generated for that view (if not, click on the top right hand corner of the view and it will generate one for you)...

Use the parametrization available here to pass the parameters you need to the next view. Alternatively, if you want to locate this yourself, dig into the code and search for the point where it calls out to the RFC (where it generates the RFCRequest object) and you should be able to work your way backwards from there to the point where you can pass the parameters...

If you're looking for a widget that uses two views (one for the initial parameter screen and second to display data), here's a wiki ...

[https://wiki.sdn.sap.com/wiki/display/EmTech/PSACheckerWidget]

and here's where to download this widget from :

[https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/c06f0234-df48-2b10-90a4-a844b8579d57]

If you're looking for a single window widget with a parameter for the RFC in the same window (at the top, of the window for examples) let me know and I'll send you another example I haven't yet published on SDN...

Cheers,

- Aditya

Former Member
0 Kudos

Hi Aditya,

Thanks for the responce..

I have used parametirazition, as you mentioned in case of my display only widget......

Also I have called an RFC with import and export parameters......................

Now I have used drag and drop method to place import and Export parameters in the desired view....

After user enters Import parameter, it has to press a button in the Footer (Lets say Display button...)

We have to detect the event of the display button and then pass import parameter to RFC where respective data will bw manipilated and sent to the Man View ,where these Export parameters are placed..............

NOW......My question how to code the whole process

.Event Detection--


> Import parametr pass to RFC--


> Get Export parameter

is written in Widget ?????/

I have used Eclipse and SAP Widget Development plug-in..............

.Can you please clarify the understandings in light of this ?

regards,

Omkar .

Former Member
0 Kudos

Lets step back a few paces to What is the function you're calling? and What are the import and export parameters ?

I suppose you've dragged the columns or the export parameters from the RFC tab to the view (lets say this one is main-view. If you've generated a controller for this view, you should have a function that's in the Controller module and would be referenced as Controller.showMain_View.

Now, coming back to the import parameters of the function you're calling, say the import parameter is I_IMPORT and the value is read into a variable v_import... and, you have a button (.. in the footer as you mentioned..) you could very well put some code into the button's event-click handler that looks like this :

if (Controller.loadingData) return;
Controller.showMain_View({"I_IMPORT":v_import});

This of course presumes that you've already dragged something (export parameter or a column from an exported table in the RFC) to the view, this view is called main_view and this view has a controller.

Lemme know if this helps...

Cheers,

- Aditya