Entering content frameBackground documentation Part 3 - Chaining a Series of Transactions Locate the document in its SAP Library structure

Use

The first transaction that you recorded, Create Vendor (FK01), creates a customer record. Another transaction, Change Vendor (FK02), allows you to modify an exiting customer record. In this transaction, you will edit the address in a customer record that you created earlier.

You can chain these transactions together so that when you create a customer record, the record is automatically passed to the second transaction for modification. To do this, you need to define the Vendor number as an export parameter in the first transaction, and as an import parameter in the second transaction. The Vendor number is passed between the transactions as a local variable.

Prerequisites

You have recorded transaction Create Vendor (FK01) and edited the test script as described in parts 1 and 2 of this tutorial.

Procedure

Recording Transaction FK02 and Creating an Import Parameter

  1. Create a new test script. Name it XYZ_FK02 (where XYZ are your initials).
  2. Start recording transaction FK02.
  3. In the Vendor and Company Code fields, enter data of a vendor that you created earlier. You can find this by looking in the Structure linklog that was generated when you created the vendor.
  4. Select Address.
  5. Choose This graphic is explained in the accompanying text.
  6. Edit the name of the vendor to B Other.
  7. Keep choosing Enter until you return to the test script editor.
  8. In the screen simulation, delete the contents of the Vendor field and choose This graphic is explained in the accompanying text.
  9. A dialog box appears.

  10. In the Param. Name field, enter a name for the import parameter (for this example use VENDOR_IMP) and in the Field contents field, enter the vendor number again.
  11. Choose This graphic is explained in the accompanying text.
  12. Choose This graphic is explained in the accompanying text, to go back to the script editor.
  13. The import parameter has been automatically entered in the structure editor.

  14. In the parameter list, choose This graphic is explained in the accompanying text to display parameters. The input parameter appears automatically. It has value I in the Visibility of Parameter I/E/V field. If it is not visible choose This graphic is explained in the accompanying text to refresh the list.
  15. This graphic is explained in the accompanying text

  16. Save the script as a local object.
  17. Creating an Export Parameter

    You have seen that transaction FK01 issues a message containing the vendor number and company code. You can use the first variable part of the message, which contains the vendor number, to provide the value for an export parameter.

  18. In a new session, open test script XYZ_FK01.
  19. In the parameter list, choose This graphic is explained in the accompanying text to display parameters. There are no parameters defined yet.
  20. Choose This graphic is explained in the accompanying text.
  21. In the Parameter field, enter VENDOR_EXP.
  22. In the Visibility of Parameter I/E/V field, enter E.
  23. Choose Enter.
  24. In the command editor, enter VENDOR_EXP = &MS1. below the TCD command. &MS1 is an eCATT variable. These always start with an ampersand (&). &MS1 contains the first variable text part of the last message from the transaction.
  25. This graphic is explained in the accompanying text

  26. Choose This graphic is explained in the accompanying text.
  27. Calling Scripts from Another Script and Passing Values

  28. In a new session, create a new test script. Name it XYZ_CHAIN (where XYZ are your initials).
  29. Choose Pattern, and in the Command field, choose REF from the dropdown list.
  30. In the Test Script field, enter the name of the script in which you recorded transaction FK01, and choose This graphic is explained in the accompanying text.
  31. In the Interface field, a system-generated name appears.

  32. Accept the system-generated name by choosing This graphic is explained in the accompanying text.
  33. The following appears in the command editor:

    REF ( XYZ_FK01 , XYZ_FK01_1 ).

  34. In the command editor, position the cursor after the last statement. Use Pattern to add a line to the script so that it looks like this:
  35. REF ( XYZ_FK01 , XYZ_FK01_1 ).

    REF ( XYZ_FK02 , XYZ_FK02_1 ).

  36. In the parameter list, choose This graphic is explained in the accompanying text to display parameters. There are no parameters defined yet.
  37. Choose This graphic is explained in the accompanying text.
  38. In the Parameter field, enter VENDOR_LOC.
  39. In the Visibility of Parameter I/E/V field, enter V.
  40. Choose Enter.
  41. In the structure editor, assign the local variable to the import and export parameters.
  42. This graphic is explained in the accompanying text

  43. Save and execute the test script.
  44. Examine the log.

This graphic is explained in the accompanying text

Result

You have generated a new vendor record and automatically altered it.

 

Leaving content frame