Calling Webservice defined in SAP R/3 in Flex builder using mx:Webservice
Hi All,
I am calling R/3 webservices in Flex builder using <mx:webservice> tag. but the wsdl is not accepting additional parameters like &, = ....
when I try to run this code Flex builder is generating an error
<mx:WebService id="ws" wsdl="http://localhost.com:8088/sap/bc/srt/rfc/sap/Z_SIMPLE_TEST_WS?<b>sap-client=030</b>&wsdl<b>=1.1</b>"
useProxy="false"
result="handleResult(event)"
fault="handleFault(event)" showBusyCursor="true" >
and when I remove the <b>sap-client=030&</b> and <b>=1.1</b> from the wsdl, the program gets executed, however SAP is calling client 010 as that is the default client.
I would appreciate if anyone can tell how to pass the parameter sap-client=030 in Flex.
Thanks,
Madhavi
Message was edited by:
Madhavi<b></b>
Message was edited by:
Madhavi
its because of the & sign. instead use it like below it will work.
Z_SIMPLE_TEST_WS?sap-client=030&emp;wsdl=1.1
in the above line replace 'e' in emp with 'a' (amp)
Raja
Similar Messages
-
Need information about WebServices available in SAP
Hi
I have a .Net application and SAP R/3 ECC 5.0.. I want to communicate between SAP R/3 and .NET using webservices. For example if i create a sales order in .Net application it has to store in SAP R/3 ECC5..0 using webServices. Are there any webServices provided by SAP. If yes please tell me those webservices provided by SAP
Please help me how to do this
Best Regards
Ravi Shankar BHi
I hope you may get some useful information from this link.
http://www.microsoft-sap.com/default.aspx
regards
Srinivas -
How to Developed user defined functions to call function modules in SAP R/3
how to Develope user defined functions to call function modules in SAP R/3 system
Hello Raja,
Go through this V.imp Link...
http://download.oracle.com/docs/cd/B10464_05/integrate.904/b10408/rfc.htm
Steps to crate FM..
Follow these steps..
Go to the T: code SE37
First You Create Function Group
On That u specify
Function Group Name..............
Short Text..............................
save...
Go to SE 37
Specify the Function Module Name: Eg: Z_Bapi_Materialmaster
Short Text.......
Save...
Next Go to Attributes..
Select Radio button : Remote enabled model
Go to Parameters..
Click Import...
Give Parameter Type Associate type S.t
next Click Export...
Give Parameter Type Associate type S.t
Next Click Tables Button..
Specify tables..
Next click source code button..
Write Source code here..
Eg : Select statements Etc..
Finally we should be select the Radio button Enable remorely
https://www.sdn.sap.com/irj/sdn/wiki?path=/pages/viewpage.action?pageId=39728
https://www.sdn.sap.com/irj/sdn/wiki?path=/display/abap/bapi%2bstep%2bby%2bstep
Re: User Defined Functions Tutorials
Hope this information is useful to you..
Thanks ,
Satya Kumar.. -
Webservice & SSO in SAP portal
Hi,
I have created a webservice with basic authentification in my ABAP SAP backend.
Now I like to use this webservice at my Java Web Dynpro application in SAP Portal. SSO (or is it SAP Logon-Ticket?) for the portal is set up correctly. I tested it with a SAP transaction iView that now doesn't need an addition logon.
In the Web Dynpro application I added the webservice as a model.
At project properties a also added tcsecwssec~service in the "Service references" tab.
If I manually add username/pw the webservice works fine.
._setUser("user");
._setPassword("pw123456");
But I like to use Single Sign On (SSO) for calling the webservice. How can I reach this?
I also searched the Forum but none of the tested workarounds worked for me.
Calling the webservices results in this exception:
Service call exception; nested exception is: com.sap.engine.services.webservices.jaxrpc.exceptions.InvalidResponseCodeException: Invalid Response Code: (401) Unauthorized.
Thanks a lot.
Henningok, I found the solution on my own.... it's easy :-D
I had to define a HTTP destination for my webservice in Visual Administrator:
(Services -> Destionations -> HTTP)
Then only add the destination in the custom controller:
setHTTPDestinationName("ZDEMO_SERVICE");
Henning -
How to call a SAP service from adobe flex
Hi experts,
I need to call a webservice create from SAP BAPI my URL is: http://xxxxxxxxx:8000/sap/bc/srt/wsdl/bndg_DD90E166ACE1B1F18AD8001B789FF0AD/wsdl11/allinone/ws_policy/document?sap-client=200, with this URL I can test the webservice from WsNavigator.
The operation is ZimrfcVerifOtUbica and the input structure is:
ZimrfcVerifOtUbica
> PiNumeroAlmacen (input parameter)
> PiOTransporte (input parameter)
The output structure is:
ZimrfcVerifOtUbicaResponse
>PoMessage (output parameter)
I've created a view with two inputfield (one to PiNumeroAlmacen, one to PiOTransporte), one button and one label (to put the result value).
but I don't know how to call the WS, I tried with this code:
<mx:WebService id="ZCCONVERTERService"
wsdl="http://xxxxxxxxx:8000/sap/bc/srt/wsdl/bndg_DD90E166ACE1B1F18AD8001B789FF0AD/wsdl11/allinone/ws_policy/document?sap-client=200;" useProxy="false" >
<mx:operation name="ZimrfcVerifOtUbica" resultFormat="e4x">
<mx:request >
<PiNumeroAlmacen>AGR</PiNumeroAlmacen>
<PiOTransporte>01000</PiOTransporte>
</mx:request>
</mx:operation >
</mx:WebService>
and I get this error: [RPC Fault faultString="Could not load WSDL" faultCode="Server.NoServicesInWSDL" faultDetail="No <wsdl:service> elements found in WSDL at ."].
I tried with actionscript and runtime library but I get this error: java.lang.Exception: Unsupported element in WSDL file: UnknownExtensibilityElement
I tried put in Data--> Import Web Service and I put the URL and I get Unable to load the WSDL. Specify another URI.
Other thing is for this webservice I've created a logic destination, and this webservice is used in a webdynpro aplication and works correctly. But now I need to use the same webservice in flex.
Could you help me to call to this webservice?
Thanks in advance.
JoseI have could do it, but now I'm trying to do the same with a SAP standard service.
Any idea?
Regards,
Jose -
Dear All,
How can we call web service from SAP?
Thanks in Advance,
RamanaHI kcr,
pls see this link
http://****************/Tutorials/Others/ValidateEmailID/Webservice.htm
write this program
REPORT zvalidate_email.PARAMETERS: p_mail(100) LOWER CASE. " E-Mail id to be verifiedDATA: http_client TYPE REF TO if_http_client .DATA: w_string TYPE string ,
w_result TYPE string ,
r_str TYPE string .DATA: result_tab TYPE TABLE OF string.START-OF-SELECTION .
CLEAR w_string .
CONCATENATE
'http://www.webservicex.net/ValidateEmail.asmx/IsValidEmail?Email=' p_mail
INTO
w_string . CALL METHOD cl_http_client=>create_by_url
EXPORTING
url = w_string
IMPORTING
client = http_client
EXCEPTIONS
argument_not_found = 1
plugin_not_active = 2
internal_error = 3
OTHERS = 4. CALL METHOD http_client->send
EXCEPTIONS
http_communication_failure = 1
http_invalid_state = 2. CALL METHOD http_client->receive
EXCEPTIONS
http_communication_failure = 1
http_invalid_state = 2
http_processing_failed = 3.
CLEAR w_result .
w_result = http_client->response->get_cdata( ). REFRESH result_tab .
SPLIT w_result AT cl_abap_char_utilities=>cr_lf INTO TABLE result_tab . READ TABLE result_tab INTO r_str INDEX 2.
IF r_str+44(1) = 't'.
WRITE:/ 'Valid email address'.
ELSE.
WRITE:/ 'Invalid email address'.
ENDIF.Output:
thanks
karthik -
How do i call web services from SAP ABAP
Hello,
Ian working with .net team. they are using sap .net Connector to connect SAP. But my job is In SAP side when Purchase Requisition is created, I have to call web services from ABAP and i have to pass the Purchase Requisition number to web service(.net Program). Please help me how to call web services from ABAP and how to pass value. Any one help me with example.
Thanks
RaviKumarHi Ravi,
If you can call EJB from ABAP and from EJB call Web service which you want to call. I am giving code to write in EJB business method processFunction.
public void processFunction(Function function) {
IRepository repository;
repository = new Repository("TestRepository");
JCO.MetaData fmeta = new JCO.MetaData("ZTEST_EJB");
fmeta.addInfo("REQUTEXT", JCO.TYPE_CHAR, 255, 0, 0,
JCO.IMPORT_PARAMETER, null);
fmeta.addInfo("ECHOTEXT", JCO.TYPE_CHAR, 255, 0, 0,
JCO.EXPORT_PARAMETER, null);
fmeta.addInfo("RESPTEXT", JCO.TYPE_CHAR, 255, 0, 0,
JCO.EXPORT_PARAMETER, null);
repository.addFunctionInterfaceToCache(fmeta);
JCO.ParameterList input =
function.getImportParameterList();
JCO.ParameterList output =
function.getExportParameterList();
JCO.ParameterList tables =
function.getTableParameterList();
if (function.getName().equals("ZTEST_EJB")) {
output.setValue(input.getCharArray("REQUTEXT"),"ECHOTEXT");
output.setValue("This is a response " + table.getString("E_NAME") +" " + output.getName(1), "RESPTEXT");
else if (function.getName().equals("STFC_STRUCTURE")) {
JCO.Structure sin = input.getStructure("IMPORTSTRUCT");
JCO.Structure sout = (JCO.Structure)sin.clone();
try {
System.out.println(sin);
catch (Exception ex) {
System.out.println(ex);
output.setValue(sout,"ECHOSTRUCT");
output.setValue("This is a response from Example5.java","RESPTEXT");
}//if
Here REQUTEXT, ECHOTEXT are import parameter and RESPTEXT is the Export parameter of Function module ZTEST_EJB in SAP.
Here from this bisuness method you can call web service which you want and give back the result of webservice to ABAP F.M.
Regards,
Bhavik -
Calling WebServices using Flex Builder
Hello,
I want to use a WebService in the Flex Builder. I first defined the WebService:
<mx:WebService id="test" wsdl="http://ld9030.wdf.sap.corp:50050/sap/bc/srt/rfc/sap/ZTP_TEST4?wsdl" result="log(event)" showBusyCursor="true">
I have 2 importing parameters in the WebService (IText and IText2).
But in the log-method, I cannot access these parameters:
private function log(event:ResultEvent):void {
var test1 = event.result.IText;
Do you know, how I can access the import parameters?
Please find attached the wsdl definition.
Thanks,
Thomas
<?xml version="1.0" encoding="utf-8" ?>
- <wsdl:definitions targetNamespace="urn:sap-com:document:sap:soap:functions:mc-style" xmlns:http="http://schemas.xmlsoap.org/wsdl/http/" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:tns="urn:sap-com:document:sap:soap:functions:mc-style" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
- <wsdl:types>
- <xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:tns="urn:sap-com:document:sap:soap:functions:mc-style" targetNamespace="urn:sap-com:document:sap:soap:functions:mc-style" elementFormDefault="unqualified" attributeFormDefault="qualified">
- <xsd:element name="TpTest">
- <xsd:complexType>
- <xsd:sequence>
<xsd:element name="IFlag" type="xsd:string" />
<xsd:element name="IFlag2" type="xsd:string" />
</xsd:sequence>
</xsd:complexType>
</xsd:element>
- <xsd:element name="TpTestResponse">
- <xsd:complexType>
- <xsd:sequence>
<xsd:element name="EText" type="xsd:string" />
<xsd:element name="EText2" type="xsd:string" />
</xsd:sequence>
</xsd:complexType>
</xsd:element>
</xsd:schema>
</wsdl:types>
- <wsdl:message name="TpTest">
<wsdl:part name="parameters" element="tns:TpTest" />
</wsdl:message>
- <wsdl:message name="TpTestResponse">
<wsdl:part name="parameters" element="tns:TpTestResponse" />
</wsdl:message>
- <wsdl:portType name="ZTP_TEST4">
- <wsdl:operation name="TpTest">
<wsdl:input message="tns:TpTest" />
<wsdl:output message="tns:TpTestResponse" />
</wsdl:operation>
</wsdl:portType>
- <wsdl:binding name="ZTP_TEST4SoapBinding" type="tns:ZTP_TEST4">
<soap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http" />
- <wsdl:operation name="TpTest">
<soap:operation soapAction="" />
- <wsdl:input>
<soap:body use="literal" />
</wsdl:input>
- <wsdl:output>
<soap:body use="literal" />
</wsdl:output>
</wsdl:operation>
</wsdl:binding>
- <wsdl:service name="ZTP_TEST4Service">
- <wsdl:port name="ZTP_TEST4SoapBinding" binding="tns:ZTP_TEST4SoapBinding">
<soap:address location="http://us4419.wdf.sap.corp:50050/sap/bc/srt/rfc/sap/ZTP_TEST4?sap-client=000" />
</wsdl:port>
</wsdl:service>
</wsdl:definitions>You can try putting the URL in a var as the next example:
private var wsdl:String = "http://sapbdo5.bdo-argentina.com:8002/sap/bc/srt/rfc/sap/ZVER_TABLA?wsdl=1.1";
private var wsdl2:String = "http://sapbdo5.bdo-argentina.com:8002/sap/bc/srt/rfc/sap/ZVER_TABLA?sap-client=600&wsdl=1.1";
[Bindable] private var datos:ArrayCollection;
private function retrieve_data():void{
//ws.loadWSDL(wsdl);
ws.loadWSDL(wsdl2);
ws.ZVER_TABLA(txt.text);
private function handleError(ev:Event):void{
Alert.show("Se produjo un error");
private function handleResult(ev:ResultEvent):void{
datos = ev.result.DATA;
]]>
</mx:Script>
<mx:WebService id="ws" showBusyCursor="true" makeObjectsBindable="true">
<mx:operation name="ZVER_TABLA" fault="handleError(event)"
result="handleResult(event)"/>
</mx:WebService>
<mx:TextInput id="txt" enter="retrieve_data()" x="10" y="10"/>
<mx:Button label="Ver datos" click="retrieve_data()" x="178" y="10"/>
<mx:DataGrid id="dtGrid" horizontalScrollPolicy="auto" dataProvider=""
verticalScrollPolicy="auto" right="10" bottom="10" top="40" left="10"
visible="false"/> -
Can we call function module in sap script
hi
can we call function module in sap script
i want to use function module HR_TMW_GET_EMPLOYEE_NAME in sapscript
to get Empname by using personal no
pernr no is coming from bseg-pernr table
so how i can use it .
please help me
thanks in advanced.hi,
You can use like this:
PERFORM FUNCTION_MODULE IN PROGRAM SUBROUTINE_POOL
USING &FIELD1&
USING &FIELD2&
CHANGING &FIELD3&
ENDPERFORM.
where function_module is the func. module name defined in program SUBROUTINE_POOL , field1 n field2 are the fields to be passed, and field3 is the value which you want to display...
You have to read field1 & field2 in the pool, process them & get the value of field to be output.
Reward helpful answers.
Regards,
SIddhesh Sanghvi. -
Is there a BADI to call custom defined fields in Project Systems (PS)
Hi,
Is there a BADI to call custom defined fields in Project Systems (PS)
The business process is as under:
SRM MDM product catalog is called from PS applcation in ECC using transaction code CJ20N.
Standard fields like description, qty, price etc are displayed and transfered to the PS application.
The requirement is in addition to above mentioned fields, need to display
custom defined (CUST_FIELD1 to CUST_FIELD5) fields and subsequently to be transfered to the PS application.
Pls provide help or inputs.
Thanks,Hi,
There is customizing in the PS side. PS -> Material-? *(OCI) -> Convert HTML to SAP Fields
Regards,
Masa -
Using Synchronous webservice without using SAP XI
Hi,
I have a requirement of wherein which my client has provided me a dot net webservice which needs to be consumed in SAP R/3 using which i have to build an interface between SAP R/3 and the legacy system. This interface needs to be synchronous in nature.
Please let me know how to handle this in ABAP and is this possible without using SAP XI / PI.
Step 1:
SAP r/3 ( sends data )------> (Webservice) Legacy system
Step 2:
(Webservice) Legacy system -
> SAP R/3 (recives response from legacy system)
Regards
JoelHi Joel,
You can use the webservie (SOAP or WS[if it is PI7.1server] adapter).
By calling the webservice from the ABAP.
http://help.sap.com/saphelp_srm40/helpdata/EN/2d/64d023e74911d6b2e400508b6b8a93/frameset.htm
or by using PI also it is possible
http://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/c00ca32e-f991-2b10-f5be-97114bd2b08f?quicklink=index&overridelayout=true
Read page no 26th onwards.
> Step 1:
> SAP r/3 ( sends data )------> (Webservice) Legacy system
you can use Proxy to PI to SOAP/WS scenario.
http://help.sap.com/saphelp_nw04/helpdata/en/29/5bd93f130f9215e10000000a155106/frameset.htm
> Step 2:
> (Webservice) Legacy system -
> SAP R/3 (recives response from legacy system)
you can use SOAP to PI to Proxy scenario.
http://help.sap.com/saphelp_nw2004s/helpdata/en/8e/464442c1a1c253e10000000a1550b0/content.htm (For SOAP)
/people/siva.maranani/blog/2005/04/03/abap-server-proxies (for proxy)
Regards
Ramesh -
How to call a subroutine from sap script
hi friends,
Can anybody tell me How to call a subroutine from sap script .
thanks n regards .
Maheshhi..
Calling ABAP Subroutines: PERFORM
You can use the PERFORM command to call an ABAP subroutine (form) from any program, subject to the normal ABAP runtime authorization checking. You can use such calls to subroutines for carrying out calculations, for obtaining data from the database that is needed at display or print time, for formatting data, and so on.
PERFORM commands, like all control commands, are executed when a document is formatted for display or printing. Communication between a subroutine that you call and the document is by way of symbols whose values are set in the subroutine.
The system does not execute the PERFORM command within SAPscript replace modules, such as TEXT_SYMBOL_REPLACE or TEXT_INCLUDE_REPLACE. The replace modules can only replace symbol values or resolve include texts, but not interpret SAPscript control commands.
Syntax in a form window:
/: PERFORM <form> IN PROGRAM <prog>
/: USING &INVAR1&
/: USING &INVAR2&
/: CHANGING &OUTVAR1&
/: CHANGING &OUTVAR2&
/: ENDPERFORM
INVAR1 and INVAR2 are variable symbols and may be of any of the four SAPscript symbol types.
OUTVAR1 and OUTVAR2 are local text symbols and must therefore be character strings.
The ABAP subroutine called via the command line stated above must be defined in the ABAP report prog as follows:
FORM <form> TABLES IN_TAB STRUCTURE ITCSY
OUT_TAB STRUCTURE ITCSY.
ENDFORM.
The values of the SAPscript symbols passed with /: USING... are now stored in the internal table IN_TAB . Note that the system passes the values as character string to the subroutine, since the field Feld VALUE in structure ITCSY has the domain TDSYMVALUE (CHAR 80). See the example below on how to access the variables.
The internal table OUT_TAB contains names and values of the CHANGING parameters in the PERFORM statement. These parameters are local text symbols, that is, character fields. See the example below on how to return the variables within the subroutine.
From within a SAPscript form, a subroutine GET_BARCODE in the ABAP program QCJPERFO is called. Then the simple barcode contained there (First page, Next page, Last page) is printed as local variable symbol.
Definition in the SAPscript form:
/: PERFORM GET_BARCODE IN PROGRAM QCJPERFO
/: USING &PAGE&
/: USING &NEXTPAGE&
/: CHANGING &BARCODE&
/: ENDPERFORM
/ &BARCODE&
Coding of the calling ABAP program:
REPORT QCJPERFO.
FORM GET_BARCODE TABLES IN_PAR STUCTURE ITCSY
OUT_PAR STRUCTURE ITCSY.
DATA: PAGNUM LIKE SY-TABIX, "page number
NEXTPAGE LIKE SY-TABIX. "number of next page
READ TABLE IN_PAR WITH KEY PAGE.
CHECK SY-SUBRC = 0.
PAGNUM = IN_PAR-VALUE.
READ TABLE IN_PAR WITH KEY NEXTPAGE.
CHECK SY-SUBRC = 0.
NEXTPAGE = IN_PAR-VALUE.
READ TABLE OUT_PAR WITH KEY BARCODE.
CHECK SY-SUBRC = 0.
IF PAGNUM = 1.
OUT_PAR-VALUE = |. "First page
ELSE.
OUT_PAR-VALUE = ||. "Next page
ENDIF.
IF NEXTPAGE = 0.
OUT_PAR-VALUE+2 = L. "Flag: last page
ENDIF.
MODIFY OUT_PAR INDEX SY-TABIX.
ENDFORM.
regards,
veeresh -
Calling perl script from SAP system
Hi all,
I would like to call script from a SAP system. How many ways I can do that. Please guide me.
Thanks!In transaction SM69, you can define an external command. This command can be a perl script, or anything else executable at the OS level. Once defined, you can execute it with transaction SM49, or by defining a step in a background job to execute an external command, or by calling function module SXPG_CALL_SYSTEM in an abap program.
Cheers,
David. -
Using BAPI as WebService Interface in SAP PI
Hello,
Situation is:
BAPI is imported in SAP PI from SAP R/3 system.
The BAPI will be used for R/3 as Sync.Receiver.
A Web Application should connect to SAP PI with the same message structure for request and response.
So the idea is to publish the BAPI interface as a WSDL for this partner.
But when doing this in Directory SAP PI does not offer BAPIs as Interfaces for WSDL, only message interfaces created
in Repository are offered.
BAPIs are interfaces per definition. So we dont need a message interface to add the BAPI to it.
Maybe this woin t work anyhow with a SAP system.
But how to use the BAPI for a WSDL?
Is it required to create an interface for this purpose and add this one in the Directory WSDL create function?
Best regards
DirkHi Meinhard,
There are more ways to get where you want to go, some are mentioned above.
You can also do the following:
1) From the BAPI you create the Webservice in R3 (as described in the link from pavan kumar)
2) Go to trx SOAMANGER (in R3) and get the URL for the WSDL
3) Import the WSDL in PI as an External Definition (ED)
4) Now you create an INBOUND, synchronous, service interface with the external definition.
5) After saving the SI you can create a matching Outbound service interface (it's a menu option)
Now you can use these service interfaces in the Integration directory.
You can even create an ICO (integrated configuration) provided you use SOAP communication channels.
kr
Robert -
How to call subroutines defined in ABAP program with type S
how to call subroutines defined in ABAP program with type S? can you give an example?
Normal executable program,
REPORT ZTEST_MAIN.
perform sub1 in program ztest_sub.
"you can call using in program addition
Subroutine pool program
PROGRAM ZTEST_SUB.
form sub1.
endform.
Maybe you are looking for
-
HTTP Adapter Issue - ATTRIBUTE_CLIENT_DEST
Hello Everyone, Just curiou to know if anyone has seen this type of issue before from SXMB_MONI: <?xml version="1.0" encoding="UTF-8" standalone="yes" ?> - <!-- Call Adapter --> - <SAP:Error xmlns:SAP="http://sap.com/xi/XI/Message/30" xmlns:SOAP
-
How to transfer photos from iPad to imac
How to transfer photos from iPad to iMac
-
Report subscription on SQL 2008 AlwaysOn
I work with a ReportServer2012 and the databases are on SQL2012 Always On (cluster Win2008) . I have created a new report with a subscription via email. When the AG-database fails and switch over another node the subscription of the reports fails be
-
Hello, I was wondering how to get around the CS4 not including the batch action of creating contact sheets for printing multiple pictures at once. I can't upload it to my computer, I'm working on a computer I am not the admin of. I remember reading s
-
Can someone access their AOL e-mail on my iPad?
I'm letting my cousin use my iPad for a week while she gives me a break from caring for my elderly Mother who is going through cancer treatment. There is no Internet access or wireless available at my Mom's house and that is why I got an IPad... know