cancel
Showing results for 
Search instead for 
Did you mean: 

Web Dynpro Output?

Former Member
0 Kudos

I just created a very simple Web Dynpro. I have an input box and a button that say Go. When I type my name in the input box and say go, the next displays my name and has a button, Back that will return me to the first screen.

Needless to say it is useless, but it is my first dynpro that I would like to build upon, and I was amazed at how easy it was to create.

My question: Is their simple way, for demo purposes, to enter say an order number, or whatever, that submits the VA03 order diaplay and can diaply values to the second screen?

I am thinking the logic would need to be in the Out method of screen one?

method wd_this->fire_out1_plg(

) ?

Call a BAPI somewhere in a Method?

Or is this much more complex than I am thinking.

I just wanted to throw together a quick demo?

Any suggestions would be great!

Thank-You.

Edited by: Tom M. on Apr 15, 2008 9:50 PM

Edited by: Tom M. on Apr 15, 2008 9:55 PM

Accepted Solutions (1)

Accepted Solutions (1)

Sm1tje
Active Contributor
0 Kudos

Tom,

this really shouldn't be to difficult to achieve. Upon clicking on button SUBMIT (or whatever you call it), you can call a BAPI / Function module to retrieve the data from the R/3 system. Since you are dealing with WD, it is advisable (mandatory) to do this according to MVC design (Model-View-Controller). In a nutshell this means that you shouldn't mix business (application) logic with view logic. In other words, do not retrieve the data from a method in a view, but do this in a method of the controller. However, since it will just be a demo, this shouldn't be a problem. But just as a reminder for future developments.

So we have a button, and to this button you will have to assign an event in the properties of the button (right side bottom of the screen). Give it a name and double click on it. You will go into the method (coding). From here call a controller method (MVC) which you have defined in the (main) controller.

In this controller method (retrieve data) the data from VA03 is retrieved using a function module for example. For all the data to be displayed on your second screen, create nodes in the controller according to the structure of your data which was retrieved via function module. The tricky part will be to bind all the data to the context. Use the code wizard for this. It will generate the better part of the code for you.

In your second view in which the data has to be displayed, you can map the context from the controller to the context of your view. So all the data will be directly available in the view automatically (no programming required).

In the second view, create all your user interface elements like table, output field etc. The binding will be automatically done when you create these UI elements via the context directly. For example, right click on ROOTUIELEMENT at top of view on the right, and choose create form. Next click on the button <CONTEXT. and your mapped context will be displayed. Choose one for which you want to create UI element and continue.

Sounds complicated at first, but after doing this a few times (look also at tutorials on SDN) it will all be a matter of routine.

Good luck with demo.

Answers (1)

Answers (1)

Former Member
0 Kudos

Hi Tom,

Using Servica call you can achieve youe requirement easily. Have a look on following steps.

1. Create a service call for your BAPI. So at component controller it will automatically create one method and Context nodes and attributes based on your BAPI fields.

2. For order number create one node with your attribute(order_no) at component controller. So now Order_No is global one for all viewa in your application.

3. Now in first view create one input field and Button. Then Drag & drop the Attribute(Order_no) from component controller to your First view controller. Then find Order_no to your Input field.

4. So when the user enter's input Order number at browser means it will be avilable in your View context as well as your component controller context.

5. So in second view, Just drag & drop the Order_no from Component controller to view controller. Already you have the node for BAPI in component controller. SO drag it to view controller.

6. Finally create one table and bind it to your Context node[BAPI].

Thanks.

Former Member
0 Kudos

Thank-You for both, very informative, posts. I will be trying these out. More to come I am sure.