on 10-19-2010 8:00 PM
Hello,
I am very new to SAP and webservices and have an issue with getting a response from a web service I created for a simple function module BAPI_CREATE_TRIP_FROM_DATA. I am getting the following response for the SOAP request from soapUI:
<soap-env:Envelope xmlns:soap-env="http://schemas.xmlsoap.org/soap/envelope/">
<soap-env:Header/>
<soap-env:Body>
<soap-env:Fault>
<faultcode>soap-env:Client</faultcode>
<faultstring xml:lang="en">Dynamic function call failed</faultstring>
<detail>
<n0:DynamicFunctionCallFault xmlns:n0="http://www.sap.com/dynamic-call">
<FunctionName>BAPI_TRIP_CREATE_FROM_DATA</FunctionName>
<ParameterMissingFault>
<DescriptionText>Function call of BAPI_TRIP_CREATE_FROM_DATA failed; the obligatory parameter EMPLOYEENUMBER</DescriptionText>
</ParameterMissingFault>
<Caller>
<Class>CL_SRG_RFC_PROXY_CONTEXT</Class>
<Method>EXECUTE</Method>
<Positions>1</Positions>
</Caller>
</n0:DynamicFunctionCallFault>
</detail>
</soap-env:Fault>
</soap-env:Body>
</soap-env:Envelope>
I am using ECC 6.0 with GUI 7.10. soapUI is v3.5.1.
What is hard to find also is the purpose of the class / method mentioned ... nothing on googling either. All the errors seem to be on the DECODE method of the same class which is to do with serialization error, my issue is with the EXECUTE method.
Hi everybody,
I don't know whether you have solved this issue or not. I've found out the cause and a workaround to avoid the error.
As the error description says, the problem is in the Employeenumber field. The BAPI_CREATE_TRIP_FROM_DATA FM has the same name both for an input and an output parameter. Once you create the WS, only one descriptor remains in de WSDL and the FM is called wrongly.
To avoid this problem I have encapsulated the standard FM BAPI_CREATE_TRIP_FROM_DATA into a ZBAPI_CREATE_TRIP_FROM_DATA that hasn't got the output parameters employeenumber and tripnumber. Once you create the WS out of this FM you won't get the error.
This is the code for the FM:
FUNCTION zbapi_trip_create_from_data.
*"----------------------------------------------------------------------
*"*"Interfase local
*" IMPORTING
*" VALUE(EMPLOYEENUMBER) LIKE BAPIEMPL-PERNR
*" VALUE(FRAMEDATA) LIKE BAPITRMAIN STRUCTURE BAPITRMAIN
*" VALUE(STATUS) LIKE BAPITRVSTA STRUCTURE BAPITRVSTA OPTIONAL
*" VALUE(BATCH_SESSION_NAME) LIKE APQI-GROUPID OPTIONAL
*" VALUE(CHANGE) LIKE BAPITRVHIS STRUCTURE BAPITRVHIS OPTIONAL
*" VALUE(BATCH_INPUT_ONLY) LIKE BAPITRVXXX-BOOLEAN OPTIONAL
*" EXPORTING
*" VALUE(RETURN) LIKE BAPIRETURN STRUCTURE BAPIRETURN
*" TABLES
*" RECEIPTS STRUCTURE BAPITRVREC OPTIONAL
*" ADDINFO STRUCTURE BAPITRADDI OPTIONAL
*" ADVANCE STRUCTURE BAPITRVSCH OPTIONAL
*" TEXT STRUCTURE BAPITRTEXT OPTIONAL
*" MILEAGE STRUCTURE BAPITRVMIL OPTIONAL
*" STOPOVER STRUCTURE BAPITRVSTO OPTIONAL
*" DEDUCTIONS STRUCTURE BAPITRVDED OPTIONAL
*" TRANSPORT STRUCTURE BAPITRVTRN OPTIONAL
*" COSTDIST_TRIP STRUCTURE BAPITRVCOT OPTIONAL
*" COSTDIST_STOP STRUCTURE BAPITRVCOS OPTIONAL
*" COSTDIST_RECE STRUCTURE BAPITRVCOR OPTIONAL
*" COSTDIST_MILE STRUCTURE BAPITRVCOM OPTIONAL
*" RECEIPTS_JURCODES STRUCTURE BAPIJURCODE OPTIONAL
*"----------------------------------------------------------------------
DATA: employeenumber_out LIKE bapiempl-pernr,
tripnumber_out LIKE bapitrip-tripno.
CALL FUNCTION 'BAPI_TRIP_CREATE_FROM_DATA'
EXPORTING
employeenumber = employeenumber
framedata = framedata
status = status
batch_session_name = batch_session_name
change = change
batch_input_only = batch_input_only
IMPORTING
return = return
employeenumber = employeenumber_out
tripnumber = tripnumber_out
TABLES
receipts = receipts
addinfo = addinfo
advance = advance
text = text
mileage = mileage
stopover = stopover
deductions = deductions
transport = transport
costdist_trip = costdist_trip
costdist_stop = costdist_stop
costdist_rece = costdist_rece
costdist_mile = costdist_mile
receipts_jurcodes = receipts_jurcodes.
ENDFUNCTION.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi guys,
Could you sort this issue out ?
I'm having the same issue, employeenumber is valid in SAP HCM filled in the soap xml request and yet I'm getting this error message (missing mandatory field employeenumber)...
Thanks.
Br,
-Omar.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Complete SOAP Request:
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/">
<soapenv:Body>
<urn:ZbapiTripCreateFromData xmlns:urn="urn:sap-com:document:sap:soap:functions:mc-style">
<Employeenumber>00001000</Employeenumber>
<Framedata>
<DepDate>2010-11-11</DepDate>
<DepTime>02:00:00</DepTime>
<ArrDate>2010-11-12</ArrDate><ArrTime>02:00:00</ArrTime>
<Customer>Client</Customer>
<Location>Edison</Location>
<Country>US</Country>
<Ort01>2035 Lincoln Hwy</Ort01>
</Framedata>
</urn:ZbapiTripCreateFromData></soapenv:Body>
</soapenv:Envelope>
I looked at one option: putting a wrapper around the BAPI itself and changing the type of 'Employeenumber' in the importing to a more common data type such as Char8 to see if it was a serialization error. That still gives me this response:
<soap-env:Envelope xmlns:soap-env="http://schemas.xmlsoap.org/soap/envelope/">
<soap-env:Header/>
<soap-env:Body>
<soap-env:Fault>
<faultcode>soap-env:Client</faultcode>
<faultstring xml:lang="en">Dynamic function call failed</faultstring>
<detail>
<n0:DynamicFunctionCallFault xmlns:n0="http://www.sap.com/dynamic-call">
<FunctionName>ZBAPI_TRIP_CREATE_FROM_DATA</FunctionName>
<IllegalTypeFault>
<DescriptionText>The function call of ZBAPI_TRIP_CREATE_FROM_DATA failed; a field may have been assigned to the parameter EMPLOYEENUMBER whose type is not compatible with this parameter</DescriptionText>
</IllegalTypeFault>
<Caller>
<Class>CL_SRG_RFC_PROXY_CONTEXT</Class>
<Method>EXECUTE</Method>
<Positions>1</Positions>
</Caller>
</n0:DynamicFunctionCallFault>
</detail>
</soap-env:Fault>
</soap-env:Body>
</soap-env:Envelope>
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I am providing Employee Number in the right format in the Soap request as:
<Employeenumber>00002000</Employeenumber>
Inspite of this I get the same error in the response. It works perfectly when I test the FM in the SE37 transaction. Any suggestions?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
You are right, I also created same service and even though supplying correct data service is throwing exception:
I found that datatype of Employeenumber is correct:
- <xsd:simpleType name="numeric8">
- <xsd:restriction base="xsd:string">
<xsd:maxLength value="8" />
<xsd:pattern value="\d*" />
</xsd:restriction>
</xsd:simpleType>
Need to investigate further.
Regards,
Gourav
Hi guys,
I'm facing the similar issue. Just wante to add up some more points.
Upon analysis, I could find that this is because of the same name given to the 'Import' and 'Export' variables in the BAPI/Function Modules. These values are somehow not being interpreted by the Webservies because of the similar name.
Still investigating on how to resolve this.
Regards,
Naresh
Error message says, you didn't provide 'Employee Number' for a necessary parameter.
Check your FM source code for any missing parameter.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
91 | |
10 | |
10 | |
9 | |
9 | |
7 | |
6 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.