Operations on text strings

Hi experts,
      I have a situation wherein i have to compare the text strings and if it matches i want to copy the below lines to an internal table until it faces some other keyword. Let me explain in detail, I have an internal table like this,
summary
    xxxxxx
    yyyyyyy
    zzzzzzz
project
    aaaaaa
    bbbbbb
    cccccc
    dddddd
Now i want to search for summary in the above itab and i want to copy the contents under summary(3 lines here) to another internal table until it encounters project. And I want do same for project also. Pls help me.
Points assured
Regards
Tharanatha

!!! Check this code !!!
TYPES : BEGIN OF ty_struct ,
          sv_string TYPE string,
        END OF ty_struct.
DATA : itab_struct1 TYPE TABLE OF ty_struct,
       wa_struct1 LIKE LINE OF itab_struct1,
       itab_struct2 TYPE TABLE OF ty_struct,
       wa_struct2 LIKE LINE OF itab_struct2.
        wa_struct1-sv_string = 'efghijkl'.
        APPEND wa_struct1 to itab_struct1.
        wa_struct1-sv_string = 'hmgkdhfl'.
        APPEND wa_struct1 to itab_struct1.
        wa_struct1-sv_string = 'summary'.
        APPEND wa_struct1 to itab_struct1.
        wa_struct1-sv_string = 'xxxxxxx'.
        APPEND wa_struct1 to itab_struct1.
        wa_struct1-sv_string = 'yyyyyyy'.
        APPEND wa_struct1 to itab_struct1.
        wa_struct1-sv_string = 'zzzzzzz'.
        APPEND wa_struct1 to itab_struct1.
        wa_struct1-sv_string = 'project'.
        APPEND wa_struct1 to itab_struct1.
        wa_struct1-sv_string = 'aaaaaaa'.
        APPEND wa_struct1 to itab_struct1.
DATA : lv_string1 TYPE string,
       lv_string2 like lv_string1,
       summary_index TYPE I,
       project_index TYPE I.
lv_string1 = 'summary'.
lv_string2 = 'project'.
READ TABLE itab_struct1 INTO wa_struct1 WITH TABLE KEY sv_string = 'summary'.
IF sy-subrc eq 0.
  summary_index = sy-tabix.
  summary_index = summary_index + 1.
ENDIF.
READ TABLE itab_struct1 INTO wa_struct1 WITH TABLE KEY sv_string = 'project'.
IF sy-subrc eq 0.
  project_index = sy-tabix.
  project_index = project_index - 1.
ENDIF.
        LOOP AT itab_struct1 INTO wa_struct1  FROM summary_index to project_index.
          APPEND wa_struct1 to itab_struct2.
        ENDLOOP.
        WRITE : 'Done'.
<b>Reward Points If Useful</b>

Similar Messages

  • [Forum FAQ] How to find and replace text strings in the shapes in Excel using Windows PowerShell

    Windows PowerShell is a powerful command tool and we can use it for management and operations. In this article we introduce the detailed steps to use Windows PowerShell to find and replace test string in the
    shapes in Excel Object.
    Since the Excel.Application
    is available for representing the entire Microsoft Excel application, we can invoke the relevant Properties and Methods to help us to
    interact with Excel document.
    The figure below is an excel file:
    Figure 1.
    You can use the PowerShell script below to list the text in the shapes and replace the text string to “text”:
    $text = “text1”,”text2”,”text3”,”text3”
    $Excel 
    = New-Object -ComObject Excel.Application
    $Excel.visible = $true
    $Workbook 
    = $Excel.workbooks.open("d:\shape.xlsx")      
    #Open the excel file
    $Worksheet 
    = $Workbook.Worksheets.Item("shapes")       
    #Open the worksheet named "shapes"
    $shape = $Worksheet.Shapes      
    # Get all the shapes
    $i=0      
    # This number is used to replace the text in sequence as the variable “$text”
    Foreach ($sh in $shape){
    $sh.TextFrame.Characters().text  
    # Get the textbox in the shape
    $sh.TextFrame.Characters().text = 
    $text[$i++]       
    #Change the value of the textbox in the shape one by one
    $WorkBook.Save()              
    #Save workbook in excel
    $WorkBook.Close()             
    #Close workbook in excel
    [void]$excel.quit()           
    #Quit Excel
    Before invoking the methods and properties, we can use the cmdlet “Get-Member” to list the available methods.
    Besides, we can also find the documents about these methods and properties in MSDN:
    Workbook.Worksheets Property (Excel):
    http://msdn.microsoft.com/en-us/library/office/ff835542(v=office.15).aspx
    Worksheet.Shapes Property:
    http://msdn.microsoft.com/en-us/library/office/ff821817(v=office.15).aspx
    Shape.TextFrame Property:
    http://msdn.microsoft.com/en-us/library/office/ff839162(v=office.15).aspx
    TextFrame.Characters Method (Excel):
    http://msdn.microsoft.com/en-us/library/office/ff195027(v=office.15).aspx
    Characters.Text Property (Excel):
    http://msdn.microsoft.com/en-us/library/office/ff838596(v=office.15).aspx
    After running the script above, we can see the changes in the figure below:
    Figure 2.
    Please click to vote if the post helps you. This can be beneficial to other community members reading the thread.

    Thank you for the information, but does this thread really need to be stuck to the top of the forum?
    If there must be a sticky, I'd rather see a link to a page on the wiki that has links to all of these ForumFAQ posts.
    EDIT: I see this is no longer stuck to the top of the forum, thank you.
    Don't retire TechNet! -
    (Don't give up yet - 13,085+ strong and growing)

  • Cp4 AS3 - using Javascript to generate a text string

    I'm a complete Javascript beginner, so please forgive me if this is a stupid question!
    I need to generate a pseudo random text string. I'm using the unpatched version of Cp4, AS3, Internet Explorer 7
    I've had a look at Captivate.Dev.com and the w3schools site to try to understand how to pass variables & basic javascript, and this is what I've come up with:
    var objCP = document.Captivate;
    function GenerateCode(){
    var rngen = new Array(8);
    var tgits = new Array(8);
    var cdrtn="";
    var lpdx=0;
    var mulier=1;
    for (lpdx=0;lpdx<=5;lpdx++){
    rngen[lpdx]=(Math.floor(Math.random()*9)+1);
    mlier=mulier*(rngen[lpdx]);
    tgits[lpdx]=rngen[lpdx]+"";
    cdrtn=cdrtn+tgits[lpdx];
    rngen[6]=(mlier%17)%10;
    rngen[7]=(mlier%13)%10;
    for (lpdx=6;lpdx<=7;lpdx++)
    tgits[lpdx]=rngen[lpdx]+"";
    cdrtn=cdrtn+tgits[lpdx];
    objCP.cpEISetValue('MyJavascriptVariable', cdrtn);
    GenerateCode();
    I've created a user variable called MyJavascriptVariable , put the code above in the On Slide Enter, Execute Javascript window on the first slide, and on the second a simple caption box showing the variable contents.
    However, when I press F12 I get an orange playbar at the top of the window, and in the middle the preloader and the captionbox (without the return value) flickering. i.e. classic sign of wrong AS version.
    If I change to AS2 the movie progresses ok, but the value the caption reports back for MyJavascriptVariable is blank.
    I know my core code works correctly - if I use the w3school's tryit editor with the code after the function declaration up to the closing curly before the objcCP line, with an addeded document.write to show the variable it works fine.
    It's clearly something to do with the way I'm declaring/passing the function or the way Cp runs the javascript. But what?
    Any help greatfully appreciated!
    Thanks

    Hi Jon,
    You are right... it works great on the W3Schools site.  Although in Cp, you ran into quite an issue using the modulus operater (%).  Looks like Cp needs the encoded version of this operator which is (%25).  Also, if you're using Cp4, then when you go to set the caption, you want to use objCP.cpSetValue();  Cp5 uses cpEISetValue.  I also try to use single quotes when working with strings.
    Here's the updated code:
    var objCP = document.Captivate;
    function GenerateCode() {
    var rngen = new Array(8);
    var tgits = new Array(8);
    var cdrtn='';
    var lpdx = 0;
    var mulier=1;
        for (lpdx=0; lpdx<=5; lpdx++){
            rngen[lpdx]=(Math.floor(Math.random()*9)+1);
            mlier=mulier*(rngen[lpdx]);
            tgits[lpdx]=rngen[lpdx]+'';
            cdrtn=cdrtn+tgits[lpdx];
    rngen[6]=(mlier %25 17) %25 10;
    rngen[7]=(mlier %25 13) %25 10;
       for (lpdx=6; lpdx<=7; lpdx++){
            tgits[lpdx]=rngen[lpdx]+'';
            cdrtn=cdrtn+tgits[lpdx];
    objCP.cpSetValue('MyJavascriptVariable', cdrtn);
    GenerateCode();
    This looks like some really crazy math.
    Let me know if this helps.
    Jim Leichliter

  • SAVE TEXT not updating the database for Recipe Operation Long Texts

    Hi,
    We are trying to update the Recipe Operation long text using the FM SAVE_TEXT.
    The FM is not throwing any error, but the changes are not reflecting in the database.
    Text ID: PLPO
    Text Object: ROUTING
    Language: EN
    Text Name: Concatenated string of ARBPL,PLNNR,OPRATIONCOUNTER
    If someone faced similar scenarios, please share your inputs.
    Thanks in advance,
    Anand

    After some more R & D, i got to know that the Long Text indicator should be enabled to get the changes reflected in the C203 recipe operation details.
    In C202, if you pass two text lines for Operation long text, this Long text indicator is automatically enabled and its a non editable field.
    Can some one provide inputs how to enable this through program?
    Regards,
    Anand

  • Error message if invalid characters entered in PM order oper.short text fld

    Hi ALL,
    I need to display a error message, when user enters the invalid characters in work order operation short text field. The error message should be displayed during work order u201CSaveu201D (during creation and change mode).
    Kindly let me know is there is any user exit / BADI can be used for this.
    Note: I have checked some user exit, such as IWO10009 but I am not getting the value of Operation short text (AFVGD-LTXA1) to compare and throw the error message
    Regards
    Ramu

    hi
    the exit is correct but don't use structure field,
    follow this to get text
    get AUFPL(Routing number of operations in the order)from  CAUFV and paa it in AFVC -AUFPLyou get the short text
    it can be usefull
    -ashok

  • Convert text string file to object array without outputting to file first?

    I have a log file that is just a text string file which is appended to with Out-File.  If the log file does not exist I pipe headers to it so that I can import the data as CSV.  For example:
    DATA.LOG
    DATE,TIME,RESPONSE_TIME
    05-28-2014, 14:47, 132
    05-28-2014, 14:50, 94
    05-28-2014, 14:53, 72
    I'm using Microsoft Chart Controls to graph the data; it takes it in via CSV format.  If I'm going to chart all the entries in DATA.LOG I can simply IMPORT-CSV DATA.LOG.  But I only want to graph the 20 most recent entries.
    Perhaps there is a better way to do this, but to maintain the header and get the 20 most recent entries I'm using select.
    $DATA+=Get-Content .\data.log | select -first 1
    $DATA+=Get-Content .\data.log | select -last 20
    The problem is $DATA is of type system string so I can't use it directly with Chart Controls; I need to get it in CSV format first.  I can Out-File $DATA and then use IMPORT-CSV.  But I'd prefer to not have to use
    the temporary file.  Any suggestions on how I can accomplish this objective? 

    Import-CSV creates an object with the 'header' becoming the named values in the array.  The code I posted does the same thing as your 4 lines of code in one line of code:
    Much more quickly:
    PS C:\temp> (1..1000 | measure-command {import-csv .\data.log | select -last 2}).totalseconds
    0.4792951
    PS C:\temp> (1..1000 | measure-command {$DATATMP=@();$DATATMP+=Get-Content .\data.log | select -first 1;$DATATMP+=Get-Content .\data.log | select -last 2;ConvertFrom-CSV $DATATMP}).totalseconds
    1.6227726
    You're more than welcome to use whatever code you want, but if you want to improve your Powershell knowledge you should try to understand the object model around which Powershell is built, it is powerful and efficient.
    I hope this post has helped!

  • How can I display an icon, instead of text string, as a validation prompt?

    My validate method inside my custom validator is like this:
    public void validate(FacesContext context, UIComponent component, Object value) {
      Pattern datePattern = Pattern.compile("(\\d{2})/(\\d{2})/(\\d{4})");
      Matcher dateMatcher = datePattern.matcher((String)value);
      if(!dateMatcher.find()){
        ((UIInput)component).setValid(false);
        FacesMessage message = new FacesMessage();
        String msg = "[" + value + "] invalid date";
        message.setDetail(msg);
        context.addMessage(component.getClientId(context), message);
        FacesMessage facesMsg = new FacesMessage(FacesMessage.SEVERITY_FATAL, "xx", "msg");
        throw new ValidatorException(facesMsg);
    }My JSP has this:
    <h:inputText id="test" value="#{projecthandler.test}">
    <f:validator validatorId="DateValidator" />
    </h:inputText>
    <h:message id="testErrorMessage" for="test"/>The <h:message> tag will kick in if the user has invalid data in the <h:inputText> field and clicks submit.
    When the page is regenerated, the user will see a text string reflecting what the issue is.
    However, instead of this, I would like to display an icon consisting of a red circle with an exclamation point.
    The user is supposed to click on the icon if they want more information. By clicking on the icon,
    the user will see a message box, with a description of the error.
    This is our standard for applications. I'm trying to put together a demo showing how an existing application
    would work in JSF, so I won't be able to talk others into using JSF, unless I can get the validation to display an
    icon instead of text.
    Edited by: Kazan on Mar 18, 2009 9:31 AM
    Edited by: Kazan on Mar 18, 2009 9:33 AM
    Edited by: Kazan on Mar 18, 2009 9:36 AM

    OK, I noticed a bug in my validate method. This is updated to fix the bug, and to include the recomendation about background-image:
      public void validate(FacesContext context, UIComponent component, Object value) {
        System.out.println("DateValidator.test.1");
        Pattern datePattern = Pattern.compile("(\\d{2})/(\\d{2})/(\\d{4})");
        Matcher dateMatcher = datePattern.matcher((String)value);
        System.out.println("DateValidator.test.1");
        if(!dateMatcher.find()){
          ((UIInput)component).setValid(false);
          FacesMessage message = new FacesMessage();
          String msg = "<span style='background-image: url(/error.gif)'/>";
          message.setDetail(msg);
          message.setSeverity(FacesMessage.SEVERITY_FATAL);
          context.addMessage(component.getClientId(context), message);
          throw new ValidatorException(message);
      }When I run this, the litteral string of "<span style='background-image: url(/error.gif)'/>" is printed as the message. It does not interpret this as a span tag with an image url.
    Can someone tell me what's going on?

  • Multi-language support for user-specified text strings used in the forms

    multi-language support for user-specified text strings used in the forms
    Instead of creating multiple forms, 1 in each different language, for the same service, is there any workaround?

    Hoan - is your question what are the considerations when creating multiligual catalogs? If so, I can tell you that at other clients I have seen them use a single catalog for one or two languages. For the two langugages, such as Spanish/English, you can create a single catalog with both of them. Once you get to more than two languages, the catalog would get unweildy and is therefore not suggested.

  • Find and Replace text string in HTML

    Opps... I hope this forum is not just for Outlook. My Html files reside on my hard-drive. I am looking for VBA code to open specified file names ####File.html and then find and replace text strings within the html for example "####Name" replaced
    with "YYYYY"
    I drive the "####File.html" names and the find and replace text strings from an Excel sheet. I am an artist and this Sub would give me time to paint instead of find and replace text. Thank you!
    [email protected]

    Hello Phil,
    The current forum is for developers and Outlook related programming questions. That's why I'd suggest hiring anybody for developing the code for you. You may find freelancers, for example. Try googling for any freelance-related web sites and asking such
    questions there.
    If you decide to develop an Outlook macro on your own, the
    Getting Started with VBA in Outlook 2010 article is a good place to start from.

  • How Can I replace newScale Text Strings with Custom Values?

    How Can I replace newScale Text Strings with Custom Values?
    How can I replace newScale text strings with custom values?
    All  newScale text is customizable. Follow the procedure below to change the  value of any text string that appears in RequestCenter online pages.
    Procedure
    1. Find out the String ID of the text string you would like to overwrite by turning on the String ID display:
    a) Navigate to the RequestCenter.ear/config directory.
    b) Open the newscale.properties file and add the following name-value pair at the end of the file:res.format=2
    c) Save the file.
    d) Repeat steps b and c for the RmiConfig.prop and RequestCenter.prop files.
    e) Stop and restart the RequestCenter service.
    f) Log  in to RequestCenter and browse to the page that has the text you want  to overwrite. In front of the text you will now see the String ID.
    g) Note down the String ID's you want to change.
    2. Navigate to the directory: /RequestCenter.ear/RequestCenter.war/WEB-INF/classes/com/newscale/bfw.
    3. Create the following sub-directory: res/resources
    4. Create the following empty text files in the directory you just created:
    RequestCenter_0.properties
    RequestCenter_1.properties
    RequestCenter_2.properties
    RequestCenter_3.properties
    RequestCenter_4.properties
    RequestCenter_5.properties
    RequestCenter_6.properties
    RequestCenter_7.properties
    5. Add the custom text strings to the appropriate  RequestCenter_<Number>.properties file in the following manner  (name-value pair) StringID=YourCustomTextString
    Example: The StringID for "Available Work" in ServiceManager is 699.
    If you wanted to change "Available Work" to "General Inbox", you  would add the following line to the RequestCenter_0.properties file
         699=General Inbox
    Strings are divided into the following files, based on their numeric ID:
    Strings are divided into the following files, based on their numeric ID:
    String ID  File Name
    0 to 999 -> RequestCenter_0.properties
    1000 to 1999 -> RequestCenter_1.properties
    2000 to 2999 -> RequestCenter_2.properties
    3000 to 3999 -> RequestCenter_3.properties
    4000 to 4999 -> RequestCenter_4.properties
    5000 to 5999 -> RequestCenter_5.properties
    6000 to 6999 -> RequestCenter_6.properties
    7000 to 7999 -> RequestCenter_7.properties
    6. Turn off the String ID display by removing (or commenting out) the line "res.format=2" from the newscale.properties, RequestCenter.prop and RmiConfig.prop files
    7. Restart RequestCenter.
    Your customized text should be displayed.

    I've recently come across this information and it was very helpful in changing some of the inline text.
    However, one place that seemed out of reach with this method was the three main buttons on an "Order" page.  Specifically the "Add & Review Order" button was confusing some of our users.
    Through the use of JavaScript we were able to modify the label of this button.  We placed JS in the footer.html file that changes the value of the butt

  • How to display  LONG TEXT STRING in Module Pool Screen ?

    Hi Experts,
    I want to display long text string, on screen designed through module pool(SE51). I tried to display through input/output field , but it displays it in SINGLE LINE and i have to scroll all through to view all string.
    I want to display it in rectangular format . It doesnt allow me to set HEIGHT of component.
    Please provide solution.
    Thanks in advance.
    Regards
    Deepak

    This is the program where u can get the WA_THEAD from other program like report and trying to display and modifying that text. U can do instead of WA_THEAD u can generate here itself and use also
    *& Module pool       ZMP_LTEXT                                         *
    PROGRAM  ZMP_LTEXT                               .
    TABLES: STXL.
    *&      Module  STATUS_9000  OUTPUT
    MODULE STATUS_9000 OUTPUT.
    CONSTANTS:line_length type i value 132.
    DATA:g_editor type ref to cl_gui_textedit,
         g_editor_container type ref to cl_gui_custom_container,
         CONT1 type scrfname value 'CONT1',
         g_repid like sy-repid,
         g_ok_code like sy-ucomm,
         g_mytable(132) type c occurs 0,
         g_mycontainer(30) type c ,
         v_result(256) type c,
         g_head like thead,
         it_line type table of tline with header line,
         wa_stxl type stxl.
    DATA : BEGIN OF IT_THEAD1,
           ICON TYPE ICON-ID.
           INCLUDE STRUCTURE STXL.
    DATA : END OF IT_THEAD1.
    DATA : IT_THEAD LIKE TABLE OF IT_THEAD1,
           WA_THEAD LIKE LINE OF IT_THEAD.
    IMPORT WA_THEAD FROM MEMORY ID 'ABCD'.
    select SINGLE * from STXL into wa_stxl
                     where tdname = '00006000156500000002'.
    SELECT SINGLE * from STXL into wa_stxl
                      where tdname = WA_THEAD-TDNAME
                      AND TDID = WA_THEAD-TDID
                      AND TDOBJECT = WA_THEAD-TDOBJECT
                      AND TDSPRAS = WA_THEAD-TDSPRAS.
    IF SY-SUBRC NE 0.
    MESSAGE 'NO RECORD EXIST' TYPE 'E'.
    ENDIF.
    MOVE-CORRESPONDING WA_STXL TO G_HEAD.
    SET PF-STATUS 'STATUS'.
    SET TITLEBAR '001'.
      if g_editor is initial.
         CREATE OBJECT G_EDITOR_CONTAINER
           EXPORTING
            PARENT                      =
             CONTAINER_NAME              = CONT1
            STYLE                       =
            LIFETIME                    = lifetime_default
            REPID                       =
            DYNNR                       =
            NO_AUTODEF_PROGID_DYNNR     =
           EXCEPTIONS
            CNTL_ERROR                  = 1
            CNTL_SYSTEM_ERROR           = 2
            CREATE_ERROR                = 3
            LIFETIME_ERROR              = 4
            LIFETIME_DYNPRO_DYNPRO_LINK = 5
             others                      = 6.
         IF SY-SUBRC <> 0.
         MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
                    WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
         ENDIF.
         CREATE OBJECT G_EDITOR
           EXPORTING
            MAX_NUMBER_CHARS       =
            STYLE                  = 0
       WORDWRAP_MODE          = cl_gui_textedit=>wordwrap_at_fixed_position
    for to fix number of characters in row to 132 characers
             WORDWRAP_POSITION      = line_length
             WORDWRAP_TO_LINEBREAK_MODE = cl_gui_textedit=>true
    for the word to break to next line if it don’t fit in line
            FILEDROP_MODE          = DROPFILE_EVENT_OFF
             PARENT                 = G_EDITOR_CONTAINER
            LIFETIME               =
            NAME                   =
           EXCEPTIONS
            ERROR_CNTL_CREATE      = 1
            ERROR_CNTL_INIT        = 2
            ERROR_CNTL_LINK        = 3
            ERROR_DP_CREATE        = 4
            GUI_TYPE_NOT_SUPPORTED = 5
             others                 = 6  .
         IF SY-SUBRC <> 0.
         MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
                    WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
         ENDIF.
      REFRESH g_mytable.
         MOVE: WA_THEAD-TDNAME TO STXL-TDNAME,
               WA_THEAD-TDID TO STXL-TDID,
               WA_THEAD-TDOBJECT TO STXL-TDOBJECT,
               WA_THEAD-TDSPRAS TO STXL-TDSPRAS.
        CALL FUNCTION 'READ_TEXT'
        EXPORTING
        CLIENT                        = SY-MANDT
          ID                            = wa_stxl-tdid
          LANGUAGE                      = wa_stxl-tdspras
          NAME                          = wa_stxl-tdname
          OBJECT                        = wa_stxl-tdobject
        ARCHIVE_HANDLE                = 0
        LOCAL_CAT                     = ' '
      IMPORTING
        HEADER                        =
        TABLES
          LINES                         = it_line
      EXCEPTIONS
        ID                            = 1
        LANGUAGE                      = 2
        NAME                          = 3
        NOT_FOUND                     = 4
        OBJECT                        = 5
        REFERENCE_CHECK               = 6
        WRONG_ACCESS_TO_ARCHIVE       = 7
        OTHERS                        = 8
      IF SY-SUBRC <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
            WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
      ENDIF.
    LOOP AT IT_LINE INTO V_RESULT.
       APPEND V_RESULT TO G_MYTABLE.
    ENDLOOP.
    CALL METHOD G_EDITOR->SET_TEXT_AS_R3TABLE
       EXPORTING
         TABLE           = G_MYTABLE
       EXCEPTIONS
         ERROR_DP        = 1
         ERROR_DP_CREATE = 2
         others          = 3.
    IF SY-SUBRC <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
                WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    ENDIF.
       endif.
    ENDMODULE.                 " STATUS_9000  OUTPUT
    *&      Module  USER_COMMAND_9000  INPUT
    MODULE USER_COMMAND_9000 INPUT.
    CASE SY-UCOMM.
    REFRESH G_MYTABLE[].
    REFRESH IT_LINE[].
    CLEAR V_RESULT.
      WHEN 'SAVE'.
         CALL METHOD G_EDITOR->GET_TEXT_AS_R3TABLE
          EXPORTING
            ONLY_WHEN_MODIFIED     = FALSE
            IMPORTING
              TABLE                  = G_MYTABLE
            IS_MODIFIED            =
          EXCEPTIONS
            ERROR_DP               = 1
            ERROR_CNTL_CALL_METHOD = 2
            ERROR_DP_CREATE        = 3
            POTENTIAL_DATA_LOSS    = 4
            others                 = 5
         IF SY-SUBRC <> 0.
         MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
                    WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
         ENDIF.
    LOOP AT G_MYTABLE INTO V_RESULT.
       APPEND V_RESULT TO IT_LINE.
    ENDLOOP.
    CLEAR V_RESULT.
        CALL FUNCTION 'SAVE_TEXT'
          EXPORTING
            CLIENT                = SY-MANDT
            HEADER                = G_HEAD
            INSERT                = ' '
            SAVEMODE_DIRECT       = 'X'
          OWNER_SPECIFIED       = ' '
          LOCAL_CAT             = ' '
        IMPORTING
          FUNCTION              =
          NEWHEADER             =
          TABLES
            LINES                 = IT_LINE
        EXCEPTIONS
          ID                    = 1
          LANGUAGE              = 2
          NAME                  = 3
          OBJECT                = 4
          OTHERS                = 5
       IF SY-SUBRC <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
            WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
       ENDIF.
    REFRESH G_MYTABLE[].
    REFRESH IT_LINE[].
    CLEAR V_RESULT.
    WHEN 'BACK' OR 'CANCEL' OR 'EXIT'.
    LEAVE TO SCREEN '0'.
    *CALL SCREEN '0'.
    WHEN OTHERS.
    ENDCASE.
    *G_OK_CODE = SY-UCOMM.
    *CLEAR SY-UCOMM.
    ENDMODULE.                 " USER_COMMAND_9000  INPUT

  • Operation Long text creation problem in IW32

    Hi experts,
    I have a requirement of showing a checklist pop up for all the new external operations in creating a MPA work order(IW32). And when the user answers the questions on the checklist, I have to copy all the questions and answers into the long text of the corresponding operation.
    The problem here is,
    for a case when the long text is not yet created for a new line item, when the pop up is shown and answers are filled, I am creating a new standard text using SVE_TEXT(setting the insert paramter 'X'), but the standard text is getting created in the database i.e a record is getting created in STXH with the text id, text name, text object of the operation. But when I go to IW32 and see the operation line it shows the create long text icon which says that the text is not created at all.
    In a case where the long text is already created for the operation, and then the pop up is shown with the questions and answers are filled, the questions and answers are copied into the operation long text which is already created. So this works fine.
    If any pointers regarding this please let me know.
    Thanks and Regards,
    Asha

    Hi,
    Try passing SAVEMODE_DIRECT = 'X' and check..
    also check if the text exists using the function module READ_TEXT once you do the SAVE_TEXT..
    Thanks,
    Naren

  • Calculating Height and Width of Text String in 6.1

    We have a vi that uses a CIN. It takes in a specified font and string
    and x,y origin and calculates the rectangular area of the given text.
    We have been using this VI since LabVIEW 4. Unfortunately, it will not
    work in LV6.1 and causes the compatexport.cpp error documented at NI.
    It works in 6.0.2, but not in 6.1. I believe that this VI was
    downloaded from somewhere, but the name was changed long ago. I'm
    wondering if anyone has a simiar VI that works with LV 6.1.
    When I choose the create .c file I get:
    * CIN source file
    #include "extcode.h"
    * typedefs
    typedef struct {
    LStrHandle Font_Name_;
    int16 Size;
    LVBoolean Strikeout_;
    LVBoolean Italic_;
    LVBoolean Underline_;
    LVBoolean Outline_;
    LVBool
    ean Shadow_;
    LVBoolean Bold_;
    uInt16 desired_font_application_;
    } TD1;
    typedef struct {
    int16 horizontal;
    int16 vertical;
    } TD2;
    CIN MgErr CINRun(LStrHandle text, TD1 *_user_specified_font_, int32
    *var3, TD2 *origin_0_0_);
    CIN MgErr CINRun(LStrHandle text, TD1 *_user_specified_font_, int32
    *var3, TD2 *origin_0_0_) {
    /* ENTER YOUR CODE HERE */
    return noErr;

    There is a vi in the picture library called "Get Text Rect.vi" that will give you a cluster of the four points that make up the rectangle around a given text string with the provided font. I'm attaching a small example that demonstrates this.
    Brian
    Attachments:
    TextRect.vi ‏47 KB

  • Writing a text string in a table

    Right now the current piece of script is
    document.body.insertBefore(oAddLink, document.StockForm);
    and that writes the text string inside the form. Well I need
    to write it inside a table but the table doesn't have a name so how
    could I do that?

    TGuthrie wrote:
    > Right now the current piece of script is
    > document.body.insertBefore(oAddLink,
    document.StockForm);
    > and that writes the text string inside the form. Well I
    need to write it
    > inside a table but the table doesn't have a name so how
    could I do that?
    >
    I would give the <td> in which you want to place the
    link an id
    document.getElementById("yourID").innerHTML=oAddLink;
    Mick

  • Upload Task List Operation long Text using SAVE_TEXT-Urgent

    Hi ,
    I am trying to create Task List Operation Long text using the function module ..
    SAVE_TEXT .I am passing the following keys
    Text Name       300ATEST057 0000000900000009
    Language        EN
    Text ID            PLPO Long Text
    Text Object     ROUTING    Texts for task list types
    But the long texts are not getting updated in the Task lists operations .
    Can anyone please suggest whether SAVE_TEXT will work for Operation long Texts or not Are we missing something
    .This is pretty urgent requirement .Award points are assured.
    Regards
    Sam

    hi,
    use function module create text
    check the sample code
    DATA: BEGIN OF itab OCCURS 0,
          asnum LIKE asmd-asnum, " Service No
          text(5000)  TYPE c, " Long Text
          END OF itab.
    *DATA: itab1 LIKE itab OCCURS 0 WITH HEADER LINE.
    DATA: BEGIN OF itab1 OCCURS 0,
          asnum LIKE asmd-asnum, " Service No
          sequ  type i,          " Text Sequence
          text(5000)  TYPE c, " Long Text
          END OF itab1.
    To create Long Text lines for CREATE_TEXT function module
    DATA:BEGIN OF dt_lines OCCURS 0.
            INCLUDE STRUCTURE tline. " Long Text
    DATA:END OF dt_lines.
    Variable declarations for CREATE_TEXT function module
    DATA : dl_name TYPE thead-tdname, " Object Name
           dl_lan TYPE thead-tdspras. " Language
    Constants
    Object ID for Long Text of Service Master
    CONSTANTS:c_best TYPE thead-tdid VALUE 'LTXT',
              c_material TYPE thead-tdobject VALUE 'ASMD'. " Object
    for file splitting.
    DATA: start TYPE i,
          len   TYPE i VALUE 92,
          totlen TYPE i,
          n TYPE i.
    PARAMETERS p_file LIKE rlgrap-filename."input file
    At selection-screen on Value Request for file Name
    AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_file.
    Get the F4 Values for the File
      CALL FUNCTION 'F4_FILENAME'
        EXPORTING
          program_name  = syst-cprog
          dynpro_number = syst-dynnr
        IMPORTING
          file_name     = p_file.
    Start Of Selection
    START-OF-SELECTION.
    *To Upload Flat file
      CALL FUNCTION 'UPLOAD'
        EXPORTING
          filename                = p_file
          filetype                = 'DAT'
        TABLES
          data_tab                = itab
        EXCEPTIONS
          conversion_error        = 1
          invalid_table_width     = 2
          invalid_type            = 3
          no_batch                = 4
          unknown_error           = 5
          gui_refuse_filetransfer = 6
          OTHERS                  = 7.
      LOOP AT itab.
        itab1-asnum = itab-asnum.
        CLEAR: totlen,n, start.
        totlen = STRLEN( itab-text ).
        n = totlen / len.
        n = n + 1.
        DO n TIMES.
          itab1-text  = itab-text+start(len).
          itab1-sequ  = sy-index.
          start = start + len.
          APPEND itab1.
        ENDDO.
      ENDLOOP.
      delete itab1 where text is initial.
      SORT itab1 BY asnum sequ.
      LOOP AT itab1.
        dt_lines-tdformat = '*'.
        dt_lines-tdline = itab1-text.
        APPEND dt_lines.
    Call the Function Module to Create Text
        AT END OF asnum.
          dl_lan = sy-langu.
          WRITE : / itab-asnum.
          CALL FUNCTION 'CONVERSION_EXIT_ALPHA_INPUT'
            EXPORTING
              input  = itab1-asnum
            IMPORTING
              output = itab1-asnum.
          MOVE itab1-asnum TO dl_name.
          CALL FUNCTION 'CREATE_TEXT'
            EXPORTING
              fid         = c_best
              flanguage   = dl_lan
              fname       = dl_name
              fobject     = c_material
              save_direct = 'X'
              fformat     = '*'
            TABLES
              flines      = dt_lines
            EXCEPTIONS
              no_init     = 1
              no_save     = 2
              OTHERS      = 3.
          IF sy-subrc <> 0.
            WRITE:/ 'Long Text Creation failed for Service No'(001),
            itab1-asnum.
          ELSE.
            WRITE:/ 'Long Text Created Successfully for Service No'(002),
            itab1-asnum.
          ENDIF.
          REFRESH dt_lines.
        ENDAT.
      ENDLOOP.
    in text file give first field records in capitals
    regards
    siva

Maybe you are looking for