Technology Blogs by Members
Explore a vibrant mix of technical expertise, industry insights, and tech buzz in member blogs covering SAP products, technology, and events. Get in the mix!
cancel
Showing results for 
Search instead for 
Did you mean: 
jakob_steen-petersen
Active Participant

Introduction

When using Web Dynpro for ABAP, sometimes we have the need to call other functions or transactions in the SAP system landscape. In the "old days" where everything was done in ABAP and the user was calling the SAP system by using an SAP GUI  - this was easy; just call the requried function and a new session was launched in the GUI.

This has changed - several technologies for user UI development are possible, This means that whe could have a switch between technologies inside a Business Process.

The good news is that the NWBC can act as a framwork for this. Using the NWBC we can have an central application we all our SAP functions are processes inside, without having a lot of browser windows popping up etc.

This example shows how to develop a simple Webdynpro application, where the user can enter a Sales Order number and from the Dynpro call transaction VA03 in SAP GUI.

Prerequsites

SAP ERP System

Netweaver Business Client (setup and running)

Basic Web Dynpro Knowledge

How is it done?

The goal is reached by using Object-Based Navigation (OBN). OBN is used in Roles (PFCG) to assign an object to a function.

What basically happens is that the OBN call searches the Roles of the user calling a certain function and when found it launches the corresponding transaction (or other function). Because of that we will later se, that the OBN is very tightend to the Roles of the user (but NWBC is anyway)

Do the stuff

First of all we create the WebdynPro application. It could be a list of Sales Orders or anything, but in this example it´s just a simple screen with an input field and a button:

This is quite basic: an input field whe the user can enter a Sales Order number and a pushbutton to excute...

The interresting part is the code of the Action of the button:

The onAction event is implemented like this:

First part is done to retrieve the value of the Sales Order from the screen. Second part is the interesting one:

By using the IF_WD_PORTAL_INTEGRATION class we can exceute the call of the Business Transaction. Note! There is no SAP Portal involved here - it works without!

Four parameters are used here:

OBJECT_TYPE:                    This is the type of object called

OBJECT_VALUE_NAME        This is the name of the parameter passed to the call

OBJECT_VALUE                   This is the value passed from screen

OPERATION                         This is the operation to call

To fully understand the above coding i will goto the next step right now:

We will have to define a Role (or expand an existing one) in order to give the user the required functionality:

Call PFCG and create a role:

The role consist of a Root folder and a Subfolder (NWBC requires at least one lower level). First "pin" is the Web Dynpro Application created in step one - just basic call of a Web Dynpro application.

Second "pin" is the Sales Order display Transaction VA03. When you press the Other Node Details button you will notice the OBN part below

  This is where we apply our OBN part. Press Insert Method button

In here we can use a BOR object as the object. We choose BUS2032 (SalesOrder) and method Display

Next screen is for entering the parameters

This is where we pass the actual value from the screen to the transaction. Parameter ID (first column) is found by entering transaction and get the Scrren field name (F1->technical).

In the second column the value is intered - by using Curly bracktes we tell the system that we vil pass a variable value.

Note: the BOR object used is only for defining the naming of the Object type etc. No BOR object logic are called at runtime! In part 2 i will show how to use a none BOR value...

Now the Role are ready to use!

Save it and assign to a user.

Start NWBC

Execute the Web Dynpro App

Enter Sales Order number and press Button

So: the VA03 are called with a regular SAP GUI interface - no HTML GUI. We have done a Switch between technologies from Web Dynpro ABAP to SAP GUI.

What happened?

The system was told to call a Business Object called SalesOrder with the method Display (SalesOrder.Display). When that called was executed it searches the Roles assigned to the logged in user for an entry with the OBN assignment SalesOrder.Display.

When found in the Role, it executed the transaction assigned to that menu point and passed the value from the Screen field to the VBAL-VBELN fields in VA03.

2 Comments
Labels in this area