on 2005 Jul 28 12:16 AM
hackers , geeks .
here is the scenario I imported a RFC model from a non-standard RFC.
the webdynpro i make does not work, i created a jco client and the connection worked.
i have mapped the problem , to the java dictionary created by the import process ,
there is a "Date" type that when i send via the JCO client i send as a String
webdynpro understands the "Date" data type as a java.sql.Date
as a standard behaviour we cant change the standard dictionary
is there a work around ?
or a way to hack away at DEveloper Studio to be able to change the dicionary type ?
thanks in advance ,
Guy
Erin,
thank you for the link
i noticed i explained things badly
first i have a webDynpro project that used te model imported from an RFC
second
i have a pure java main() project that executes this connection via JCO client i created . it executes the bapi and prints out everything that is returned
my second program works fine ,
my first program is a no go , because the rfc import is bringing back a java.sql.Date when i need a String
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thanks, that does clear things up a bit. Was the the java main just a test program? Within WD you can simple execute the model object and the connection to backend happens automatically. Like:
Z_Bapi_Input input = new Z_Bapi_Input();
wdContext.nodeZ_Bapi_Input().bind(input);
//set your input parms
wdContext.currentZ_Bapi_InputElement().setDATA(mySqlDate);
//call the bapi
wdContext.currentZ_Bapi_InputElement().modelObject().execute();
wdContext.nodeOutput().invalidate();
//read your results here
Having done both jco and adaptive RFC, the later is much easier and more java-like to deal with...
Good luck!
this works (from my test Jco Client) :
JCO.ParameterList entrada = funcao.getImportParameterList();
entrada.setValue("20041025, "DATA");
client.execute(funcao);
JCO.ParameterList recebido = funcao.getExportParameterList();
System.out.println(recebido.toString());
JCO.ParameterList tableExportList = funcao.getTableParameterList();
this does not (from webdynpro):
public void executarBapi( )
{
//@@begin executarBapi()
try {
wdContext.currentY_Ssd_Get_Remessas_Novo_InputElement().setData(java.sql.Date.valueOf("25-10-2004"));
wdContext.currentY_Ssd_Get_Remessas_Novo_InputElement().modelObject().execute();
wdContext.nodeOutput().invalidate();
}catch(Exception e){
e.printStackTrace();
}
when i pass the value DATA via string , it goes no problem
put when i change it to sql.Date , it does not work =[ .
thats why i wanted to change the java dictionary
tried that , the function on the rfc SetData(Date date) is mapped to a sql.date =[
i am using Developer Studio sp 12.
i am currently located at the client when i get back to SAP sao paulo i will send you the web dynpro project for you to have a look at (if you could please help me out =] )
if gone so far as to try to manually change the *.gsimpleType and other *.xml files created , but when i save it all goes back to the way it was =[
if you would like send me an email (guy.barros@sap.com)
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Erin , you where rigth after a nice and long debug session i found the problem, another field required by the rfc was not refrenced I created the web dynpro call.
i did not have access to the se37 transaction to see what this rfc really needed. and the customer did not pass me all of the required data.
thanks for all your help,
Guy
ooppss message duplicated , tried to delete it
Message was edited by: Guy Barros
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Guy I think you are going about things the wrong way. Why are you using jco to invoke the rfc? Once you have created the adaptive rfc model, you don't have to create jco clients and connections. Please refer to the following code samples.
https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/com.sap.km.cm.docs/library/webas/s-u/tutorial on accessing abap functions in web dynpro - 4.htm
Thanks, Erin
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
the problem is . i need that field to go as string
i have already converted it to java.sql.Date and the rfc did not work
the problem is just that , my metamodel structure understood the field as date , but the field is set to string
field name: ABAP type:
DATA ,SYST
when i pass the parameter "DATA " to my jco client
i pass as a string , and i am able to view the result
when i import the model to webdynpro it understands that the field DATA is of type java.sql.Date . and I am not able to view the results.
what i want to do is go into my web dynpro dictionary
and modify from java.sql.Date to String
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
If you sent the date as string,Webdynpro metamodel will take it as character.
So look into the following link which has conversion methods for java.sql.Date
http://java.sun.com/j2se/1.4.2/docs/api/index.html
Hope it helps.
Pls close the thread if ur query is answered.
Regards,
Guru
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Guy
Instead why dont you convert your String to java.sql.Date.
Check the SimpleDateFormat class for conversion methods
Regards
Pran
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
71 | |
10 | |
8 | |
7 | |
7 | |
6 | |
6 | |
6 | |
6 | |
5 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.