BADI_CRM_BP_UIU_DEFAULTS with method GET_DEFAULT_VALUES
Hi,
I am trying to use the BADI_CRM_BP_UIU_DEFAULTS to default the Country field on an account. I found sample code to update fields within the view AccountDetails.htm of the BP_HEAD component which is read when the screen first loads, but the country field is actually in StandardAddress.htm of BP_ADDR. How would I go about accessing the country field?
Thanks,
Bernard
Hi Jason,
I just faced the same problems as you do so let me give you a brief desription of our solution.
My problem is that within the code how I can detect which of the screens was being edited (Account/contact/employee) so that I can then set the Grouping field, if blank.
The BADI only will work for all the viewsets that are in the BP_HEAD component. For us this would have been the following controller names: AccountViewSet.do, accountdetails.do, StandardAddress.do and Notes.do. As you can see there are no roles here. What we did was adding the view Roles.AccountRolesEdit to the Viewset BP_HEAD/AccountViewSet.
After you added this you have to switch in the BP_ROLES component in the component workbench and create an component enhancement for the View BP_ROLES/AccountRolesEL. After you've done this you can redefine that method DO_PREPARE_OUTPUT. In there you just call the BADI. See code below for how I did this.
DATA lr_me TYPE REF TO cl_bsp_wd_view_controller.
CALL METHOD super->do_prepare_output
EXPORTING
iv_first_time = abap_false.
TRY.
lr_me ?= me.
CATCH cx_sy_move_cast_error.
ENDTRY.
CALL METHOD /dpa/cl_im_bp_uiu_defaults=>if_uiu_bp_defaults~get_default_values
EXPORTING
iv_first_time = iv_first_time
CHANGING
cr_me = lr_me.
You also have to set the visibility of your attribute ZTYPED_CONTEXT on public.
Now the BADI will also be called for the Roles View in the BP_HEAD component. You determine which View you are currently viewing by it's name, e.g.
cr_me->controller_name = 'accountrolesel.do'.
I also need to set the Role as well, so a Contact may have a Role of 'Prospect', for example.
Setting a new role/group works as follows (snippet):
ASSIGN cr_me->('ZTYPED_CONTEXT') TO <typed_context>.
IF sy-subrc = 0.
TRY.
lr_typed_context ?= <typed_context>.
CATCH cx_sy_move_cast_error.
ENDTRY.
IF lr_typed_context IS BOUND.
ASSIGN lr_typed_context->('BUILROLES') TO <context_node>.
IF sy-subrc = 0.
TRY.
lr_node ?= <context_node>.
CATCH cx_sy_move_cast_error.
ENDTRY.
IF lr_node IS BOUND.
TRY.
lr_coll_wrapper ?= lr_node->collection_wrapper.
CATCH cx_sy_move_cast_error.
ENDTRY.
IF lr_coll_wrapper IS BOUND.
lr_entity ?= lr_coll_wrapper->get_current( ).
lr_entity->set_property( iv_attr_name = 'PARTNERROLE'
iv_value = 'YOUR ROLE' ).
lr_entity->set_property( iv_attr_name = 'VALID_FROM'
iv_value = '00010101' ).
lr_entity->set_property( iv_attr_name = 'VALID_TO'
iv_value = '99991231' ).
lr_entity->set_property( iv_attr_name = 'PARTNERROLECATEGORY'
iv_value = 'YOUR ROLE' ).
lr_entity->set_property( iv_attr_name = 'RLTITL'
iv_value = 'NAME OF ROLE' ).
ENDIF.
CATCH cx_sy_move_cast_error.
CATCH cx_crm_cic_parameter_error.
ENDTRY.
MORE ENDIFS.
For grouping it would look something like this:
ASSIGN cr_me->('TYPED_CONTEXT') TO <typed_context>.
IF sy-subrc = 0.
TRY.
lr_typed_context ?= <typed_context>.
IF lr_typed_context IS BOUND.
ASSIGN lr_typed_context->('HEADER') TO <context_node>.
IF sy-subrc = 0.
lr_node ?= <context_node>.
IF lr_node IS BOUND.
lr_coll_wrapper ?= lr_node->collection_wrapper.
IF lr_coll_wrapper IS BOUND.
lr_current ?= lr_coll_wrapper->get_current( ).
CHECK lr_current IS BOUND.
lr_current->set_property( iv_attr_name = 'BP_GROUP'
iv_value = 'YOUR GROUPING NUMBER' ).
ENDIF.
ENDIF.
ENDIF.
ENDIF.
CATCH cx_sy_move_cast_error.
CATCH cx_crm_cic_parameter_error.
ENDTRY.
ENDIF.
I hope that helps to anwser some of your questions!
Regards,
Georg
Edited by: Georg.Lubrich on Jul 6, 2010 3:07 PM
Similar Messages
-
Sending an email with attachment with method SENDTASKDESCRIPTION.
Hi everyone sorry for my english_;
in custom workflow I set a Send Mail's step.
If i try to send an email without attachments with method SENDTASKDESCRIPTION, the function SWW_SRV_MAIL_SEND return sy-subrc eq 0 and the email wa sent.
If I try to attach a text, change binding for the step
ATTACHOBJECTS -> &ATTACHMENTS& the step have an error in method SENDTASKDESCRIPTION execute the function SWW_SRV_MAIL_SEND; this function return an exception that had not defined.
Thank's a lot.Hello.
Take into acount that the attacment tha you pass to method has to be type of business object SOFM. The attachment is correctly created in the workflow container? Review the creation of the object to attach.
How do you created the attachment?
Regards. -
I have a problem with method calling as it does the method but doesn't send the values to the main program. The Need section in the main should take in the Max and Allocation arrays from the setMax and setAllocation but it doesn't. I figure I'm missing a return call or something. Could you help me out.
public class Project4
public static void main (String[] args)
int[] Available=new int[4];
int[][]Max=new int[5][4];
int[][]Allocation=new int[5][4];
int[][] Need=new int[5][4];
setMax();
setAllocated();
setAvailable();
//Creates the need.
int numMax, numAlloc, numNeed;
for(int row=0; row<5; row++)
for (int col=0; col<4; col++)
numMax=Max[row][col];
numAlloc=Allocation[row][col];
numNeed=numMax-numAlloc;
Need[row][col]=numNeed;
for(int row=0; row<Need.length; row++)
for (int col=0; col<Need[row].length; col++)
System.out.print (Need[row][col]);
System.out.println();
System.out.println();
//From here on checks to see if available.
int[] processLeft=new int[5];
int numChecker, numAvail, counter, check, num, stop, processCounter;
int i=0;
num=0;
stop=3;
processCounter=0;
for(int row=num; row<Need.length; row++)
int col=0;
counter=Need[row].length;
numChecker=Need[row][col];
numAvail=Available[col];
do
check=0;
numChecker= Need[row][col];
numAvail=Available[col];
col++;
if (numChecker<=numAvail)
check=1;
while(numChecker<=numAvail && col<counter);
if(col==counter && check==1)
System.out.println("Process P"+row+" executes");
for(col=0; col<Allocation.length-1; col++)
numChecker=Allocation[row][col];
numAvail=Available[col];
numAvail=numChecker+numAvail;
Available[col]=numAvail;
num++;
processCounter=processCounter+1;
else
processLeft=row;
i++;
// Checks the processes left over
int j=0;
int row=0;
int col=0;
counter=Need[row].length;
while(processLeft[j]!=5 && processCounter!=5)
row=processLeft[j];
do
check=0;
numChecker= Need[row][col];
numAvail=Available[col];
col++;
if (numChecker<=numAvail)
check=1;
while(numChecker<=numAvail && col<counter);
if(col==counter && check==1)
System.out.println("Process P"+row+" executes");
for(col=0; col<Allocation.length-1; col++)
numChecker=Allocation[row][col];
numAvail=Available[col];
numAvail=numChecker+numAvail;
Available[col]=numAvail;
processCounter=processCounter+1;
j++;
safe(processCounter);
public static void setAllocated()
// Creates the Allocation
int[][] Allocation= {{3,0,0,2},{1,0,0,0},{1,3,5,4},{0,6,3,2},{0,0,1,4}};
for(int row=0; row<Allocation.length; row++)
for (int col=0; col<Allocation[row].length; col++)
System.out.print (Allocation[row][col]);
System.out.println();
System.out.println();
public static void setMax()
// Creates the max
int[][] Max= {{3,0,1,2},{1,5,5,0},{2,3,5,6},{0,6,5,2},{0,6,5,6}};
for(int row=0; row<Max.length; row++)
for (int col=0; col<Max[row].length; col++)
System.out.print (Max[row][col]);
System.out.println();
System.out.println();
public static void setAvailable()
// Creates the Available.
int[] Available={3,5,2,0};
public static void safe(int processCounter)
// Prints if it is safe or not
if(processCounter!=5)
System.out.println("\n The system is not safe");
else
System.out.println("\n The system is safe");those methods declare and initialize variables that exist only within that specific method, so no other method can see them
move the 4 arrays you declare in main() out of the method into the class body, then in the other methods, don't declare new arrays, simply initialize the ones you just moved into the class body
or alternatively, you could make the methods return the arrays they create, and instead of your main method creating arrays, it simply works with whatever those methods return
btw 20 minutes is a bit early to be getting impatient -
Hello !!
i'm french
scuse my english
I got a probleme with method exec(String[],String[],File) of Runtime Class
i don't have any probleme when my program runs on Windows NT but the same program on UNIX doesnt execute my command..
When i use exec(String[]) methode i dont have this problem ...but i need the second one methode because i have to execute my command in a different directory than the JAVA program.
I need that results of this command are placed in this drectory so that i can't use an exex() like that :
exemple with a perl :
"perl /toto/titi/hello.pl"
I want to execute this :
"perl hello.pl" (and hello.pl is placed in /toto/titi)
Conclusion :
the exec(String[],String[],File) solution is ok with NT ...
but with UNIX ????
Is there other solution ??
Should i do a "cd" command before my execution ? how can i do this ??
Thanks !!!!Could you post your source code (only relevant part)
Raghu -
CSM HTTP Probes with Method GET
Hello.
How does the HTTP Probe with Method GET work on CSM and what is the difference with CSS?
CSS calculates the HASH of the web page it receives as a first answer and considers that as a REFERENCE HASH, to compare with subsequent answers. Is the behaviour of the CSM the same?
In the CSS it is also possible to insert the HASH in the configuration as a reference HASH. I did not find such a command on the CSM. Is that feature not present on CSM?
Thanks.the CSM just looks for the response code.
No hash or anything similar to the CSS.
Regards,
Gilles. -
Call Paje jsp passing parameters with method post
How can I call a jsp page with outputlink, passing parameters with method post ?
Ex: I need that the word "?pNumMensagem=#{currentRow["NumMensagem"]}" not was exposed when a call P0077_2.jsp.
<h:outputLink binding="#{P0077.hyperlink1}" id="hyperlink1" target="t1" value = "#{facesContext.externalContext.requestContextPath}/faces/P0077_2.jsp?pNumMensagem=#{currentRow["NumMensagem"]}">
<h:outputText binding="#{P0077.outputText14}" id="outputText14" value="#{currentRow['NumMensagem']}"/>
</h:outputLink>
Thanks.
Heitor.Any body have an idea ?
-
How to send Parameters FORM to PHP WEB Page with method POST (secure)?
Hello everyone,
i hope someone can help me to find a solution to this problem!
i have to send "+precious+" parameters from an oracle form to php page, like username and password, with a secure method... i tried with WEB.SHOW_DOCUMENT procedure but it uses GET Method and when the web page open up you can read those parameters in the url...no good!
some suggestion?
Thank a lot in advance... FMicioThe other way you have is to make a PJC java bean ...
which uses HTTPClient library..
for example:
PostMethod post = new PostMethod("http://jakarata.apache.org/");
NameValuePair[] data = {
new NameValuePair("user", "joe"),
new NameValuePair("password", "bloggs")
post.setRequestBody(data);
// execute method and handle any error responses.
InputStream in = post.getResponseBodyAsStream();
// handle response.I have done a multipart form data post to upload files to my db over httpClient.. and other things...
Or with java.net.* api-s
try {
// Construct data
String data = URLEncoder.encode("key1", "UTF-8") + "=" + URLEncoder.encode("value1", "UTF-8");
data += "&" + URLEncoder.encode("key2", "UTF-8") + "=" + URLEncoder.encode("value2", "UTF-8");
// Send data
URL url = new URL("http://hostname:80/cgi");
URLConnection conn = url.openConnection();
conn.setDoOutput(true);
OutputStreamWriter wr = new OutputStreamWriter(conn.getOutputStream());
wr.write(data);
wr.flush();
// Get the response
BufferedReader rd = new BufferedReader(new InputStreamReader(conn.getInputStream()));
String line;
while ((line = rd.readLine()) != null) {
// Process line...
wr.close();
rd.close();
} catch (Exception e) {
}Or you can call your web page (post data) from your database
http://awads.net/wp/2005/11/30/http-post-from-inside-oracle/
Edited by: Peterv6i on Mar 30, 2012 3:49 PM
Edited by: Peterv6i on Mar 30, 2012 3:55 PM -
hi guys, I have almost done everything, except one thing that gives me a grief all the time.. perhaps it's kinda stupid, but.. can someone please take a pick at this code (I know its huge) and help me with how to call those static methods. everytime I'm receiving messages like "cannot resolve symbols" but I cannot figure out what is it wrong and how am I suppose to invoke them:((
thanks!
any kind of help is appreciated:)
// the program works its way through webpages and locates email addresses, collects them and prints them out
// limitations:
// - maximum of 100 web pages
// - maximum of 100 email addresses
// - maximum of 100 lines per web page
import java.io.*;
import java.net.*;
import java.util.*;
// This class uses an array to keep track of email addresses
class emailClass {
private int EMailArrayMax = 100;
private int EMailArrayCounter = 0;
private String[] EMailArray = new String [EMailArrayMax];
// AddElement method
// adds an address to the array
// if the array is not full
// - convert the address to lower case
// - add the address to the array
public void addElement(String Address, String Element)
if (EMailArrayCounter < EMailArrayMax)
EMailArray[EMailArrayCounter] = Element;
String sAddress = Address.toLowerCase();
// printAll method
// prints the entire array of email addresses
public static void printAll(String[] EMailArray, int EMailArrayMax)
for (int a=0; a<EMailArrayMax; a++)
System.out.println(a + " " + EMailArray[a]);
// contains method
// checks to see if an email address is already in the array
// see if the address is in the array
// return true if it is
// return false if it is not
public boolean contains(String Data)
boolean found = false;
for (int a=0; a<EMailArrayCounter; a++)
if (EMailArray[EMailArrayCounter].compareTo(Data)==0)
found = true;
return found;
// Links class
// it keeps track of what pages have been visited
// it is IDENTICAL to the email class
class LinksClass
private int LinksArrayMax = 100;
private int LinksArrayCounter = 0;
private String[] LinksArray = new String [LinksArrayMax];
public static void printAll(String[] LinksArray, int LinksArrayMax)
for (int a=0; a<LinksArrayMax; a++)
System.out.println(a + " " + LinksArray[a]);
public boolean contains(String Data)
boolean found = false;
for (int a=0; a<LinksArrayCounter; a++)
if (LinksArray[LinksArrayCounter].compareTo(Data)==0)
found = true;
return found;
// the main class
public class SpamMaster {
static boolean debug = true;
// the main recursive method that retrieves the webpages
public static void GetPage(String PageAddress, // the name of the webpage to retrieve
int Depth, // the depth
emailClass EMail, // the emailclass object that should add found email addresses to
LinksClass Links) { // the linksclass object that should add found links to
// print the address of the page that we are working on
System.out.println("http://www.google.ca/search?q=find+me&ie=UTF-8&oe=UTF-8&hl=en&btnG=Google+Searc
h");
// check to see if we have gone to deep
// Do nothing if the depth is < 0;
if (Depth < 0)
// hold the entire web page in single string.
// that will make it easy to tear apart using the StringTokenizer
String contents = "";
// now ... open the webpage, add it to the String one line at a time
// add a space between the lines as you add them together
try {
URL url = new URL(PageAddress);
BufferedReader inStream = new BufferedReader(
new InputStreamReader(url.openStream()));
String line = inStream.readLine();
while (line != null)
// add the line to the array
contents = contents + " " + line;
line = inStream.readLine();
catch (Exception e)
System.out.println("Sorry, page not found");
// check for email addresses
// print the address to the screen too so we can see what is going on
StringTokenizer stEmail = new StringTokenizer(contents); //break on whitespace
String sEmail;
while (stEmail.hasMoreTokens())
sEmail = stEmail.nextToken().toLowerCase();
// check for the "@" ... that means we have an email address
// look for the "@" in the token in sEmail
if (sEmail.indexOf("@") >= 0) {
// print the email address to the screen
System.out.println(sEmail);
// check to see if the email address is in the email object already
// if it is not, add it.
// okey dokey. Let's see if there are any links on the page
// assuming that a link is of the form <a href = "http://.......">
// use a StringTokenizer
StringTokenizer st = new StringTokenizer(contents, "\n \t\">"); //break on newline, blank, tab, ", and
greater-than
String s;
while (st.hasMoreTokens()) {
s = st.nextToken().toLowerCase();
// check for the "<a" ... that means we have a link!
if (s.equals("<a")) { // check for the <a
s = st.nextToken().toLowerCase();
if (s.indexOf("href") == 0) { // then it must start with the word href
s = st.nextToken();
if (s.toLowerCase().indexOf("http://") == 0) { //an absolute link URL
// at this point, we have found a link!
// it is in the variable s
// check to see if the link is in the links object
// if it is ... do nothing
// if it is not in the links object ... do the following
// - add the link to the object
// - print a message that a link is being added ... print the link so you know what it is
// - call this method that we are in now ... GetPage (yes, that is recursion).
// calling the method, do the following:
// - pass the method call the link that you just found
// - pass it maximumdepth reduced by one
// - pass the email and links objects so they can be used
// the main method
public static void main(String[] args) throws IOException
BufferedReader kb = new BufferedReader (new InputStreamReader (System.in));
// create a email address object
emailClass email = new emailClass();
// create a links object
LinksClass Links = new LinksClass();
// create a String variable for the start web page address
String StartPage;
// create an int variable for the maximum depth
int Depth = 5;
// ask the user for the start web page address
System.out.println("Enter the start web page:");
// use http://www.google.ca/search?q=find+me&ie=UTF-8&oe=UTF-8&hl=en&btnG=Google+Search to test
things with
StartPage = kb.readLine();
// ask the user for the maximum depth
System.out.println("Enter the depth:");
String Depth1 = kb.readLine();
// call the GetPage method that traverses the website
// pass it:
// - web page address to visit
// - maximum page depth
// - email object
// - visitedpages object
GetPage(PageAddress, Depth, emailClass, LinksClass);----------------> what else to put if not this?
// print the results
System.out.println("");
System.out.println("");
System.out.println("");
System.out.println("Results");
System.out.println("*******");
System.out.println("");
System.out.println("Pages Visited:");
// call the printAll method of the links object
printAll( I KNOW ITS STUPID BUT I DONT KNOW WHAT TO PUT ANYMORE:((( !!! );
System.out.println("");
System.out.println("Email Addresses Found:");
// call the method to print the email addresses
printAll( );
// got to call the method to save the email addresses to file herein line:218 you have:
GetPage(PageAddress, Depth, emailClass, LinksClass);
This will result in a "cannot resolve symbol error" because
1) PageAddress is not defined in your main method nor is it defined in your main class. You have to declare and initialize it to something: eg: String PageAddress = "whatever you want";
2) emailClass is a class. You want to pass the instance of that class that you created. In line 185 you did emailClass email = new emailClass(); so you want to pass the object email.
3) same thing for LinksClass. Don't pass the class, pass the object that you created. Line 189:
LinksClass Links = new LinksClass();
=)
Liam -
Re: EJB Control not working with methods that contain arguments
John,
I'm not qualified to answer your EJB control question, but before you
become too disillusioned with page flows I'd like to mention that the
request scoped data form and and the return-to="page" issues you
mentioned have been addressed for the next service pack. We've
introduced the ability to specify a page flow scoped form bean which
lives for the life of the page flow, and we've clarified the return-to
values to include both "currentPage" and "previousPage" which should
clarify the expected behavior.
I hope you give it a try.
Thomas
John Hundley wrote:
Oh well guess you guys gave up on this one. Thats ok, I have utilized a workaround
that forgoes your non working controls just like I have workarounds for your dataforms
that do not maintain their data between pages, your retrun to page that does not
work etc.... At this rate I should have just used struts and JBoss.
"John Hundley" <[email protected]> wrote:
oop's attached the wrong one here is the right one.
"John Hundley" <[email protected]> wrote:
Ok I have attached one of my beans.
"Anurag" <[email protected]> wrote:
John,
For a stateless session bean, the ejbCreate() method is called for
every
individual method call. This is because the bean instance is returned
to the
pool after every method call, it does not hold any state.
I am still surprised about the behaviour you are seeing.
Can you just attach your stateless session bean. You need not sendthe
dependent files, since we only want to sniff the call made to the stateless
EJB method, and are not concerned with the implementation.
Regards,
Anurag
"John Hundley" <[email protected]> wrote in message
news:[email protected]...
Anurag,
I am using the GA release. My control looks identicle toTraderEJBControl.jcx
except of course it is extending a different home and bean interface.The
bean
itself does not exacly match the traderbean but it does look very
similar
to MusicBean.java
in the tutorialsApp. One thing that has me a bit confused is the
fact
the
create()
method is being called every time I make a method call on the control.Shouldn't
the bean only be created once at the first method call and persistfor the
life
of the session?
John
"Anurag" <[email protected]> wrote:
John,
Have you tried running the ejbControl/TraderEJBClient.jws in SamplesApp.
It
does involve calling methods on the stateless EJB TraderEJB through
an
EJB
control, which accept parameters and run fine.
Could you also confirm that you are using the 8.1 GA release, andnot
the
beta.
Regards,
Anurag
"John Hundley" <[email protected]> wrote in message
news:[email protected]...
Raj,
I cannot attach them here. I am not sure how you would test them
anyway
as I
would have to send you my Oracle schema and you would have to
set
up
a
database
instance. There is no way I can do that. If you could please
send
me an
e-mail
I can attach the relevant files in reply and you could take a
look
at them
and
see if you see any obvious problems.
Thanks,
John
"Raj Alagumalai" <[email protected]> wrote:
John,
Can you attach the ejb jar, the jcx and the jws files that you
have
created.
I will test and get back to you.
Thanks
Raj Alagumalai
WebLogic Workshop Support
"John Hundley" <[email protected]> wrote in message
news:[email protected]...
Hi,
I have created an EJB control on a stateless session bean.
For
some
reason when
I attempt to call a method on my control that takes any number
of
arguments I
get a java.lang.IllegalArgumentException yet if I call a method
that
takes
no
arguments everything works fine. I used the debugger to walk
through
the
code
and have discovered that every time I call any method on the
control
the
create()
method gets called, this is exactly where the error is occurring.It is
almost
like the control is trying to pass my method args to the create()
method
instead
of the method I am calling. I have tested all of the methods
in
the
ejb
by manually
coding everything (getInitialContext ejb.create etc) in a .jsp
and
calling
all
of the methods within that .jsp. There they all work fine
so
I
am
pretty
sure
the control is doing something funky. Any ideas as to what
is
going
on
and how
I can fix it?
Thanks,
JohnWas this issue ever resolved ? We are running into the same problem.
The last response is "I'm not qualified to answer your EJB control question."
Can this be escalated to someone who can please ?
Regards
Shahriar -
11gR2 error: call a bounded task flow with method call as default activity
hi all,
We migrated several applications to the JDev 11g R2.
There are 2 applications that contain a bounded task flow where we define Method Call as default activity.
We need invoke specific actions before opening the page.
They run well with 11gR1.
But with *11G R2*, I can’t call directly this task flow with the following URL:
http://127.0.0.1:7101/MyAPP/faces/adf.task-flow?adf.tfId=my-flow-def&adf.tfDoc=/WEB-INF/flows/my-flow-def.xml
Message:
*<SecurityUtils><invokeURLAllowed> ADFc : impossible to call directly the task flow '/WEB-INF/flows/ my-flow-def.xml #my-flow-def' with the help of URL*
(original message: <SecurityUtils><invokeURLAllowed> ADFc : impossible d'appeler directement le flux de tâches '/WEB-INF/flows/ my-flow-def.xml #my-flow-def' à l'aide de l'URL.)
Any idea?
Thanks for you helpHi,
Have a look at the task flow properties, in PatchSet1, a new feature "invokeURLAllowed" is added that prevents bounded task flows from being URL accessible for security reasons. You can swithc this feature on and off
Frank
Ps.: I though that bounded task flows that you call from a URL generally needed to have a viewActivity as the default activity -
How to return an internal table with methods ?
Hi,
I am an Java programmer and very new to ABAP.
How do I return a internal table with a method? I have the table GP1_PRODUCTS and want to return a copy of this table as an internal table called PRODUCTS.
Here is my code that does not work:
class PRODUCTS definition
public
final
create public .
public section.
*"* public components of class PRODUCTS
*"* do not include other source files here!!!
methods GET_PRODUCT_LIST
returning
value(PRODUCTS) type GP1_PRODUCTS .
protected section.
*"* protected components of class PRODUCTS
*"* do not include other source files here!!!
private section.
*"* private components of class PRODUCTS
*"* do not include other source files here!!!
ENDCLASS.
CLASS PRODUCTS IMPLEMENTATION.
* <SIGNATURE>---------------------------------------------------------------------------------------+
* | Instance Public Method PRODUCTS->GET_PRODUCT_LIST
* +-------------------------------------------------------------------------------------------------+
* | [<-()] PRODUCTS TYPE GP1_PRODUCTS
* +--------------------------------------------------------------------------------------</SIGNATURE>
method GET_PRODUCT_LIST.
DATA: it_products TYPE STANDARD TABLE OF GP1_PRODUCTS.
select * from GP1_PRODUCTS into table it_products.
PRODUCTS = it_products.
endmethod.
ENDCLASS.You have to create a table type for your table GP1_PRODUCTS.
If you use global class (created in SE24), than:
Create a Table Type in SE11
Go to SE11, Enter a name like ZPRODUCTS in the Data Type
There will be popup when you press the Create button to decide a type. Select the Table Type
Enter GP1_PRODUCTS in the Line Type.
* method declaration
methods GET_PRODUCT_LIST
returning
value(PRODUCTS) type ZPRODUCTS.
If you use local class:
TYPES: ty_products type standard table of GP1_PRODUCTS..
* method declaration
methods GET_PRODUCT_LIST
returning
value(PRODUCTS) type ty_products
Regards,
Naimesh Patel -
When Contract.ForAll or Contract.Exists is used in a pre/post condition, and the predicate given is a method group instead of a lambda, CCDoc fails with the following error:
CCDoc failed with uncaught exception: Object reference not set to an instance of an object.
Stack trace: at CCDoc.CCDocCSharpSourceEmitter.TraverseChildren(IMethodCall methodCall)
at Microsoft.Cci.CodeTraverser.Traverse(IMethodCall methodCall)
at CCDoc.XContract.WriteCSharpFromAST(IExpression expression)
at CCDoc.XPrecondition.WriteTo(XmlWriter writer)
at CCDoc.XmlTraverser.WriteEndElement(XmlReader reader, XmlWriter writer)
at CCDoc.XmlTraverserBase.WriteNodeSingle(XmlReader reader, XmlWriter writer)
at CCDoc.XmlTraverserBase.Transform(XmlReader reader, XmlWriter writer)
at CCDoc.CCDoc.WriteContracts(IDictionary`2 contracts, Options options, DocTracker docTracker)
at CCDoc.CCDoc.RealMain(String[] args)
at CCDoc.CCDoc.Main(String[] args)
Stack trace can vary, but its always the same method at the top.
Example code that produces this error:
public static class Program
public static void Main(string[] args)
Contract.Requires(Contract.ForAll(args, ValidateArg));
public static bool ValidateArg(string arg)
return arg != null;Hi Lev,
To your question to clear the track
You can delete your track as described in the below link, and then recreate the track and reimport.
Link: [Deleting Track|http://help.sap.com/saphelp_nw70/helpdata/EN/33/71fe94e1834af8b5bd3c0e1de5ab41/frameset.htm]
Do not forget to delete DTR workspace.
Do reward points if you find the link useful.
Cheers,
Sandeep -
Using ValueHolder Indirection With Method Accessing
I am trying to use method getters/setters with value indirection member as described in the documentation
(http://download-east.oracle.com/docs/cd/B31017_01/web.1013/b28218/mapcfg.htm#CEGFHCJF).
My code modifies the mapping with the following lines:
SessionFactory sf= LocatorLocator.getPersistence().getSessionFactory();
Session s= sf.acquireUnitOfWork();
ClassDescriptor d= (ClassDescriptor)s.getDescriptors().get(CharterBusTripLeg.class);
DatabaseMapping m= d.getMappingForAttributeName("scheduledStartingLocation");
m.setGetMethodName("getScheduledStartingLocationHolder");
m.setSetMethodName("setScheduledStartingLocationHolder(oracle.toplink.indirection.ValueHolderInterface)");
The CharterBusTripLeg class has the following members:
private ValueHolderInterface scheduledStartingLocation;
public Location getScheduledStartingLocation();
public void setScheduledStartingLocation(Location scheduledStartingLocation);
public ValueHolderInterface getScheduledStartingLocationHolder();
public void getScheduledStartingLocationHolder(ValueHolderInterface scheduledStartingLocationHolder);
When I try to restore an instance of CharterBusTripLeg, I get the following Exception:
java.lang.NullPointerException
at oracle.toplink.internal.security.PrivilegedAccessController.getMethodParameterTypes(PrivilegedAccessController.java:394)
at oracle.toplink.internal.descriptors.MethodAttributeAccessor.getSetMethodParameterType(MethodAttributeAccessor.java:86)
at oracle.toplink.internal.descriptors.MethodAttributeAccessor.setAttributeValueInObject(MethodAttributeAccessor.java:152)
at oracle.toplink.mappings.DatabaseMapping.setAttributeValueInObject(DatabaseMapping.java:1119)
at oracle.toplink.mappings.DatabaseMapping.readFromRowIntoObject(DatabaseMapping.java:1022)
at oracle.toplink.internal.descriptors.ObjectBuilder.buildAttributesIntoObject(ObjectBuilder.java:244)
at oracle.toplink.internal.descriptors.ObjectBuilder.buildObject(ObjectBuilder.java:525)
at oracle.toplink.internal.descriptors.ObjectBuilder.buildObject(ObjectBuilder.java:381)
at oracle.toplink.internal.descriptors.ObjectBuilder.buildObjectsInto(ObjectBuilder.java:677)
at oracle.toplink.internal.queryframework.DatabaseQueryMechanism.buildObjectsFromRows(DatabaseQueryMechanism.java:142)
at oracle.toplink.queryframework.ReadAllQuery.executeObjectLevelReadQuery(ReadAllQuery.java:483)
at oracle.toplink.queryframework.ObjectLevelReadQuery.executeDatabaseQuery(ObjectLevelReadQuery.java:811)
at oracle.toplink.queryframework.DatabaseQuery.execute(DatabaseQuery.java:620)
at oracle.toplink.queryframework.ObjectLevelReadQuery.execute(ObjectLevelReadQuery.java:779)
at oracle.toplink.queryframework.ReadAllQuery.execute(ReadAllQuery.java:451)
at oracle.toplink.publicinterface.Session.internalExecuteQuery(Session.java:2073)
at oracle.toplink.publicinterface.Session.executeQuery(Session.java:988)
at oracle.toplink.internal.indirection.QueryBasedValueHolder.instantiate(QueryBasedValueHolder.java:62)
at oracle.toplink.internal.indirection.QueryBasedValueHolder.instantiate(QueryBasedValueHolder.java:55)
at oracle.toplink.internal.indirection.DatabaseValueHolder.getValue(DatabaseValueHolder.java:61)
at oracle.toplink.internal.indirection.UnitOfWorkValueHolder.instantiateImpl(UnitOfWorkValueHolder.java:148)
at oracle.toplink.internal.indirection.UnitOfWorkValueHolder.instantiate(UnitOfWorkValueHolder.java:217)
at oracle.toplink.internal.indirection.DatabaseValueHolder.getValue(DatabaseValueHolder.java:61)
at oracle.toplink.indirection.IndirectList.buildDelegate(IndirectList.java:202)
at oracle.toplink.indirection.IndirectList.getDelegate(IndirectList.java:359)
at oracle.toplink.indirection.IndirectList.size(IndirectList.java:703)
at test.com.laidlaw.les.charter.charter.DeleteBusTest.checkLegs(DeleteBusTest.java:55)
at test.com.laidlaw.les.charter.charter.DeleteBusTest.testAddBus(DeleteBusTest.java:79)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
Any suggestions as to what I am doing wrong?
thanks,
chasChas,
You only need to set the method name without parameters.
m.setSetMethodName("setScheduledStartingLocationHolder");Since these methods will typically only be used by TopLink you can make them protected or private.
Doug -
EJB Control not working with methods that contain arguments
Hi,
I have created an EJB control on a stateless session bean. For some reason when
I attempt to call a method on my control that takes any number of arguments I
get a java.lang.IllegalArgumentException yet if I call a method that takes no
arguments everything works fine. I used the debugger to walk through the code
and have discovered that every time I call any method on the control the create()
method gets called, this is exactly where the error is occurring. It is almost
like the control is trying to pass my method args to the create() method instead
of the method I am calling. I have tested all of the methods in the ejb by manually
coding everything (getInitialContext ejb.create etc) in a .jsp and calling all
of the methods within that .jsp. There they all work fine so I am pretty sure
the control is doing something funky. Any ideas as to what is going on and how
I can fix it?
Thanks,
JohnOh well guess you guys gave up on this one. Thats ok, I have utilized a workaround
that forgoes your non working controls just like I have workarounds for your dataforms
that do not maintain their data between pages, your retrun to page that does not
work etc.... At this rate I should have just used struts and JBoss.
"John Hundley" <[email protected]> wrote:
>
>
>
oop's attached the wrong one here is the right one.
"John Hundley" <[email protected]> wrote:
Ok I have attached one of my beans.
"Anurag" <[email protected]> wrote:
John,
For a stateless session bean, the ejbCreate() method is called for
every
individual method call. This is because the bean instance is returned
to the
pool after every method call, it does not hold any state.
I am still surprised about the behaviour you are seeing.
Can you just attach your stateless session bean. You need not sendthe
dependent files, since we only want to sniff the call made to the stateless
EJB method, and are not concerned with the implementation.
Regards,
Anurag
"John Hundley" <[email protected]> wrote in message
news:[email protected]...
Anurag,
I am using the GA release. My control looks identicle toTraderEJBControl.jcx
except of course it is extending a different home and bean interface.The
bean
itself does not exacly match the traderbean but it does look very
similar
to MusicBean.java
in the tutorialsApp. One thing that has me a bit confused is the
fact
the
create()
method is being called every time I make a method call on the control.Shouldn't
the bean only be created once at the first method call and persistfor the
life
of the session?
John
"Anurag" <[email protected]> wrote:
John,
Have you tried running the ejbControl/TraderEJBClient.jws in SamplesApp.
It
does involve calling methods on the stateless EJB TraderEJB through
an
EJB
control, which accept parameters and run fine.
Could you also confirm that you are using the 8.1 GA release, andnot
the
beta.
Regards,
Anurag
"John Hundley" <[email protected]> wrote in message
news:[email protected]...
Raj,
I cannot attach them here. I am not sure how you would test them
anyway
as I
would have to send you my Oracle schema and you would have to
set
up
a
database
instance. There is no way I can do that. If you could please
send
me an
e-mail
I can attach the relevant files in reply and you could take a
look
at them
and
see if you see any obvious problems.
Thanks,
John
"Raj Alagumalai" <[email protected]> wrote:
John,
Can you attach the ejb jar, the jcx and the jws files that you
have
created.
I will test and get back to you.
Thanks
Raj Alagumalai
WebLogic Workshop Support
"John Hundley" <[email protected]> wrote in message
news:[email protected]...
Hi,
I have created an EJB control on a stateless session bean.
For
some
reason when
I attempt to call a method on my control that takes any number
of
arguments I
get a java.lang.IllegalArgumentException yet if I call a method
that
takes
no
arguments everything works fine. I used the debugger to walk
through
the
code
and have discovered that every time I call any method on the
control
the
create()
method gets called, this is exactly where the error is occurring.It is
almost
like the control is trying to pass my method args to the create()
method
instead
of the method I am calling. I have tested all of the methods
in
the
ejb
by manually
coding everything (getInitialContext ejb.create etc) in a .jsp
and
calling
all
of the methods within that .jsp. There they all work fine
so
I
am
pretty
sure
the control is doing something funky. Any ideas as to what
is
going
on
and how
I can fix it?
Thanks,
John -
Error with method createaquery
Hello, I am finding getting an error
No method with signature - createaquery(class java.lang.String)
I have a feeling this is a problem with how I have set up one of the VO's on the page, as there is not a call to a method such as this in my code base. Also, the OAF is not giving me a stack trace, so I don't know where the problem originates from.
Any ideas?
TIAYou need to find where the method is getting called from. This kind of problems normally happens when you have wrong versions of class files or file version mismatches which tries to reference a newer version but the classpath has a older version.
Check the controllers, AMs and VOs associated with the page.
Maybe you are looking for
-
How can I get my thunderbird address book to show up in alphabetical order by surname?
When entering my email addresses in the address book they do not show up in alphabetical order by surname. What do I do to get it to do so?
-
Error - opening a web query from my favorite or roles
I am trying to open a query saved as web query from my favorite folder or user menu. I got error when processing the request. Below is the detailed error. Error when processing your request What has happened? The URL http://p2pr3.ittind.com:8000/sap/
-
I just installed html db yesterday, but today I could not get logged back in as admin. I changed the admin password, evidently before email was set up correctly. I saw the post for "stupid password tricks", but How do I find the password for flows_01
-
Put value into internal table field
Hello Gurus, I have one field which I stored into one variable through cncatenate statment in variable VAR1. and I have another variable VAR2 have some amount. now I want to put this amount to the field which is present into the VAR1. ex: VAR1 = 't_d
-
Request for S300 owner (save me please ^^)
Hi everybody ! I am looking for someone who could make a backup of the BIOS (with Universal BIOS Backup Toolkit) to try a recovery BIOS procedure.(I've a S300/i3). Indeed, downloadable bios on the website are no t in the correct format for recovery p