RFC function results with CodePage
Hi everybody,
I'm trying to call RFC SAP Z-function from ASP page:
<%Response.Buffer = false
Response.Expires = -1
Response.CacheControl ="no-cache"
Session.CodePage = "65001"
Response.charset = "UTF-8"
%>
The result string is '####' , the problem in codepage?...
We works 640 Final Release - Unicode system.
Have any idea to help me.
Thanks, Natalia.
Hi,
<b>The way I connect to SAP:</b>
(include file)
Set SapLogon = CreateObject("SAP.LogonControl.1")
Set SapConn = SapLogon.NewConnection
SapConn.Client = "<Client>"
SapConn.Language = "HE"
SapConn.HostName = "<HostName>"
SapConn.destination = "<destination>"
SapConn.user = "<user>"
SapConn.password = "<password>"
If SapConn.LogOn(0, True) <> True Then ' LogOn WithOut dialog
Set SapConn = Nothing
SAP_LogOn = false
else
SAP_LogOn = true
End If
<b>The way I call RFC SAP Z-Function:</b>
(ASP page)
<!#include file="include/SAP_CONNECTION.INC">
<%Response.Buffer = false
Response.Expires = -1
Response.CacheControl ="no-cache"
Session.CodePage = "65001"
Response.charset = "UTF-8"
%>
<%
DIM SEARCHCRITERIA
DIM SEARCHQUERY
SEARCHCRITERIA = Request.QueryString("SEARCHCRITERIA")
SEARCHQUERY = Request.QueryString("SEARCHQUERY")
if SAP_LogOn then
response.write Z_SAP_SEARCH
SAP_LogOff
else
response.write "error on Sap LogOn"
end if
Public Function Z_SAP_SEARCH()
Z_SAP_SEARCH = False
Dim dieFunc, strXmlGetData, oFunctionCtrl,TABR, i
strXmlGetData = ""
'Create Function Object
Set oFunctionCtrl = CreateObject("SAP.Functions")
Set oFunctionCtrl.Connection = SapConn
Set dieFunc = oFunctionCtrl.Add("<RFC SAP Z-Function name>")
dieFunc.Exports("SEARCHCRITERIA") = SEARCHCRITERIA
dieFunc.Exports("SEARCHQUERY") = SEARCHQUERY
If dieFunc.Call = True Then
Set TABR = dieFunc.tables.Item("T_XML_STRING")
If TABR.rows.Count > 0 Then
For i = 1 To TABR.rows.Count
strXmlGetData = strXmlGetData & TABR.Value(i, "XML_STRING")
Next
End If
Else
strXmlGetData = "<ERROR>Z_SAP_SEARCH connection error</ERROR>"
End If
Z_SAP_SEARCH = strXmlGetData
End Function
%>
As you seen I receive from SAP RFC Z-Function table of strings .
I receive right result strings, but Instead of Hebrew letters I see #:
When I run the function in SAP I don't see #.
Thanks, Natalia.
Similar Messages
-
Getting Return values from RFC function call with visual basic
Hi,
I am creating a sample app to connect to a SAP system which call its RFC functions created with ABAP. It was known that the function will return more than 1 return values.
SAP Function name ==> "ZFMTP_RFC_GET_RESULT"
Export parameters (to SAP):
- Student Name [char 10] ==> "STUNAME"
- Student ID [char 20] ==> "STUID"
Return values (From SAP):
- Results [char 10] ==> "RESULT"
- Remarks [char 200] ==> "REMARKS"
i have managed to get sample codes for connecting and call a RFC function with vb but they only get a return value. How do i retrieve multiple return values like the above function "RESULT" and "REMARKS"?
Here's my vb code to accessing the function
Dim R3 As Object
Dim FBFunc As Object
Dim returnFunc As Boolean
Dim connected As Boolean
R3 = CreateObject("SAP.Functions")
R3.Connection.Client = "000"
R3.Connection.User = "BCUSER"
R3.Connection.Password = "minisap"
R3.Connection.Language = "DE"
R3.Connection.System = "dtsystem"
R3.Connection.Applicationserver = "xxx.xxx.xxx.xxx"
connected = R3.Connection.Logon(0, True)
If connected <> True Then
MsgBox("Unable to connect to SAP")
End If
FBFunc = R3.add("ZFMTP_RFC_GET_RESULT")
FBFunc.exports("STUNAME") = "Jonny"
FBFunc.exports("STUID") = "12345"
returnFunc = FBFunc.Call() <<== How do i get the return value? or RESULT and REMARKS of the RFC Function?
thanks alot.
Edited by: Eugene Tan on Mar 4, 2008 7:17 AMHi Gregor,
Thanks for the link....i am having some doubts with the codes, hope you can clarify them for me if you know the codes..
Below is the code snippet.
Set impReturn = CHPASS_FN.Imports("RETURN") <<=== is RETURN the standard keyword to get a return object?
expPassword.Value = currpass
expNewPass.Value = newpass
expFillRet.Value = "1"
''' Call change password function
If CHPASS_FN.Call = True Then
outFile.Write (", Called Function")
Message = impReturn("MESSAGE") <<==== So if i have 3 return values..i just replace with the return value variable names?
outFile.WriteLine " : " & Message
Else
outFile.Write (", Call to function failed")
End If
thanks alot...all your help is very appreciated. -
RFC Function module-With Only Request message
Hi
i need a RFC with only Request message and Response message is not required.
please help me, how to create a RFC function module with out Response message, and it should contain only Request message.
i have created RFC in this way:
RFC doesn't contain neither import nor export parameters. and i have defined one table in TABLE tab which refers to a ztable created already.
when i imported RFC into XI i came to know that RFC has both Request and Response messages, but i don't need Response message.
Thanks in advance..help would be appreciated
Regards,
RajeshThankx Michal,
I have written ZRFC this way:
insert ZMM_AUTO_GR from INPUT_TABLE .
if sy-subrc = 0.
commit work.
else.
rollback work.
im not using neither import nor export parameters..but using only tables parameters. but when imported in XI im getting same table structure in both request an response.
please suggest what changes required in above code to invoke my ZRFC in async way.
you will not get any response in XI- what chages required in my code to dnt get .reponse in XI.
appreciate your help.
Regards,
Rajesh. -
RFC function module with call transaction and Import memory ID
Hi,
I am calling RFC function module from R/3 which exists in BW.
In BW stand alone function module works fine.
When I am Calling from R/3 it is not working,
Can you tell me is it because of the below code, And suggest if any corrections required.
I am calling the call transaction and using EXPORT memory iD inside the program
and IMPORT in after that.
And populating RFC table's table " p_i_tcode_user" finally.
set parameter id 'TCD' field p_tcode.
call transaction 'Z_BW_RSUSR002' AND SKIP FIRST SCREEN.
ENDIF.
get the final user data from submitted program
import gt_users_complete from memory id tcode_userid.
LOOP AT gt_users_complete.
lwa_tcode_user-tcode = p_tcode.
lwa_tcode_user-uname = gt_users_complete-Bname.
APPEND lwa_tcode_user TO p_i_tcode_user.
ENDLOOP.
Thanks,
Veerendra.HI,
Can you just exaplin it clearly plz..
Thanks
Mahesh -
Call RFC Function Module and return 1000 records at a time
I would like to call a Remote Enabled Function Module from a non SAP system. This function module will select data from the database and return it to the calling program.
Suppose there are 100,000 records that need to be returned, but the calling module would like the data in chunks of 1000 records. Therefore the calling program would call the FM 100 times.
How do I code the function module to know on each subsequent call to grab the next chunk of 1000 records?
Let me know if additional information is needed.
Thanks,
AaronHello,
Here is how you can go for this issue:
1. Create one RFC function module with following parameter. These parameters are with respective of chunking logic.
Import: Package Size
Export: Total number of records
Changing: chunk count
Implement following logic:
1. First of you need to know how many chunks you need to fetch for that get the count of total number of records. This is one
time activity so you better maintain one flag import parameter will be set to 'X' only first call.
2. Get the number of chunk using total number of records / chunk size for e.g. 1000 / 100 so chunk count = 10.
3. Define internal chunk counter in function module which will be used to locate the correct chunk depending on the chunk
counter value sent from calling program.
4. Send first call with package size 100 and chunk count = 1, execute select statement and increment internal
chunk count check if chunk count = internal chunk count in current case chunk count = 1 so exit select statement and return
with first chunk.
5. Send second call with package size 100 and chunk count = 2. Execute select statement and check chunk count with internal
chunk counter, in current case it will be 1 so skip that data and go for next chunk of 100 records increment internal chunk
counter. In this case it will match with external chunk count = 2. load output table with that data and return to calling program.
6. Repeat step 4 until you reach last chunk.
You need to use SELECT...ENDSELECT with PACKAGE SIZE addition so for every loop it will return number of records mentioned in package size.
Hope this helps.
Thanks,
Augustin. -
Hi ,
Our requirement is like this , we have to send the material long text from r/3 to srm system
for this we have developed a rfc function module with srm system as destination .But when we are using this in the program while rfc funtion module is invoked that time it is going to srm system and asking for credentials. how can i supress this .
Thanks in advance.Hello;
In your RFC destination, you can use a default user.
If you want to use the current user, go check
<a href="http://help.sap.com/saphelp_nw2004s/helpdata/en/22/042860488911d189490000e829fbbd/frameset.htm">http://help.sap.com/saphelp_nw2004s/helpdata/en/22/042860488911d189490000e829fbbd/frameset.htm</a>
It explains how to setup up trusted/trusting system and the use of SSO.
Regards -
Rfc function with table parameter
Hey,
im trying to call a RFC function from Webdynpro where i have to give a table as parameter. When creating the table i following exception:
java.lang.IllegalArgumentException: model object must not be null
at com.sap.tc.webdynpro.progmodel.context.ModelNodeElement.<init>(ModelNodeElement.java:66)
at be.vrt.wdp.IPublicPlanning_Validation$IP_Update_TableElement.<init>(IPublicPlanning_Validation.java:3667)
at be.vrt.wdp.IPublicPlanning_Validation$IContextNode.doCreateElement(IPublicPlanning_Validation.java:87)
at com.sap.tc.webdynpro.progmodel.context.NodeInfo.createElement(NodeInfo.java:854)
at com.sap.tc.webdynpro.progmodel.context.Node.createElementInternal(Node.java:1346)
at com.sap.tc.webdynpro.progmodel.context.Node.createElement(Node.java:1365)
at be.vrt.Planning_Validation.executeRFC_Z_Whatson_Sap_Update_Transmissio_Input(Planning_Validation.java:265)
The code from Planning_Validation (controller class)
public void executeRFC_Z_Whatson_Sap_Update_Transmissio_Input( java.util.Vector nodes, java.lang.String display_value )
//@@begin executeRFC_Z_Whatson_Sap_Update_Transmissio_Input()
Z_Whatson_Sap_Update_Transmiss_Input transmiss = new Z_Whatson_Sap_Update_Transmiss_Input();
//transmiss.addP_Update_Table(new Zmm_S_Update_Status_Table());
wdContext.nodeZ_WHATSON_SAP_UPDATE_TRANSMIS().bind(transmiss);
//wdContext.createP_Update_TableElement(new Zmm_S_Update_Status_Table());
for (int i = 0; i < nodes.size(); i++){
String [] node = (String[])nodes.get(i);
IWDNodeElement el = wdContext.nodeP_Update_Table().createElement();
el.setAttributeValue("Won_Id", node[0]);
el.setAttributeValue("Won_Status", node[1]);
el.setAttributeValue("Display_Status", display_value);
try {
// Call remote function
wdContext.currentZ_WHATSON_SAP_UPDATE_TRANSMISElement().modelObject().execute();
// synchronise data in context with data in model
wdContext.nodeOutput().invalidate();
} catch (WDDynamicRFCExecuteException e) {
// TODO Auto-generated catch block
e.printStackTrace();
Line 265 is where i call wdContext.nodeP_Update_Table().createElement();
Any ideas ?
grtz,
HannesHey, thanks .. i managed to solve it
this is the code:
//@@begin javadoc:executeRFC_Z_Whatson_Sap_Update_Transmissio_Input()
/** Declared method. */
//@@end
public void executeRFC_Z_Whatson_Sap_Update_Transmissio_Input( java.util.Vector nodes, java.lang.String display_value )
//@@begin executeRFC_Z_Whatson_Sap_Update_Transmissio_Input()
Z_Whatson_Sap_Update_Transmiss_Input transmiss = new Z_Whatson_Sap_Update_Transmiss_Input();
wdContext.nodeZ_WHATSON_SAP_UPDATE_TRANSMIS().bind(transmiss);
for (int i = 0; i < nodes.size() ; i++){
String [] node = (String[])nodes.get(i);
Zmm_S_Update_Status_Table updEl = new Zmm_S_Update_Status_Table();
updEl.setWon_Id(node[0]);
updEl.setWon_Status(node[1]);
updEl.setDisplay_Status(display_value);
transmiss.addP_Update_Table(updEl);
wdComponentAPI.getMessageManager().reportSuccess("wohoo!");
try {
// Call remote function
wdContext.currentZ_WHATSON_SAP_UPDATE_TRANSMISElement().modelObject().execute();
// synchronise data in context with data in model
wdContext.nodeOutput().invalidate();
} catch (WDDynamicRFCExecuteException e) {
// TODO Auto-generated catch block
e.printStackTrace();
//@@end -
RFC function module always creating BPs with the same user name (RFC user )
Hi All
I posted the below question in a different area before. But thought it would be more suitable here.
Moderators - Please let me know if am doing any mistake.
Question:
I have a RFC function module in CRM that creates Business Partners in ECC (XD01 tcode).
I am using a dialog RFC destination configured in SM59 in CRM.
But my RFC function module in CRM is always creating the Business Partners in ECC with the RFC user id (the user that we maintain for the RFC destination in SM59).
This is a problem for the users because they are not able to track the actual person responsible for creating these Business Partners.
Can somebody please let me know how to solve this problem?
Thanks
RajHi.
You may use the trust relationship between CRM and R/3 and in SM59 instead of set a specific username, you set the flag "current user".
With this flag, the system will access R/3 system with the user logged in CRM system. The Trust relationship must be created between CRM and R/3 in order to the system doesn't ask for a password to login in R/3.
If you need more details please reply.
Kind regards,
Susana Messias -
Collection problem with RFC function module WSDL.
Hi.
I have developed an RFC function module in a SAP system version 4.7 (WAS 620). This FM has 2 table parameters. I have no problem when I see the WSDL in the SAP Web Service Browser.
Another team is trying to consume this RFC FM as a web service from a Java application but they say they can't see the table parameters as collections.
Here is the WSDL of the FM, the table parameters are T_MOVIM and T_ERROR:
<?xml version="1.0" encoding="UTF-8" ?>
<definitions xmlns="http://schemas.xmlsoap.org/wsdl/" xmlns:s0="urn:sap-com:document:sap:rfc:functions" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:http="http://schemas.xmlsoap.org/wsdl/http/" targetNamespace="urn:sap-com:document:sap:rfc:functions">
<types>
<xsd:schema targetNamespace="urn:sap-com:document:sap:rfc:functions">
<xsd:element name="ZMMFUSAPTK_0001">
<xsd:complexType>
<xsd:all>
<xsd:element name="GENIDOC" minOccurs="0">
<xsd:simpleType>
<xsd:restriction base="xsd:string">
<xsd:maxLength value="1" />
</xsd:restriction>
</xsd:simpleType>
</xsd:element>
<xsd:element name="T_ERROR">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="item" minOccurs="0" maxOccurs="unbounded" type="s0:ZMMTASAPTK_0012" />
</xsd:sequence>
</xsd:complexType>
</xsd:element>
<xsd:element name="T_MOVIM">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="item" minOccurs="0" maxOccurs="unbounded" type="s0:ZMMTASAPTK_0011" />
</xsd:sequence>
</xsd:complexType>
</xsd:element>
</xsd:all>
</xsd:complexType>
</xsd:element>
<xsd:element name="ZMMFUSAPTK_0001.Response">
<xsd:complexType>
<xsd:all>
<xsd:element name="CODRET">
<xsd:simpleType>
<xsd:restriction base="xsd:string">
<xsd:maxLength value="1" />
</xsd:restriction>
</xsd:simpleType>
</xsd:element>
<xsd:element name="T_ERROR">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="item" minOccurs="0" maxOccurs="unbounded" type="s0:ZMMTASAPTK_0012" />
</xsd:sequence>
</xsd:complexType>
</xsd:element>
<xsd:element name="T_MOVIM">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="item" minOccurs="0" maxOccurs="unbounded" type="s0:ZMMTASAPTK_0011" />
</xsd:sequence>
</xsd:complexType>
</xsd:element>
</xsd:all>
</xsd:complexType>
</xsd:element>
<xsd:complexType name="ZMMTASAPTK_0011">
<xsd:sequence>
<xsd:element name="REFERENCIA" minOccurs="0">
<xsd:simpleType>
<xsd:restriction base="xsd:string">
<xsd:maxLength value="10" />
</xsd:restriction>
</xsd:simpleType>
</xsd:element>
<xsd:element name="FECHACONT" minOccurs="0">
<xsd:simpleType>
<xsd:restriction base="xsd:string">
<xsd:maxLength value="8" />
</xsd:restriction>
</xsd:simpleType>
</xsd:element>
<xsd:element name="FECHADOC" minOccurs="0">
<xsd:simpleType>
<xsd:restriction base="xsd:string">
<xsd:maxLength value="8" />
</xsd:restriction>
</xsd:simpleType>
</xsd:element>
<xsd:element name="CODMOV" minOccurs="0">
<xsd:simpleType>
<xsd:restriction base="xsd:string">
<xsd:maxLength value="2" />
</xsd:restriction>
</xsd:simpleType>
</xsd:element>
<xsd:element name="NROPLAN" minOccurs="0">
<xsd:simpleType>
<xsd:restriction base="xsd:string">
<xsd:maxLength value="12" />
</xsd:restriction>
</xsd:simpleType>
</xsd:element>
<xsd:element name="NROCOMP" minOccurs="0">
<xsd:simpleType>
<xsd:restriction base="xsd:string">
<xsd:maxLength value="10" />
</xsd:restriction>
</xsd:simpleType>
</xsd:element>
<xsd:element name="CLASEMOV" minOccurs="0">
<xsd:simpleType>
<xsd:restriction base="xsd:string">
<xsd:maxLength value="3" />
</xsd:restriction>
</xsd:simpleType>
</xsd:element>
<xsd:element name="CENTRO" minOccurs="0">
<xsd:simpleType>
<xsd:restriction base="xsd:string">
<xsd:maxLength value="4" />
</xsd:restriction>
</xsd:simpleType>
</xsd:element>
<xsd:element name="ALMACEN" minOccurs="0">
<xsd:simpleType>
<xsd:restriction base="xsd:string">
<xsd:maxLength value="4" />
</xsd:restriction>
</xsd:simpleType>
</xsd:element>
<xsd:element name="MATERIAL" minOccurs="0">
<xsd:simpleType>
<xsd:restriction base="xsd:string">
<xsd:maxLength value="5" />
</xsd:restriction>
</xsd:simpleType>
</xsd:element>
<xsd:element name="LOTE" minOccurs="0">
<xsd:simpleType>
<xsd:restriction base="xsd:string">
<xsd:maxLength value="10" />
</xsd:restriction>
</xsd:simpleType>
</xsd:element>
<xsd:element name="CANTIDAD" minOccurs="0">
<xsd:simpleType>
<xsd:restriction base="xsd:string">
<xsd:maxLength value="15" />
</xsd:restriction>
</xsd:simpleType>
</xsd:element>
<xsd:element name="MOTIVOMOV" minOccurs="0">
<xsd:simpleType>
<xsd:restriction base="xsd:string">
<xsd:maxLength value="4" />
</xsd:restriction>
</xsd:simpleType>
</xsd:element>
<xsd:element name="CENTROREC" minOccurs="0">
<xsd:simpleType>
<xsd:restriction base="xsd:string">
<xsd:maxLength value="4" />
</xsd:restriction>
</xsd:simpleType>
</xsd:element>
<xsd:element name="ALMACENREC" minOccurs="0">
<xsd:simpleType>
<xsd:restriction base="xsd:string">
<xsd:maxLength value="4" />
</xsd:restriction>
</xsd:simpleType>
</xsd:element>
<xsd:element name="CENTROCTO" minOccurs="0">
<xsd:simpleType>
<xsd:restriction base="xsd:string">
<xsd:maxLength value="10" />
</xsd:restriction>
</xsd:simpleType>
</xsd:element>
<xsd:element name="ORDEN" minOccurs="0">
<xsd:simpleType>
<xsd:restriction base="xsd:string">
<xsd:maxLength value="12" />
</xsd:restriction>
</xsd:simpleType>
</xsd:element>
<xsd:element name="TIPOSTK" minOccurs="0">
<xsd:simpleType>
<xsd:restriction base="xsd:string">
<xsd:maxLength value="1" />
</xsd:restriction>
</xsd:simpleType>
</xsd:element>
<xsd:element name="NROPEDIDO" minOccurs="0">
<xsd:simpleType>
<xsd:restriction base="xsd:string">
<xsd:maxLength value="10" />
</xsd:restriction>
</xsd:simpleType>
</xsd:element>
<xsd:element name="CODCISTERNA" minOccurs="0">
<xsd:simpleType>
<xsd:restriction base="xsd:string">
<xsd:maxLength value="50" />
</xsd:restriction>
</xsd:simpleType>
</xsd:element>
</xsd:sequence>
</xsd:complexType>
<xsd:complexType name="ZMMTASAPTK_0012">
<xsd:sequence>
<xsd:element name="REFERENCIA" minOccurs="0">
<xsd:simpleType>
<xsd:restriction base="xsd:string">
<xsd:maxLength value="10" />
</xsd:restriction>
</xsd:simpleType>
</xsd:element>
<xsd:element name="CODERR" minOccurs="0">
<xsd:simpleType>
<xsd:restriction base="xsd:string">
<xsd:maxLength value="3" />
</xsd:restriction>
</xsd:simpleType>
</xsd:element>
<xsd:element name="MSJERR" minOccurs="0">
<xsd:simpleType>
<xsd:restriction base="xsd:string">
<xsd:maxLength value="100" />
</xsd:restriction>
</xsd:simpleType>
</xsd:element>
</xsd:sequence>
</xsd:complexType>
</xsd:schema>
</types>
<message name="ZMMFUSAPTK_0001Input">
<part name="parameters" element="s0:ZMMFUSAPTK_0001" />
</message>
<message name="ZMMFUSAPTK_0001Output">
<part name="parameters" element="s0:ZMMFUSAPTK_0001.Response" />
</message>
<portType name="ZMMFUSAPTK_0001PortType">
<operation name="ZMMFUSAPTK_0001">
<input message="s0:ZMMFUSAPTK_0001Input" />
<output message="s0:ZMMFUSAPTK_0001Output" />
</operation>
</portType>
<binding name="ZMMFUSAPTK_0001Binding" type="s0:ZMMFUSAPTK_0001PortType">
<soap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http" />
<operation name="ZMMFUSAPTK_0001">
<soap:operation soapAction="http://www.sap.com/ZMMFUSAPTK_0001" />
<input>
<soap:body use="literal" />
</input>
<output>
<soap:body use="literal" />
</output>
</operation>
</binding>
<service name="ZMMFUSAPTK_0001Service">
<documentation>SAP Service ZMMFUSAPTK_0001 via SOAP</documentation>
<port name="ZMMFUSAPTK_0001PortType" binding="s0:ZMMFUSAPTK_0001Binding">
<soap:address location="http://dbades00.bue.bemberg.com.ar:8002/sap/bc/soap/rfc" />
</port>
</service>
</definitions>
Should I change something in the definition of the parameters of the FM? or the problem is with the parsing process on the other system?
Thanks in advance.
Fabian.Welcome to SDN.
I am not sure about this particular issue, but i have used WSDL from WAS6.20 system in MS Office infopath to consume webservice where we have had table parameters without any issue.
may be try with office infopath to make sure that the problem is with the WSDL or with the java application.
Regards
Raja -
To upload a data into SAP Table with the help of RFC function in BODS
Hi,
Please provide me step-by-step solution to upload data into any SAP table with the help of RFC function in Data Services.
I have created RFC function that upload data into SAP table. RFC Function contains one table that has same structure as my database table.
In the data services how can i filled the table of RFC function, i am using this function in query transform of data services but it gives me error.
I am also follow link http://wiki.sdn.sap.com/wiki/display/BOBJ/BusinessObjectsDataServicesTipsand+Tricks
but it did not help me.
Thanks,
AbhishekHi Abhishek,
Did you import the function module in the SAP datastore first? When you open the SAP datastore, the function should be listed in the 'functions' section. If not, import it. Make sure your function is remote executable.
Once the function is there, you can use it in a transformation. In 'Schema Out' right-click on 'Query' (top level) and choose 'New Function Call'. You can then select a datastore and a function in the datastore. The wizard will show you which output parameters are available. I believe you have to add at least one and can select as many as you like.
After confirming your selection the function and the output parameters appear in Schema Out. You can then right-click on the function and choose 'Modify function call'. A popup will appear where you can specify the input parameters.
I hope this helps.
Jan. -
XML Problem: RFC Function with XSTRING or raw table (4.6C)
hello,
I have a serialized XML-Document, i.e. a xstring or a raw table. Now I want to write a RFC Function Module that sends/receives this data. I'm running on 4.6C. Is this possible under 4.6C?
I've managed to write a Function module with appropriate parameters (XML in a raw table) that works fine, but I can't declare it as a <b>remote</b> function module. Is there a standard method of importing binary XML Data via RFC in 4.6C?
Regards,
Alexander SchulzCan you please share the answer?
-
IDOC with ABAP - PI Port , RFC Function module
Hi ,
I am creating outbound Idoc in one system, In the same system I am using a ABAP - PI port and assigned a RFC function module.
So when ever the outbound IDOC is created it will go to the port and triggers the RFC function module.
now my question is how to get the outbound IDOC number in the RFC function module.
I thought of reading the table EDIDC with message type, but all previous IDOC's aslo coming .
Regards
BhaskarHi Bhaskar, the IDOC control record or records are transfered to your function module in table paramater I_EDIDC. You could read the IDOC data by calling function modules EDI_DOCUMENT_OPEN_FOR_PROCESS and EDI_SEGMENTS_GET_ALL for each control record.
Regards Jack -
RFC function is called with null paremeters on SAP side
I used the new version of .Net Connector 2.0.1.
I created a simple client called RFC function with one table parameter and simple RFC function inserts record to simple table on SAP side.
If I call this RFC function from SAP side the record is inserted to my table with correct value.
If I call this RFC function from NET side the record is inserted with null value.
What's wrong ?
Could anybody help me ?
Code :
SAP side
FUNCTION ZRVFRFCNV.
*" TABLES
*" ITDATA STRUCTURE ZRVNAMEVALUE
insert into ZRVNAMEVALUE values ITDATA.
ENDFUNCTION.
Net side
ZRVNAMEVALUE nam_val2 = new ZRVNAMEVALUE();
nam_val2.Name = "100";
nam_val2.Value = "NORD";
ZRVNAMEVALUETable tblTest = new ZRVNAMEVALUETable();
tblTest.Add(nam_val2);
// for testing : dataGrid show correct values
dataGrid1.SetDataBinding(tblTest, "");
this.sapProxy11.Zrvfrfcnv(ref tblTest);The problem was in insert statement. I changed insert to modify on SAP side and solved it.
-
The below function is giving me the hours difference what I wanted, but today it is giving us the below error:
Msg 535, Level 16, State 0, Line 1
The datediff function resulted in an overflow. The number of dateparts separating two date/time instances is too large. Try to use datediff with a less precise datepart.
Please Help..
ALTER FUNCTION [dbo].[GetHoursExcludingWeekdays](@StartDate datetime2,@EndDate datetime2)
returns decimal(12,3)
as
begin
if datepart(weekday,@StartDate) = 1
set @StartDate = dateadd(day,datediff(day,0,@StartDate),1)
if datepart(weekday,@StartDate) = 7
set @StartDate = dateadd(day,datediff(day,0,@StartDate),2)
-- if @EndDate happens on the weekend, set to previous Saturday 12AM
-- to count all of Friday's hours
if datepart(weekday,@EndDate) = 1
set @EndDate = dateadd(day,datediff(day,0,@EndDate),-2)
if datepart(weekday,@EndDate) = 7
set @EndDate = dateadd(day,datediff(day,0,@EndDate),-1)
declare @return decimal(12,3)
set @return = ((datediff(second,@StartDate,@EndDate)/60.0/60.0) - (datediff(week,@StartDate,@EndDate)*48))
return @return
end
ReportingServicesYou'll get this error if the difference between the start and end date is greater that about 68 years due to the "second" DATEDIFF specification. Perhaps the dates are greater than the expected range due to a data quality issue.
Taking the advice from the error message, you could use minutes instead of seconds like the example below the version below. This could still result in the error of the difference is greater than a couple of hundred years, though. You might consider
validating the dates and returning NULL if outside expected limits.
ALTER FUNCTION [dbo].[GetHoursExcludingWeekdays](@StartDate datetime2,@EndDate datetime2)
returns decimal(12,3)
as
begin
if datepart(weekday,@StartDate) = 1
set @StartDate = dateadd(day,datediff(day,0,@StartDate),1)
if datepart(weekday,@StartDate) = 7
set @StartDate = dateadd(day,datediff(day,0,@StartDate),2)
-- if @EndDate happens on the weekend, set to previous Saturday 12AM
-- to count all of Friday's hours
if datepart(weekday,@EndDate) = 1
set @EndDate = dateadd(day,datediff(day,0,@EndDate),-2)
if datepart(weekday,@EndDate) = 7
set @EndDate = dateadd(day,datediff(day,0,@EndDate),-1)
declare @return decimal(12,3)
set @return = ((datediff(minute,@StartDate,@EndDate)/60.0) - (datediff(week,@StartDate,@EndDate)*48))
return @return
end
GO
Dan Guzman, SQL Server MVP, http://www.dbdelta.com -
Hi All,
I am getting error while executing oDATA service from SAP Netweaver Gateway
Error details:
RFC call ended with "Communication Failure" exception (Function call failed; could not find the function
I am using SAP NG 740
Project is created in Gateway system using SEGW having Map to Datasource option used.
in SPRO manage alias, I had seleted Local App option. Screen attached
I had tried all troubleshooting like delete and add service and alias in "/IWFND_MAINT_SERVICE".
but still getting same error for all service.
Kindly advise.
Regards
VivekHello Vivek,
Service builder would have also generated code for RFC Exception handling to catch exceptions raised when communication fails between your GW and BE for some reasons.
Handling is done for 1. System Failure 2. Communication Failure & 3. Business Failure;
Put a BP in your DPC or DP_EXT class where exception code is written to check what exactly is has caused communication failure.
Check if that RFC is existing in that destination or not.
For your reference : Code would be something like this. Put BP here and check the problem.
* Error and exception handling
IF lv_subrc <> 0.
* Execute the RFC exception handling process
me->/iwbep/if_sb_dpc_comm_services~rfc_exception_handling(
EXPORTING
iv_subrc = lv_subrc
iv_exp_message_text = lv_exc_msg ).
ENDIF.
Go inside this method and check to get info on what has to be done to resolve issue.
Check carefully what has gone wrong and fix it accordingly.
No need of adding service & deleting as problem is not because of that.
Regards,
Ashwin
Maybe you are looking for
-
Ipad new3 does not appear as device in itunes but ipod touch does
ipad appears in windows computer but not in itunes
-
Macbook Pro makes a faint/light clicking sound.
I just recently purchased my macbook pro and over the last week, I noticed a light/fint clicking sound on the right side of the keyboard. I do not think it is the hard drive because it has not been slow or lagging or anything else and I verified the
-
Considering Airport Express purchase, but have some questions...
Hi people. As per title. I'm considering purchasing this in the near future, but although i understand how it works, i just have a few questions... 1) The unit has a USB port correct? I have an external HD & DVD drive, scanner and printer aswell as m
-
Fail Over and Redundancy with UCCE 7.5
I have a customer that is installing UCCE and they want to run side A and side B in stand alone if the visable and private network are both down.. Based on the SRND it states the system looks at the PG with the most active connections and takes over
-
I would like to plot my data, being read from a daq board.
The data should not move off the graph, as i would like to be able to see the whole graph from start, to current. The x-axis would be 24 points, indicating each hour of the day, and the y-axis would be from 0 to 40. what type of graph do i use and ho