Download as pdf or txt
Download as pdf or txt
You are on page 1of 29

Public

openSAP:
Manage B2B Scenarios Effectively with SAP
Integration Suite
Exercise Week 2

Marton Luptak, SAP SE


Marco Ertel, SAP SE
Gunther Stuhec, SAP LGD

Public
TABLE OF CONTENTS
0 INTRODUCTION ............................................................................................................................... 3
1 EXERCISE 1: SIMPLE ONBOARDING OF A NEW TRADING PARTNER ..................................... 4
1.1 Create new Trading Partner ............................................................................................................ 4
1.2 Use Agreement Template to create an agreement ..................................................................... 12
1.3 Prepare Simulation Flow and send a message .......................................................................... 16
1.4 Monitor the Scenario ..................................................................................................................... 20
2 EXERCISE 2: CREATE NEW MIG ................................................................................................. 21
3 EXERCISE 3: CREATE NEW MAG ................................................................................................ 24
4 EXERCISE 4: USE NEW MIG AND MAG ...................................................................................... 27

www.sap.com/contactsap

© 2022 SAP SE or an SAP affiliate company. All rights reserved.


No part of this publication may be reproduced or transmitted in any form or for any purpose without the express permission of SAP SE or an SAP affiliate company.

The information contained herein may be changed without prior notice. Some software products marketed by SAP SE and its distributors contain proprietary software components of other software vendors.
National product specifications may vary.

These materials are provided by SAP SE or an SAP affiliate company for informational purposes only, without representation or warranty of any kind, and SAP or its affiliated companies shall not be liable
for errors or omissions with respect to the materials. The only warranties for SAP or SAP affiliate company products and services are those that are set forth in the express warranty statements
accompanying such products and services, if any. Nothing herein should be construed as constituting an additional warranty.

In particular, SAP SE or its affiliated companies have no obligation to pursue any course of business outlined in this document or any related presentation, or to develop or release any functionality
mentioned therein. This document, or any related presentation, and SAP SE’s or its affiliated companies’ strategy and possible future developments, products, and/or platform directions and functionality are
all subject to change and may be changed by SAP SE or its affiliated companies at any time for any reason without notice. The information in this document is not a commitment, promise, or legal obligation
to deliver any material, code, or functionality. All forward-looking statements are subject to various risks and uncertainties that could cause actual results to differ materially from expectations. Readers are
cautioned not to place undue reliance on these forward-looking statements, and they should not be relied upon in making purchasing decisions.

SAP and other SAP products and services mentioned herein as well as their respective logos are trademarks or registered trademarks of SAP SE (or an SAP affiliate company) in Germany and other
countries. All other product and service names mentioned are the trademarks of their respective companies. See www.sap.com/trademark for additional trademark information and notices.

1
0 INTRODUCTION
In this week’s exercises, you will learn how to onboard a new Trading Partner by using the following
capabilities of the Integration Suite:
• Integration Advisor
• Trading Partner Management
• Cloud Integration
To make this session a successful one for all attendees, we recommend a good understanding of data
structures (e. g. IDoc, SOAP, X12 or EDIFACT) along with some understanding of SAP Integration Suite
capability Cloud Integration. The business process we will simulate in this exercise is part of the procure-to-
pay process. The complete procure to pay consists of three transactions:
• Purchase Order Request (Two way transaction)
• Shipment Notification
• Invoice Message
Here we focus on the first transaction.
To make things easier no additional installations (like postman) are necessary. The EDIFACT ORDERS will
be sent from an iflow which acts as a simulator of the Trading Partner. There is also no real S/4HANA
system connected but another iflow which receives the IDoc Orders Message and responds with an
ORDRSP IDoc sent via Process Direct to TPM. After TPM has handled the message again a simulated
Trading Partner receives the ORDRSP message as an EDIFACT message over AS2 and sends the
message to your personal mail inbox that you can verify.
To make exercise 1 easy, you will reuse already defined MIGs and MAGs. In the following exercises you will
then create your own MIG and MAG. You simulate it to check if your mapping creates the expected results to
use it in your transaction.

openSAP: Manage B2B Scenarios Effectively with SAP Integration Suite – Exercise Week 2 3

Public
1 EXERCISE 1: SIMPLE ONBOARDING OF A NEW TRADING PARTNER

1.1 Create new Trading Partner


We have several tenants for the exercises. Please use the tenant booker app and description as explained in
the week 2 as a prerequisite (https://opensaptenantbookerapplication-
ad5b9d48b.dispatcher.hana.ondemand.com/index.html). If you forgot your password, you can restart the
tenant booker app to get again the same password.
To make all entities unique we recommend adding your user id like TradingPartner-P123456 (if your userid is
P123456)

Explanation Screenshot
1. Log on to the Integration
Suite tenant with your
system details provided to
you by the app.

2. Navigate to Design and


select B2B Scenarios.

openSAP: Manage B2B Scenarios Effectively with SAP Integration Suite – Exercise Week 2 4

Public
Explanation Screenshot
3. As you want to onboard a
new Trading Partner
switch to the tab Trading
Partners.

4. Select Create to create a


new Trading Partner.

5. On the following screen,


you need to maintain
general data for the new
trading partner as follows:
Company Name:
TradingPartner-P123456
(with P123456 your
userid)
Company Short Name:
TradingPartnerXX (with
P123456 your user id)
All the other fields are
optional.

Please save the newly


created Trading Partner.

openSAP: Manage B2B Scenarios Effectively with SAP Integration Suite – Exercise Week 2 5

Public
Explanation Screenshot
6. Switch to the Contacts tab
and select Create Contact.

7. On the Contacts tab, you


can add names and
details of persons who are
responsible at the Trading
Partner side.

8. Navigate to the tab


Identifier and select
Create Identifier.

openSAP: Manage B2B Scenarios Effectively with SAP Integration Suite – Exercise Week 2 6

Public
Explanation Screenshot
9. Every Trading Partner
needs at least two
identifiers: one which is
used in the exchange and
a second one which is
used in the S/4 System.
Maintain the first identifier
as follows:
Use Identification
UNEDI_TP_E_P123456
(with P123456 your user
id), the same for the alias,
select Type System
UN/EDIFACT,
and Scheme Duns (Dun &
Bradstreet),
then save the new
identifier.
10. Maintain the second
identifier as follows:
Use Identification O-
P123456 (with P123456
your user id), the same as
Alias,
select Type System SAP
S/4HANA on Premise
IDoc,
and Scheme N/A,
then save the new
identifier.
11. Now in the security tab
you need to add the
partner ID which your
trading partner will use to
send the message. To
make it simpler we use the
same ID as in the step
before.
O-P123456 (with P123456
your user id). Then save it.

12. As the AS2 Partner ID


also need to be pushed to
the Partner directory you
need to activate it by
clicking the activate toggle
button.

openSAP: Manage B2B Scenarios Effectively with SAP Integration Suite – Exercise Week 2 7

Public
Explanation Screenshot
13. The Business Context is
currently optional, but we
need to create a system
where the supported type
system and
communication details
must be maintained.
Navigate to the tab
System and select Create
System.

14. Please add the following


Details:
Name B2B-System-
P123456 (with P123456
your user id), B2B-
System-P123456 (with
P123456 your user id) as
Alias,
Type B2B System,
Purpose Dev
and save the new
system.

openSAP: Manage B2B Scenarios Effectively with SAP Integration Suite – Exercise Week 2 8

Public
Explanation Screenshot
15. Select the beforehand
created system to create
the supported Type
System. On tab Type
System, select Create
Type System.

16. Use UN/EDIFACT and


Version D.02A S3, then
save the new Type
System.

17. Next, you need to


maintain the
communication details.
Switch to tab
Communication and select
Create Communication.

openSAP: Manage B2B Scenarios Effectively with SAP Integration Suite – Exercise Week 2 9

Public
Explanation Screenshot
18. As this Trading Partner
will send an Order via AS2
you need to create an AS2
Sender.
Use in the Security
Configuration Mode Profile
and the AS2 Partner ID
you’ve configured under
the security tab.

19. As the backend will send


an ORDRSP message
back, you also need to
create another
communication as this
should be received by the
Trading Partner (which will
forward it then to you via
mail). To create that, you
need first to find out the url
of the simulated trading
partner on your tenant.
For this first duplicate this
tab to easily switch
between screens, than
navigate to the monitoring
for Integrations and APIs
20. Click on the tile with All.

openSAP: Manage B2B Scenarios Effectively with SAP Integration Suite – Exercise Week 2 10

Public
Explanation Screenshot
21. Search for B2B-Partner-
Simulator and copy the url
with the copy button. This
url will end with
.com/as2/as2.
Do not use the url from the
screenshot as your tenant
might be a different one
than the tenant from the
screenshot.
22. Now jump back to TPM
and there to your Trading
Partner where you have to
add another
communication under the
system tab.
Use the names as you can
see in the screenshot.
For the recipient url you
need to paste the url from
the previous step.
Please switch then to
Basic Authentication with
the Credential ESB.

23. Switch to the Tab


Processing to enter to
AS2 IDs, Subject and your
mail address. Please use
a mail address which
works and where you can
receive mails as the
output will later be sent to
that mail.
It is mandatory that the
Own AS2 looks like
OwnId-P123456 and the
Partner AS2 Id like
PartnerId-P123456 (both
times with P123456 as
your user id). Then save
the communication.

openSAP: Manage B2B Scenarios Effectively with SAP Integration Suite – Exercise Week 2 11

Public
1.2 Use Agreement Template to create an agreement
With the Agreement, you instantiate the agreement template where you need to fill out the details of the
trading partners.

Explanation Screenshot
1. Navigate back to Design
→ B2B Scenarios, and
switch to the tab
Agreements.

2. On the Agreements tab,


create a new Agreement.

3. In the upcoming dialog,


select the existing
Agreement [openSAP -
BTP4] Procure to Pay B2B
Template and select Next.

4. Switch the Agreement


Creation Mode to Copy
from Template.
(more details can be found
in the documentation
https://help.sap.com/docs/i
ntegration-suite/sap-
integration-suite/creating-
trading-partner-agreement
Deselect Shipment
Notification and Invoice
Message as in this
simplified example we are
only using the Purchase
Order Request Response.
Then select the
TradingPartner-P123456
(with P123456 your
userid) you’ve created and
click on Open Draft.

openSAP: Manage B2B Scenarios Effectively with SAP Integration Suite – Exercise Week 2 12

Public
Explanation Screenshot
5. Please start with renaming
the Agreement to Procure
to Pay – P123456 (with
P123456 your user id) and
change the Description.
Now you need to specify
which Trading Partner
Details you want to use.
Please enter these details
in the following order (with
P123456 your user id):
Maintain System B2B-
System-P123456, Type
System UN/EDIFACT,
Type System Version
D.02A S3, Identifier
UNEDI_TP_E_P123456,
1
and Identifier as Company
O-P123456.
Finally, select the Identifier
as Trading Partner
123456789123 from the
drop-down.
2
Hint: use the drop-down
help but start with the
Trading Partner Details
and select the Identifier as
Trading Partner as the last 3
one.
When done, save your
settings.
6. Navigate to the tab B2B
Scenarios and switch the
Transaction to the edit
mode.

7. There you see the


transactions for the
scenario. In our exercise,
it is a two-way transaction
initiated by the trading
partner.

openSAP: Manage B2B Scenarios Effectively with SAP Integration Suite – Exercise Week 2 13

Public
Explanation Screenshot
8. Please start on the right
by clicking on the first
Communication box within
the flow and select AS2
for Communication.

9. Please click now on the


Interchange box to define
the Message
Implementation Guideline.
Select the drop-down list.

Note: The Message


Implementation Guideline
have been already
prepared by using the
Integration Advisor
capability of SAP
Integration Suite.

10. In the pop up select


openSAP BTP4 -
EDIFACT ORDERS and
switch to the highest
version. Then select
Choose.

11. Last step for the definition


of the Order is to select
the Mapping box (which is
also prepared by using the
Integration Advisor).
Select the drop-down list.

openSAP: Manage B2B Scenarios Effectively with SAP Integration Suite – Exercise Week 2 14

Public
Explanation Screenshot
12. In the pop up select
openSAP BTP4 -
EDIFACT ORDERS to
IDoc ORDERS and switch
to the highest version.
Then select Choose.

13. As the backend will also


send an Order Response
the necessary data for this
needs also to be
maintained. Select the
Communication for the
outgoing message to
AS2.Receiver.

14. Please click now on the


Interchange box to define
the Message
Implementation Guideline.
Select the drop-down list.

15. In the pop up select


openSAP BTP4 -
EDIFACT ORDRSP and
switch to the highest
version. Then select
Choose.

16. Last step for the definition


of the Order Response is
to select the Mapping box
Select the drop-down list.

openSAP: Manage B2B Scenarios Effectively with SAP Integration Suite – Exercise Week 2 15

Public
Explanation Screenshot
17. In the pop up select
openSAP BTP4 – Idoc
ORDRSP to EDIFACT
ORDRSP and switch to
the highest version. Then
select Choose.

18. Save the Agreement

19. Activate the agreement to


write all necessary data
into the Partner Directory
Database.

1.3 Prepare Simulation Flow and send a message


As we have defined that the trading partner sends an EDIFACT Order via the AS2 Protocol we need to
simulate this. Therefore, we have built an integration flow which you have to copy to a new package,
configure it and deploy. The EDIFACT message is sent as soon as the integration flow is deployed.

openSAP: Manage B2B Scenarios Effectively with SAP Integration Suite – Exercise Week 2 16

Public
Explanation Screenshot
1. Navigate to Design ->
Integrations and APIs.

2. If you haven’t done so


before, create a new
Package by clicking
Create.

3. Use openSAP-BTP4-
P123456 for Name and
Short Description with XX
your user Id and save the
package.

openSAP: Manage B2B Scenarios Effectively with SAP Integration Suite – Exercise Week 2 17

Public
Explanation Screenshot
4. Navigate back to the list of
existing packages by
clicking Integrations and
APIs.

5. Open the package


openSAP BTP -
SimulatorFlow.

6. In the package, switch to


tab Artifacts.

7. Copy the integration flow


openSAP-Send-Purchase-
Order to your own
package. Select Copy
from the Actions menu of
the openSAP-Send-
Purchase-Order
integration flow.
Important: please do not
change or use or delete
this iflow as this is the
source for all
participants!

openSAP: Manage B2B Scenarios Effectively with SAP Integration Suite – Exercise Week 2 18

Public
Explanation Screenshot
8. In the popup, change the
name to openSAP-Send-
Purchase-Order_P123456
(with P123456 your User
ID).
Then choose Select to
change the target
package.

9. In the upcoming package


selection screen, select
your package openSAP-
BTP4-P123456 (with
P123456 your user id).

10. Next, select Copy.

11. On the next dialog, select


Navigate to open your
package.

12. You now have to


Configure the integration
flow. Select Configure
from the Actions menu of
the openSAP-Send-
Purchase-Order_P123456
integration flow.
13. Please configure the
integration flow with your
UserID P123456.
Then select Save and
Deploy. Once the
integration flow is
successfully deployed, the
message is sent and
should appear in your
mailbox a few seconds
later.

openSAP: Manage B2B Scenarios Effectively with SAP Integration Suite – Exercise Week 2 19

Public
Explanation Screenshot
14. Please select the
Confirmation message
about transaction handling
by selecting the
checkmark.
The runtime profile is
preselected as Cloud
Integration and select
deploy!

1.4 Monitor the Scenario


The EDIFACT message is now sent to the generic integration flow and from there via the IDOC Adapter to
the simulated S/4HANA system which generates an ORDRSP. This is then mapped to EDIFACT and sent as
an email to your inbox. To monitor B2B Scenarios let’s have a look at the B2B Monitoring.

Explanation Screenshot
1. Navigate to the B2B
Monitoring by selecting
Monitor → B2B Scenarios.

2. On the tiles you see how


many interchanges had
been processed in the last
24 hours. Click on the left
tile.

3. Now you see all


messages from the last 24
hours. You can restrict
them by using the filters.

openSAP: Manage B2B Scenarios Effectively with SAP Integration Suite – Exercise Week 2 20

Public
Explanation Screenshot
4. Click on one of your
Completed interchanges.
As we are using here a
two-way transaction you
will see for each started
simulator iflow two entries:
One for the Orders, one
for the OrderRSP.

5. On this page, you see


more details like Sender
Name, Adapter Type, …
and you can also jump to
the technical monitoring if
this is necessary, and you
are also able to see the
payload of the source and
target message.

6. Depending on the Event


you’ve selected, you see
here more details on a
technical level to solve
issues if necessary.

Congrats, you have successfully completed the first exercise.

2 EXERCISE 2: CREATE NEW MIG


In the next step you will create your own MIG. Your Trading Partner expects the following Order Response
EDIFACT Message:
UNB+UNOC:3+1234567890123:1+UNEDI_TP_E_P123456:1+231217:1500+000255++++1'
UNH+5220230+ORDRSP:D:02A:UN:DF0320'

openSAP: Manage B2B Scenarios Effectively with SAP Integration Suite – Exercise Week 2 21

Public
BGM++0000347163'
DTM+137:20231004:203'
LIN++5'
QTY+21:8.000:PCE'
PRI+INV:5250.00'
CUX+7:USD'
LIN++5'
QTY+21:8.000:PCE'
PRI+INV:4400.00'
CUX+7:USD'
LIN++5'
QTY+21:8.000:PCE'
PRI+INV:4884.00'
CUX+7:USD'
LIN++5'
QTY+21:8.000:PCE'
PRI+INV:5300.00'
CUX+7:USD'
UNS+S'
UNT+21+LS'
UNZ+1+000255'
As explained in week 2 unit 2, use that to create a MIG. As youalready have a lot of knowledge about the
Integration Suite the explanations will no longer be detailed as in the first exercise.

Explanation Screenshot
1. Navigate to Design and
select MIGs.

2. Click on Add to create a


new MIG. Use
UN/EDIFACT as Type
System and ORDRSP as
Message with Version
D.02A S3 and skip the
upload of sample xml.

openSAP: Manage B2B Scenarios Effectively with SAP Integration Suite – Exercise Week 2 22

Public
Explanation Screenshot
3. Change the Name to
EDIFACT Ordrsp
P123456 (with P123456
your userid). Use Direction
Both and add in the
Business Context the
Business Process Manage
Purchase Order. Then
press the Button Create.

4. Now ask the proposal


service how the structure
normally looks like and
compare the structure with
the EDIFACT file you have
seen at the beginning of
this exercise and mark all
necessary nodes and
leafes. and also qualify
wherever possible (e.g.
DTM)

5. Qualify wherever possible


(e.g. DTM). Do this by
selecting the line and then
right mouse click.

openSAP: Manage B2B Scenarios Effectively with SAP Integration Suite – Exercise Week 2 23

Public
Explanation Screenshot
6. Give the Nodes and leafes
meaningful names. Add
documentation where it is
helpful and necessary by
selecting the line and use
the documentation area
on the right

If you’re finished your MIG do not forget to Save it as we will use it in the next exercises!

3 EXERCISE 3: CREATE NEW MAG


In this exercise you have to create your own mapping to map from the IDoc Order Response Message to the
EDIFACT OrdRsp Message. For each mapping you need a source and a target MIG. The source MIG has
already been created by us and the target MIG had been created by yourself in the last exercise.

Explanation Screenshot
1. Navigate to Design and
select B2B Scenarios and
select MAGs.

2. As you want to create a new


MAG please press Add

openSAP: Manage B2B Scenarios Effectively with SAP Integration Suite – Exercise Week 2 24

Public
Explanation Screenshot
3. At first you have to select
the source MIG. Use the
prepared one: openSAP
BTP4 – IDoc ORDRSP.
Then click Next.

4. Select as Target MIG the


MIG you’ve created in the
last exercise EDIFACT
Ordrsp P123456 (with
P123456 your user id) and
press Create.

5. Now you get the proposals


from the knowledge base
with the Button Proposal
and take the best
proposals with the button
Select best proposals.
Then clear the Proposals
(by clicking Clear
Proposal) and save the
MAG.
6. Next simulate with the MAG
with the idoc you can
download from openSAP
site “ordrsp-idoc.xml”
using the Simulate with
Payload Data.

7. It is very likely that you now


run into an error message
like this

openSAP: Manage B2B Scenarios Effectively with SAP Integration Suite – Exercise Week 2 25

Public
Explanation Screenshot
8. As the knowledge base also
might propose xslt
snippets for special
purposes which want to
access some global
parameters (which are not
existing in your mapping)
this is the consequence.
Therefore, delete this
snippet. At first you have
to find it like in the
screenshot. Search for
xsl:param. Select then the
found line.

9. This will show you the used


function. As you don’t
want to use it, please
delete that mapping. You
can do this by navigating
back to the Mapping List

10. And click on the trashcan

11. Try again the simulation.


Very likely you will get
now an additional column
in source and target.
Check all elements and
compare with the edifact
example at the beginning
of the MIG exercise.
Adjust the mapping till all
elements are correct.
On some elements you
have to use constants
(e.g. 0065, 0052, 0054,
0057) as not all necessary
values are existing in the
source.

openSAP: Manage B2B Scenarios Effectively with SAP Integration Suite – Exercise Week 2 26

Public
4 EXERCISE 4: USE NEW MIG AND MAG
After you’ve created now a MIG for the EDIFACT Order Response Message and a MAG to map from the
IDoc Order Response to the Edifact message you need to change your trading partner agreement to use the
newly created MIG and MAG.

Explanation Screenshot
1. Navigate to the B2B
Scenarios

2. Go to Tab Agreements
and open the Trading
Partner Agreement you’ve
created in exercise 1 (the
name should be Procure
to Pay – P123456 with
P123456 your user id)

3. Switch from the Overview


to the B2B Scenarios

openSAP: Manage B2B Scenarios Effectively with SAP Integration Suite – Exercise Week 2 27

Public
Explanation Screenshot
4. And there to the edit
mode.

5. Select the Interchange in


the second line (where the
definition of the order
response message is)

6. Use the drop down to


change the MIG and reset
the filter. Select your MIG
(EDIFACT Ordrsp
P123456 with P123456
your user id) and click
Choose.

7. Now select the Mapping


for the outgoing message.

openSAP: Manage B2B Scenarios Effectively with SAP Integration Suite – Exercise Week 2 28

Public
Explanation Screenshot
8. Use here also the drop
down to select a new
MAG. Also here change
the filter (or reset
completely) to find your
MAG (Name will be
Mapping openSAP BTP4
– Idoc ORDRSP to
EDIFACT Ordrsp
P123456 with P123456
your user id) and click on
Choose.
9. Save the Trading Partner
Agreement

10. Update your scenario

Now you can again send a test message with the iflow you’ve copied in exercise 1 and look at the monitoring
and in your personal inbox if everything works fine.

openSAP: Manage B2B Scenarios Effectively with SAP Integration Suite – Exercise Week 2 29

Public

You might also like