Register Login

How to CopyText command for Notification Long Text data

Updated May 18, 2018

I'm hoping someone can help with a problem I'm having with the CopyText command. I'm trying to copy the long text of a Notification Item so that later on I can display the contents in a Textbox for the user to edit with, as part of a custom input screen. At the end of the editing process, I want the user to be able to save the contents of the textbox back to the Noti Item Long Text.

When I manually display the Notification Item Long Text, SAP is displaying a Word 2007 window within the SAP screen as the Long Text entry area. GuiXT identifies this long text field as
X[SCMSW_CONTAINER_2102].

When I read the data fields in the Notification into variables, I'm using the following script commands to read the Long Text:

. . .
Screen SAPLIQS0.7200
Enter "=TXPS" // Press the Long Text button...

Screen SAPLSTXX.2102
Copytext fromScreen="X[SCMSW_CONTAINER_2102]" toText="iw_noti_item1.remarks"
Enter "/3" // go back to Noti Item

...

Later on when I display the custom input screen I'm using the following code:
. . .
// populate the text variable with the contents from the Long Text field
copytext fromText="iw_noti_item1.remarks" toText="iw_noti_wdr_remarks"
Enter

textbox (20,15) (23,95) name="iw_noti_wdr_remarks"
...
When the custom input screen displays, the Textbox displays the word "MsoWorkPane", rather than the contents of the Long Text field. My suspicion is that Word 2007 as the graphical editor has something to do with this problem. I have tried unchecking the Graphical Editor option, but then the screen reverts back to the line by line Table which Iwould rather not read and reassemble for the custom input screen, if I don't have to.

I have tried other variations of the CopyText command to get the Long Text data, such as using -toClipboard and -toFile options, and in each case, "MsoWorkPane" is the contents copied from the
Noti Item Long Text field into the clipboard or to the file respectively.

I welcome all suggestions on how to resolve this question.


Comments

  • 26 Aug 2011 7:51 am Shalesh Singh Visen
    You may use the download/upload function. Example (header text):


    Enter "=TXQM"

    Screen SAPLSTXX.2102
    Enter "=EDDO"

    Screen SAPLSTXK.0101
    Set R[ITCTK-TDASCII] "X"
    Enter

    Screen SAPLSTXK.0111
    Set V[tempfile] "&%[TEMP] ext&V[today_ymdhms].txt"
    Set F[ITCTK-TDFILENAME] "&V[tempfile]"
    Enter

    Screen SAPLSTXX.2102
    CopyText fromFile="&V[tempfile]" toText="t1"
    Enter "/3"
  • 26 Aug 2011 7:52 am Shalesh Singh Visen
    Thanks so much for the quick and useful reply! This technique worked like a charm! I will plan to use the upload technique to write the user's textbox contents back into the long text. I was planning on a complete replacement of the existing long text for whatever the user had in the Textbox field. Is there anything to watch out for with the upload?
  • 26 Aug 2011 7:52 am Shalesh Singh Visen
    Is there anything to watch out for with the upload?"

    - you need to delete the existing text before uploading the new one
    - the screen numbers for upload/download are different
    - after /3 there is a popup "Do you want to save" -> press YES button
    - for download and upload I suggest you set the codepage; for Unicode systems choose 4110 = UTF-8

    Enter "=TXQM"

    Screen SAPLSTXX.2102

    // delete text
    Enter "=TXDE"

    Screen SAPLSPO1.0100

    // popup: yes, delete text
    Enter "=YES"

    Screen SAPLSTXX.2102
    // upload
    Enter "=EDUP"

    Screen SAPLSTXK.0102
    Set R[ITCTK-TDASCII] "X"
    Enter

    Screen SAPLSTXK.0121
    Set F[ITCTK-TDFILENAME] "&V[tempfile]"
    Set F[ITCTK-TDCODEPAGE] "4110"
    Enter

    Screen SAPLSTXX.2102
    Enter "/3"

    Screen SAPLSPO1.0100

    // popup: yes, save text
    Enter "=YES"

×