суббота, 30 декабря 2017 г.

IDOCs tips & tricks

Link logical system to RFC-destination

 SM59 for RFC destinations and BD54 for logical systems

1. The name of the corresponding RFC destination must be identical to the name of the logical target system.

 2. First, in WE21 - link IDOC port to RFC-destination, then, point receiver port in outbound parameters (WE20).

 

среда, 20 сентября 2017 г.

The next blockbuster is HERE: SAP TM 9.0 maps display

As soon as you started digging SAP Transportation Management (in my case 9.0), you will be very interested in GIS & maps integration and using it in your business scenarios.
Let's review GIS & maps functionality as it is in SAP:
  • Map display - shows maps in SAP Web Dynpro environment
  • GEO-coding - derives the geo coordinates from an address (reverse geocoding is opposite - defines the address from geo coordinates)
  • GEO-routing (including Distance and Duration determination) - builds a route between points and calculate distance and duration of the route
This article will be dedicated mostly to what we can do without ABAP coding.
Let's start from map display, the TM version is 9.0.
For maps and some 3D figures SAP has implemented a special add-on named SAP Visual Business, which must be installed on every client PC. Along with Transportation Management 9.0 you can use only Visual Business 2.0 with Net Weaver Business Client 5.0.

Block 1: Basis and installation pre-requisites

Pre-requisites for map display on a Server - side are:

  • to install SAP_BS_FND -- SAP Business Suite Foundation component (backend installation, SPAM ):
 
  • to activate ENTERPRISE_BUSINESS_FUNCTION FND_VISUAL_BUSINESS in SFW5:

  • switch on map display in SPRO
SAP Transportation Management -- Transportation Management -- Basic Functions  -- Geographical Map -- Define Settings for Geographical Map

Pre-requisites  for map display on the every Client - side are: 

  • install SAP VISUAL BUSINESS 2.0 (media disk 51043596),
    otherwise you'll get an error GAC: Method/property does not exist
  • install certificate  (t-code ACF_WHITELIST_SETUP or WDR_ACF_WLIST, select certificate ‘VB200’ and press ‘Install Certificate’)

  • optional: install SAP Netweaver Business Client 5.0 (media disk 50131526_6) or you can work with TM functionality without NWBC directly from the Internet Explorer, the link is https://ehp5.tpc.com:8003/sap/bc/nwbc 
    (constant part of URL is highlighted) 
Block 2: Settings for Alpha - map provider
I advise you to pass the procedure of map-customizing having the one map-provider. In SAP documents there are lots of obsolete links, so you can start from those which works and later to configure additional map-providers through the same procedure.
As the Alpha-map provider I advise you to choose HERE.
Later I will try to compare a couple of other map&GIS providers with HERE.
To work with HERE you have to register under the link below (free plan restricted by 15k requests per month).
https://developer.here.com/plans?create=Public_Free_Plan_Monthly&keepState=true&step=account
After registration you will get App Code (token) and App ID.
SAP uses map data represented as tiles and you can find Map Tile API under the link below:
https://developer.here.com/documentation/map-tile/topics/quick-start.html
Having your App Code (token) and App ID on hand you can maintain the URL for the map service.
Map tile URL have the next view:

https://1.base.maps.cit.api.here.com/maptile/2.1/maptile/newest/normal.day/{LOD}/{X}/{Y}/256/png?token=YOUR_APP_CODE&app_id=YOUR_APP_ID

https://2.base.maps.cit.api.here.com/maptile/2.1/maptile/newest/normal.day/{LOD}/{X}/{Y}/256/png?token=YOUR_APP_CODE&app_id=YOUR_APP_ID

https://3.base.maps.cit.api.here.com/maptile/2.1/maptile/newest/normal.day/{LOD}/{X}/{Y}/256/png?token=YOUR_APP_CODE&app_id=YOUR_APP_ID

https://4.base.maps.cit.api.here.com/maptile/2.1/maptile/newest/normal.day/{LOD}/{X}/{Y}/256/png?token=YOUR_APP_CODE&app_id=YOUR_APP_ID

Now you are ready to perform map customizing.
SPRO -- Cross-Application Components -- Processes and Tools for Enterprise Applications -- Visual Business -- Visual Business 2.0 -- Maintain Application Definitions
Step 1 Define Map Product:
 
 
 And assign map tile URL (for better performance used several servers):

Step 2 Define Map Layer Stack:

 And assign Map Product:

 Step 3 Define Application:
 
If you clear all check-boxes, you will get maximum navigation control tools: 
 
 
Assign the Layer Stack:

Having several stacks you can switch between different maps view:


Block 3: Map screens in NWBC
Combinations of applications and screens in NWBC are shown below:

TM_VTC : NWBC -- Planning -- Transportation Cockpit -- Show Map

TM_MDC : NWBC -- Planning -- Transportation Cockpit -- Map (Planning detail quarter)

TM_TNC : NWBC -- Master Data -- Transportation Network  -- Transportation Network Cockpit

GEOMAP_DEMO (web service vbc_geomap_gen2)
 
Block 4: Map providers comparison
There are several map (GIS) providers you can use in SAP and my own opinion about them is expressed below.
 
Google
As I understand, there is no free account to experiment with Google, you must have a Premium account for map display API.
Obtaining an API key:
 
Map tile requests:
 
OpenStreetMap
 
OpenStreetMap (or OSM) it's a free GIS provider been developing by volunteers community, but it looks like it attract more consumers than contributors. Any way, OSM has the most detailed maps.

Map tile common URL:
1 http://a.tile.openstreetmap.org/{LOD}/{X}/{Y}.png
2 http://b.tile.openstreetmap.org/{LOD}/{X}/{Y}.png
3 http://c.tile.openstreetmap.org/{LOD}/{X}/{Y}.png

Comparing to HERE there are more details, lots of Points Of Interest (POI) are on the map (the same place Büschstraße 12 Hamburg 20354 as example):


And in OSM house numbers are not only in the center of the city (the same place Panónska cesta 33 Bratislava 851 04 as example):



Bing
Obtaining an API key:
 
Map tile requests:
 
Map tile common URL:
 
Comparing to HERE there are no house numbers (the same place Büschstraße 12 Hamburg 20354 as example):
 
 
Appendix

Steps to change a map tile URL

In order to change map tile URL for an existing map-provider you need to past it in a dedicated SPRO path:
Cross-Application Components -- Processes and Tools for Enterprise Applications -- Visual Business -- Visual Business 2.0 -- Overwrite Map Server Default URLs
 
 
 
 


You can also like other articles:

SAP Transportation Management
ERP -- TM integration by WSRM (without XI / PI)
Handling deadlines (or Dates) in Delivery and Transportation
SAP Transportation Management 9.0 Installation from scratch
Pricing
How to setup Variant Condition (Price Condition, dependent on the configuration).
IDOCs
Self-Billing and Evaluated Receipt Settlement (ERS) - EDI process
How to set up ORDERS, ORDRSP, DESADV, INVOIC IDOCs interchange in the same system
How to setup loopback connection for IDOC and copy characteristics from 300 to 023 class type
IDOC Data Filtering
How to connect two systems for IDOC interaction
Supply Chain Management
First steps to make SCM Deamand Planning working
SCM liveCache Initializing
ERP <--> SCM integration tricks

вторник, 6 июня 2017 г.

ERP -- TM integration by WSRM (without XI / PI)


Special thanks to Andrey Karepanov
                              and Carlos Pería

Web Service Reliable Messaging (WSRM) provide the connection between systems directly, without XI/PI system.
In my case the general landscape consist of three systems: ERP with EHP5, Transportation Management (TM) 9.0 and SCM, but in the integration two of them - ERP and TM partisipate.
So, the purpose of this article is to take you through the configuration to finally send an Order based transportation requirement (OTR) from the ERP to the TM system.


The basis components looks like this (t-code SPAM):

ERP with EhP5

Netweaver 7.31 with TM 9.0 Add-on

I strongly advise you to have the highest SAP_BASIS level in both systems.

Prerequisites

RFC-destinations
Before following the steps I recommend  to set up RFC destinations between ERP and TM, although it is not clear where it used (after successful WSRM integration I disrupted RFC and it worked anyway) I think RFC destinations participates only in the Core Interface (CIF).

Business function activation
For a TM, ERP, and EWM system, make sure that the business function FND_SOA_REUSE _1
is activated to enable WS/RM usage in these systems.

In TM you need to activate the next business functions:
/BCV/MAIN – FND, Business Context Viewer
/BCV/MAIN_1 – FND, Business Context Viewer 2
FND_VISUAL_BUSINESS – Visual Business
SCM_SAPTM_SCMB_FND – SAP TM-Specific Enhancements in SCM Basis

Block 1. Basic Settings for SAP TM system

Step 1. Defining System Landscape Directory (SLD) Data of Business Systems
In Customizing for SAP TM, choose:
SAP Transportation Management -- Transportation Management Integration -- Define SLD Data of Business Systems



Step 2. Maintaining Business System Groups
In Customizing for SAP TM, choose:
SAP Transportation Management -- SCM Basis -- Integration -- Basic Settings for Creating the System Landscape -- Maintain Business System Group



Step 3. Assigning Logical Systems and Queue Types
In Customizing for SAP TM, choose:
SAP Transportation Management -- SCM Basis -- Integration -- Basic Settings for Creating the System Landscape -- Assign Logical System and Queue Type


Step 4. Activating Queues
In SAP TM, call the QIN scheduler using transaction SMQR and register queue CF*



Block 2. Set up SLD

SLD is located on the Java instance, so you need separate Java server for that.
I think SLD configuration needs are only temporary - it's not necessary during documents interchange.
Related SLD settings consist of two parts:
  • connect your systems to SLD and
  • add systems to SLD
To connect the ABAP system to SLD, you need execute RZ70 from that system. Specify the Host of your Java - instance and service sapgw00:


Maintain SLD access data: t-code SLDAPICUST, point Hostname to Java server and port:



Check list of RFC-destinations: SLD_NUC, SLD_UC, LCRSAPRFC, SAPSLDAPI (type T).

After customizing you can check correctness in t-code SLDCHECK


My SLD - is the part of Solution Manager and configuration performs under the path:

http://solman.mycloudnas.com:50000/webdynpro/dispatcher/sap.com/tc~sld~wd~main/Main


The next steps explain how to add systems to SLD.

Step 1. Add a new technical system (for example - NW7 = the TM system presented)


Step 2. Select the type of technical system you want to create -- Web AS ABAP


Step 3. Specify the Technical System Details (Web AS АВАР Name (SID), Installation Number, Database Host Name)


Step 4. Enter information about the message server and the central application server (Host Name, Message Server Port - parameter rdisp/msserv_internal in RZ10, Instance number)
 
 
 
 Step 5. Optional: Define additional application servers - no other servers for my landscape
 

 


Step 6. Enter at least one client with Logical Client Number 


Step 7. Select products that are installed in this business system (at least one obvious product)

Step 8. Select the role of this business system


Repeat steps 1-8 to add ERP system to SLD.

Block 3. Technical Setup of the Web Services Runtime

All systems participating in the interaction must undergo a Web Services Runtime procedure, for example - NW7 = the TM system presented.

Step 1. Run technical configuration
Run t-code SRT_ADMIN in 000 client with options:


 Step 2. Check the result of the WS runtime
It's also SRT_ADMIN with options:

 

Step 3. Web Services Runtime tuning
On the next screen you can see whether is everything OK. For most points in the "text" column you can "drill-down" for a detailed setup. It's enough to have ticks for 000 and your working client.



Block 4. Central Business Scenario Configuration

Most customizing of this block performs in SOAMANAGER.

Step 1. Configure one system as the central system
You should configure one system as the central system. Use the system with the highest NetWeaver release.
In my case NW7 will be the central system (please refer the scheme at the beginning of the article).

NW7 = ehp5.tpc.com:8002 - central system
ER5 = ehp5.tpc.com:8000 - managed system

In the central system (NW7) select:
Management Connections - Management Connections - Configuration:


 Select "Central system" and save, also enable Connectivity Service:


After a while, the new connection will appear in the list (Existing Connections tab) and main screen title will change to Central SOA Management

 
 

Step 2. Configure managed system(s)
In the managed system (ER5) select:
Management Connections - Configuration and enable Connectivity Service:


At the Maintain New Connection tab populate Hostname, Portnumber, Protocol, Client and Start Setup:


After a succesful configuration you will see two connections in the central system:


And one connection in managed system:


Step 3. Create a Domain in Central System
A domain can only be created in the system which is marked as central system.


If Connections are customized correctly, they will be seen at the Domain Systems screen:


At the Domain screen choose Create


 And specify domain name, priority and description


On the next screen  select systems from the list and specify Authentication Method (User ID/Password):


Step 3. Create a Central Business Scenario ConfigurationChoose create and specify scenario name (only letters).



 On the next screen, under the "Connections" block click "Create":


Select Consumer system = ER5_710, Provider system = NW7_001, Service group = TM_ERP_ORDINT & TM_ERP_ORDINT_SE (TM_ERP* pattern):


Add both Service Groups to the Connections list:


You also can define Service Definitions (Provider Configurations block):


And very important - release your scenario to the managed system, green traffic light will appear if everything is correct:


It is also possible to transfer your settings to managed system through Central Change Processor (Central Administration tab), but in this case it will be all settings, not just scenariou's ones.


I also advise you to ping the scenario ( ), if everything is OK, you will see something like this:


 Another check is Bindings (), and correct result will be like this:


Errors meanings:

Yellow - settings are not transfered to the managed system:



Red - Logon Data Assignments problem, check the existence of the Logon Data profile (Service administration -- Logon Data Management). Logon Data settings should be the same as Domain Authentication. 


Step 4. Setup Matching interfaces in the Managed System
In the managed system choose
Tools -- Matching interfaces


If your Matching Interfaces screen is empty for service groups TM_ERP_ORDINT & TM_ERP_ORDINT_SE like this:



then you should create the appropriate records in the table SMIFHDR for TM_ERP_ORDINT and TM_ERP_ORDINT_SE:


 Then, follow the t-code SMIF and create Matching Interfaces for service groups TM_ERP_ORDINT & TM_ERP_ORDINT_SE

Outbound records for Service Group TM_ERP_ORDINT

TransportationRequestSUITESimulateRequestConfirmation_Out http://sap.com/xi/APPL/Global2
SLO_TransportationRequestSUITERequest_Out http://sap.com/xi/APPL/Global2
CRP_TransportationRequestSUITERequest_Out http://sap.com/xi/APPL/Global2
CRP_TransportationRequestSUITECancellationRequest_Out http://sap.com/xi/APPL/Global2
SLO_TransportationRequestSUITECancellationRequest_Out http://sap.com/xi/APPL/Global2
POP_TransportationRequestSUITERequest_Out http://sap.com/xi/APPL/Global2
POP_TransportationRequestSUITECancellationRequest_Out http://sap.com/xi/APPL/Global2

Inbound records for Service Group TM_ERP_ORDINT

IntracompanyTransportationRequestSimulateRequestConfirmation_In http://sap.com/xi/TMS/Global
IntracompanyTransportationRequestRequest_In http://sap.com/xi/TMS/Global
IntracompanyTransportationRequestRequest_In http://sap.com/xi/TMS/Global
IntracompanyTransportationRequestCancellationRequest_In http://sap.com/xi/TMS/Global
IntracompanyTransportationRequestCancellationRequest_In http://sap.com/xi/TMS/Global
IntracompanyTransportationRequestRequest_In http://sap.com/xi/TMS/Global
IntracompanyTransportationRequestCancellationRequest_In http://sap.com/xi/TMS/Global


Outbound records for Service Group TM_ERP_ORDINT_SE

ODP_TransportationRequestSUITECancellationRequest_Out http://sap.com/xi/APPL/SE/Global
ODP_TransportationRequestSUITERequest_Out http://sap.com/xi/APPL/SE/Global
InboundDeliveryConfirmation_Out_V1 http://sap.com/xi/APPL/SE/Global
IDP_TransportationRequestSUITECancellationRequest_Out http://sap.com/xi/APPL/SE/Global
IDP_TransportationRequestSUITERequest_Out http://sap.com/xi/APPL/SE/Global

Inbound records for Service Group TM_ERP_ORDINT_SE

IntracompanyTransportationRequestCancellationRequest_In http://sap.com/xi/TMS/Global
IntracompanyTransportationRequestRequest_In http://sap.com/xi/TMS/Global
InboundDeliveryConfirmation_In_V1 http://sap.com/xi/TMS/Global
IntracompanyTransportationRequestCancellationRequest_In http://sap.com/xi/TMS/Global
IntracompanyTransportationRequestRequest_In http://sap.com/xi/TMS/Global


Save & Activate and you will see in SOAMANAGER:


Step 5. Setup Logical Port in the Managed System
In the managed system we need to check (or setup) that Logical Port marked as default logical port for every Consumer Proxy.

SOAMANAGER -- Service Administration -- Web Service Configuration  -- Select Service Group (TM_ERP_ORDINT)


And drill-down to the next screen:


Copy Consumer proxy names

CO_PUR_POP_TRANSPORTATION_REQU
CO_PUR_TRQ_SUITEREQUEST
CO_SAPPLCO_SLO_TRANSPORTATION
CO_SLS_CRP_TRANSP_REQUEST
CO_SLS_CRP_TRQ_SUITEREQUEST
CO_SLS_TRQ_SUITEREQUEST
CO_TRQ_SUITE_SIM_REQ

Then return to the selection screen again and select those Consumer proxies:


Jump to every Consumer proxy and check (or setup) Logical Port as the Default:


Repeat steps for TM_ERP_ORDINT_SE Service Group.

After that, you will be able to transfer Order Based Transportation Requirement from ERP to TM system.

Sales Order Output Type TRS0 in ERP system:


SRT_MONI in ERP:


SRT_MONI in TM:



You might also like:

Handling deadlines (or Dates) in Delivery and Transportation
SAP Transportation Management 9.0 Installation from scratch. Part 1: Standalone installation