In last week's tip, we talked about how to use Transaction to download long text from SAP. In this week's tip, we'll build on that and combine two additional tips in one - how to use if conditions to determine what data to upload and how to use Transaction to update long text.
In last week's Studio script, we used Studio's Add Long Text feature to download data from SAP. In that script we uploaded the Material Number and Language fields and downloaded text related to the materials. We can use that same script to now upload text to SAP simply by changing the mapping from download to upload in the Studio script. Using both scripts together provides the capabilities we like to call "round trip" where you download data to Excel, update the data, and then upload it back to SAP.
Open the existing Studio download script and change the mapping direction from download to upload.
Before:

After:

That's it. You can easily start from an existing long text download script and change it to an upload. If you don't have an existing download script, you can record a new script. There are samples of both types of scripts along with an Excel template attached to this tip.
But wait, there's more :-)
Now…let's add some extra functionality. In the attached sample Excel template, we have material long text for four types of long text all in one template (Basic Data, PO Text, Internal Note, and Inspection Text). You may want to give your users the option to update none, some, or all the text on each row. This can be accomplished by adding if conditions in your script mapped to columns on your template. In the example below, we are using columns A - E to allow the user to determine what text gets updated.

In this Excel template, if the user does not specifically identify what to update by entering an "X" in the corresponding column, the script will ignore the data. For Basic Data Text, we want to create an if condition that reads if column A or column B contains an "X" update Basic Data Text. Then we'll repeat the same concept for each text type.
How to create if conditions for each long text type.
- Open the Expert view in the Map tab in Studio.

- Click on the green header row for Basic data text and highlight all of the rows in that section.
- Rows 19 - 22 are highlighted in the example below.

- Click on Create Condition in the Studio ribbon
- Make sure your rows match your desired set of rows.
- Note: They should match what you highlighted, but you can change them if needed.
- If column A contains an X, ALL text types will be updated. If there is an X in column A, the user doesn't have to enter an X in any of the other individual columns.
- Note: For each long text type, there should be a condition for an X in column A and an X in the corresponding column for the individual text type.
- Click Add New Group to add another condition.
- Make sure the logical operator between the two conditions is set to "OR".
- Add another condition that reads if Column B is Equal To X.

Result in the script:

Test your script.
Repeat the steps for each text type. Examples:

Test your script.
Tip to keep in mind: If you have existing text in SAP, uploading the text from an Excel template will overwrite the text. If you want to append, you can use the download capabilities to download existing text and then append new text in the Excel template. Where you put the new text is up to you. We have seen customers add new text above existing text to always have the newest text displayed at the top.
Reminder, you find a list of all the SAP long text supported t-codes here.
Enjoy!
------------------------------
Tammy Lake
Principal Sales Engineer
*Precisely Software Inc.
------------------------------