• No results found

Enhancing Inbound Processing

In document BIT350 (Page 91-101)

Example: Enhancement Using a Customer Exit

Exercise 4: Enhancing Inbound Processing

Exercise Objectives

After completing this exercise, you will be able to:

• Enhance an ALE scenario when transferring additional fields is not necessary

Business Example

A scenario for ordering materials has been deliberately simplified for this exercise. Some facts have been omitted compared to the standard scenario.

You want to create the order for another SAP system. For the outbound order, the message type ORDLGT is available with an outbound function module for message control. For the incoming order, an inbound function module for the message typeORDLGTis available. To create an order in the target system, you need to implement an enhancement.

Task

Use a program enhancement to ensure that the IDoc for the simplified ordering scenario with message typeORDLGTis processed without errors in inbound processing.

1. Change the partner profile for the partner T-BIL##. Change the outbound parameters for the message type ORDERS: Delete the settings for message control (tab page NAST)Change the outbound parameters for the message typeORDLGT:

Message control:

ApplicationEF Message typeNEU

Process code ORDLGT_OUT_##

2. Create an order using a CATT.

Choose System→ Services → CATT → Record (= transaction SCEM. . Select and execute the test case .

5. In project management (transaction CMOD), create the project

BIT##. Select the SAP enhancementBIT350## for the project. Which components are affected by inbound processing? Analyze the interface: Which parameters are transferred to the enhancement, and which parameters does the enhancement return to the program?

6. At which point is the customer exit called? In which program is theCall Customer-Functioncall? Is the original function call in the

BIT350_Input_##function module?

7. How can you use the Customer Exit to enter the value TA in the field

AUARTin structurexvbak, if the segment fieldE1HEAD AUARTcontains the value NB? Enter the enhancement code in the inbound component.

Solution 4: Enhancing Inbound Processing

Task

Use a program enhancement to ensure that the IDoc for the simplified ordering scenario with message typeORDLGTis processed without errors in inbound processing.

1. Change the partner profile for the partner T-BIL##. Change the outbound parameters for the message type ORDERS: Delete the settings for message control (tab page NAST)Change the outbound parameters for the message typeORDLGT:

Message control:

ApplicationEF Message typeNEU

Process code ORDLGT_OUT_##

a) Note that you can only set up message control forORDLGTif you have already deleted it inORDERS.

2. Create an order using a CATT.

Choose System→ Services → CATT → Record (= transaction SCEM. . Select and execute the test caseYBIT350_ME21_##.

a) Note the number of the generated IDoc.

3. Display the IDoc in the transaction BD87. What status does the IDoc have in the target system?

a) The IDoc has status 51 with the status text: Entry NB not available.

4. Can the problem be solved using an enhancement? Consider at which point you need to make the enhancement.

a) The problem can be solved using an enhancement that converts the incorrect application document type NB into the correct application document type TA.

b) Technically, the enhancement can be made in both inbound

5. In project management (transaction CMOD), create the project

BIT##. Select the SAP enhancementBIT350## for the project. Which components are affected by inbound processing? Analyze the interface: Which parameters are transferred to the enhancement, and which parameters does the enhancement return to the program?

a) If you choose Components, two EXIT function modules are displayed. Double click to display the details. Choose the Properties tab page. You can tell from the short text which component is used in inbound processing, and which in outbound processing. The EXIT function module for inbound processing is calledEXIT_SAPLIB##_002.

b) Import parameter: PI_VBAK621 Export parameter: PI_VBAK621

6. At which point is the customer exit called? In which program is theCall Customer-Functioncall? Is the original function call in the

BIT350_Input_##function module?

a) The program: LIB00F01 is, however, a subprogram. To find the inbound function module, you need to call the where-used list more than once.

b) The original function call is in the function module

BIT350_Input_##.

Hint: You can also use the following method to find the function module ofcall customer-function:

• In the Object Navigator (transaction SE80), enter the function group IB## , and the function module

BC621_Input_## .

• FindCall customer function

• Double click on002. Note the name of the function module.

Continued on next page

7. How can you use the Customer Exit to enter the value TA in the field

AUARTin structurexvbak, if the segment fieldE1HEAD AUARTcontains the value NB? Enter the enhancement code in the inbound component.

a) Return to the EXIT function module EXIT_SAPLIB##_002. In the source code, double click on the name of the include and recreate b) it.Enhancement code for the inbound component:

1 *---*

2 *INCLUDE ZXBIT350##U02

3 *---*

4 5 6

7 pe_vbak621 = pi_vbak621.

8

9 IF pe_vbak621-auart = 'NB'.

10

11 pe_vbak621-auart = ‘TA’.

12 ENDIF.

Lesson Summary

You should now be able to:

• Enhance an ALE scenario, when you do not need to transfer additional fields

Unit Summary

You should now be able to:

• Enhance an ALE scenario, when you do not need to transfer additional fields

Test Your Knowledge

1. Which statement enables you to recognize a customer exit in the calling program?

2. Which statement enables you to recognize a Business Add-In (BAdI) in the calling program?

3. How do you recognize a Business Transaction Event (BTE) in the calling program?

4. You want to enhance the outbound processing of an ALE scenario.

The change affects the segmentE1APPLXPL. Several enhancements are offered in the outbound program. What conditions does an enhancement need to fulfill before you can use it?

Choose the correct answer(s).

A The call cannot be made until the function module

MASTER_IDOC_DISTRIBUTEhas been called.

B The call must be made before the function module

MASTER_IDOC_DISTRIBUTEis called.

C The master IDoc must be transferred to the enhancement, but it cannot be changed in the enhancement.

D The interface enables a change to the master IDoc, or the

Answers

1. Which statement enables you to recognize a customer exit in the calling program?

Answer: CALL CUSTOMER-FUNCTION

2. Which statement enables you to recognize a Business Add-In (BAdI) in the calling program?

Answer: Prerequisite: A reference variable is defined in the program that refers to an interface with the naming conventionIF_EX_<BAdI>. You will then recognize a Business Add-In by the call of an interface method.

DATA exit_ref TYPE REF TO IF_EX_<badi>.

...

3. How do you recognize a Business Transaction Event (BTE) in the calling program?

Answer: By the function module call, which uses the naming conventionOPEN_FI_PERFORM_<BTE>.

4. You want to enhance the outbound processing of an ALE scenario.

The change affects the segmentE1APPLXPL. Several enhancements are offered in the outbound program. What conditions does an enhancement need to fulfill before you can use it?

Answer: B, D

The point at which the call is made, and the interface, must be configured so that the master IDoc can be changed. They must therefore be called before the function moduleMASTER_IDOC_DISTRIBUTE, either due to transfer of the master IDoc byCHANGINGorTABLES, or due to the program updating the master IDoc with information from the enhancement after the enhancement is called.

Unit 5

Adjusting a Scenario With

In document BIT350 (Page 91-101)