Skip to Content
In our first Weblog we have seen details about Bapis used to create SALES ORDER in a SAP System and how to import those bapis in single model and how to implement required context mapping for Custom controller and view controllers using template concepts.

Now we will see Handling of Structure and Table Details for RFCs and also about ViewSets..

V) Handling Structure & Table Details.

Now we come to our important session.To create sales order we need to give header,Partner & Item Details to the BAPI_SALESORDER_CREATEFROMDAT2 Bapi.So within that executeBapi_Salesorder_Createfromdat2_Input ( ) method we need to hardcode all those details.
Let we see the Source code for this..

VI) Creating View to customize applications:

We can also use the template method in CreateSalesOrderView to customize the layout. By this we can create FORM, TABLE & Action Button whatever as per our requirements.


Finally our SalesOrderCreate Screen will be like this.


And SalesOrderOutput Screen will be like this..


After this we need to create one Action (CreateSalesOrder) to create Sales Order

And link this with a button.

VII) Using View sets to customize the screen shots Design.

Let us have a quick look about View Composition.
The term view composition describes a set of all view assemblies that can be accessed by navigation. A view assembly consists of normal Web Dynpro views and interface Views of Web Dynpro components within the browser window.
We can model view compositions in the Navigation Modeler as part of the Web Dynpro tools. We can use the following options to model view compositions:

1) Embedding several views in view sets. We can define the division of these view sets into Rectangular areas by selecting a particular layout (T layouts, Grid Layout).

2) Embedding view sets in each other.

3) Embedding visible Web Dynpro components using their component interface views.

So we have to create a View Set SOViewSet with following properties.

1) Layout : Grid Layout
2) Rows : 1
3) Columns: 3

We will embed the SalesOrdercreaeView in (1, 1) Row, Column position and SalesOrderOutputView in (1, 3) Row, Column

And we also have to create required Inbound Plugs, Outbound plugs & corresponding actions.

So our SOViewSet will be like this.


VIII) Building, Deploying, Configuring, and Running our Application

We have now reached the last stage in this development of our example application. Here we have to build our application. And we need to deploy it into J2EE Server. After Deployment our project is ready to Run.

Before running our application we need to check the JCO Destinations.

IX) Creating the JCO Connections in the Content Administrator

The logical system names used in the model declaration must be associated with an actual SAP system defined in the SLD before this application can be executed. For this reason, we need to create JCO connections in the Web Dynpro Content Administrator. To use an Adaptive RFC model in your Web Dynpro application, we need to define two connections:

• A connection to get the required (Dictionary) metadata information

• A connection to read the application data

For our applications the JCO Destinations are already defined .So we can now directly run our application.

X) Result

The Developer Studio automatically launches our application in the Web browser. As we hard coded all values in Program we can directly create Sales Order for that Details Just by clicking Create Sales Order Button. Now Sales Order is created on SAP and the Bapi will return a Sales Document Number.


To report this post you need to login first.


You must be Logged on to comment or reply to a post.

  1. Former Member

    this is the way great weblog should look like, thanks for helping finding out basic principles of doing complex BAPI’s in WebDynpro ๐Ÿ™‚
    Looking forward to see next articles from you!


    1. Former Member
      Thanks for this BLOG!!

      Please could you clarify this, Why explicitly you are setting the values (hard code) to the BAPU node elements? are they not getting values from BAPI?

  2. I’ve tried your code but the header doesn’t get instantiated.  In debug mode, it says “<error(s) during the evaluation>”<br/><br/><br/><br/>Bapisdhd1 header1 = new Bapisdhd1();<br/><br/>in Watch; “header1” <error(s) during the evaluation><br/>


Leave a Reply