Parameterized Classes in WebDynpro applications
Hello,
I'm developing a Java WebDynpro application with Dynamic Programming.
I'm wondering why the NDWS won't let me do
Vector<java.lang.String> labels = new Vector<java.lang.String>();
forcing me to use a generic Vector and then typecasting everything I take out again.
NWDS complains it's an "Invalid expression as statement".
What am I missing here?
Thank you.
Thank you all for the replies.
Indeed, it seems like generics were introduced with Java 5.0, at least when I compare Vector in 1.4.2-API Docs ([http://java.sun.com/j2se/1.4.2/docs/api/java/util/Vector.html]) with the same for Version 5. ([http://java.sun.com/j2se/1.5.0/docs/api/java/util/Vector.html])
And it's a good thing. Much cleaner, safer code (imho). And yes, of course Sun's marketing confuses everyone as the Version numbering does not really make much sense.
EDIT: The Wikipedia article on the subject might be helpful also: [http://en.wikipedia.org/wiki/Generics_in_Java]
Everyone have a great day (always remember there's only approx. 22,000 of those in your life),
Lukas.
Similar Messages
-
How To Get GP Process Parameters in a Webdynpro Application runtime
Hi ,
Iu2019 ll hope you can help me to solve my problem with GP process.
Iu2019 m trying to get GP process parameters from a Webdynpro application.
I have to get parameters during the process runtime in every step of the process using
a webdynpro application with the following code:
IGPRuntimeManager rtm = GPProcessFactory.getRuntimeManager();
try {
IGPProcessInstance processInst = rtm.getProcessInstance(processId,userContext);
IGPProcessInstanceInfo procInfo = rtm.getProcessInstanceInformation(processInst.getID(),
userContext.getSAPUser());
IGPStructureInfo inputstructInfo = processInst.getTemplate().getInputParameters();
IGPStructure inputparams = GPStructureFactory.getStructure(inputstructInfo);
} catch (GPEngineException e) {
// TODO Auto-generated catch block
// e.printStackTrace();
manager.reportException("GPEngineException:"+getStackTrace(e), false);
} catch (GPInvocationException e) {
// TODO Auto-generated catch block
// e.printStackTrace();
manager.reportException("GPInvocationException:"+getStackTrace(e), false);
But printing the values of attributes with u201Cinputparams.getAttributeAs... ("param name")u201C the value returned is always 0. On the contrary if I check the same parameters structure in the runtime
GP view of the portal, the values are those that I have set in the start process wizard.
Have you a solution for this question?
Thanks in advance
Lucahi Abhimanyu
I believe originally access to session was deliberately not made available inside WDA.
Growing security concerns due to misuse of session information and
perhaps other reasons as well.
X.509 is considered a better approach.
This may not help you in your problem.
But you may see a trend in WDA pushing more robust and client independent
approaches.
Full x.509 access should remove the need for session fiddling.
Also when developers access such session info directly, there is a possiblity
when they dont understand the technology exactly that they create a security hole.
You may know how to do safely, it is however discouraged.
Im not aware of a way to get at the session info inside the WDA framework.
Well not without a mod to the framework.
It may be possible without a mod, but I dont know the trick.
If someone has a little trick... please post.
You may need to use BSP, if your only solution requires access to the session info.
regards
Phil -
Adding and reading the parameters from the WebDynpro Application URL
Hi,
I have a WebDynpro Application with two views. Based on the values populated by the user in the first view, I am pulling the data from database and populating the data in the second view. I do have a scenario where I have to skip the first screen and show the second screen directly. But, for the values that has to be populated in first screen, I am planning to append the parameters in the url and provide the link to the users via email.
Is it possible to add parameters to URL and read those Parameter values when user clicks on the URL.
Thanks & Regards
swetha.HI,
Code for accessing params in webdynpro java:
String urlParamVal = WDProtocolAdapter.getProtocolAdapter().getRequestObject().getParameter("URL_PARAMETER");
if((urlParamVal != null) && (urlParamVal.trim().length() > 0))
<Write the code>
Reading parameters:
Re: Reading URL Parameter
How to pass and fetch multiple parameter in the URL of the Web Dynpro
Regards,
Lavanya.G -
Calling A Webdynpro Application From Another Webdynpro Application
Hi,
i want to call a webdynpro application from another webdynpro application with sending parameters.
i used this method,
CALL METHOD cl_wd_utilities=>construct_wd_url
EXPORTING
application_name = lv_webapp
IMPORTING
out_absolute_url = lv_url.
CONCATENATE lv_url '?param1=' lv_param INTO lv_url.
data lo_window_manager type ref to if_wd_window_manager.
data lo_api_component type ref to if_wd_component.
data lo_window type ref to if_wd_window.
lo_api_component = wd_comp_controller->wd_get_api( ).
lo_window_manager = lo_api_component->get_window_manager( ).
lo_window = lo_window_manager->CREATE_EXTERNAL_WINDOW(
URL = LV_URL
lo_window->open( ).
but this method shows the parameters on the address bar.
is there a method to send the parameters to another webdynpro application without show the parameters on the address bar?
Can somebody help me pls?
Thanks.I've used a server cookie before. This was built for BSP, but it is really usable anywhere. It just writes the data temporary into the database. This way you can just pass one meaningless URL parameter - like a GUID and use this key to read the data (the server cookie) upon initialization of the new application. I generally serialize all the data that I want into one server cookie by serializing a class. I can then restore whatever attributes of the class that I want on the receiving side.
http://help.sap.com/saphelp_nw70ehp1/helpdata/en/bd/4cd23a09313b37e10000000a11405a/frameset.htm -
Navigate from WebDynpro Application to BPS Layout and vice versa
Hi,
Please see the following Problem Statement:
We have WebDynpro applications and BPS applications in our project. All the applications are published via SAP Portal. Both areas (WebDynpro and BPS) have same selection screen (Selection fields are common). Is it possible to call
WebDynpro application from BPS layout (on click of button)and also passing the selection parameters to the WebDynpro application and vice-versa.
- Sujal ShahHi,
You can you free tool from Oracle called OMWB (Oracle Migration Workbench) for SQL Server to Oracle.
For more details, visit http://www.oracle.com/technology//tech/migration/workbench/index.html
From Oracle to SQL Server, there are third party tools available.
Cheers,
Harshw
Message was edited by:
[email protected] -
Call a ABAP webdynpro application from a standard transaction.
Hi Gurus,
Can we trigger a webdynpro application on a click of button from a standard transaction as IW31 and pass some of the parameters?
If so, how do we do that?
Please let me know.
Thanks,
DasHi,
You can trigger the webdynpro application on click of a button.
construct the URL dynamically or you can use the URL of the application present in WebDynpro application(if you are sure that if this application run only in this system).
We can display the application either in standard screen using HTML control or we can also open the browser on click of a button on standard screen using the code:
call method cl_gui_frontend_services=>execute
exporting
application = 'www.google.com'
exceptions
others = 1.
For passing the parameters to the application:
1. Create the parameters in the default interface plug of the application.
2. Associate the parameters to the WebDynpro application
3. Pass the parameters to the application by appending to the URL like (¶1=abc¶2=def).
Best regards,
Suresh
P.S. we can define the parameters in the Webdynpro component by defining the importing parameters in the default interface view's inbound plug's method. If we define the importing parameters in the inbound plug (for example DEFAULT plug of the window) then they are visible in the parameters tab in the WD application.
We can receive the parameters in the inbound plug method (HANDLE<plugname>) of the window (interface view associate in application).
Message was edited by:
Suresh Honnappanavar -
Webdynpro application parameters
Hi,
How can i access my webdynpro application parameters inside my view / in WDDOINIT method.
ThanksYou can dinamically construct Url with parameters calling method CL_WD_UTILITIES=>CONSTRUCT_WD_URL
DATA: T_PARAMETERS TYPE TIHTTPNVP,
L_PARAMETERS TYPE IHTTPNVP,
APPL_NAME TYPE STRING,
ABS_URL TYPE STRING.
APPL_NAME = 'ZAPPL_NAME'.
L_PARAMETERS-NAME = 'PARAM_NAME1'.
L_PARAMETERS-VALUE = 'value1'.
APPEND L_PARAMETERS TO T_PARAMETERS.
L_PARAMETERS-NAME = 'PARAM_NAME2'.
L_PARAMETERS-VALUE = 'value2'.
APPEND L_PARAMETERS TO T_PARAMETERS.
CL_WD_UTILITIES=>CONSTRUCT_WD_URL( EXPORTING APPLICATION_NAME = APPL_NAME
IN_PARAMETERS = T_PARAMETERS
IMPORTING OUT_ABSOLUTE_URL = ABS_URL ). -
Calling WebDynpro Application and Passing parameters
Hi,
I want to call a webdynpro application from another application and also i want to pass parameters to the called webdynpro application.
Is there an example on SDN which shows how this can be done. If not please advise how this can be done.
Thanks and Regards
SidharthHi Sidharth,
until the tutorial is available, here's a step by step guide.
1. Create an outbound exit plug, for example "CallApp" in an interface view controller belonging to the calling component.
2. Add a string parameter 'Url' to the plug "CallApp". It's important that the parameter starts with uppercase 'U'.
3. Declare a controller usage of the interface view controller for the view controller, which will fire the plug.
4. Add an action to the calling view controller.
5. Add the following code snippet to the method body of the action handler. Change the application name "CalledApp" to the name of your called application and the wdThis.wdGet<YourInterfaceView>Controller().wdFirePlugCallApp(url) so that it matches the names you defined. The example will not work, if the application is not part of the deployable object the calling component resides in.
IWDDeployableObject componentDPO = wdComponentAPI.getDeployableObjectPart().getDeployableObject();
String appName = "CalledApp";
WDDeployableObjectPart[] applicationParts = componentDPO.getParts(WDDeployableObjectPartType.APPLICATION);
WDDeployableObjectPart appPart = null;
for (int idx = 0; idx < applicationParts.length; idx++) {
appPart = applicationParts[idx];
if (appPart.getShortName().equals(appName)) {
break;
appPart = null;
if (appPart == null) {
throw new WDRuntimeException(
"The application: " + appName + " is not a part of: " + componentDPO.getName());
Map urlParameters = new HashMap(1);
urlParameters.put(ClientConstants.APPLICATION_PREFIX + "Param1", "Parameter sent by caller.");
try {
String url = WDURLGenerator.getApplicationURL(appPart, urlParameters);
wdThis.wdGet<YourInterfaceView>Controller().wdFirePlugCallApp(url);
} catch (WDURLException e) {
throw new WDRuntimeException(e);
6. Add a string value attribute named "ReceivedParameter" to the context of the component controller owning the target interface view.
7. Declare a controller usage of this component controller for the target interface view controller.
8. Add a startup plug to the target interface view controller. Add a parameter ("Param1" in this example) to the plug. It's important, that the name of the plug parameter is the same (case sensitive) as used for the URL generation.
9. Add the following to the method body of the startup plug handler:
wdThis.wdGet<YourComponent>Controller().wdGetContext().currentContextElement().setReceivedParameter(Param1);
10. To check, if the parameter passing works, map a value attribute in a view controller to the component controller context and bind e.g. the text property of a TextView to that attribute.
Hope that helps.
Regards
Stefan -
Passing Parameters from Par component to WebDynpro Application
Hi all,
We have a created a WebDynPro and par application. Also we want to pass the parameters from Par component to WebDynPro Application. ( not in query string as application parameters property of webdynpro iView).
Is it possible to do so? if yes then how?
Please help us......
Thanks and regards,
Prath.Hi ,
If the iviews are on the same page you can use portal eventing for that
see the documents on portal eventing
<a href="https://www.sdn.sap.comhttp://www.sdn.sap.comhttp://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/com.sap.km.cm.docs/library/ep/_d-f/enterprise%20portal%20client.pdf">EPCF pdf</a>
<a href="http://help.sap.com/saphelp_nw04/helpdata/en/d3/3857422d095542e10000000a1550b0/frameset.htm">EPCF</a>
Hope this helps you
Regards
Rohit -
Error in executing 'HR_INFOTYPE_OPERATION' from webdynpro application
Hi Experts,
I am using FM 'HR_INFOTYPE_OPERATION' for infotype PA0034 operations. I have written below code in assistant class.
when i execute the class method and pass the parameters this FM executing fine and creates record into pa0034. But when i execute the webdynpro application it is giving error "Invalid parameter EXCEPTION , value ". Please Help me in solving this issue
CALL FUNCTION 'HR_INFOTYPE_OPERATION'
EXPORTING
INFTY = '0034'
NUMBER = lv_pernr
SUBTYPE = ls_p0034-subty
OBJECTID = ''
LOCKINDICATOR = ''
VALIDITYEND = ls_p0034-endda
VALIDITYBEGIN = ls_p0034-begda
RECORDNUMBER =
RECORD = ls_p0034
OPERATION = 'INS'
TCLAS = ' '
DIALOG_MODE = '0'
NOCOMMIT =
VIEW_IDENTIFIER =
SECONDARY_RECORD =
IMPORTING
RETURN = ls_return
KEY =
Thanks
VijayHi Vijay,
So you are passing the values from the screen. So you must have binded the screen fields with the attributes, just make sure that they are of the same type as the importing parameters of the FM
Regards
Arjun -
How to use call transaction stmt from webdynpro application
Hi Expers,
Can I use call transaction 'tcode' in my webdynpro application, I have tried in my application but i am getting short dump saying
Error analysis+
An exception occurred that is explained in detail below.The exception, which is assigned to class'CX_SY_SEND_DYNPRO_NO_RECEIVER', was not caught and therefore caused a runtime error. The reason for the exception is: During background processing, the system attempted to send a screen to a user. Current screen: "SAPLMGMM " 0060.
I haven't used any more statements in my application am sure from my application side everything perfect. but I have seen a screen shot
with SAP screen in webbrowser.
Please help me out if you are not clear abt my doubt please ask me for clear idea.
Thanks in advance
Phalani MHello,
Since you can't use the call transaction command in web dynpros components, I suggest you to create a report and fill a BDC table on this and use the call transaction in this report.
So, in your web dynpro component you can use a command SUBMIT to create a job in background.
DATA: number TYPE tbtcjob-jobcount,
name TYPE tbtcjob-jobname VALUE 'JOB_TEST',
print_parameters TYPE pri_params.
CALL FUNCTION 'JOB_OPEN'
EXPORTING
jobname = name
IMPORTING
jobcount = number
EXCEPTIONS
cant_create_job = 1
invalid_job_data = 2
jobname_missing = 3
OTHERS = 4.
IF sy-subrc = 0.
SUBMIT submitable TO SAP-SPOOL
SPOOL PARAMETERS print_parameters
WITHOUT SPOOL DYNPRO
VIA JOB name NUMBER number
AND RETURN.
IF sy-subrc = 0.
CALL FUNCTION 'JOB_CLOSE'
EXPORTING
jobcount = number
jobname = name
strtimmed = 'X'
EXCEPTIONS
cant_start_immediate = 1
invalid_startdate = 2
jobname_missing = 3
job_close_failed = 4
job_nosteps = 5
job_notex = 6
lock_failed = 7
OTHERS = 8.
IF sy-subrc <> 0.
ENDIF.
ENDIF.
ENDIF.
Regards. -
Table as Input parameter for BAPI in Webdynpro Application
I am creating webdynpro JAVA application to create RFQ, for which ABAP guy written a Custom BAPI called Z_BAPI_INQUIRY_CREATE. I tested this BAPI in SAPGUI it is working fine. From my webdynpro application when I passes header and item parameter, my header getting inserted but my item data is not. It is giving me error like "Table input parameter not found". I am passing table to this bapi. When I tried my code to standard BAPI's (NOT CUSTOM), I am able to insert both HEADER and ITEM data.
In above scenario I have few questions,
1. Is there anything extra we have to do with custom BAPI's? (my BAPIs are in BOR).
2. What is the datatype in webdynpro parallal to table parameter?
3. is there any tutorial available for table parameter? (except FLIGHT examle).
Thanks and regards,
NitinHi Vijayakhanna Raman,
Thanks much for your reply.
Yes I did the same as you mentioned, but still I am getting an error "Table parameter not avaliable is empty".
I am not getting were is the bug. And this is happening only with ZBapi's not with Standard Bapi's.
I am really stucted becouse of this, answer will really get all 10 points.
Here is my code,
1. First create an instance for bapi and bind the instance to the bapi node.
Z_Bapi_Inquiry_Change_Input input = new Z_Bapi_Inquiry_Change_Input();
Zbapirfqitem item =new Zbapirfqitem();
wdContext.nodeBapi_RFQ_OnHold_Update_Input().bind(input);
2. Then if u have the import parameter u have to set them by using
input.setRfq_Number("6");
input.setCreated_By("NLNS0000");
//wdContext.currentBapi_RFQ_OnHold_Update_InputElement().modelObject().setRfq_Number("6");
//wdContext.currentBapi_RFQ_OnHold_Update_InputElement().modelObject().setCreated_By("NLNS0000");
3. If the bapi has a table parameters then the structure for the table parameters will also be imported In the model class.
DONE!
4. Set the table parameters by creating the instance for that structure and using this instance set it.
item.setUpdateflag("I");
item.setItm_Number("000030");
item.setMaterial("MAT-NITIN");
item.setMatl_Desc("Inserted by Nitin");
item.setQuantity(new BigDecimal(4));
item.setBase_Uom("PCE");
item.setReq_Qty(new BigDecimal(4));
item.setBase_Uom1("PCE");
item.setList_Price(new BigDecimal(3));
item.setList_Curr("");
item.setReq_Price(new BigDecimal(4));
item.setCurrency("EUR");
item.setIndirect_Price(new BigDecimal(4));
item.setCurrency_2("EUR");
item.setFinal_Price(new BigDecimal(4));
item.setCurrency_3("EUR");
item.setText_Line("");
item.setReq_Date_H(new Date(12-05-06));
item.setDirect_Dis(new BigDecimal(4));
item.setIndirect_Dis(new BigDecimal(4));
item.setFinal_Dis(new BigDecimal(4));
item.setProfit_Margin1(new BigDecimal(4));
item.setProfit_Margin2(new BigDecimal(4));
item.setBrand1("");
item.setModel1("");
item.setVal_Loccurr1(new BigDecimal(4));
item.setCurrency1("");
item.setBrand2("");
item.setModel2("");
item.setVal_Loccurr2(new BigDecimal(4));
item.setCurrency2("");
5. Then add the structure instance to the bapi instance.
input.addItem(item);
6. Then Execute the bapi after setting the import parameters.
//wdThis.wdGetContext().currentBapi_RFQ_OnHold_Update_InputElement().modelObject().execute();
input.execute();
Message was edited by: Nitin Kamble -
Needs a background webdynpro application running at the server side
Hi All,
We have a requirement wherein we need to have an application running all the time at the server side to capture the response coming from a web application. Based on the response that the application receives, it needs to update some backend R/3 tables.
We are thinking of a webdynpro java application.
Can anyone suggest what kind of application needs to be implemented here?
And what would be the steps required to run the application at the server side without calling the application.
Thanks & Regards,
AnuragHi Robin,
Thanks for the detailed explaination.
This may sound silly to you but I've another doubt which is as follows:
As you mentioned that the external web application will be sending requests to our Web service(in SOAP envelopes) and rest of the functionality can be achieved by our web service.
Actually, we are expecting only responses from the external web application. The thing is that we are sending the requests to the external web applications from our custom webdynpro application and in return the web application will be sending us 2 responses.
First response would be back to our WD java application URL(to the browser in which WD java app is running) which would get the response and display some message based on the response.
Second would be to this web service which you have just suggested. We are having two responses so that even if the browser in which the WD java application is running gets accidentally closed, the response from the external web application must get captured somewhere else and should not get lost in any case.
So, now since we are only expecting the response from the web application and we do not want any requests from the web application to our web service; how is this possible?
I am asking the above question because you have mentioned that the external web application has to request our Web service but we want is only this web service to capture the response coming from the Web application.
Or is it like the web application will send us the response string as request string to our Web Service and the web service will capture these response parameters as request parameters from the web application and do the further processing.
But in that case, we do not want any response to be sent by the Web Service to the external web application.
Please suggest if this is possible.
Once again, many thanks for the help so far.
Thanks & Regards,
Anurag -
Database connection in a WebDynpro Application - urgent
Hi
I am facing a problem with database connection. I am trying to develop a normal webdynpro application.
I want to retrieve data from a table and show it.
But my query is not giving the expected output. It is not even raising errors.
Please give me an answer
Thanks & regards
AparnnaConnection con=null;
Statement st=null;
ResultSet rs=null;
public void wdDoInit()
//@@begin wdDoInit()
try
Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
con = DriverManager.getConnection("jdbc:odbc:erdsn","root","enteg123");
st=con.createStatement();
catch(Exception e){
//@@end
public void onActiononClickLogin(com.sap.tc.webdynpro.progmodel.api.IWDCustomEvent wdEvent )
//@@begin onActiononClickLogin(ServerEvent)
String desig=null;
try{
rs = st.executeQuery("select * from Login where Empid like uid and Pword like pw");
if(rs.next()){
desig=rs.getString("Designation");
wdComponentAPI.getComponent().getMessageManager().reportSuccess(desig);
if(desig.equalsIgnoreCase("Employee")){
wdThis.wdFirePlugEmpOutPlug();
else
wdComponentAPI.getComponent().getMessageManager().reportWarning("Invalid input!");
}catch(Exception e){ -
Storing the output of BAPI for further use in Webdynpro application
Hi,
In my webdynpro application, a BAPI_A is called multiple times from a backend.
All the previous outputs of the BAPI_A need to be stored in the webdynpro application as they serve as a complete set of input parameters for BAPI_B at the end.
Can anybody shed light on this temporary storage mechanism of the outputs of the BAPI_A.
Regards
MeesumHi Meesum,
Your BAPI structure
BAPI_A
--Output (0..n)
Field1
Field2
Field3
Field4
Value node structure
vnBAPI_A (0..n)
--vnResult (0..n)
vaField1
vaField2
vaField3
vaField4
1. Declare objVnBAPI_A (between begin and end)
2. Initialize in the vnBAPI_A in the wdDoInit()
3. After each execution of the BAPI (BAPI_A), create the vnResult and populate the fields of vnResult (from the BAPI_A --> output)
4. Add the vnResult object to objVnBAPI_A
Hope this should help you.
Regards,
Santhosh.C
Maybe you are looking for
-
Error when run crystal report viewer page
Hi I created form using vb 2008 contains crystalreportviewer and in load sub I wrote the following code to show the report: Dim r_select As String Dim MyReport As New CrystalDecisions.CrystalReports.Engine.ReportDocument Protected Sub Page_Lo
-
Time Capsule Network Turned to Junk
I give up. This TC and new Expresses really are pieces of garbage. All of a sudden my TC WDS network has collapsed. While it will allow my PowerPC G5 to connect no problems with an nQuicky, it has suddenly started to either refuse connections from my
-
Useing Crytal Report in SAP B1
Hi, everybody ! I want to use Crytal Report to report. have i to use it? Can you tell me an examlpe! Thank you!
-
Working with multiple audio tracks
Hello, I'm working with video clips that have a stereo audio track (guide audio fed into the camera) synch'ed to 4 mono tracks (recorded from a variety of boom mics and lavaliers). Although I've linked all the audio clips to the video, it still gets
-
Can i see the LAST UPDATE made?
hey ppl... I was wondering if there is a way to list all the recent updates made by my iBook..Be it iTunes update or anything else.. And is there anyway that i can undo the last update made? This is bcoz i guess i tried to update my system, and the o