ERP Sap REST

Documenti Condivisi:

api_s4_production_order.pdf

Tabella di conversione campi SAP (java) con il modello REST :

oee_s4_integration_mapping.xlsx

il protocollo Rest utilizza Oauth2 quindi le trasmissioni sono attraverso un token, in questo caso và mandato nella header; è di tipo Bearer quindi prevede una chiave fissa "Bearer" prima del Token

il Token ha una validità descritta nel campo expire_in al momento dell'arrivo del token:

la curl per richiedere il token ha questa forma:

#token curl -X POST -H "Content-Type: application/x-www-form-urlencoded" -d "grant_type=client_credentials&client_id=API&client_secret=SECRET" https://franke.prod.apimanagement.eu10.hana.ondemand.com/OAuthService/GenerateToken #rueck curl --request GET 'https://franke.prod.apimanagement.eu10.hana.ondemand.com/a88a/NEXTOEE/API_PROD_ORDER/ProductionOrder/1000001' --header 'APIKey: API' --header 'Authorization: Bearer TOKEN' #falshback curl --request POST 'https://franke.prod.apimanagement.eu10.hana.ondemand.com:443/a88a/NEXTOEE/API_PROD_ORDER/ConfirmProductionOrder/1000007' --header 'APIKey: API' --header 'Authorization: Bearer TOKEN' --header 'Content-Type: application/json' --data-raw '{ "ConfirmationDate": "2022-01-24T00:00:00","ManufacturingOrder": "1000007", "YieldQuantity": "0", "ProductionUnit": "PC", "FinalConfirmatio

Utilizzare Postman per il debug; e caricare prendere le curl

<?xml version="1.0" encoding="UTF-8"?> <!-- Document : etnconfig.xml Created on : 2 febbraio 2005, 18.30 Author : BERGANTINO Nicola Description: Purpose of the document follows. --> <xnetagents> <mtp name="nome_mtp" > <netmtp name="maganet" host="127.0.0.1" port="5151" /> </mtp> <super_agents> <!-- <param name="tmmax" value="7000" /> --> <agent lib="/usr/lib/libiasupag.so" create="agentXNet" live="1" name="xnet"> <param name="ipaddr" value="ANY" /> <param name="port" value="6161" /> </agent> </super_agents> <agents> <!-- Agente gestiore della comunicazione tra framework --> <agent lib="/usr/lib/libiautiag.so" create="agentNetMtp" live="1" name="netmtp"> <param name="class0" value="agdb" /> <param name="askp10" value="1" /> <param name="dirask0" value="1" /> <param name="tellp10" value="2" /> <param name="askout0" value="2" /> <param name="class1" value="tpevo" /> <param name="askp11" value="2" /> <!--1=PKT_SEM 2=REC_SEM 0=NONE_SEM --> <param name="dirask1" value="1" /> <param name="askout1" value="2" /> <param name="tellp11" value="2" /> <param name="dirtell1" value="0" /> <param name="class2" value="ctrlpc" /> <param name="askp12" value="0" /> <!--1=PKT_SEM 2=REC_SEM 0=NONE_SEM --> <param name="dirask2" value="0" /> <param name="askout2" value="2" /> <param name="tellp12" value="2" /> <param name="dirtell2" value="0" /> <param name="class3" value="tell_p1_rec" /> <param name="tellp13" value="2" /> <param name="class4" value="tell_p1_rec_ask_p12_pkt_out_pkt" /> <param name="tellp14" value="2" /> <param name="askp14" value="1" /> <param name="askp24" value="1" /> <param name="askout4" value="1" /> <param name="class5" value="tell_p12_pkt_ask_p12_pkt_out_rec" /> <param name="tellp15" value="1" /> <param name="tellp25" value="1" /> <param name="askp15" value="1" /> <param name="askp25" value="1" /> <param name="askout5" value="2" /> <param name="class6" value="tell_p1_rec_ask_out_rec" /> <param name="tellp16" value="2" /> <param name="askout6" value="2" /> <param name="class7" value="ask_out_pkt" /> <param name="askout7" value="1" /> <param name="class8" value="tell_p1_rec_ask_p1_pkt_out_rec" /> <param name="tellp18" value="2" /> <param name="askp18" value="1" /> <param name="askout8" value="2" /> <param name="class9" value="tell_p1_rec_ask_p1_rec_out_pkt" /> <param name="tellp19" value="2" /> <param name="askp19" value="2" /> <param name="askout9" value="1" /> <param name="class10" value="tell_p12_rec_ask_p1_rec_out_rec" /> <param name="tellp110" value="2" /> <param name="tellp210" value="2" /> <param name="askp110" value="2" /> <param name="askout10" value="1" /> <param name="class11" value="tell_p12_pkt_ask_p1_rec_out_rec" /> <param name="tellp111" value="1" /> <param name="tellp211" value="1" /> <param name="askp111" value="2" /> <param name="askout11" value="2" /> <param name="class12" value="ask_p1_rec_out_rec" /> <param name="askp112" value="2" /> <param name="askout12" value="2" /> <param name="class13" value="tell_p1_rec_ask_p1_rec_out_rec" /> <param name="tellp113" value="2" /> <param name="askp113" value="2" /> <param name="askout13" value="2" /> <param name="tmwait" value="7200000" /> <param name="ipaddr" value="ANY" /> <param name="port" value="5161" /> </agent> <!-- Agente che gestisce i servizi legati al database --> <agent lib="/usr/lib/libiautiag.so" create="agentDb" live="1" name="tpevodb"> <param name="libdb" value="/usr/lib/libpgdb.so" /> <param name="libfunc" value="CDb_Create" /> <param name="serverdb" value="127.0.0.1" /> <param name="dbname" value="andon" /> <param name="usr" value="postgres" /> <param name="pwd" value="HMtrs9hY" /> <param name="ipnume" value="127.0.0.1" /> <param name="portnume" value="5002" /> </agent> <!-- Agente che si occupa del carico a magazzino dei lotti --> <agent lib="/usr/lib/libgtrace.so.0.0.0" create="agentSimpMovi" live="0" name="simpmovi"> <param name="agdb" value="tpevodb" /> <param name="agdepo" value="depo" /> <param name="aglotto" value="lotto" /> <param name="causca" value="SCAPR" /> <param name="enabnpsub" value="0" /> <param name="pparam" value="0" /> <param name="tm" value="1000" /> </agent> <!--Agente gestisce l'inserimento degli ordini di produzione, degli articoli e del tempo ciclo dei prodotti--> <agent lib="/usr/lib/libgtrace.so.0.0.0" create="agentInsOp" live="1" name="insop"> <param name="agdb" value="tpevodb" /> <param name="agsm" value="simpmovi" /> </agent> <agent lib="/usr/lib/libniserp.so.0.0.0" create="agentRestSAP" live="1" name="sapnis"> <param name="agdb" value="tpevodb" /> <param name="agop" value="insop" /> <param name="urlpref" value="https://franke.prod.apimanagement.eu10.hana.ondemand.com" /> <param name="urlget" value="/a88a/NEXTOEE/API_PROD_ORDER/ProductionOrder" /> <param name="urlpost" value="/a88a/NEXTOEE/API_PROD_ORDER/ConfirmProductionOrder" /> <param name="bearer" value="Bearer" /> <param name="api" value="7SggN0ISNOxAaCCckiojO3yRGRAGIrpK" /> <param name="secret" value="hcHcczWs23n3Eku2" /> </agent> </agents> </xnetagents>