To build the query that the script will use, you add tables to the workspace on the Studio Query Workspace tab and choose the fields for the data you want to download.
After you choose the fields, you narrow the data set that you want to download by specifying criteria.
Choose the creation method and log on to SAP
- Click the File tab, and then click New.
- Click Query.
- Under Choose a Creation Method, click Create from Tables.
- On the Studio logon screen, do one of the following:
- Click the SAP system box and then click the SAP system you want to log onto.
- Click Advanced SAP Logon. In the SAP Logon box, choose your SAP system, and then type your client number, user name, and password.
To save your credentials for future sessions, check the Save as auto logon credentials box and type a name for the credentials in the Auto logon name box. The next time you log on to SAP from Studio, you will see your Auto logon name in the SAP system box and your other credentials. All you have to do is click the logon button.
- Click OK.
Choose the tables
- In the Data type box, choose the type of result file you want to use for the downloaded data:
- Excel worksheet
- Access database file
- Text file
- Web form (XML form for web services)
- SQL Server file
- Reference Data list
Note: The account that you use to write to SQL Server must have db_owner or db_ddladmin membership on the database that contains the target table. - Click Create Script.
- On the Studio Query Workspace tab, you have several ways to add tables:
- In the Quick add box, type the table name and click Add to Workspace or press Enter.
To add multiple tables, type the names separated by commas or spaces. For example: MARA MAKT MARC or MARA,MAKT,MARC.
- In the Search for tables box, type part of the table name or description and a wildcard character—for example, mat*l. Use the options in the drop-down list to narrow the search.
Then click Search and click the Add Table to Workspace button in the Search Results pane.
Note: To see which fields are in the table before you add it, click the Inspect Table button, which is next to the Add Table to Workspace button. - Click the drop-down list at the top of the pane, click Data Dictionary, browse to the table you want, and then drag it onto the workspace.
- In the Quick add box, type the table name and click Add to Workspace or press Enter.
The tables in the workspace are connected by inner joins.
If you are using only one table, you can add it again and join it to itself. If you have tables that aren't connected by joins, you can manually add the joins or find an intermediary table to connect the other tables. You can also convert inner joins to left outer joins. For more information about joins, see Create joins between tables.
Select the fields
- Check the Output box for each field that you want to download data from SAP.Note: If an input field has a conversion exit applied to it, no data will be returned. (Conversion Exit is supported on the field level. This enables you to use formatting operations such as zero padding.)
- Check the Criteria box for each field that you want to use to define the data set that you are downloading.
For example, if you want Query to return material data based on a range of material numbers, check the Criteria box for the MARA.MATNR field.
The next step is to define criteria.
You can add categories to Tables, Input Structures, and Output Structures for a BAPI, as well as remove and rename the categories.