ME31K_ Create a contract, Studio v11 - Automate_Studio - 20.3

Automate Studio with Connect User Guide

Product type
Software
Portfolio
Integrate
Product family
Automate
Product
Automate > Automate Studio
Version
20.3
Language
English
Product name
Automate Studio
Title
Automate Studio with Connect User Guide
Topic type
Overview
Administration
Installation
How Do I
First publish date
2018

ME31K step by step: Creating a contract

This document describes how you can use Automate Transaction to create a contract in the SAP Business Suite from data in Microsoft Excel using the SAP transaction ME31K.

Steps

Record

  1. Start Automate Studio from the desktop shortcut or from the Windows Start menu.
  2. Click New.

    file tab new

  3. Click Transaction, and then click Create from SAP recording.

    create from sap recording

  4. Choose the SAP system that you want to use, enter the appropriate user data, and then click Log On to SAP.

    s a p logon

    If you do not see the SAP system that you want, click Advanced SAP Logon, click Add System, provide the system information, and click OK.

  5. In the Transaction code box, type ME31K.

    transaction code box

  6. Leave the recording mode as Standard. If you do not see Standard, click Change and then click Batch Input Mode.

    Note: For most transactions, the default mode is Standard, and the Automate Function Module (WFM) selects the optimum mode for the t-code that is being recorded. If the WFM is not installed, Batch Mode will work for ME31K, and Non-Batch Input Mode Without Controls will work for most transactions. Non-Batch modes are necessary for downloading information from SAP transactions, or for Finance or HR transactions in which there are Dynamic Actions executing or user parameter values being used; otherwise, if you do not have access to Non-Batch modes, you can try recording in Batch Mode. The difference between Without SAP Controls and With SAP Controls is just a matter of what tools are on the transaction screens. For more information, see the Recording modes topic (Connect mode or Foundation mode).

  7. Click Start Recording

    start recording button

    The ME31K transaction starts.

    Note: The screens might appear slightly different in the recording mode because we are using a background mode. The screens might also vary according to the way that your SAP system has been configured.

  8. On the first screen, enter the following data:
    • Vendor
    • Agreement Type
    • Agreement Date
    • Purch. Org
    • Purchasing Group
    • Plant
    • Storage Location

    create contract initial screen

  9. Press Enter.
  10. Enter additional header details. In this example:
    • Validity End
    • Payt Terms
    • Targ. Val.

    create contract header data

  11. Press Enter to continue.

    Important: The next step might be different from the manual entry process.

  12. On the second row, enter the details for the first line item, including item number 10:
    • Item
    • Material Number
    • Quantity
    • Net Price

    enter line item on second row

  13. Click the Enter Lines button to create items.

    enter lines button

    This will move the first line item to row 1, so that row 2 is available again for data entry.

  14. Enter the details for the second row of line-item data, including item number 20.

    second line item on row 2

  15. Click the Enter Lines button again.
  16. Click Save to save the Contract. This also ends the recording.

    save button

After Studio finishes compiling the script, it will take you to the Map tab.

Map

It is now time to create the mapping for this transaction. Mapping a script is just a matter of connecting SAP fields to fields in your data file. Transaction provides a Mapper to facilitate this process.

Auto Mapping will map the entire script to an Excel spreadsheet in the order that they appear in the Mapper. Because of the complexity of this transaction, we will map the fields manually instead.

The screenshot below shows the Basic View tab of the Mapper.

In each row of the Mapper, you will see:

  • Mapper row number: This is just a reference number.
  • Enable flag: only enabled Mapper rows will be executed by Transaction.
  • Field Description: The label associated with the SAP technical field name.
  • Field Name: The SAP technical field name.
  • Field Type & Length: For example, String or Decimal, and the padding options.
  • Mapping direction: Fixed Value, Excel to SAP, SAP to Excel (or, if mapping to Access: Access to SAP, SAP to Access).
  • Value: Values assigned to the SAP field; either fixed values or mapped locations in the associated data source.

Note: The Properties pane is also displayed, but it is not shown below.

basic tab in mapper

In the Data Set panel, you will see a preview screen of the selected data source type.

To change the data source type, click the drop-down menu under the Data Set tab and choose the data source type that you want.

change data source type drop down menu

The preview will change to reflect the choice. In this case, we will use Excel.

The first step is to add the loop.

A loop takes a section of the script and allows that section to repeat. In the case of a contract, the section where you enter line items needs to be repeatable. That way, whether you enter 1 line item or 100 into your Excel file, the script can upload all of the line items, using a single line item of scripting.

  1. Click the Expert View tab.

    Expert View displays the fields organized by screens, and you can see the screen name, number, and description.

    expert view

  2. Select the screen and fields for the second line item, right-click, and then click Disable to hide the screens and fields for the second line item.

    disable fields for second line item

  3. Select the Mapper rows for the remaining line item. In this example, select Mapper row 19, hold down the Shift key, and click row 25.

    line item rows selected

  4. Click the Create Loop button.

    create loop button

  5. The Loop box opens with default values, which you can change:
    • The boxes at the top show the start and end rows of the loop in the Mapper (the highlighted rows—in this case, XX through XX).
    • The Loop identifier column box displays the column in the spreadsheet that will contain the Header and Detail (line item data) identifiers.

      To map the loop identifier to column A, click the Loop identifier column box, click Show unmapped columns, click A, and then click Go.

    • The Text to identify Transaction Header and Text to identify repeating Line Items boxes display the values that will identify the Header (H) and Line Item (D) rows.

    loop dialog box

  6. Click OK to insert the loop around the selected Mapper rows.

    The Mapper reflects the following changes as a result of inserting the loop:

    • The graphical depiction of the Loop around the selected lines indicates which Mapper rows will be contained within the loop.
    • The ID column has been identified in the Preview panel and row 2 contains the first Header ID value.

      Note: This will appear in the preview file only if you are mapping to a blank file.

    loop shown in mapper

  7. Click the Basic View tab.
  8. To map the script to the data source, you will drag in the direction that the data will move. For this script, you are uploading data from Excel to SAP, so you will drag from Excel to the Mapper.

    Map the Header data first. In this example:

    • Drag column B up and drop it onto row 6.
    • Drag column C up to row 7.
    • Drag column D up to row 8, and so on, until all the header data is mapped.

    If you do not see fields that you want to map, they might be disabled. In this example, Agreement Date and quotation Submission Date did not appear automatically, but they can be added. Click the View tab, and then click Disabled Fields

    disabled fields checkboxx

    Check the boxes Enable boxes for the fields that you want to show, then uncheck the Disabled Fields box and return to the Map tab.

    Map the Line Item data. In this example:

    • Drag column M up to row 24 (Agreement Item).
    • Drag column N up to row 25.
    • Drag column O up to row 26.
    • Drag column P up to row 27.

    mapped fields in excel preview

Add the data and run the script

  1. Click the Run tab.

    run tab

    Note: Transaction will automatically assign the Log column to the next available column after the last mapped column (in this case, column X).

  2. Type the data in the columns (i.e., the data for creating the contracts).

    Be sure to include an H (header identifier) or a D (detail identifier) for each row of data.

    You can specify a start and end row, specify the Excel sheet that contains the data, and change the Log column.

  3. To execute the upload, click the Test button, if you are a Foundation user, or click the Run button if you are not a Foundation user.

    Studio prompts you to save the script and data files.

    save box

    The best practice is to name the Excel spreadsheet the same name as the script unless an Excel spreadsheet will be used for multiple scripts.

    After you save the script and data files, the script runs.

    The yellow message bar displays a message when the run has finished.

    run completed message

The contracts are now created based on the data in the spreadsheet.

log column after run

© Precisely, LLC ·Legal

Automate support

Automate.com

Provide feedback