cancel
Showing results for 
Search instead for 
Did you mean: 

No records display wen OVS UI table is popup for SalesDocument Type

Former Member
0 Kudos

Below mention code is for OVS which i hav used for Sales order creation form where using Order_Type as an F4 value help to get the Sales Order from the R3 system so as to create sales order.

I hav used Bapi_Salesorder_Createfromdat2_Input for this application.

private IWDOVSContextNotificationListener ovsListener = new OVSNotificationListener();

private class OVSNotificationListener implements IWDOVSContextNotificationListener

{

public void onQuery (IWDNodeElement queryInputNodeElement,IWDNode queryOutputNode)

{

IPublicOVSBapiCustomController.IBapi_Salesorder_Createfromdat2_InputElement ovsInput =

(IPublicOVSBapiCustomController.IBapi_Salesorder_Createfromdat2_InputElement) queryInputNodeElement;

IPublicOVSBapiCustomController.IBapisdhd1OutputNode ovsOutput =

(IPublicOVSBapiCustomController.IBapisdhd1OutputNode) queryOutputNode;

try

{

ovsInput.modelObject().execute();

ovsInput.node().getChildNode("Order_Header_In", 0).invalidate();

}

catch (Exception e) {

IWDMessageManager msgMgr = wdComponentAPI.getMessageManager();

msgMgr.reportException(e.getLocalizedMessage(), false); }

}

// Setting result to Value node elwment

public void applyResult(IWDNodeElement applicationNodeElement,IWDNodeElement queryOutputNodeElement)

{

//IWDMessageManager msg = wdControllerAPI.getMessageManager();

IPrivateOVSBapiView.IBapisdhd1DataElement OVSElement = (IPrivateOVSBapiView.IBapisdhd1DataElement) applicationNodeElement;

IPublicOVSBapiCustomController.IBapisdhd1OutputElement outputElm = (IPublicOVSBapiCustomController.IBapisdhd1OutputElement)queryOutputNodeElement;

OVSElement.setDoc_Type(outputElm.getDoc_Type());

}

// Setting Input for search

public void applyInputValues(IWDNodeElement applicationNodeElement,IWDNodeElement queryInputNodeElement)

{

Object initialValue = applicationNodeElement.getAttributeValue("Sales_Org");

queryInputNodeElement.setAttributeValue("Sales_Organization", initialValue);

}

}

In the View controller init() methos using the code.......

public void wdDoInit()

{

//@@begin wdDoInit()

IWDAttributeInfo[] ovsStartUpAttributes = {wdContext.nodeBapisdhd1Data().getNodeInfo().getAttribute("Doc_Type")};

IWDOVSContextNotificationListener listener =

wdThis.wdGetOVSBapiCustomControllerController().getOVSListener();

WDValueServices.addOVSExtension("Sales Order Creation", // not used yet

// fields bound to startup attributes will be OVS-enabled

ovsStartUpAttributes,

wdThis.wdGetOVSBapiCustomControllerController().getOVSInputNode(),

wdThis.wdGetOVSBapiCustomControllerController().getOVSOutputNode(), listener);

//@@end

}

Well this application is running without no error but when OVS UI popup is generated for Doc_type

the OVS UI is not showing any record just showing the data field name in the row header of the table...

wereas i want the record too in the table werein the enduser clicks on any record the value of the

Doc_type shud be get selected..

Please tell me how to display Doc_Type F4 values of R3 were this Sales Document Type is binded to the structure Bapisdhd1 to display only SaTy and Description data fields only..

Regards

SK

Accepted Solutions (0)

Answers (5)

Answers (5)

Former Member
0 Kudos

no yet resolved

Former Member
0 Kudos

Hi SK,

public void onQuery (IWDNodeElement queryInputNodeElement,IWDNode queryOutputNode)

{

IPublicOVSBapiCustomController.IBapi_Salesorder_Createfromdat2_InputElement ovsInput =

(IPublicOVSBapiCustomController.IBapi_Salesorder_Createfromdat2_InputElement) queryInputNodeElement;

IPublicOVSBapiCustomController.IBapisdhd1OutputNode ovsOutput =

(IPublicOVSBapiCustomController.IBapisdhd1OutputNode) queryOutputNode;

<Your BAPI> bapiInput = new <Your BAPI>();

try{

bapiInput.execute();

queryOutputNode.bind(bapiInput.getOutput().getFlight_List());

}

}

catch (Exception e) {

IWDMessageManager msgMgr = wdComponentAPI.getMessageManager();

msgMgr.reportException(e.getLocalizedMessage(), false); }

}

please refer this blog for more clarification

Link:[https://www.sdn.sap.com/irj/scn/wiki?path=/display/wdjava/valueHelp-ObjectValue+Selector]

Regards,

Jithin

Former Member
0 Kudos

1 ->Bapi_Salesorder_Createfromdat2_Input -


Bapi Model node binded from Model

!-> Order_Header_In -


Contain attr for sale order creation

!->Doc_Type----


Mandatory attr for sale order creation

1->Bapisdhd1Output----


Model Node Bapi structure which is type for doctype in bapi

!-> Doc_Type----


Contain attr for sale order creation

1->Bapisdhd1Input----


Value Node

!-> Doc_Type----


Value attr.

Now I want to display all the attr for Bapisdhd1 which is type of Doc_Type

And conatins SaTy and Description as attr in value help F4 in R3..

OVS is running error free displaying all the attributes for Doc_type but with no records in it..

OVS value help table is not showing any records..

So now plz tell how to display records for all attributes under Bapisdhd1 or these 2 attributes in it....

Former Member
0 Kudos

Hi Sk,

Sorry for the late response..

Please refer the following code. This code works fine for me.. so please compare and make changes.

Hope it will clear your issue.

public void wdDoInit()

{

//@@begin wdDoInit()

tempOVSListener = ovsListener;

Bapi_Flight_Getlist_Input bapiInput = new Bapi_Flight_Getlist_Input();

wdContext.nodeBAPI_Flight_Getlist_Input().bind(bapiInput);

//@@end

}

public com.sap.tc.webdynpro.progmodel.api.IWDOVSContextNotificationListener getOVSListener( ) {

//@@begin getOVSListener()

return tempOVSListener;

//@@end

}

public com.sap.tc.webdynpro.progmodel.api.IWDNode getOVSInputNode( ) {

//@@begin getOVSInputNode()

if (tempOVSListener == ovsListener) {

return wdContext.nodeOVSFlightQueryInput();

} else {

//wdContext.nodeFlight_List().invalidate();

return wdContext.nodeBAPI_Flight_Getlist_Input();

}

//@@end

}

4.

public com.sap.tc.webdynpro.progmodel.api.IWDNode getOVSOutputNode( ) {

//@@begin getOVSOutputNode()

if (tempOVSListener == ovsListener) {

return wdContext.nodeOVSFlightQueryOutput();

} else {

return wdContext.nodeFlight_List();

}

//@@end

5

//@@begin others

/**

  • Implement IWDOVSContextNotificationListener as inner class of Custom Controller

  • OVSCust.

*/

private class OVSDemoContextNotificationListener implements IWDOVSContextNotificationListener {

private String attributeName;

public OVSDemoContextNotificationListener(String attributeName) {

super();

this.attributeName = attributeName;

// TODO Auto-generated constructor stub

}

public void onQuery(IWDNodeElement queryInputNodeElement, IWDNode queryOutputNode) {

IPublicOVSCust.IOVSFlightQueryInputElement input =

(IPublicOVSCust.IOVSFlightQueryInputElement) queryInputNodeElement;

IPublicOVSCust.IOVSFlightQueryOutputNode output =

(IPublicOVSCust.IOVSFlightQueryOutputNode) queryOutputNode;

Bapi_Flight_Getlist_Input bapiInput = new Bapi_Flight_Getlist_Input();

Bapisfldst bapiDestTo = new Bapisfldst();

Bapisfldst bapiDestFrom = new Bapisfldst();

Bapisfldra bapiDateRange = new Bapisfldra();

if (input.getFlightdate() != null) {

bapiDateRange.setSign("I");

bapiDateRange.setOption("EQ");

bapiInput.addDate_Range(bapiDateRange);

}

if (input.getCityfrom() != null) {

bapiDestFrom.setCity(input.getCityfrom());

}

if (input.getCityto() != null) {

bapiDestTo.setCity(input.getCityto());

}

if (input.getAirportfr() != null) {

bapiDestFrom.setAirportid(input.getAirportfr());

}

if (input.getAirportto() != null) {

bapiDestTo.setAirportid(input.getAirportto());

}

if (input.getAirlineid() != null) {

bapiInput.setAirline(input.getAirlineid());

}

bapiInput.setDestination_From(bapiDestFrom);

bapiInput.setDestination_To(bapiDestTo);

try {

bapiInput.execute();

queryOutputNode.bind(bapiInput.getOutput().getFlight_List());

} catch (Exception e) {

IWDMessageManager msgMgr = wdComponentAPI.getMessageManager();

msgMgr.reportException(e.getLocalizedMessage(), false);

}

}

public void applyResult(IWDNodeElement applicationNodeElement, IWDNodeElement queryOutputNodeElement) {

IPrivateOvsappView.IFlightDataElement ovsCallerNodeElement =

(IPrivateOvsappView.IFlightDataElement) applicationNodeElement;

IPublicOVSCust.IOVSFlightQueryOutputElement output =

(IPublicOVSCust.IOVSFlightQueryOutputElement) queryOutputNodeElement;

ovsCallerNodeElement.setAirlineid(output.getAirlineid());

ovsCallerNodeElement.setAirportfr(output.getAirportfr());

ovsCallerNodeElement.setAirportto(output.getAirportto());

}

public void applyInputValues(

IWDNodeElement applicationNodeElement1,

IWDNodeElement queryInputNodeElement) {

Object initialValue = applicationNodeElement1.getAttributeValue("Airlineid");

queryInputNodeElement.setAttributeValue("Airlineid", initialValue);

}

}

private IWDOVSContextNotificationListener tempOVSListener;

private IWDOVSContextNotificationListener ovsListener = new OVSDemoContextNotificationListener("AirlineId");

//@@end

}

Jithin

Former Member
0 Kudos

Hi SK,

You have forgot to bind the BAPI output.

try

{

ovsInput.modelObject().execute();

<please add the code to bind the BAPI output to the query output node>

ovsOutput.bind();

ovsInput.node().getChildNode("Order_Header_In", 0).invalidate();

}

catch (Exception e) {

IWDMessageManager msgMgr = wdComponentAPI.getMessageManager();

msgMgr.reportException(e.getLocalizedMessage(), false); }

}

// Setting result to Value node elwment

jithin

Former Member
0 Kudos

Satish : well i have gone through it dont see any error plz mention u see any ...

Wll jitin : were shud i bind the output node as already i hav binded the model node in init() method of CustomController....do u mean to say shud use Bapisdhd1OutputElement which is binded to the structure Bapisdhd1 from the model of the Bapi_Salesorder_Createfromdat2_Input.and i want to bind this with Input Field of Doc_Type i.e Order Type to get the order type to create a sales order...

from which i want to display only the field SaTy and Description on OVS UI popup....

Please clear.................

former_member185086
Active Contributor
0 Kudos

Hi

Read the previous reply (I have edited).

Second important is its takes some time to understand the OVS please do that.Although the link which we guys provided it really really best.

Best Regards

Satish Kumar

Former Member
0 Kudos

Still struggling , it shall be nice if u tell me were am i going wrong.........................

Former Member
0 Kudos

Hi SK,

I think implementing OVS is a bit complex and it has been made very simple by Albert on this Blog. It is a very easy plugin that you have to include in Eclipse (NWDS) and two files to be transported to the SAP-System. Have a look and let me know if you have any issues or if you need the link to download the Plugin.

/people/dirk.rehberg/blog/2006/12/27/generic-search-help-for-web-dynpro-for-java

I hope this helps you.

Regards,

Gopal.

Former Member
0 Kudos

Hi Gopal thanx for the reply.............from my end blogs are not opening ..so if u have any other alternative to this then please do send me....

Former Member
0 Kudos

Please reply.....

Former Member
0 Kudos

Hi SK,

Alright, how do you want me to send you? Let us know.

Regards,

Gopal.

Former Member
0 Kudos

Hi Gopal u can send me on hanif.masoodat gmailcom

Or else if u give me the steps how to display the fields from the structure Bapisdhd1 of the bapi

BAPI_SALESORDER_CREATEFROMDAT2

through which i am creating sales order and adn the first input i.e Order_type contains F4 help which i hav to embedd in WD application ..

Well through OVS i hav displayed the structure of Bapisdhdr1 for the F4 help for Order-Type but the table records in that are not displaing and the table for this value on Order_type is V_TVAK displaying all attributed in WD but no records and i want only two columns records i.e....SaTy and Description.

Former Member
0 Kudos

Hi,

As I said in my previous email, this solution has nothing to do with OVS. It is an easy alternative to OVS. More or less like a Plug-n-play tool developed by Albert. You would understand only if you look at the blog!!!!

Regards,

Gopal.

Former Member
0 Kudos

HI gopal the blog u mention is using the eclipse plugin Search HelpWizard....

If u r having that plugIn plz forward And will that search help will support the structure type Bapisdhd1..

were OVS is not shiwing any records in it...

former_member185086
Active Contributor
0 Kudos

Hi

public void onQuery (IWDNodeElement queryInputNodeElement,IWDNode queryOutputNode)
{
IPublicOVSBapiCustomController.IBapi_Salesorder_Createfromdat2_InputElement ovsInput =
(IPublicOVSBapiCustomController.IBapi_Salesorder_Createfromdat2_InputElement) queryInputNodeElement;

IPublicOVSBapiCustomController.IBapisdhd1OutputNode ovsOutput =
(IPublicOVSBapiCustomController.IBapisdhd1OutputNode) queryOutputNode;
try
{
ovsInput.modelObject().execute();
ovsInput.node().getChildNode("Order_Header_In", 0).invalidate();
}
catch (Exception e) {
IWDMessageManager msgMgr = wdComponentAPI.getMessageManager();
msgMgr.reportException(e.getLocalizedMessage(), false); }

You executed the model where u set the values in out put node.

Follow this tutorials from scratch it explain everything about ovs its field ,populating data etc [thread|;

take basic help from [this|https://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/e038cf90-0201-0010-0a9a-ec69262a1564] also.

ovsInput.node().getChildNode("Order_Header_In", 0).invalidate();

Its wrong u have to invalidate model node but seems that u have created some hierarchy in ovsinputNode.

Best Regards

Satish Kumar

Edited by: satish jhariya on Mar 19, 2009 5:48 PM