How to write selected text in JTextArea in selected location

iam using JTextArea ...
i want to writer selected text in selected location,,,,,,

use
JTextArea.getSelectedText() and
JTextArea.replaceRange(String str, int start, int end)
methods.

Similar Messages

  • How to write Select statement for this codition

    I need to check whether SGTXT contains BELNR value.
    SGTXT is a text field and It should be matched with BELNR
    How to write select statement for this.
    Select AUGBL AUGDT into t_BSAD
    from BSAD
    where SGTXT should have the given BELNR Value.
    Plz note : Here I cannot give as SGTXT = BELNR as coz BELNR have only 10 digits.

    Hi,
    data temp(12).
    concatenate '%' belnr '%' into temp.
    Select AUGBL AUGDT into t_BSAD
    from BSAD
    where SGTXT like temp.
    If belnr is having multiple values,just create a internal table as follows.
    types : begin of ty,
            belnr....
            temp(12),
            end of ty.
    data itab_ type standard table of ty.
    data wa type ty.
    loop at itab into wa.
    concatenate '%' wa-belnr '%' into wa-temp.
    modify itab from wa index sy-tabix transporting temp.
    endloop.
    Change your select statement accordingly.
    Kindly reward poits if it helps.

  • How to write select statement in XSL-FO type XML program

    Hi All,
    Could you please anyone explain briefly how to write select statement in XSL-FO XML Program.
    Requirement:
    In the seeded program, OAF page is creating one XML file and through XSL-FO type XML Pulisher loading data and generating PDF output. as per the requirement some of the informations are missing in the XML file and for modifing the OAF page will be taking someting. we are planing to write a select query inside the XSL-FO program to get the required information.
    Could you please help me how to write a select statement inside the XSL-FO type programs.
    Please give me some example program for this...
    Thanks in Advance.
    Regards,
    Senthil

    Hi ,
    Please check the below code and modified plant as select-option
    Check the below code :
    tables : mara,
    mast.
    data : begin of i_data occurs 0,
    matnr like mara-matnr,
    end of i_data.
    select-options : s_matnr for mara-matnr,
                           <b>S_werks for mast-werks.</b>
    start-of-selection.
    select a~matnr into table i_data
    from mara as a inner join mast as b on amatnr = bmatnr
    where <b>b~werks in s_werks</b>
    and a~matnr in s_matnr
    and a~mtart = 'AA'
    or a~mtart = 'UT'
    and b~stlan = '1'.
    loop at i_data.
    write:/ i_data-matnr.
    endloop.
    Hope you got it.
    Thanks
    Seshu

  • How to write SELECT statement using tables ekko,ekpo and eket?

    Hi,
    I got a problem in  performance tuning using below tables?
    how to write SELECT statement using tables EKKO,EKPO and EKET and in conditon ( WHERE clause)  use only fields 
                        ekko~ebeln       IN ebeln
                       ekko~loekz       EQ ' '
                       ekko~lifnr       IN lifnr
                       ekko~ekorg       IN ekorg
                      ekko~ekgrp       IN ekgrp          
                       ekpo~werks       IN werks
                       ekpo~pstyp       EQ  '3'
                       ekpo~loekz       EQ  space
                       ekpo~elikz       EQ  space
                       ekpo~menge       NE  0
                     eket~rsnum       NE space.
    Thanks in Advance.
    bye.

    Hi,
    ekko~ebeln IN ebeln
    ekko~loekz EQ ' '
    ekko~lifnr IN lifnr
    ekko~ekorg IN ekorg
    ekko~ekgrp IN ekgrp
    ekpo~werks IN werks
    ekpo~pstyp EQ '3'
    ekpo~loekz EQ space
    ekpo~elikz EQ space
    ekpo~menge NE 0          " Remove this from where clause
    eket~rsnum NE space.    " Remove this from where clause
    ' instead delete the entries after fetching into the table
    DELETE it_itab WHERE menge EQ '0' AND rsnum EQ ' '.
    Regards
    Bala Krishna

  • How to write selection-screen block on 15th position?

    Hello all,
    I want to write selection-screen block on 15th position, How can I do this?
    I know that we can write parameter/select-option on perticuler position using following code.
    SELECTION-SCREEN BEGIN OF BLOCK b1 WITH FRAME TITLE t7.
    SELECTION-SCREEN BEGIN OF LINE.
    SELECTION-SCREEN POSITION 15.
    PARAMETERS: fdat LIKE SY-DATUM,
    SELECTION-SCREEN END OF LINE.
    SELECTION-SCREEN END OF BLOCK b1.
    It writes parameter(FDAT) on 15th position. How can I write whole block on 15th position?

    Hi,
    For this u have to use comment lines. See the below simple program...
    SELECTION-SCREEN COMMENT /2(50) TEXT-001 MODIF ID SC1.
    SELECTION-SCREEN SKIP 2.
    SELECTION-SCREEN COMMENT /10(30) COMM1.
    SELECTION-SCREEN ULINE.
    PARAMETERS: R1 RADIOBUTTON GROUP RAD1,
    R2 RADIOBUTTON GROUP RAD1,
    R3 RADIOBUTTON GROUP RAD1.
    SELECTION-SCREEN ULINE /1(50).
    SELECTION-SCREEN COMMENT /10(30) COMM2.
    SELECTION-SCREEN ULINE.
    PARAMETERS: S1 RADIOBUTTON GROUP RAD2,
    S2 RADIOBUTTON GROUP RAD2,
    S3 RADIOBUTTON GROUP RAD2.
    SELECTION-SCREEN ULINE /1(50).
    INITIALIZATION.
    COMM1 ='Radio Button Group 1'.
    COMM2 ='Radio Button Group 2'.
    LOOP AT SCREEN.
    IF SCREEN-GROUP1 = 'SC1'.
    SCREEN-INTENSIFIED = '1'.
    MODIFY SCREEN.
    ENDIF.
    ENDLOOP.

  • How to write select statement ?

    Hi,
    i have requirement like below :
    In selection screen we have material number as selection options  and plant as single entry.
    Based on the input.
    We have to extract  the material number and plant based on MTART = AA or UT in MARA table and STLAN = 1 in MAST table.
    how to write a select statment to pick values from selection option and extract those material and plant which fullfill above conditions.
    Please let me know..
    its urgent
    please help..
    i have written code like below..
    types: begin of x_it_mat,
           matnr type mkal-matnr,
           werks type mkal-werks,
           stlan type mast-stlan,
           end of x_it_mat.
    types: begin of x_it_mat1,
           matnr type mkal-matnr,
           werks type mkal-werks,
           mtart type mara-mtart,
           end of x_it_mat1.
    data : it_mat type table of x_it_mat,
           wa_mat like line of it_mat.
    data : it_mat1 type table of x_it_mat1,
           wa_mat1 like line of it_mat1.
    TABLES: MKAL , MAST , MARA.
    SELECTION-SCREEN BEGIN OF BLOCK matnr
                              WITH FRAME TITLE TEXT-001.
    select-options :
      so_matnr for mkal-matnr.
    SELECTION-SCREEN END OF BLOCK matnr.
    SELECTION-SCREEN BEGIN OF BLOCK plant
                              WITH FRAME TITLE TEXT-002.
    parameter p_werks type mkal-werks.
    SELECTION-SCREEN END OF BLOCK plant.
    select matnr
           werks
           stlan
           from mkal INTO table it_mat
           where matnr in so_matnr
           and werks = p_werks.
    after this how to write another select statement to extract material by satisfiying above 2 conditions..

    Hi ,
    Please check the below code and modified plant as select-option
    Check the below code :
    tables : mara,
    mast.
    data : begin of i_data occurs 0,
    matnr like mara-matnr,
    end of i_data.
    select-options : s_matnr for mara-matnr,
                           <b>S_werks for mast-werks.</b>
    start-of-selection.
    select a~matnr into table i_data
    from mara as a inner join mast as b on amatnr = bmatnr
    where <b>b~werks in s_werks</b>
    and a~matnr in s_matnr
    and a~mtart = 'AA'
    or a~mtart = 'UT'
    and b~stlan = '1'.
    loop at i_data.
    write:/ i_data-matnr.
    endloop.
    Hope you got it.
    Thanks
    Seshu

  • How to write select statement before the loop and how to use read statemnt

    Hi,
    Recently our system has changed from 4.6 to ECC6.
    As its migrated its showing lots of errors like in between loop and endloop there should be no select statemnt........
    Can any one please tell how to write that coding in ECC6 , how can i change the code......
    In between loop and endloop i am having lots of select statemnts.....ple tell thye coding how can i select before the loop starts and
    how to read that internal table in loop.

    Hi Deepthi,
    You can do as per below:
    1) Select the required entries from the tables you need (VBAK, VBAP, KNA1, etc)
    SELECT VBELN ERDAT KUNNR
        into table it_vbak
        from VBAK
    where VBELN = S_VBELN. "Selection criteria
    If sy-subrc = 0.
    SELECT VBELN POSNR MATNR
        into table it_vbap
        from VBAP
    for all entries in it_vbak
    where VBELN = it_vbak-vbeln
    SELECT KUNNR NAME1
        into table it_vbak
        from VBAK
    where VBELN = it_vbak-vbeln.
    endif.
    2) Loop at the entries, and read internal table it-kna1 for customer info.
    Loop at it_vbak into wa_vbak.
    read table it_kna1 into wa_kna1 with key kunnr = wa_vbak-kunnr.
    if sy-subrc = 0.
    endif.
    loop at it_vbap into wa_vbap where vbeln = wa_vbak-vbeln.
    endloop.
    endloop.
    This is the basic idea and short example of how to extract entries and read internal table.
    Hope this helps.
    Regards,
    Patrick

  • How to write select statement directly in java file instead of using vo

    Hi,
    I have written the following code in my java file:
    if(empvo==null)
    empvo=worklistamimpl2.createViewObject("InvoiceVO", "xxetfc.oracle.apps.icx.icatalog.shopping.server.InvoiceVO");
    if(empvo!=null){
    OAViewObject oaviewobject2 = (OAViewObject)worklistamimpl2.findViewObject("InvoiceVO");
    OAViewObjectImpl oaviewobjectimpl = (OAViewObjectImpl)oapagecontext.getApplicationModule(oawebbean).findViewObject("InvoiceVO");
    oaviewobject2.setWhereClause("Invoice_num="+" ' " + s + " ' ");
    oaviewobjectimpl.executeQuery();
    String abc = (String)oaviewobjectimpl.first().getAttribute("Invoice_id");
    It is giving me error as
    oracle.apps.fnd.framework.OAException: oracle.jbo.SQLStmtException: JBO-27122: SQL error during statement preparation. Statement: SELECT * FROM (select invoice_id from ap_invoices_all) QRSLT WHERE (Invoice_num='ERS15022012_3')
    1. Why is this error coming.. how to solve this
    2. Instead of using vo how can i write select statement directly in the above code
    Thanks,
    Edited by: user10873676 on Apr 9, 2012 1:18 AM
    Edited by: user10873676 on Apr 9, 2012 1:21 AM

    it says java.sql.SQLSyntaxErrorException: ORA-00904: "INVOICE_NUM": invalid identifier
    where as invoice_num column is present in my table

  • How  to write select query for this

    Hi,
    I had a html form and in the for i had drop down box and it needs to select multiple values from the drop down box. When i select multiple values then i have to write the SQL select statement  query .
    When i try to write the select statement and trying to run i am getting error.
    select * from Table
    where emo_no = '1,2,3'
    this is how i write query please suggest me how  to write query for selecting multiple values from the drop down box.
    Thanks

    select * from Table
    where emo_no in ( 1,2,3)
    for integer values
    select * from Table
    where emo_no in ('1','2','3')
    for characters
    If we talk about large scale applications that may have millions of records, I would suggest this.
    declare @t table (v int)
    insert into t (v) values (1)
    insert into t (v) valves (2)
    insert into t (v) values (3)
    select *
    from table
         inner join @t t on table.emo_no = t.v
    Using "in" for a where clause is not so bad for filtering on a few values, but if you are filtering a lot of rows and a lot of values (emo_no) the performance degrades quickly for some reasons beyond the scope of this.
    This is just one solution, I'll through this out as well, instead of an in memory (@t) table, doing a disk based temp table (#t) and creating an index on the column "v".
    create table #t (v int)
    insert into #t (v) values (1)
    insert into #t (v) valves (2)
    insert into #t (v) values (3)
    create index ix_t on #t (v)
    select *
    from table
         inner join #t t on table.emo_no = t.v
    drop table #t
    Pardon any syntax errors and careful using a drop statement.
    Sometimes in memory tables work better than disk temp tables, it takes some testing and trial and error depending on your datasets to determine the best solution.
    Probably too much info  ;-)
    Byron Mann
    [email protected]
    [email protected]
    Software Architect
    hosting.com | hostmysite.com
    http://www.hostmysite.com/?utm_source=bb

  • How to display giant text in JTextArea???

    hi!.......how can i display lets say 20mbs of text in JTextArea?......i try to display but it only show till 2-3mb then the rest is empty.....anyone knows how?

    Hi, I don't know how.
    But I know that it wouldn't be so nice loading 20/30 Mb of text at once. You could load a smaller amount of data like 1 Mb and show it. Then when the user scrolls to bottom you could load more text.
    pseudocode :
    - load some text and show it
    - while true
    if user scrolls down
    * actualize text showed loading more text if necesary
    if user scrolls up
    * actualize text showed
    - end while
    Hope it helps.

  • How to write the text into text objects

    Hi,
    I have one requirements . from the web we get the delivery line item based pallet numbers info with Quntity .
    How to write the line item level pallet information in the the Delivery line items text element "pallet info" .
    Any function module to write the text data into text elements in SAP like READ_TEXT.
    please give your valuable suggisions .
    Thanks &Regards
    Sai.

    Try:
    CREATE_TEXT
    SAVE_TEXT

  • How to write select within select  in ABAP

    Hi Guys
    I want to write a select statement in ABAP to select from 2 tables below is my code I want to write select within select statment in --->A and replace with ---> B
    FORM sales_production_order  USING    p_vbeln TYPE vbeln_va
                                 CHANGING p_aufnr TYPE aufnr
                                          p_rtcod TYPE sysubrc.
      CLEAR: p_rtcod,
             p_aufnr.
    A *******
      SELECT aufnr FROM aufk INTO p_aufnr UP TO 1 ROWS
        WHERE kdauf EQ p_vbeln .
    B *******
      SELECT kdauf from aufk into p_aufnr UP TO 1 ROWS
        WHERE KDAUF IN ( SELECT VBELN FROM VBAP where vbeln EQ p_vbeln) .
      ENDSELECT.
      p_rtcod = sy-subrc.
    ENDFORM.                    " sales
    T

    Hi Eslam,
    In select statements, ENDSELECT must be added when single line returned without the addition 'SINGLE'.
    The innner query in your code, returns a single record but with the addition 'UP TO 1 ROWS'. The outer query also like this only. But the outer query ended with 'ENDSELECT', not for inner query.
    Else you can add 'SINGLE' keyword.
      SELECT aufnr FROM aufk INTO p_aufnr UP TO 1 ROWS
        WHERE kdauf EQ '10' .
        SELECT SINGLE kdauf from aufk into p_aufnr
        WHERE KDAUF IN ( SELECT VBELN FROM VBAP where vbeln EQ p_vbeln) .
      ENDSELECT.
      SELECT aufnr FROM aufk INTO p_aufnr UP TO 1 ROWS
        WHERE kdauf EQ '10' .
    ***** It assigns Nth record's KDAUF to p_aufnr provided N records satisfy the condition.
        SELECT  kdauf from aufk into p_aufnr UPTO 1 ROWS
        WHERE KDAUF IN ( SELECT VBELN FROM VBAP where vbeln EQ 'p_vbeln) .
        ENDSELECT.
      ENDSELECT.
    Regards,
    R.Nagarajan.

  • How to write select statement into SCRIPT editor

    hello,
    i build a sap script for purchase order printing for exporting.
    now after all po order print fine then our client want some more should be print into layout regarding po header.
    At the soul my q is can i write select query into script editor itself.
    thanks and regards
    amit.

    You cannot write your select statement inside your SAPscript, to overcome this SAP has provided us an option of calling sub-routines.. go through the below example
    Go through this example
    Ex. SAPSCRIPT
    /: PERFORM <Subroutine name> IN PROGRAM <subroutine prog name>
    /:USING &<field name>&
    /:CHANGING &<field name1&    "It will be returned back from sub-routine
    /:ENDPERFORM
    Then create subroutine pool program(of your own name) and you have to write the code.
    FORM ><subroutine name> tables int_cond structure itcsy
    outt_cond structure itcsy.
    data : value(20), value1(20). "do your own declarations
    Read int_cond table index 1.
    value = int_cond-value.
    value1 = value1 + value.
    *****Write your select statement
    Read outt_cond table index 1.
    outt_cond-value = value1.
    Modify outt_cond index 1. 
    ENDFORM.
    Just rough idea given above.
    Regards,
    SaiRam

  • How to right align text in JTextArea

    Can u plz tell me how to right align text in JTextArea

    what do you mean by align text in java you mean you have a default text that align in the center is it?
    can you please explain ur question clearly
    Thanks

  • How to determine the text on a given Mouse Location

    Hi friends,
    Can you people guide me with this feature? I'm using JTextPane & want to determine the text on a given Mouse Location on Mouse Click event. I consulted the docs but could'nt make out any methods providing this feature.
    Thanx in advance.
    Afroze.

    Hi,
    I think you can use the viewToModel() method... it should do the trick.
    Regards.

Maybe you are looking for