To take only first 12 chars doing SELECT

Dear ABAPers
I am doing
SELECT single * from TAB
    where A = MYKEY.
if SY-SUBRC=0.
  MYKEY2 = TAB-A.
endif.
The question is u2013 I need to take(analyse) only first 12 chars of A .
Say, A is 20 chars, MYKEY is 12 chars.
Is that possible to catch only first 12 chars of A in u201Cselectu201D statement?
If yes, provide the code please.
THANK YOU!

Try something like this,
data: var type string.
concatenate MYKEY '%' into var.
SELECT single * from TAB
where A like var.
if SY-SUBRC=0.
MYKEY2 = TAB-A.
endif.
Vikranth

Similar Messages

  • Select only first 10 chars from the field in a table while writlng a selec

    hi experts,
    In a table  one field contains a value of above 10 characters (ex 10 or 15 or 20 characters).But i want to select
    only first 10 characters from this field while writing a select statement.
    This logic should be included in select statement.
    please gime immediate solution.
    My question is understood.

    Hi,
    Try this one
    data : begin of itab occurs 0,
            maktx(10) type c,
    end of itab.
    " though the length of MAKTX is 40 you only get 10 chars
    select maktx from makt into table itab up to 10 rows.
    if sy-subrc is initial.
    endif.
    " Suppose the field name of table you want to select is MAKTX then declare
    " Your internal table in the above manner, it will automatically fit into it and will get 10 Chars only
    " Instead of burding the select query / DB interface use the above.
    Cheerz
    Ram

  • Photosmart C7280 only takes the first 4 chars of the WPA Key

    When I try to set the WEP key on the printer it seems to truncate after the first 4 chars. Some one said that there is a way to reset the printer using a reset button - pressing this might fix the problem. 
    Any ideas on how I can printer to work again wireless? 

    How are you trying to enter the key?  What operating system?  What router are you using?
    Say thanks by clicking "Kudos" "thumbs up" in the post that helped you.
    I am employed by HP

  • Can I use automatically select only first line of a caption to include in List of Figures?

    Is there a setting in the TOC utility in ID CS6 that will allow me to use only the first sentence in a caption to include in a list of Figures?
    Example
    Willard's Wharf, Cocoa, Florida, 1887.   This was Cocoa's first  blah blah blah.  Photo by a dead guy.  courtesy of a nice old lady whose grandmother collected it.
    In the example above, the entire passage is currently formatted using a paragraph style sheet in Arno Pro Caption.  When I'm done, I would like to have that first phrase or sentence in bold, which I planned to do with a character style sheet.  The remainder will be in regular type. 
    Now that I understand more how the TOC utility works, I'm wondering, can I make a paragraph style for the title phrase, and a second paragraph style for the remaining text in the caption that follows  If so, how to I ensure that the second paragraph will follow on the same line where ever the first paragraph style ends?  Nested styles, maybe?  If nested styles are the way to go, comments on or pointers to the simplest strategy to make this work will be appreciated.
    Captions are not consistent.  Some have a name and date; others are a Title phrase or sentence, followed, sometimes, by up to several sentences.  Typically, however, there is only one sentence after the title. I also usually have a "Courtesy of . . ." statement acknowledging the source of the photo.
    I'm a newbie using id cs6, for the first time, to format a book.  I'm enjoying using the program, but a few details sometimes bring me to a stop.
    Thanks
    Roy

    Roy,
    In fact, you only need a char style to control that you correctly mark what you want in the LOF.
    See how I do:
    1/ I create the para style "Caption" [color: Red] and insert a grep style in it.
    2/ I create the char style "Char_Caption" [color: Blue]. It only needs to control what I want in the LOF.
    3/ What I have to do is insert a "N-Joiner" in the "Caption" text. See the grep code of the grep style defined in the "Caption" para style.
    4/ I generate the TOC, only with the "Caption" para style. I select the story where I insert the TOC and launch this simple regex.
    Done! 

  • Copying and pasting adjustments.  When I copy the adjustments of an image, I thought I could then select several images and batch paste the adjustments to all selected images. But instead it's only pasting to the first photo of the selection. What am I do

    Copying and pasting adjustments.  When I copy the adjustments of an image, I thought I could then select several images and batch paste the adjustments to all selected images. But instead it's only pasting to the first photo of the selected. What am I doing wrong?

    Copy and Paste develop settings in Develop mode on multiple photos on the film strip works for me, even with Auto-Sync turned off.  Lr5.6 OSx 10.8.5

  • Not all selection screen value coming from selection screen only first val

    hi i am doing
    SELECTION-SCREEN BEGIN OF BLOCK gl_ac3 WITH FRAME TITLE text-019.
    SELECT-OPTIONS: gl_acdp1 FOR gv_gldep1.
    SELECTION-SCREEN END OF BLOCK gl_ac3.
    then i am using seelct as below
    SELECT      robukrs
                    rzzhkont
        FROM  zzamd1t INTO TABLE it_amdt
           WHERE ryear = p_gjahr
           AND   robukrs IN so_bukrs
           AND   rzzhkont IN gl_acdp1.
    but the value selected by select statement from internal table is for only first value of gl_acdp1 ie for first account c1 but user is entereng three acts c1 c2 and c3 so fro all data should be selected but for only one it is being selected
    pls sugest

    Hi,
        Is gv_gldep1 & rzzhkontare of same data type.
    Do as below
    SELECTION-SCREEN BEGIN OF BLOCK gl_ac3 WITH FRAME TITLE text-019.
    SELECT-OPTIONS: gl_acdp1 FOR gv_gldep1.
    SELECTION-SCREEN END OF BLOCK gl_ac3.
    INITILIZATION.
    MOVE 'I'      TO  gl_acdp1-sign,
               'EQ'  TO  gl_acdp1-option,
               'C1'   TO  gl_acdp1-low,
       APPEND gl_acdp1.
    MOVE 'I'      TO  gl_acdp1-sign,
               'EQ'  TO  gl_acdp1-option,
               'C2'   TO  gl_acdp1-low,
       APPEND gl_acdp1.
    MOVE 'I'      TO  gl_acdp1-sign,
               'EQ'  TO  gl_acdp1-option,
               'C3'   TO  gl_acdp1-low,
       APPEND gl_acdp1.
    START-OF-SELECTION.
    SELECT robukrs
                 rzzhkont
                               FROM zzamd1t INTO TABLE it_amdt
                               WHERE ryear = p_gjahr
                               AND robukrs IN so_bukrs
                               AND rzzhkont IN gl_acdp1.
    Make sure that ur table zzamd1t has values for C1, C2 and C3.
    Tell us how is ur output with this code.
    Regards,
    Bala Krishna
    Edited by: Bala Krishna on Aug 11, 2008 9:11 PM

  • I am having the problem when trying to take a panorama picture.   It may only take the first frame or doesn't even start at all when I press the shutter button. even though when i  hold the phone straight up and down, so that camera is at the top

    I am having the problem when trying to take a panorama picture. 
    It may only take the first frame or doesn't even start at all when I press the shutter button.
    even though when i  hold the phone straight up and down, so that camera is at the top on the back and the home button is on the bottom on the front.
    This problem is irritating me....?

    To take panorama
    - ensure that the panorama option is on
    - press the shutter button once
    - you will see a line with an arrow
    - move around in a circle  ( I keep the camera steady and turn myself around in a circle)
    - as you do this you will see the arrow moving across the screen as it captures pictures
    - at the end of the capture, you will be able to see your panorama picture
    I hope that this helps, do report back.

  • With my new macbook I attempted to open an older spreadsheet and get the following error message:  "This spreadsheet cannot be opened because ti is too old.  To open it, save it with numbers '09 first"  So how does one do this when I only have ver3.1?

    With my new macbook I attempted to open an older spreadsheet and get the following error message:  "This spreadsheet cannot be opened because ti is too old.  To open it, save it with numbers '09 first"  So how does one do this when I only have ver3.1?

    Numbers 3.x can only open Numbers '09 and later.  You will need Numbers '09 to open Numbers '08 files.
    If it is a single file (or only a few) you can email me and I will open and convert then email back.  My email address is in the "Biography" of my profile.
    You may have Numbers '09 installed.  Look in the folder "/Applications/iWork '09"  if Numbers is in that folder launch it, open the file you tried to open, and save.  Then you should be able to open in Numbers 3.x

  • Select from 1 table only if a value does not exist

    Hello all,
    I'm having problems devising a single select statement to accomplish a single return value. I have tried variations of DECODE and COALESCE, but it's escaping me.
    I have two tables that are as follows:
    NAME
    ID, FULLNAME
    1, Senior
    2, Junior
    3, Mister
    4, Senor
    5, Miss
    ABBREVIATION
    ID, ABBREV
    1, Sr
    2, Jr
    3, Mr
    5, Ms
    What I would like to do is select from the NAME table only if the value does not exist in the ABBREVIATION table.
    Ideally if I were to do something such as:
    SELECT * FROM .... WHERE (ID=1 or ID=2 or ID=4) ....
    I would receive the following output:
    1, Sr
    2, Jr
    4, Senor
    Thanks for reading!

    You want an outer join.
    SELECT decode(a.abbrev, NULL, n.fullname, a.abbrev)
    FROM name n,
    abbreviation a
    WHERE n.ID = a.ID(+)
      AND ....Something like that.
    Full example:
    with n as (
    select 1 as ID, 'Senior' as FULLNAME from dual UNION ALL
    select 2 as ID, 'Junior' as FULLNAME from dual UNION ALL
    select 3 as ID, 'Mister' as FULLNAME from dual UNION ALL
    select 4 as ID, 'Senor' as FULLNAME from dual UNION ALL
    select 5 as ID, 'Miss' as FULLNAME from dual),
    a as (
    select 1 as ID, 'Sr' as ABBREV from dual UNION ALL
    select 2 as ID, 'Jr' as ABBREV from dual UNION ALL
    select 3 as ID, 'Mr' as ABBREV from dual UNION ALL
    select 5 as ID, 'Ms' as ABBREV from dual)
    select decode(a.abbrev, NULL, n.fullname, a.abbrev)
    from a, n
    where n.id = a.id(+)
    order by n.id;
    ID                     DECODE(A.ABBREV,NULL,N.FULLNAME,A.ABBREV)
    1                      Sr                                       
    2                      Jr                                       
    3                      Mr                                       
    4                      Senor                                    
    5                      Ms                                       
    5 rows selectedEdited by: tk-7381344 on Nov 17, 2008 1:31 PM

  • Hi, I was working on a PDF writing comments using Adobe Reader on a Mac.  I clicked save and got a 'cannot save' message.  I then clicked save as instead, Reader froze and my PDF disappeared.  The only version saved has only my first comment.  Does Adobe

    Hi, I was working on a PDF writing comments using Adobe Reader on a Mac.  I clicked save and got a 'cannot save' message.  I then clicked save as instead, Reader froze and my PDF disappeared.  The only version saved has only my first comment.  Does Adobe Reader save to temporary files that I can access in order to recover my work?  Is there any other way to recover it?  Thanks!

    Hi @Pat Willener,
    since I got the same problem as pdfprincess I hope you can help me. The 'Automatically save document changes to temporary file...' is enabled in my adobe reader.
    A file I worked (commented) on a lot crashed. When I reopened the file, adobe reader didn't ask if I want to restore my changes in this file, as it is written on the help.adobe.com page. Is there any possibility to restore the changes manually from the temporary file?
    Thanks in advance - it is really important for me to restore these changes!!

  • Select first 4 char

    Hi all,
    I am new to ABAP.
    I want select first 4 char of  variable.
    Example:
    X = '627128891'.
    i want first 4 char of X  save to Y.
    Y= '6271'.
    How can I do it with ABAP statement?
    Thanks
    Shiva.

    hi,
    data x(10) type c value '1234567'.
    data y(4) type c.
    y = x0(4).   " xn(m) n is the starting position and m no of character from n.
    output y = 1234.. first four characters
    y = x+2(2).
    output y = 34 ..
    rewards if understood..
    regards,
    nazeer

  • How to select only first few values in a Column

    Hi, in one of the column of type SDO_GEOMETRY. In that column we have many values. Example : *(-6.33787700000002, 56.547309, -6.33786800000001, 56.547279, -6.33781400000001, 56.547249, -6.33776900000001)*
    I wanted to know how can i select only first two or last two values from within the column.
    Eg: i want only -6.33787700000002, 56.547309 to be displayed
    Thanks

    Hi,
    Are the value specified here are multirow or single row data?
    if it is multi row, Karthick solution should work. Else if it is a single row then try this
    with T as
    select '-6.33787700000002, 56.547309, -6.33786800000001, 56.547279, -6.33781400000001, 56.547249, -6.33776900000001' SDO_GEOMETRY from dual
    -- end of sample data
    select substr(SDO_GEOMETRY,1,instr(SDO_GEOMETRY,',',1,&cnt)-1) Output from T
    PRAZY@11gR2> /
    Enter value for cnt: 2
    OUTPUT
    -6.33787700000002, 56.547309
    Elapsed: 00:00:00.05And remember, while posting questions it is good to specify your DB version with clear sample data and required output.
    HTH,
    Prazy

  • Virtual chars does not take part in update rules

    Hi
    Friends my question is Virtual Chars Does not take part in update rules than why to include it in data target??? directly we can include it at query designer .
    Thanks
    Asim

    Hi,
    Adding a charachteristics is to have a place holder in your data target. In virtual char you make use of this field memory pointer to populate the data for this field.
    Hope this helps for you.
    Thanks,
    Arun

  • My ipod touch 5th generation wont charge or turn on at all, at first i though the lightning cable was the problem so i bought 2 more lightning chargers and the only thing my ipod does it gets really hot but wont turn on :( help!!

    My ipod touch 5th generation wont charge or turn on at all,
    i upgraded to iOS 6.1.3 and after that my ipod started having trouble charging, at first i though the lightning cable was the problem so i bought 2 more lightning cable chargers and my ipod still would'nt charge, so it died. now the only thing my ipod does is when i try to turn it on it shows the apple logo and then the screen goes off and does it again for a few times and then the screen stays off and my ipod gets really hot but wont turn on for the rest of the day help!!

    The hotness indicate a hardware problem.
    Make an appointment at the Genius Bar of an Apple store.
    Apple Retail Store - Genius Bar
    or send it to Apple.
    Apple - Support - iPod - Service FAQ
    If not abused Apple will exchange it for a refurbished one at no coast. otherwise the exchange price is $149.

  • CC for students is 14.99 a month or prepaid 180 for a year but only for the first year. Does anyone know how much more it is on the second year

    CC for students is 14.99 a month or prepaid 180 for a year but only for the first year. Does anyone know how much more it is on the second year

    Hello,
    please pass through these libks:
    https://creative.adobe.com/plans?plan=edu >>> Promotional pricing for first year. See terms >>> http://www.adobe.com/offer-terms/edu_puf_promo.edu.html >>> After the first year we will renew your contract automatically for another year at the then-current standard annual price (currently at $359.88), unless you cancel.
    Hans-Günter

Maybe you are looking for

  • File to File Scenario - NFS

    Hi, We are busy with a very simple file-to-file scenario using NFS transport protocol. The source directory that I enter was as follows i.e. //xx.xxx.xx.xx/directoryname, but I keep on getting a configuration error on the adapter engine with the foll

  • Increase Menu Font sizes for Premier CC 2014 with 4K Monitor

    I have just purchased an 4K monitor, but the menu fonts are to small to read.  In Illustrator CC 2014, there is an option to increase them by 200%, which is perfect, but Premier doesn't seem to offer that.  Is there a solution?

  • Offline database and table, view, package organization

    Hi, I tried to import my database schema with package, synonyms, tables, and views into a jdev project (11.1.1.1.0) and noticed that unlike the online db view, all object types are imported/organized under one folder (the name of the schema). For exa

  • Pop up to purchase more data?

    I have an iPad mini (about 6 months old), and I'm on a Verizon contract for data usage.  I never even come close to the limit for data since I'm on my wireless network when I'm home.  I keep getting a pop up, telling me I'm almost out of data and ask

  • Virtual three-ring binder,,,,

    Hi.  I am looking for a Mac application that acts as a virtual three-ring binder / file manager -  something where I can set up categories and drag and drop PPT, XLS, PDF, photos, or other notes and arrange them visually across multiple subject tabs.