Quantcast
Channel: SCN: Message List - Service-Oriented Architecture (SOA) and SAP
Viewing all articles
Browse latest Browse all 1056

Re: Web service for CREATE_TRIP_DATA

$
0
0

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.


Viewing all articles
Browse latest Browse all 1056

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>