Liquid UI - Documentation - 19.06 Copytext - copying to and from screens

19.06 Copytext - copying to and from screens


In this article, you will learn how to use the screen copy method to copy text to and from SAP screen blocks, even those with long text fields. To copy text to a screen, you can use either the append or appendline options. Follow the steps below to copy text to and from SAP screen blocks:

  1. Add a textbox to enter the text.
  2. Add a toolbar push button to copy the text.
 
Note: Use fromstring instead of fromtext when copying text to screen blocks.
 

User Interface

//Create this file inside your script folder for customizing the Change Order: Initial Screen, SAPLCOIH.E3000.sjs

//Now, let's add the Liquid UI script to the above file and save it.

 

Customization

  1. Add a textbox to enter the text.
     
    //Creates a textbox
    textbox([2,87], [7,121],{"name":"iw32_text", "textfont":"Arial", "textheight":"20", "textweight":"5"});
     
     
  2. Add a two-toolbar push buttons with labels Screen Copy and Copy Text to copy the text.
     
    // Creates a two toolbar push buttons labeled Screen Text and Copy Text
    pushbutton([TOOLBAR], "Screen Copy",{ "process":copy_test});
    pushbutton([TOOLBAR], "Copy Text",{ "process":copy_screen_to_text});
    
     
     
  3. Add the function to copy the text from and into the textbox.
     
    //Function to copy the text
    function copy_test(){
      onscreen 'SAPLCOIH.3000'
      copytext({"fromstring":"iw32_text","toscreen":"X[LTEXT]"});
      enter();
    }
    function copy_screen_to_text(){
      onscreen 'SAPLCOIH.3000'
      copytext({"tostring":"iw32_text","fromscreen":"X[LTEXT]"});
      enter();
    }
    
     

SAP Process

  1. Refresh the IW32 Screen. Select the Maintenance Order type and continue to the next step. Now, click Enter to proceed further.
     
     
  2. You will be navigated to the Change Maintenance Order: Central Header screen, as shown below.
     
     
  3. Clicking on the show long text icon displays the Order description field, as shown below.
     
     
  4. Enter text in the textbox and click Screen Copy. This action copies the text from the textbox to the description field, as shown below.
     
     
  5. Similarly, click Copy Text to copy the text from the description field to the textbox, as shown below.
     
     

Can't find the answers you're looking for?