How to use an application module custom method in JSP ?
Hi,
"TestAM" is an Application Module in which i added a method "TestClient()".
in a JSP page i have :
<jbo:ApplicationModule id="am" configname="TestAMLocal" releasemode="Stateful" />
<jbo:DataSource id="ds" appid="am" viewobject="TestView" rangesize="3"/>
<%
My question is how to call the method "TestClient()" in my JSP after these 2 Datatags ?
(i have exported this method so Jdev have generated the interface "TestAM.java")
%>
Thanks for help
Here is how I did it in my app:
<jbo:ApplicationModule id="am" configname="TestAMLocal" releasemode="Stateful" />
<jbo:DataSource id="ds" appid="am" viewobject="TestView" rangesize="3"/>
<%
TestAM am2 = (TestAM) TestAM.useApplicationModule();
am2.TestClient();
%>
Hope this helps.
Similar Messages
-
How to get currentRow in an Application Module custom method?
I have written a custom method in the BC4J AppModule. In that custom method I want to update a row. But I do not know how to getCurrentRow in my custom method.
this is probably better since nobody is giving other solutions:
Repost: Simple question but no one answers -
How to call Apps Module Custom Method from Entity Object / View Object ?
Hi All,
I create a custom method in AppsModuleImpl.java. How can I call that custom method from a setter method on Entity Object / View Object ?
(I have tried to use Configuration.createRootApplicationModule(amDef,config); but it is not the correct way, is it? )
Below is my code :
The setter on MyEntityImpl.java :
public void setKodeprd(String value) {
setAttributeInternal(KODEPRD, value);
if (getProduct() != null) {
// CALL the getSalesPrice custom method from here, HOW ??
The Application Module custom method :
public Number getSalesPrice(String priceCode, String kodePrd) {
Number price = new Number(0);
String [] theKey = {priceCode, kodePrd};
Key priceKey = new Key(theKey) ;
ViewObject SalesPrice = getSalespricedView1();
Row[] salesPriceRow = SalesPrice.findByKey(priceKey, 1);
price = ((SalespricedViewRowImpl)salesPriceRow[0]).getPrice();
SalesPrice.remove();
return price;
Thank you for your help,
xtantoinside the EntityObjectImpl :
YourAppModuleImpl am = (YourAppModuleImpl)getDBTransaction().getRootApplicationModule().findApplicationModule("YourAppModuleorServiceName"); -
How to get the application module instance in backing bean.
This is Ramesh, I am new to JDeveloper world.
In my current application I have change password screen which allows user to change there password.
Here this is a pop-up page. Here I don't have the view object and pagadef for this changepassword.jspx file.
My aim is to call the Application Module method which takes the user name, old password and new password.
In backing bean I am trying to call this method by using
MyProjAM obj = _binding.getDataControl().getApplicationModule(); //throw null pointer exception.
_binding is the object of DCBindingContainer.
( I have created the parameter called "binding" as my managed bean property and values as #{binding})
But the above line is throwing the NullPointerException.
Could you please help me to come out of this problem.
Thanks and Regards,
Ramesh Biradar.If your page has no page definition, then #{bindings} will be null during the request for that page.
If you need your page to invoke a data control method when you press a button, the simplest (and declarative) way is publish your AM method on the AM's client interface, then drop the method as a button from the data control palette onto your page. You don't even need a backing bean to accomplish this.
That said, you can refer to a data control in a backing bean using the expression #{data.[i]YourAppModuleNameDataControl.dataProvider}
So, assuming you have a helper method like this:
public static Object EL(String expression) {
FacesContext ctx = getFacesContext();
Application app = ctx.getApplication();
ValueBinding bind = app.createValueBinding(expression);
return bind.getValue(ctx);
}and assuming that your application module is named SRService
and assuming that you have correctly nominated any Application Module custom methods as being available to clients by selecting them on the "Client Interface" panel of the application module editor, then in a backing bean you can acquire an instance.
Then, the ADF design time will have automatically generated you a custom AM client interface named SRService and you can reference that service interface in your backing bean by using code like this:
SRService svc = (SRService)EL("#{data.SRService.dataProvider}");
svc.yourCustomMethod(your,args); -
How to use ApplicationModule custom methods in JSP?
I have an ApplicationModule for which I have defined several custom methods (in the ApplicationModuleImpl class). I wish to invoke these methods from a JSP. I'm having trouble getting a scriptable reference to the application module object in the JSP. I can get data from the view objects using the jbo:xxx data tags, but I can't get any sort of reference to the application module object that would allow me to invoke the methods. I have tried editing the application module to expose the methods as client methods, but still can't get a reference to them.
My main questions:
1. Is there a way to invoke the custom methods somewhere between the jbo:ApplicationModule tag and the jbo:ReleasePageResources tag?
2. Is there a way to declare and use the application module without using the jbo:ApplicationModule tag? Would I ever benefit from doing this?Alan, here's how to call a custom method String getSomeInfo() that I've created on my application module, MyModule in this example. Also, in this example the id parameter in the ApplicationModule tag is "am" (<jbo:ApplicationModule id="am"...):
First, edit your application module. In the app module editor, go to the Client Methods tab and move getSomeInfo into the selected list.
Next, edit your JSP to call your custom method.
<% MyModule myAm = (MyModule)am.useApplicationModule(); String someInfo = myAm.getSomeInfo(); %>
You also have to add the correct import statements to the page tag in your JSP:
<%@ page contentType="text/html;charset=windows-1252" import="oracle.jbo.*, MyModule.common.*"%>
Hope this helps
Blaise -
BC4J: How get Connection from Application Module
I've written a custom method for my Application Module for using by the client tier. In this method I call a JPUblisher created class, that accesses a PL/SQL procedure. For this JPublisher created class I need a connection context. The class calls DefaultContext.getDefaultContext() but that seems to be null.
How can I get the current Connection of the Application Module, so that I can create a DefaultContext?
Unfortunately Transaction has no getConnection method.
Thanks,
RobertWe don't make the Connection directly available because in some sense it's a rope on which you can hang yourself if you are not careful. Since BC4J AppModules are most often used from a pool, and you might be using connection pooling in addition to application module pooling, in general it is not safe to get hold of the raw JDBC connection and "hang onto it".
If you make careful use to always get the current JDBC connection before you use it, and not try to cache it, then you should be ok. Often, you can avoid the need to get the raw JDBC connection by calling getDBTransaction().createPreparedStatement(...) or the analogous createCallableStatement() or createStatement() that are also on the DBTransaction interface.
Here is a little function you can add to your application module impl class to retrieve the Connection:
private Connection getCurrentConnection() {
Statement st = null;
try {
st = getDBTransaction().createStatement(0);
return st.getConnection();
catch (SQLException s) {
s.printStackTrace();
return null;
finally {
if (st != null) try { st.close(); } catch (SQLException s2) {}
}It basically creates a (dummy) statement, gets the current connection from the statement, then closes the statement.
I tried using this in a custom method in an AppModuleImpl class that invoked a JPublisher-create package-wrapper class like this:
public void callStoredProc() {
try {
// Empservice is package wrapper class created by JPublisher
Empservice e = new Empservice(getCurrentConnection());
BigDecimal sal = e.lookupsalary(new BigDecimal(7369));
System.out.println(sal);
catch (SQLException s) {
s.printStackTrace();
}and it works for me. -
How to use BAPI_MATERIAL_AVAILABILITY Function Module at batch level?
How to use BAPI_MATERIAL_AVAILABILITY FM to check material available at batch level?
And another question is what's the meaning of 'CHECK_RULE' in this FM. Thanks!Field name : PRREG
fcheck more details on f1 help...
check_group defines the checking procedure to be used for availability check in individual applications.
along with the checkg group, checking rule specifies the final procedure for chkg..
eg:
ST for stock transport order
AQ for SD order project srock
also chk this help doc.
http://help.sap.com/saphelp_470/helpdata/en/cf/70124adf2d11d1b55e0000e82de178/content.htm
search the forum for sample code..
How to use BAPI_MATERIAL_AVAILABILITY Function Module.... -
How to use BAPI_MATERIAL_AVAILABILITY Function Module....
Hi Experts,
I want to know actual free available quantity (ATP Qty.) for mass materials,
How to use BAPI_MATERIAL_AVAILABILITY function module ?
I have select all material from MARA and inserted in itab.
LOOP AT ITAB.
CALL FUNCTION 'BAPI_MATERIAL_AVAILABILITY'
EXPORTING
PLANT =
MATERIAL =
UNIT =
CHECK_RULE =
STGE_LOC =
BATCH =
CUSTOMER =
DOC_NUMBER =
ITM_NUMBER =
WBS_ELEM =
STOCK_IND =
DEC_FOR_ROUNDING =
DEC_FOR_ROUNDING_X =
READ_ATP_LOCK =
READ_ATP_LOCK_X =
IMPORTING
ENDLEADTME =
AV_QTY_PLT =
DIALOGFLAG =
RETURN =
TABLES
WMDVSX =
WMDVEX =
I dont know how to use it.
pl. guide us.
YusufHi,
data: iwmdvsx type table of bapiwmdvs with header line,
iwmdvex type table of bapiwmdve with header line.
parameters: p_matnr type mara-matnr,
p_werks type marc-werks,
p_meins type mara-meins.
call function 'BAPI_MATERIAL_AVAILABILITY'
exporting
plant = p_werks
material = p_matnr
unit = p_meins
CHECK_RULE =
STGE_LOC =
BATCH =
CUSTOMER =
DOC_NUMBER =
ITM_NUMBER =
WBS_ELEM =
STOCK_IND =
IMPORTING
ENDLEADTME =
AV_QTY_PLT =
DIALOGFLAG =
RETURN =
tables
wmdvsx = iwmdvsx
wmdvex = iwmdvex.
check sy-subrc = 0.
Text
ATP information
Functionality
Using this function module, you can determine the receipt quantity still available for a particular material in a certain plant according to ATP logic (MRPII).
The availability check is carried out on transferring the material number, the plant and the input table (WMDVSX). The scope of the check, that is, which stocks, receipts and issues are to be included in the check is defined by the combination of checking group (material master) and cheking rule. In the function module, the system uses the checking rule defined in Sales & Distribution (A). You can overrule this checking rule by using an interface or a user-exit (exit_saplw61v_001). A similar procedure is also valid for the plant parameters. The customer number in the user-exit means that the plant selection can be controlled via the customer. If no plant parameters are given via the interface, the system uses the parameter 'WRK' saved in the user's fixed values.
The results of the availability check are recorded in the output table (WMDVEX). This table contains dates and available receipt quantities (ATP quantities). The results of the check depends on the following entries:
If no date and no quantity is transferred, the system displays the ATP situation from today's date into the future as the result.
If only a date and no quantity is transferred, the system displays the ATP situation from the corresponding date as the result.
If both a date and a quantity are transferred, the system calculates the availability situation for the quantity specified.
In the last two cases, the parameter 'DIALOGFLAG' is supplied. This can result in the following:
' ' (blank) <=> quantity completely available
'X' <=> only partial quantity available or not available at
all
'N' <=> Material not included in the availability check
(Material not relevant to the availability check)
The system also displays the end of the replenishment lead time (ENDLEADTME).
regards -
Use of application module pool and ADF Busines Components
Hi to all;
Lets suppose an web application with about 10 CRUD forms and 15 to 20 reports or forms just to query and show data;
That's clear to me, all the advantages of using App modules pool.
But for that reports ..... Just an Read only and Forward Only data ?
I was wondering, if it will be more effective and lightweight if we just take an JNDI JDBC connection query data and show it.
This imaginary application will make use of application module pool to provide that 10 CRUD web forms and in other hand, will have for reports,JNDI data sources;
What are your opinion about having this two architectural approach working together in one application ?
Very thanks;
Marcos Ortega
Brazil;Hi Deepak;
BC4J in my opinion is great and i am proud to share this opinion with all of you;
As a meter of fact, i post this thread to help me better understand BC4J architecture.
I think that my doubt main point is ...
Are application modules pool's life cycle an extra work , when the job is just to read and show data ?
Perhaps, an document about statefull and/or stateless application service release, help me;
IMHO;
cached data most of the time must to be discarted for reports, always we want to query database directly, View's object ClearCache() method would be called to reports.
I think that it's different, when we are talking about sequent requests when we need to span the session, views and entities states.
Forwards Thanks; -
How to use WS_DOWNLOAD funciton module in back ground (Batch Job)
Hi all,
Can any one tell,
How to use WS_DOWNLOAD funciton module in back ground (Batch Job)
Thanks,
Ravi Kumar.As disussed above you can use DATASET techniques to write the file to the application server. Then you could do a bdc call to Transaction CG3Y to transfer the file to the presentation server.
Just F1 help on keyword DATASET in SE80 for more information.
BDC Call Info found here: <a href="http://www.sap-img.com/bdc.htm">http://www.sap-img.com/bdc.htm</a>
Regards,
Philip Johannesen -
How to use read_text function module
Hi how to use read_text function module to read purchase order header text .what are all tht things to pass in ID,Name and Object
thanks,
MaheDear,
Use below code.
DATA:IT_LINE LIKE TLINE OCCURS 0 WITH HEADER LINE,
V_TDNAME LIKE THEAD-TDNAME.
V_TDNAME = PO_NUMBER.
CALL FUNCTION 'READ_TEXT'
EXPORTING
* CLIENT = SY-MANDT
ID = 'F01'
LANGUAGE = 'EN'
NAME = V_TDNAME
OBJECT = 'EKKO'
TABLES
LINES = IT_LINE.
Thanks and Regards, -
How to use the text module in script
hi,
i script how to use the text modules and how to write the code in layout of the script?Hi,
You canr use text modules in script. You have to use standard texts .
Standard text are maintained in SO10 transaction.
you can create translation text for other languages also . So based on logon language it will print translation text.
go to SO10
give textname it say Ztextname id as ST and language as EN
say create, then you will get editor there maintain your text and save it . then come back . Now change language (say for german DE) say create and eneter translation text and save it.
so now you have created a text called ztextname which you can use in your script.
Inorder to insert the texts in your script do as below
go to any window editor and select path
Insert->texts->symbols->standard symbols
then you will get popup in which you have to mention all the parameters that you have created earlier.
after inserting just change language EN to sy-langu
Reward points if useful
About text elements Sravan already given some informatiomn
Regards,
Nageswar -
How to use *MonitorManager* to add custom messages in channel monitoring?
Hi experts,
How to use MonitorManager to add custom messages in channel monitoring for custom adapter development(Not in audit log).
like
Type Time Stamp Message ID Explanation
6/25/11 6:39:47 AM 00199942-6e43-02df-96ca-8b538c63dd98 Message processing completed successfully
6/25/11 6:39:47 AM 00199942-6e43-02df-96ca-8b538c63dd98 Message with ID 00199942-6e43-02df-96ca-8b538c63dd98 processed
6/25/11 6:39:46 AM 00199942-6e43-02df-96ca-8b538c63dd98 Message processing started
6/24/11 6:43:26 AM 00199942-6e43-02ef-96b1-7650f3495e03 Message processing completed successfully
6/24/11 6:43:26 AM 00199942-6e43-02ef-96b1-7650f3495e03 Message with ID 00199942-6e43-02ef-96b1-7650f3495e03 processed
6/24/11 6:43:24 AM 00199942-6e43-02ef-96b1-7650f3495e03 Message processing started
6/23/11 6:45:52 AM 00199942-6e43-02df-9698-5be345a9ddf5 Message processing completed successfully
6/23/11 6:45:52 AM 00199942-6e43-02df-9698-5be345a9ddf5 Message with ID 00199942-6e43-02df-9698-5be345a9ddf5 processed
6/23/11 6:45:50 AM 00199942-6e43-02df-9698-5be345a9ddf5 Message processing started
6/22/11 6:43:30 AM 00199942-6e43-02ef-95ff-2c03493dc078 Message processing completed successfully
Edited by: SAP_PI_D on Jun 28, 2011 12:10 PMSolve by myself
-
How to use these function modules
Hi all,
can anyone help that how to use these Function modules to update the status of a task, what are all the inputs i required to proceed
1. FC_USER_AUTHORITY_CHECK
<b>2. FC_USER_STATUS_CHECK
3. FC_USER_STATUS_UPDATE</b>
4. FC_USER_GET_CACTI
5. FC_USER_CHECK_FOR_OUTPUT
Thanks in Advance
GaneshHi Rob,
thanks for ur reply,
but they are not clear what they are meant to be, I understood there are some flags needed to run the Function Modules 2 & 3 which are in bold...
but how do i populate them.. i am not getting that..
thanks
ganesh -
How to use SO_OBJECT_SEND function module
Hi friends,
how to use SO_OBJECT_SEND function module in 4.0B Server .hi
good
check this code
REPORT ZTSAPMAIL.
DATA: X_OBJECT_TYPE LIKE SOOD-OBJTP.
DATA: BEGIN OF X_OBJECT_HD_CHANGE.
INCLUDE STRUCTURE SOOD1.
DATA: END OF X_OBJECT_HD_CHANGE.
DATA: BEGIN OF X_OBJCONT OCCURS 10.
INCLUDE STRUCTURE SOLI.
DATA: END OF X_OBJCONT.
DATA: BEGIN OF X_OBJHEAD OCCURS 0.
INCLUDE STRUCTURE SOLI.
DATA: END OF X_OBJHEAD.
DATA: BEGIN OF RAW_HEAD.
INCLUDE STRUCTURE SORH.
DATA: END OF RAW_HEAD.
DATA: BEGIN OF X_RECEIVERS OCCURS 0.
INCLUDE STRUCTURE SOOS1.
DATA: END OF X_RECEIVERS.
PARAMETERS: RECEIVER LIKE X_RECEIVERS-RECNAM. " Name
*BUILD MESSAGE HEADER
MOVE 'Sort field goes here' TO X_OBJECT_HD_CHANGE-OBJSRT. " Sort field
MOVE 'Name of the object goes here' TO X_OBJECT_HD_CHANGE-OBJNAM. " Name
MOVE 'Document title goes here' TO X_OBJECT_HD_CHANGE-OBJDES. " Title
MOVE 'F' TO X_OBJECT_HD_CHANGE-OBJSNS. " Functional OBJECT
MOVE 'E' TO X_OBJECT_HD_CHANGE-OBJLA. " Language
Object type of the new document
MOVE 'RAW' TO X_OBJECT_TYPE.
CLEAR X_OBJCONT.
MOVE 'Contents of mail' TO X_OBJCONT-LINE.
APPEND X_OBJCONT.
CLEAR X_OBJCONT-LINE. APPEND X_OBJCONT.
MOVE 'More contents' TO X_OBJCONT-LINE.
APPEND X_OBJCONT.
MOVE 'Still more contents'
to x_objcont-line.
APPEND X_OBJCONT.
MOVE ' ' TO X_OBJCONT-LINE.
APPEND X_OBJCONT.
Specific header (Dependent on the object type, here RAW)
REFRESH X_OBJHEAD.
DESCRIBE TABLE X_OBJCONT LINES RAW_HEAD-RAWSIZ.
MOVE RAW_HEAD TO X_OBJHEAD.
APPEND X_OBJHEAD.
*RECEIVERS table
CLEAR X_RECEIVERS.
REFRESH X_RECEIVERS.
MOVE RECEIVER TO X_RECEIVERS-RECNAM. " Name
MOVE 'B' TO X_RECEIVERS-RECESC. " Receiver type
MOVE 'X' TO X_RECEIVERS-SNDCP. " Send as a copy
MOVE 'X' TO X_RECEIVERS-SNDEX. " EXPRESS DOCUMENT
APPEND X_RECEIVERS.
CALL FUNCTION 'SO_OBJECT_SEND'
EXPORTING
folder_id = 'OUTBOX'
forwarder = x_forwarder
object_fl_change = x_object_fl_change
OBJECT_HD_CHANGE = X_OBJECT_HD_CHANGE
object_id = x_object_id
OBJECT_TYPE = X_OBJECT_TYPE
OUTBOX_FLAG = 'X'
OWNER = SY-UNAME
store_flag = x_store_flag
importing
object_id_new = x_object_id_new
sent_to_all = x_sent_to_all "May need to use
TABLES
OBJCONT = X_OBJCONT
OBJHEAD = X_OBJHEAD
objpara = x_objpara
objparb = x_objparb
RECEIVERS = X_RECEIVERS.
reward point if hlepful.
thanks
mrutyun^
Maybe you are looking for
-
iMovie would not let me customize new text in a new slide, so that it looks like the other titles in default slides (slides in the Adventure Theme Trailer). I basically want to have all the titles the exact same font, which is the default font in the
-
HT1222 im not savvy to this sort of stuff, so how is it fixed
just did an update and it wont load the security update? Ps how do i update my operating system?
-
Using XP. I do not use Explorer, only Firefox. The windows message I get does not prevent Firefox from opening. This only happens when I first open Firefox. Once open, it does not happen again unless I close Firefox.
-
SNP heuristic error maximum number of orders per period reached
Hello All, I am getting one strange error "APO SNP heuristic error maximum number of orders per period reached (000000040)" Product XXX/ Location XXX: Maximum number of orders per period reached (000000040) For the problem : PPDS heuristic is working
-
Can you link flash buttons to a embedded cue point
I have a video that I exported to flv with 10 embedded navigation cue points. I also have 10 buttons in a flash file that I would like to link to those cue points. I can't find any info on how to do that. I see info on making a cue point make a event