• No results found

Creating Missing Materials in the MM and SD Systems

In document Bit430 en Col74 (Page 143-159)

Procedure for Inserting User Decisions

Exercise 7: Creating Missing Materials in the MM and SD Systems

Exercise Objectives

After completing this exercise, you will be able to:

• Use the condition editor

Business Example

In the preparation step in the integration process, the SD system returns a list of materials that must be created in the system. The CreateMaterials element is in the list_abstract interface. This element is set to YES if a particular material could not be found. You create the materials in the MM and SD systems. The Airline_Group_One business system is the SD system, and the Airline_Group_Two business system is the MM system. You create the materials by combining a block in ParForEach mode with a block in ForEach mode that runs through a receiver list from the receiver determination step type as a loop.

Task:

You want to send the material or materials to be created to the SD system and the MM system almost simultaneously. Consequently, you require an independent material with header and other material data. You then transfer the contents of the preplist element to a multiline prepitemlist container element, which is based on the item_abstract interface. You make this assignment in the list2itemslist mapping object.

Furthermore, you require the prepitem container element, which references exactly one work item (which in turn represents a specific material).

Use the new SendmaterialsParallel block in ParForEach mode in combination with your new prepitemlist and prepitem container elements to send the materials to the various different systems specified in the receiver determination step.

Define a correlation to correlate the messages that are returned from the SD and MM systems. The correlation refers to the customer number and the spare part number.

The responses from the SD and MM systems are received in a receive step that uses the create_matresp message and the CorrMaterials correlation.

1. Minimize the Preparation block and add a standard block with the name CreateMaterials to it.

Continued on next page

2. Insert a switch step with the nameifto check whether materials need to be created at all. The outcome name is MaterialsCreated.

The condition checks that preplist./p1:SparePartLineItemList/CreateMaterials is set to YES.

3. You want to send the material to the SD and MM systems. You therefore need independent materials with header and business volume data. You must transfer preplist to a new prepitemlist multiline element that is based on the item_abstract interface.

Create this element and insert a transformation step in the next step.

In the CreateMaterials container, create a multiline element with the name prepitemlist that is based on the item_abstract abstract interface.

4. Insert a transformation step with the name MaterialTransformation in branch 1 of the switch step. The transformation is based on the list2itemlist operation mapping, the preplist source message, and the prepitemlist target message.

5. After the transformation step, insert a block with the name SendMaterialsParallel.

Set the block mode of the block in the first step toStandard.

6. You want to send the materials simultaneously to your MM and SD systems. For this purpose, use the ParForEach block mode. You require a list of elements to be processed, and an element that represents the current line each time.

Create a new container element with the name prepitem that is based on the item_abstract abstract interface in the SendMaterialsParallel container.

7. Set the mode of the SendMaterialsParallel block toParForEach. Use the prepitemlist container element as a multiline element. Use the prepitem container element as the entry for the Current Line.

8. You require a list of receivers to send the materials to.

Create a multiline element with the name Receivers (category Receivers) in the container of the SendMaterialsParallel block.

9. Insert a receiver determination step with the name ReceiverDetermination in the SendMaterialsParallel block. Set the Message property to prepitem, and the Receivers property to Receivers.

Figure 55: Correlation Editor

11. After the receive step, insert the step group BROADCAST_##.

The step group was created inDefaultmode and is now adapted to the actual, individual case.

12. To switch to ForEach mode, create a container element with the name Receiver (category Receiver) in the SystemBroadcastPerMaterial block.

13. Now set the SystemBroadcastPerMaterial block toForEachmode. Choose Receivers for the Multiline Element property, Receiver for the Current Line property, and CorrMaterials for the correlation.

14. Adjust the SendMaterial send step in the SystemBroadcastPerMaterial block.

This step should send the prepitem message asynchronously, and then receive the receivers from the Receivers list. Use the CorrMaterials correlation and reference CustomerNo and SPAREPART_NO for ID_Cust and ID_Mat.

15. You receive the response from each system in thecreate_matrespcontainer element.

Create a container element with the name create_matresp in the

SystemBroadcastPerMaterial container. It references the item_abstract abstract interface.

16. Using the create_matresp message and the CorrMaterials correlation, adapt a ReceiveCreateMatResp receive step.

17. Check, save, and activate the process.

18. Open your HTML client and send three individual items with the spare part numbers 2000, 3000, and 4000. The resulting workflow should look as follows:

Continued on next page

Figure 56: Workflow Log

Two materials - 2000 and 3000 - were created and the corresponding message was sent to two systems.

Solution 7: Creating Missing Materials in the MM and SD Systems

Task:

You want to send the material or materials to be created to the SD system and the MM system almost simultaneously. Consequently, you require an independent material with header and other material data. You then transfer the contents of the preplist element to a multiline prepitemlist container element, which is based on the item_abstract interface. You make this assignment in the list2itemslist mapping object.

Furthermore, you require the prepitem container element, which references exactly one work item (which in turn represents a specific material).

Use the new SendmaterialsParallel block in ParForEach mode in combination with your new prepitemlist and prepitem container elements to send the materials to the various different systems specified in the receiver determination step.

Define a correlation to correlate the messages that are returned from the SD and MM systems. The correlation refers to the customer number and the spare part number.

The responses from the SD and MM systems are received in a receive step that uses the create_matresp message and the CorrMaterials correlation.

1. Minimize the Preparation block and add a standard block with the name CreateMaterials to it.

a) Open the integration process and switch to change mode.

b) Select the Preparation block from the last exercise and minimize it either by using the context menu or by choosing the minus sign in the top right-hand corner.

c) Insert a block step after the minimized Preparation block.

d) Switch to the Properties area.

e) Name: CreateMaterials f) Mode: Default

2. Insert a switch step with the nameifto check whether materials need to be created at all. The outcome name is MaterialsCreated.

Continued on next page

The condition checks that preplist./p1:SparePartLineItemList/CreateMaterials is set to YES.

a) Insert a switch step to the CreateMaterials block.

b) Switch to the Properties area.

c) Name: if

d) Outcome name: MaterialsCreated

e) Condition: (preplist./p1:SparePartLineItemList/CreateMaterials = YES).

The step should look as follows:

Figure 57: Condition

3. You want to send the material to the SD and MM systems. You therefore need independent materials with header and business volume data. You must transfer preplist to a new prepitemlist multiline element that is based on the

In the CreateMaterials container, create a multiline element with the name prepitemlist that is based on the item_abstract abstract interface.

a) Switch to the Container view in the Object area.

b) Name: prepitemlist

c) Category: Abstract Interface d) Type: item_abstract

e) Multiline: marked

f) Scope: CreateMaterials

4. Insert a transformation step with the name MaterialTransformation in branch 1 of the switch step. The transformation is based on the list2itemlist operation mapping, the preplist source message, and the prepitemlist target message.

a) Insert a transformation step in branch 1 of the switch step.

b) Switch to the Properties area.

c) Name: MaterialTransformation d) Operation Mapping:list2itemlist e) Source Message –> list_abstract: preplist f) Target Messages –> item_abstract: prepitemlist 5. After the transformation step, insert a block with the name

SendMaterialsParallel.

Set the block mode of the block in the first step toStandard.

a) Insert a block step after the transformation step in branch 1.

b) Switch to the Properties area.

c) Name: SendMaterialsParallel d) Mode: Default

6. You want to send the materials simultaneously to your MM and SD systems. For this purpose, use the ParForEach block mode. You require a list of elements to be processed, and an element that represents the current line each time.

Continued on next page

Create a new container element with the name prepitem that is based on the item_abstract abstract interface in the SendMaterialsParallel container.

a) Switch to the Container view in the Object area.

b) Name: prepitem

c) Category: Abstract Interface d) Type: item_abstract

e) Multiline: not selected

f) Scope: SendMaterialsParallel

7. Set the mode of the SendMaterialsParallel block toParForEach. Use the prepitemlist container element as a multiline element. Use the prepitem container element as the entry for the Current Line.

a) Select the SendMaterialsParallelblock and switch to the Properties area.

b) Mode: ParForEach

c) Multiline Element: prepitemlist d) Current Line: prepitem

8. You require a list of receivers to send the materials to.

Create a multiline element with the name Receivers (category Receivers) in the container of the SendMaterialsParallel block.

a) Switch to the Container area.

b) Name: Receivers c) Category: Receiver d) Multiline: selected

e) Scope: SendMaterialsParallel

9. Insert a receiver determination step with the name ReceiverDetermination in the SendMaterialsParallel block. Set the Message property to prepitem, and the Receivers property to Receivers.

a) Insert a receiver determination step in the SendMaterialsParallel block.

b) Switch to the Properties area.

c) Name: ReceiverDetermination d) Message: prepitem

e) Receiver: Receivers

10. Create a correlation with the name CorrMaterials as illustrated in the figure below:

Continued on next page

Figure 58: Correlation Editor

a) Switch to the Correlation List view in the Object area.

b) Enter a new correlation name: CorrMaterials.

c) Navigate to the Edit area and switch to the Correlation Editor view.

d) Change the Correlation Name toCorrMaterials. e) Navigate to the Correlation Container field.

f) Enter two new values: ID_Custtypexsd:stringandID_Mattype xsd:string.

g) Navigate to the Involved Messages field.

h) Select the item_abstract message.

i) Switch to the Properties area.

j) For ID_Cust, select the value Interface./p1:SparePartLineItem/Cus-tomerNo.

k) For ID_Mat, select the value Interface./p1:SparePart-LineItem/SPAREPART_NO.

11. After the receive step, insert the step group BROADCAST_##.

The step group was created inDefaultmode and is now adapted to the actual, individual case.

a) Select the ReceiverDetermination. Use the context menu (right-click) to insert the step group BroadCast_##.

12. To switch to ForEach mode, create a container element with the name Receiver (category Receiver) in the SystemBroadcastPerMaterial block.

a) Switch back to the Container view in the Object area.

b) Name: Receiver c) Category: Receiver d) Multiline: not selected

e) Scope: SystemBroadcastPerMaterial

13. Now set the SystemBroadcastPerMaterial block toForEachmode. Choose Receivers for the Multiline Element property, Receiver for the Current Line property, and CorrMaterials for the correlation.

a) Select the SystemBroadcastPerMaterial block and switch to the Properties area.

b) Mode: ForEach

c) Multiline Element: Receivers d) Current Line: Receiver

e) Local Correlations: CorrMaterials

14. Adjust the SendMaterial send step in the SystemBroadcastPerMaterial block.

This step should send the prepitem message asynchronously, and then receive the receivers from the Receivers list. Use the CorrMaterials correlation and reference CustomerNo and SPAREPART_NO for ID_Cust and ID_Mat.

a) Select the send step in the SystemBroadcastPerMaterial block.

b) Switch to the Properties area.

c) Add the message: prepitem.

d) Receiver From: Receivers List e) Receiver: Receiver

f) Activate Correlation: CorrMaterials

g) ID_Cust: prepitem./p1:SparePartLineItem/CustomerNo h) ID_Mat: prepitem./p1:SparePartLineItem/SPAREPART_NO i) Leave the Queue Name (EOIO) and Conversation ID fields empty.

15. You receive the response from each system in thecreate_matrespcontainer element.

Continued on next page

Create a container element with the name create_matresp in the

SystemBroadcastPerMaterial container. It references the item_abstract abstract interface.

a) Switch to the Container view in the Object area.

b) Name: create_matresp

c) Category: Abstract Interface d) Type: item_abstract

e) Multiline: not selected

f) Scope: SystemBroadcastPerMaterial

16. Using the create_matresp message and the CorrMaterials correlation, adapt a ReceiveCreateMatResp receive step.

a) Select the receive step after the SendMaterial send step.

b) Switch to the Properties area.

c) Name: ReceiveCreateMatResp d) Choose the message: create_matresp e) Use Correlations: CorrMaterials 17. Check, save, and activate the process.

a) Save your process.

b) Check the process by pressing F7.

c) If no errors are found, activate the process.

18. Open your HTML client and send three individual items with the spare part numbers 2000, 3000, and 4000. The resulting workflow should look as follows:

Figure 59: Workflow Log

Two materials - 2000 and 3000 - were created and the corresponding message was sent to two systems.

a) Open your HTML client and check that your process is entered in the Process Definition field.

b) Send three individual items with the spare part numbers 2000, 3000, and 4000.

c) Call transaction SXMB_MONI_BPE.

d) Select the last workflow sent and open the workflow log.

Lesson Summary

You should now be able to:

• Explain step type receiver determination

• Explain and use step type fork

• Describe step type switch

• Illustrate step type user decision

• Use the modes ParForEach and ForEach in a block step

• Integrate user decisions into the process flow

Unit Summary

You should now be able to:

• Describe the graphical process editor

• Work with the graphical process editor

• Explain the different meanings of step types

• Explain and define correlations

• Define and use container elements

• Explain the step types transformation, send, control, and wait

• Explain the concept of exception handling in ccBPM

• Define exceptions in integration processes

• Describe common design patterns for integration processes

• Use the process patterns shipped by SAP in your integration processes

• Define step groups

• Use configurable parameters to improve the flexibility of your processes

• Explain step type receiver determination

• Explain and use step type fork

• Describe step type switch

• Illustrate step type user decision

• Use the modes ParForEach and ForEach in a block step

• Integrate user decisions into the process flow

Unit 3

Business Process Management:

In document Bit430 en Col74 (Page 143-159)