Read from vbak

i need to read bname, netwr from vbak where vbeln = clientordernum

Hi,
Try this..
DATA: v_bname TYPE vbak-bname.
DATA: v_netwr TYPE vbak-netwr.
SELECT SINGLE bname netwr
              INTO (v_bname,v_netwr)
              FROM vbak
              WHERE vbeln = clientordernum.
Thanks,
Naren

Similar Messages

  • Is there any VIEW or FM for pulling data from VBAK, VBAP?also for VBEP,VBBE

    Hi Experts,
    1) Instaed of using JOINS and FOR ALL ENTRIES, am looking to use any view or FM for pullinmg the data from, VBAK & VBAP,
    So, pls let me knwo that, Is there any VIEW or FM for pulling the data from the above  of tables
    2) Instaed of using JOINS and FOR ALL ENTRIES, am looking to use any view or FM for pullinmg the data from, VBEP & VBBE,
    So, pls let me knwo that, Is there any VIEW or FM for pulling the data from the above  of tables
    3) Am guessing FOR ALL ENTRIES is better than JOINS in PERFORMENCE perspective, Is am I correct?
    thanq
    Edited by: Srinivas on May 9, 2008 5:36 PM

    Hi Srinivas,
    You can use the view WB2_V_VBAK_VBAP2 for fetching data from VBAK and VBAP instead of using a JOIN. Note that, in the view, item data fields will have a I following the field name (POSNRI, MATNR_I are the item data fields from VBAP). The master data fields of VBAK are the same.
    As far as i know, there are no standard views provided by SAP for VBEP and VBBE. Not sure if FM exists either.
    While using FOR ALL ENTRIES clause make sure that you specify the entire primary key (EX. if selecting from VBAP specify VBELN and POSNR) as fields for selection or in the selection criteria. Its much better if you have the primary key in both. This is really important because without specifying the entire key and using FOR ALL ENTRIES will drastically bring down the performance. And also, If you are fetching not more than 100 or 200 entries using the clause it is fine, beyond that its same as using a select statement within LOOP...ENDLOOP.
    So, you have to decide whether to use FOR ALL ENTRIES or a JOIN while selecting data depending on the requirement. If you don't have the entire key either in fields for selection or selection criteria, then its better to use a JOIN or VIEW.
    The following is an example for using FOR ALL ENTRIES clause effectively.
             Select VBELN
                        POSNR
                        MATNR
                From VBAP
                  into Table T_VBAP
              For All Entries in T_DATA
              Where VBELN eq T_DATA-VBELN
                  And POSNR eq T_DATA-POSNR.
    I hope this helps, Please let me know if you need further assistance.

  • Standard function modules for selection from vbak/vbup/ekko/ekpo

    hi experts ,
    do you know if there is an existing standard function modules for selection from vbak/vbup/ekko/ekpo.
    please help

    Hi,
    for VBAK
    ADSPCM_READ_VBAK               Read VBAK (with SPEC2KM-data)
    PRS_GET_GLOBAL_VBAK            Get global structure VBAK
    Regards,
    Jyothi CH.
    Edited by: Jyothi Chinnabathuni on Feb 23, 2009 2:46 PM

  • Sequential Read on VBAK

    Hi All,
    Please help me to avoid sequential access on the table VBAK.
    as i am using this query on VBAK,VBUK,VBPA and VBFA.
    the query as follows.
    How to improve the performance of this query,its very urgent please give me the sample query if possible.
        SELECT     a~vbeln
    a~erdat
    a~ernam
    a~vkorg
    a~vkbur
    a~kunnr
    b~kunnr AS kunnr_shp
    b~adrnr
    c~gbstk
    c~fkstk
               d~vbeln AS vbeln_i
    INTO CORRESPONDING FIELDS OF TABLE t_z92sales
    FROM  vbak AS a INNER JOIN vbuk AS c ON avbeln = cvbeln
    INNER JOIN vbpa AS b ON avbeln = bvbeln
    AND bposnr = 0 AND bparvw = 'WE'
    LEFT OUTER JOIN vbfa AS d ON avbeln = dvbelv AND d~vbtyp_n = 'M'
    WHERE ( a~vbeln BETWEEN fvbeln AND tvbeln )
    AND a~vbtyp = 'C'
    AND a~vkorg IN vkorg_s
    AND c~gbstk IN gbstk_s.

    Hi Ramada,
    Try using the following code. It is a lot faster.
    RANGES: r_vbeln FOR vbka-vbeln.
    DATA: w_index TYPE sy-tabix,
          BEGIN OF t_vbak OCCURS 0,
            vbeln  TYPE vbak-vbeln,
            erdat  TYPE vbak-erdat,
            ernam  TYPE vbak-ernam,
            vkorg  TYPE vbak-vkorg,
            vkbur  TYPE vbak-vkbur,
            kunnr  TYPE vbak-kunnr,
            del(1) TYPE c         ,
          END OF t_vbak,
          BEGIN OF t_vbuk OCCURS 0,
            vbeln TYPE vbuk-vbeln,
            gbstk TYPE vbuk-gbstk,
            fkstk TYPE vbuk-fkstk,
          END OF t_vbuk,
          BEGIN OF t_vbpa OCCURS 0,
            vbeln TYPE vbpa-vbeln,
            kunnr TYPE vbpa-kunnr,
            adrnr TYPE vbpa-adrnr,
          END OF t_vbpa,
          BEGIN OF t_vbfa OCCURS 0,
            vbelv TYPE vbfa-vbelv,
            vbeln TYPE vbfa-vbeln,
          END OF t_vbfa,
          BEGIN OF t_z92sales OCCURS 0,
            vbeln     TYPE vbak-vbeln,
            erdat     TYPE vbak-erdat,
            ernam     TYPE vbak-ernam,
            vkorg     TYPE vbak-vkorg,
            vkbur     TYPE vbak-vkbur,
            kunnr     TYPE vbak-kunnr,
            gbstk     TYPE vbuk-gbstk,
            fkstk     TYPE vbuk-fkstk,
            kunnr_shp TYPE vbpa-kunnr,
            adrnr     TYPE vbpa-adrnr,
            vbeln_i   TYPE vbfa-vbeln,
          END OF t_z92sales.
    IF NOT fvbeln IS INITIAL
    OR NOT tvbeln IS INITIAL.
      REFRESH r_vbeln.
      r_vbeln-sign   = 'I'.
      IF fvbeln IS INITIAL.
        r_vbeln-option = 'EQ'.
        r_vbeln-low    = tvbeln.
      ELSEIF tvbeln IS INITIAL.
        r_vbeln-option = 'EQ'.
        r_vbeln-low    = fvbeln.
      ELSE.
        r_vbeln-option = 'BT'.
        r_vbeln-low    = fvbeln.
        r_vbeln-high   = tvbeln.
      ENDIF.
      APPEND r_vbeln.
      CLEAR r_vbeln.
      SELECT vbeln
             erdat
             ernam
             vkorg
             vkbur
             kunnr
        FROM vbak
        INTO TABLE t_vbak
        WHERE vbeln IN r_vbeln
        AND   vbtyp EQ 'C'
        AND   vkorg IN vkorg_s.
      IF sy-subrc EQ 0.
        SORT t_vbak BY vbeln.
        SELECT vbeln
               gbstk
               fkstk
        FROM vbuk
        INTO TABLE t_vbuk
        FOR ALL ENTRIES IN t_vbak
        WHERE vbeln EQ t_vbak-vbeln
        AND   gbstk IN gbstk_s.
        IF sy-subrc EQ 0.
          SORT t_vbuk BY vbeln.
          LOOP AT t_vbak.
            w_index = sy-tabix.
            READ TABLE t_vbuk WITH KEY vbeln = t_vbak-vbeln
                                       BINARY SEARCH
                                       TRANSPORTING NO FIELDS.
            IF sy-subrc NE 0.
              t_vbak-del = 'X'.
              MODIFY t_vbak INDEX w_index TRANSPORTING del.
            ENDIF.
          ENDLOOP.
          DELETE t_vbak WHERE del EQ 'X'.
        ENDIF.
      ENDIF.
    ELSE.
      SELECT vbeln
             gbstk
             fkstk
      FROM vbuk
      INTO TABLE t_vbuk
      WHERE vbtyp EQ 'C'
      AND   gbstk IN gbstk_s.
      IF sy-subrc EQ 0.
        SORT t_vbuk BY vbeln.
        SELECT vbeln
               erdat
               ernam
               vkorg
               vkbur
               kunnr
          FROM vbak
          INTO TABLE t_vbak
          FOR ALL ENTRIES IN t_vbuk
          WHERE vbeln EQ t_vbuk-vbeln
          AND   vkorg IN vkorg_s.
        IF sy-subrc EQ 0.
          SORT t_vbak BY vbeln.
        ENDIF.
      ENDIF.
    ENDIF.
    IF NOT t_vbak[] IS INITIAL.
      SELECT vbeln
             kunnr
             adrnr
        FROM vbpa
        INTO TABLE t_vbpa
        FOR ALL ENTRIES IN t_vbak
        WHERE vbeln EQ t_vbak-vbeln
        AND   posnr EQ '000000'
        AND   parvw EQ 'WE'.
      IF sy-subrc EQ 0.
        SORT t_vbpa BY vbeln.
        SELECT vbelv
               vbeln
          FROM vbfa
          INTO TABLE t_vbfa
          FOR ALL ENTRIES IN t_vbpa
          WHERE vbelv EQ t_vbpa-vbeln
          AND   vbtyp_n EQ 'M'.
        IF sy-subrc EQ 0.
          SORT t_vbfa BY vbelv.
        ENDIF.
      ENDIF.
    ENDIF.
    REFRESH t_z92sales.
    LOOP AT t_vbak.
      READ TABLE t_vbuk WITH KEY vbeln = t_vbak-vbeln
                                 BINARY SEARCH
                                 TRANSPORTING
                                   gbstk
                                   fkstk.
      IF sy-subrc EQ 0.
        READ TABLE t_vbpa WITH KEY vbeln = t_vbak-vbeln
                                           BINARY SEARCH
                                           TRANSPORTING
                                             kunnr
                                             adrnr.
        IF sy-subrc EQ 0.
          READ TABLE t_vbfa WITH KEY vbelv = t_vbak-vbeln
                                     BINARY SEARCH
                                     TRANSPORTING
                                       vbeln.
          IF sy-subrc EQ 0.
            t_z92sales-vbeln     = t_vbak-vbeln.
            t_z92sales-erdat     = t_vbak-erdat.
            t_z92sales-ernam     = t_vbak-ernam.
            t_z92sales-vkorg     = t_vbak-vkorg.
            t_z92sales-vkbur     = t_vbak-vkbur.
            t_z92sales-kunnr     = t_vbak-kunnr.
            t_z92sales-gbstk     = t_vbuk-gbstk.
            t_z92sales-fkstk     = t_vbuk-fkstk.
            t_z92sales-kunnr_shp = t_vbpa-kunnr.
            t_z92sales-adrnr     = t_vbpa-adrnr.
            t_z92sales-vbeln_i   = t_vbfa-vbeln.
            APPEND t_z92sales.
            CLEAR  t_z92sales.
          ENDIF.
        ENDIF.
      ENDIF.
    ENDLOOP.

  • Select from vbak, vbrk and vbrp

    Hi experts,
    In one of my programs i hve to select the data from tables <b>VBAK, VBRK</b> and <b>VBRP.</b>
    The requirement is:
    <b>parameters: p_matnr like vbrp-matnr,
                p_charg like vbrp-charg.
    select-options: audat for vbak-audat.</b>
    upon entering the values on selection-screen,
    i need to select <b>FKDAT, FKIMG</b> from tables VBRK and VBRP respectively.
    Please help me in writing the selection.
    Any help is appreciated.
    Thanks a lot.

    Hi,
    Hope this will give u some idea..
    select avbeln bfkdat into table itab from vbak as a inner join
                                  vbrk as b on
                                  avbeln = bvbeln where
                                  a~audat in s_audat.
    if not itab[] is initial.
    select fkimg into corresponding fields of table itab_final
                  from vbrp for all entries in itab
                  where vbeln = itab-vbeln and
                        matnr = p_matnr and
                        charg = p_charg.
    endif.
    Cheer,
    Vikram
    Pls reward fopr helpful replies!!

  • Can't see some type of orders from VBAK table in 2LIS_11_VAITM

    Hi
    What could be the reason that I I can't see some type of orders from VBAK table in 2LIS_11_VAITM extractor.
    (VBAK-vbtyp.)
    Thanks a lot
    Pawel

    Hi,
    Go to RSA3, put your extractor name and check if there is any selection field for order type, if it is there then simply put the required order type and check the data.
    Otherwise you can simply put the document number with the required order type and check if the data is coming for that in RSA3 or not, if not then simply debug the extractor and check why it is not coming?
    Finally you can have one more approach, simply extract all the data in Full load in infopackage then go to PSA table and there you can try to filter your records based on order type.
    Regards,
    Durgesh.

  • VBA automation to read from SAP

    Hi,
    Does anyone know how to read from an SAP screen using VBA code? I am NOT referring to reading from a table like VBAK, MARA etc.
    The requirement is to enter a transaction code lets say VA03/VA43, enter a document/order number and read the contents of the screen using the screen field name like VBELN, KUNNR etc.
    Regards

    Using vbs:
    If Not IsObject(application) Then
       Set SapGuiAuto  = GetObject("SAPGUI")
       Set application = SapGuiAuto.GetScriptingEngine
    End If
    If Not IsObject(connection) Then
       Set connection = application.Children(0)
    End If
    If Not IsObject(session) Then
       Set session    = connection.Children(0)
    End If
    If IsObject(WScript) Then
       WScript.ConnectObject session,     "on"
       WScript.ConnectObject application, "on"
    End If
    session.findById("wnd[0]").maximize
    session.findById("wnd[0]/tbar[0]/okcd").text = "VA03"
    session.findById("wnd[0]/tbar[0]/btn[0]").press
    session.findById("wnd[0]/usr/ctxtSOMEFIELDNAME").text = some_variable_you_can_store_later
    etc, etc
    I am not familiar with tath screen so you might need more code in wnd[0]/usr/ctxtSOMEFIELDNAME if there are multiple tabs.
    It will be a lot easier to make SAP record the script: ALT+F12 -> "Script Recording and Playback", etc then go to the file which is saved in your local SAP directory and see what SAP did.
    Hope this helps

  • IPod Error Message: "The disk could not be read from or written to."

    Hello!
    I was syncing my sister's video iPod (30GB) and this error message pops up "Attempting to copy to the disk. "SARAH'S IPO" failed. The disk could not be read from or written to."
    I have restored it three times already, but once it starts putting the music and files back onto the iPod it pops up with that error message. I have updated to the latest version of iTunes and iPod software available. My OS is Windows XP.
    Is this something serious? Will I be able to fix it myself or will I need to send it in to be fixed by Apple? Will that be expensive? We didn’t get the Apple replacement plan. D=
    Any help would be greatly appreciated. Thank you in advance. ^_^
    PowerBook G4   Mac OS X (10.4.3)   15" PowerBook 1.5 GHz PowerPC G4, 1.5GB RAM - Windows XP with iPod 5 Generation

    Okay I went thru that entire list and here's what I got...
    (1) My OS is XP and is running fine.
    (2) I've updated my windows
    (3) I don't know of any software that might be interfering.
    (4) There are no damaged files.
    (5) My Windows hard-drive is not damaged and I've tried restoring my iPod's disk thru iTunes but it still doesn't work.
    (6) I don't have an iPod photo and I can't find the folder to delete the cache if if I did.
    (7) The USB cord is firmly connected into my USB port and my iPod
    (8) My music is on my external hard-drive so I need to keep 3rd-party hardware connected
    (9) I will try another USB cord to see if that works.
    Is there anything else that I can do? Can Apple fix this?
    Please let me know.

  • Open and read from text file into a text box for Windows Store

    I wish to open and read from a text file into a text box in C# for the Windows Store using VS Express 2012 for Windows 8.
    Can anyone point me to sample code and tutorials specifically for Windows Store using C#.
    Is it possible to add a Text file in Windows Store. This option only seems to be available in Visual C#.
    Thanks
    Wendel

    This is a simple sample for Read/Load Text file from IsolateStorage and Read file from InstalledLocation (this folder only can be read)
    using System;
    using System.Collections.Generic;
    using System.Linq;
    using System.Text;
    using System.Threading.Tasks;
    using Windows.Storage;
    using System.IO;
    namespace TextFileDemo
    public class TextFileHelper
    async public static Task<bool> SaveTextFileToIsolateStorageAsync(string filename, string data)
    byte[] fileBytes = System.Text.Encoding.UTF8.GetBytes(data);
    StorageFolder local = Windows.Storage.ApplicationData.Current.LocalFolder;
    var file = await local.CreateFileAsync(filename, CreationCollisionOption.ReplaceExisting);
    try
    using (var s = await file.OpenStreamForWriteAsync())
    s.Write(fileBytes, 0, fileBytes.Length);
    return true;
    catch
    return false;
    async public static Task<string> LoadTextFileFormIsolateStorageAsync(string filename)
    StorageFolder local = Windows.Storage.ApplicationData.Current.LocalFolder;
    string returnvalue = string.Empty;
    try
    var file = await local.OpenStreamForReadAsync(filename);
    using (StreamReader streamReader = new StreamReader(file))
    returnvalue = streamReader.ReadToEnd();
    catch (Exception ex)
    // do somthing when exception
    return returnvalue;
    async public static Task<string> LoadTextFileFormInstalledLocationAsync(string filename)
    StorageFolder local = Windows.ApplicationModel.Package.Current.InstalledLocation;
    string returnvalue = string.Empty;
    try
    var file = await local.OpenStreamForReadAsync(filename);
    using (StreamReader streamReader = new StreamReader(file))
    returnvalue = streamReader.ReadToEnd();
    catch (Exception ex)
    // do somthing when exception
    return returnvalue;
    show how to use it as below
    async private void Button_Click(object sender, RoutedEventArgs e)
    string txt =await TextFileHelper.LoadTextFileFormInstalledLocationAsync("TextFile1.txt");
    Debug.WriteLine(txt);
    在現實生活中,你和誰在一起的確很重要,甚至能改變你的成長軌跡,決定你的人生成敗。 和什麼樣的人在一起,就會有什麼樣的人生。 和勤奮的人在一起,你不會懶惰; 和積極的人在一起,你不會消沈; 與智者同行,你會不同凡響; 與高人為伍,你能登上巔峰。

  • Disk could not be read from or written to

    I'm a new ipod user. I can get songs on my ipod. But when I go to get photos I get an error message saying, "ipod cannot be updated. The disk could not be read from or written to."
    In itunes I can see the ipod. When I go to look at My Computer, it does not show the ipod as a disk drive.
    Thanks!

    I'm a new ipod user. I can get songs on my ipod.
    But when I go to get photos I get an error message
    saying, "ipod cannot be updated. The disk could not
    be read from or written to."
    In itunes I can see the ipod. When I go to look at My
    Computer, it does not show the ipod as a disk drive.
    Thanks!
    It's so simple, dont worry. Just connect your ipod to the computer. iTunes must open. In iTunes clcik on the small ipod icon which appears at the right bottom of the itunes window. click on that icon and another window with some options will be opened. Click on "enable disk use" and make this selection marked and click ok.
    it'll certainly help!

  • When I update my nano ipod I get an error message "User ipod cannot be updated.  The disk couldnot be read from or written to."   How can I overcome this error message.

    In the iTunes window, when I update my nano ipod, I get an error message "User ipod cannot be updated.  The disk could not be read from or written to."   How can I overcome this error message.

    Hello there dilip77707,
    It sounds like you are getting this error message that your iPod cannot be read from or written to when you are trying to update your iPod Nano. I recommend the troubleshooting from the following article to help you get that resolved. Its pretty straight forward, just start at the top and work your way down as needed:
     'Disk cannot be read from or written to' when syncing iPod or 'Firmware update failure' error when updating or restoring iPod
    Thank you for using Apple Support Communities.
    All the very best,
    Sterling

  • Disk could not be read from

    Suddenly my Ipod will not sync. The error message says "...disk could not be read from or written to..." We tried the HOLD TOGGELING. But that didn't work. It won't let me restore the Ipod either because it says other programs are currently in use.
    Suggestions would be greatful!

    Welcome to the discussions,
    if the reset did not work, did you try to put it into disk mode? http://support.apple.com/kb/HT1363

  • Can't sync iPod - Error Message: "disc cannot be read from or written to"

    My ipod had been working fine until recently when every time I try and sync it I get the following error message:
    "Attempting to copy to the disk "iPod" failed. The disk could not be read from or written to"
    I have tried all suggestions in Apple's support article for this issue but nothing works. Does anyone else have this problem or know how to solve it?
    Thanks a lot.
    H
    Macbook Pro   Mac OS X (10.4.10)  
    Macbook Pro   Mac OS X (10.4.10)  

    Hi all,
    I am sorry to report that I too have this same disc error problem when syncing my iPod to my iTunes library. I take no comfort in knowing that I am one of many that have this same error. I checked on the iPod lounge forum and I just couldn't count the number of users that had the same problem. There are just so many!
    I too have tried "5 r's" and I have also tried using a few "s" words and others...lol.
    It seems like there is no "fix" for this problem but I will say this: If there is no solution, then I will no longer be buying iPods. This is my third iPod that I have purchased. Which makes my Apple investment near the thousand dollar mark. That is way too much money spent to not have a functioning music player. I will be switching to another player to see if the grass is greener on the other side.
    I have been most dissappointed with this error and I will not be "recycling" this iPod for ten percent off of my next iPod purchase.

  • Error Message: "Disk could not be read from or written to".

    New 5th Gen. was downloading CD's I loaded into iTunes just fine; when uploading tunes into iPod yesterday this error message appeared: "Attempting to copy to the disk (iPod name) failed. Disk could not be read from or written to". Restored iPod with 1/10/06 update of iPod Install; using iTunes 6.0.2; operating system 10.3.9. Frustrated. iPod useless at this point. Anyone found a fix to this vexing problem?
    Thanks,
    John

    Thanks Jeff. Only thing that rings true is updating OS; when I tried to downoad 10.4 message said I 'could not on this computer'. Since I purchased and installed 10.3 a year ago I don't understand. Also, iPod was downloading perfectly until two days ago when -36 appeared. Bummer. I am not a techie, Apple tech support does not have a clue, and iPod is useless. Ideas?

  • "The disk could not be read from or written to"??

    When I try to sync my ipod it gives me following error message "Attempting to copy to the disk 'My Ipod' failed. The disk could not be read from or written to."
    Have not reset or restored it yet, wondering if there is anything I can do that doesn't involve me deleting all the songs on my ipod.
    5th Gen 80g Ipod, G5 Imac   Mac OS X (10.4.9)  

    See if this troubleshooting article helps.
    Disk cannot be read from or written to error syncing iPod in iTunes.

Maybe you are looking for

  • Microsoft SQL Server JDBC driver and WLS JMS problem?

              Greetings,           I'm using the Microsoft SQL Server JDBC driver with WLS with JMS           persisted to SQL Server, during WLS startup the JMS attempts to           read the JMSStore and JMSState tables in the db, if they are          

  • How to restore ipad 2 to fabric

    How can ia restore the iPad 2 3G, my camera doesnt work, and it start to malfunction when i upgrade to iOS7...

  • Streaming Radio using Realplayer

    Hi! Am new here so please be kind! I have an iBook, using realplayer to stream BBC RADIO 1, for some reason it doesnt work at al, it stutters, stops and starts and simply doesnt play - so far I have checked using wireless and also with a patch cable,

  • How to add properties in JMS

    Hello, i have created a proxy and business services that send JMS to a queue. But i don't find how to set a new jms perpertie. Thanks for your help.

  • Error 2738 when upgrading ti ituines 7.4.3

    I downloaded itunes 7.4.3 but I'm not able to install this upgrade on my windows vista system. I get error-code 2738. what's up?? thank you francesco