How to store data in a variable in select query

Hi,
Below is the select query in which i want to store the data in variable but i am getting runtime error as the fields are more as compared to variable,the declaration is necessary for it due to the reteriving for data.
Please provide me guidelines how to do it.
DATA: BEGIN OF ITSC01 OCCURS 0,
      PRUEFLOS LIKE QALS-PRUEFLOS,
      MBLNR LIKE QAMB-MBLNR,
      LGORT LIKE MSEG-LGORT,
      END OF ITSC01.
IF STIT-MGEIG GE 0.
LOOP AT STIT." WHERE PRUEFLOS EQ STIT-PRUEFLOS.
    SELECT A~PRUEFLOS B~MBLNR C~LGORT FROM QALS AS A
           INNER JOIN QAMB AS B ON B~PRUEFLOS = A~PRUEFLOS
           INNER JOIN MSEG AS C ON C~MBLNR = B~MBLNR AND C~MJAHR = B~MJAHR
           INTO SLOC WHERE A~PRUEFLOS EQ STIT-PRUEFLOS.
*           INTO TABLE ITSC01 WHERE A~PRUEFLOS EQ STIT-PRUEFLOS AND A~MATNR EQ STIT-MATNR AND C~LGORT EQ 'SC03'.
    SORT ITSC01 BY PRUEFLOS.
     READ TABLE ITSC01 WITH KEY PRUEFLOS = ITSC01-PRUEFLOS.
      IF ITSC01-LGORT EQ 'SC03'.
      STIT-MGEIG = 0.
      ENDIF.
MODIFY STIT.
ENDLOOP.
ENDIF.

hmm..
try this:
DATA: l_PRUEFLOS LIKE QALS-PRUEFLOS,
          l_MBLNR LIKE QAMB-MBLNR,
         l_LGORT LIKE MSEG-LGORT,
IF STIT-MGEIG GE 0.
LOOP AT STIT." WHERE PRUEFLOS EQ STIT-PRUEFLOS.
    SELECT APRUEFLOS BMBLNR C~LGORT FROM QALS AS A
           INNER JOIN QAMB AS B ON BPRUEFLOS = APRUEFLOS
           INNER JOIN MSEG AS C ON CMBLNR = BMBLNR AND CMJAHR = BMJAHR
           INTO ( l_PRUEFLOS , l_MBLNR, l_LGORT )
      WHERE A~PRUEFLOS EQ STIT-PRUEFLOS.
          INTO TABLE ITSC01 WHERE APRUEFLOS EQ STIT-PRUEFLOS AND AMATNR EQ STIT-MATNR AND C~LGORT EQ 'SC03'.
    SORT ITSC01 BY PRUEFLOS.
     READ TABLE ITSC01 WITH KEY PRUEFLOS = ITSC01-PRUEFLOS.
      IF ITSC01-LGORT EQ 'SC03'.
      STIT-MGEIG = 0.
      ENDIF.
MODIFY STIT.
ENDLOOP.
ENDIF.

Similar Messages

  • How to get data type of variable in program..

    Hi ABAP Guru.
    I need to know how to get data type of variable or any structure field.. because I got short dump when use command REPLACE ALL OCCURANCE ... with variable/structure field that has data type I or P, I think it should be used with data type CHAR only, So I need to check the data type first.
    Please give me your advice
    Thank you all.
    Nattapash C.

    data : v_value type i,
             v_char(10) type c.
    v_value = 10.
    move v_value to v_char.
    REPLACE ALL OCCURRENCES of '#' from v_char....
    Best regards,
    Prashant

  • How to store data (in tdm files)

    I'm looking for advice on how to store data in tdm/tdx files.
    The main challenge is like this: At regular time intervals there is new data available (say every 10 minutes there are 10 minutes of new data available). All data is time based. So every ten minutes I may create a new tdm/tdx file containing this data segment. However, when i want to analyze the data i dont necessarily want to view 10 minutes of data from all channels, but maybe 20 hours of data from one particular channel.
    The way I've achieved this so far is to manually load each 10 minute segment of this particular channel and then add these parts together. This is both time consuming and cumbersome. Is there a better way to do this that I've simply not discovered yet? Is there a better way to store data to simplify this process?
    One solution is of course to save data from several 10-minute frames in one file, but seeing as there is a never ending supply of data i cant simply save all data in one giant file, it has to be split up at some point, and the problem will still remain.
    One factor to have in mind here is that this is rather large amounts of data (maybe 10GB each day), so the option to simply load all the data into memory goes out the window rather quickly.
    Feel free to ask if I've not made myself very clear

    Hi salte,
    If your test ever ended, and if you had LabVIEW 8.20 or higher, I would recommend using a TDMS file, which handles data appeands flawlessly.  DIAdem 10.1 now also does data reduction and index windowing during file loading for TDM / TDMS / DataPlugin files, so that you could easily load out only the part of the file you wanted to look at.  But since you describe your data acquisition as never stopping and amassing 10 GB per day, I agree that it would be impractical to use only 1 data file.  So we are stuck with some number of files which each contain a part of your measurement.  This approach can have advantages, since you can save operational properties for each "buffer" such as average value, dominant frequency, ambient room temperature, etc., and later on you can use the DataFinder to query out only the data buffers which meet specific conditions based on these properties.  The problem remains to load and assemble data based on multiple files.  This is an old problem in DIAdem, and one for which I have an efficient and I hope satisfactory workaround application.  It does what you describe already doing in the minimum amount of time and with the minimum amount of user interaction, and it can be highly parametrized to suit your particular situation.  The ideal way to start the application would be as part of a ResultsList custom menu.  This would enable you to query out the buffers you wanted, highlight those rows in the ResultsList, right-click and choose your custom menu, and WHAM! the selected buffers for your queried channel(s) are automatically appended together in the DataPortal.  Launching from a ResultsList custom menu would mean that you could skip the file dialog and just read out the data sources directly from the ResultsList selection.
    Let me know what you think,
    Brad Turpin
    DIAdem Product Support Engineer
    National Instruments
    Attachments:
    Importing Data from Multiple DataPlugin Files.zip ‏198 KB

  • What is a cube? how we store data in that? how we fetch data from cube?

    Hi,
    What is a cube? how we store data in that? how we fetch data from cube?
    Regards.
    venkat

    >
    venkey B wrote:
    > Hi,
    >
    >
    > What is a cube? how we store data in that? how we fetch data from cube?
    >
    >
    > Regards.
    >
    > venkat
    Hi Venkat,
    I guess you mean an infocube from the SAP BI product. I propose to look at the forum for Business Intelligence to find your answers.
    E.g. SAP POS DM writes the sales data in infocubes.....

  • How to store data from textfile to vector and delete a selected row.

    Can someone teach me how to store data from textfile to vector and delete a selected row. And after deleting, i want to write the changes in my textfile.
    Do someone has an idea? :)

    nemesisjava wrote:
    Can someone teach me how to store data from textfile to vector and delete a selected row. And after deleting, i want to write the changes in my textfile.
    Do someone has an idea? :)What's the problem? What have you done so far? What failed?
    What you described should be pretty easy to do.

  • How to store data in ipad from computer

    please explain me how to store data (music video & pictures) in  ipad from any personal computer...kindly explain me in simple steps...

    The iPad can only sync with one computer.  To do this you need to have iTunes installed on the computer and have it associated with your Apple ID.  you can then use iTunes to transfer music, movies and pictures from that computer, and that computer only.
    iOS: Syncing your data with iTunes
    http://support.apple.com/kb/ht1386
    If you need to get files from other computers, you would need a 3rd party App that can handle the formats you wish to transfer, and possibly transfer them either through iTunes file sharing or Wifi transfer depending on what the App supports.
    iOS: About File Sharing
    http://support.apple.com/kb/ht4094

  • How LDAP stores data?

    What is the diff bet. LDAP & Data base?
    How LDAP stores data?

    LDAP uses a hierarchical tree structure. This is why LDAP queries are formed like ldap://mydomain.com/...

  • How to get number of rows return in SELECT query

    i'm very new in java, i have a question:
    - How to get number of rows return in SELECT query?
    (i use SQL Server 2000 Driver for JDBC and everything are done, i only want to know problems above)
    Thanks.

    make the result set scroll insensitve, do rs.last(), get the row num, and call rs.beforeFirst(), then you can process the result set like you currently do.
             String sql = "select * from testing";
             PreparedStatement ps =
              con.prepareStatement(sql,ResultSet.TYPE_SCROLL_INSENSITIVE,ResultSet.CONCUR_READ_ONLY);
             ResultSet rs = ps.executeQuery();
             rs.last();
             System.out.println("Row count = " + rs.getRow());
             rs.beforeFirst();~Tim
    NOTE: Ugly, but does the trick.

  • How to pass the feild names of a select query dynamically?

    Hi
    How can we pass the feilds names in select query dynamically?
    For example in my selection screen i wil be giving the table name, and feilds in that table.....
    those feilds should be taken in my select query...
    instead of
    PARAMETERS : tab_name TYPE ddobjname .
      SELECT *
        FROM (tab_name)
        INTO TABLE <newtab>
       UP TO 25 ROWS.
    parametrs : feild1 like-------
                     feild2----
    i need select feild1 feild2 feild3    FROM (tab_name)
        INTO TABLE <newtab>
       UP TO 25 ROWS.

    by the way, contrary to popular belief there is no performance problem when using
    SELECT * FROM dbtab INTO CORRESPONDING FIELDS OF TABLE itab WHERE ...
    as long as the structure of itab contains only the required fields.
    I ran some benchmarks against this and above construct is maybe 0.1% slower (Oracle 10g) than a
    SELECT f1 f2 f3 f4 ... FROM dbtab INTO TABLE itab WHERE ...
    but is saves you from maintaining a potentially very long field list in your code. So when you need additional fields later on, you just add them to the DDIC structure or type definition and that's it.
    Maybe something you want to factor in here.
    Cheers
    Thomas

  • How to store data in hashmap so that it can be used by different methods.

    Hello,
    I have an ADF/JSF application and the database is DRM. The program gets data from DRM into this hashmap. Program needs this data frequently. Getting this HashMap is very resource intensive due to a lot of data it has.
    I want to get the data in HashMap once ( I can do this - no problem).  But where/how do I keep it so that different methods can just use this and not make individual trips to DRM? It may be a very basic java question but I seem to be stuck :)
    I am not very concerned about the HashMap part, it can be any collection - the question is of storing it so that it can be used over and over.
    Thanks,

    User,
    If I understand you correctly, you have a JSF application that needs to store data in a HashMap such that it can be accessed over and over? You could put the hashmap into an appropriately-scoped managed bean and access it from there. I'm not sure what a "DRM" is (a digital rights management database, perhaps, in which case it's a "database"), so there is something special about a "DRM" that we need to know, please share.
    John

  • How to store data in chinese from oracle and show it to jsp?

    hi, please help.
    i have design a jsp page for registeration of a website in chinese,
    but after the user have enter the chinses data throught the jsp~
    the jsp have shown some monster code~
    it can't show the valid date in chinese!!! how can i fix it????
    when i select data from SQL PLUS, monster code is showed. how to show the chinese data in the oracle.
    i am using tomcat 5.0 ~servlet 2.2 and oracle 9i for database~~
    thx thx thx~~~~~pls help me!!

    The how to at following url shows how to store, retrieve and display characters of different languages from Oracle database onto a JSP page.
    http://otn.oracle.com/sample_code/tech/java/codesnippet/jdbc/nls/Globalization.html
    HTH
    Chandar

  • How to store data from Host.vi in cRIO-9074

    TejasKumar Patel
    I implemented a advance Measurement and Control system using cRIO-9074
    with c-Series I/O cards( NI 9217, 9411, 9264)
    I have some questions about it,
    (1)- Data rate from FPGA targate to host vi is too low. how can I increase
    it, when I run my host VI, sometimes all temperature sensor update at
    same time and sometimes one by one, can you please give me some hint, how
    can I correct it, I used two FIFOs for NI-9411 digital pulses, I put all
    Digital input and all analog output and input in a seperate while loop in
    FPGA targate VI.
    (2)- I have to write that data to analyse for further result. I tried all
    possible way to write data including wite to spreadsheet.vi, write to
    text.vi, Data storage.vi, Write to measurement.vi. All this VI work
    efficientlywhen it run individualy, But when I connect this VI to
    writedata from FPGA host VI. than it always give empty file.
    I saw your post in NI discussion forum about how to write data from
    Host.vi, But still I am confuse that how can I creat a protocol between
    host VI and Fpga target vi. to write the data in a file. I have nearabout
    38 channel to write data.
    (3)- I have to measure time difference between two digital pulses, to find
    a flow rate. I am using counter for it with risisng edge shot.vi, but when
    i get a timestemp when there is risisng edge for the second rising edge
    how can I get timestemp. Its like i have to measure time between two
    pulses, I triend waveform measurement.vi to find cycle period. but it not
    worked. any other was to measure it.
    I am stuck in this question since from last one month. I already followed
    NI-discussion forum solution but it doesnt work. I think the way I applied
    is may be wrong. 
    Looking forward to hear from you soon.
    Plese send an additional email copy to [email protected]
    Thank you and Best Regards, 

    Thanks Joseph for your support,
    1-      If I count the ticks between the pulses it always seems different ….because this method I already tried, but it does not work,  like some times it shows 9099 tick and at the second pulse it shows like some more or less ticks not the same ticks every time. To complete my project, the biggest problem is the data storage.
    2-      As you gives the solution in NI forum, “low level file I/O Vis such as Write to text file” FPGA target not support this VI. And mainly I want to write data from HOST.vi, because I am process those data …and I need to store it. For to figure out my result.
    3-      If I use “Write to text file. VI (Sub-VI ) to FPGA.vi, it not support because it support string data and I have FIXpoint data. And can you explain me what is low level file IO, and how can I use in fpga.vi??
    4-      Yes, for my project time stamp it really necessary, for data analysis.
    5-      I need the time stamp to find out what was the system response at the time.  As our project based on weather temperature, I need time stamp.
    Waiting for your reply,
    Thanks and Regards,
    Patel

  • How to store data in class?

    I have a problem urgent to slove...anybody pro can help me?
    I use a method in main program type a input data and pass to the class, than when i call another method in main program print out the data which retrive form class...than all data print out become null. what is my problem? can i know how i store all my input data in class permanence and how can i retrive the data and use by main program method anytime when i needed...?

    skydestinyz wrote:
    I have a problem urgent to slove...anybody pro can help me?
    I use a method in main program type a input data and pass to the class, than when i call another method in main program print out the data which retrive form class...than all data print out become null. what is my problem? You have a bug.
    can i know how i store all my input data in class permanence and how can i retrive the data and use by main program method anytime when i needed...?Use a database. Or write data to a file.

  • How to store date in database , taking cre of timezone

    Hello java users
    I have a user interface in which a user can pick a date, time and timezone.
    Implemented simply.
    start Date as a textbox: format - MM/dd/yyyy
    start time as a textbox : format - HH/mm/ss
    start timezone as a drop down. And currently there is only 3 values here: PST,EST,CST. As this is what we support.
    I am using MSSQL and my date field column ( startdate ) is of type datetime.
    Now how will I pass the correct value to the database.
    Some more details.
    I have a bean i which I am able to retrieve all the values.
    public class MyBean implements serializable{
    private Date startDate;
    private Date startTime;
    private String timezone; // this will store the timezone id selected by the user.
    //getters and setters
    Now, how will I combine all the values selected by the user and set in the bean and save it in the database.
    I am sure there are a lot of times someone has tried to do this. But I am having a hard time finding this info in a collective manner.
    Any help would be usefull
    Thanks
    Aayush

    Its does help.
    And yes it is requirement to get the date and time and the timezone info from the user through a UI.
    And date is in format : MM/dd/yyyy
    time is in format : HH:mm:ss
    and there are 3 timezones : PST,EST,CST (And yes these are valid timezone ids).
    I guess, the other way to put this is that - The user input is the way to get the StartTime data.
    And ya it makes sense to have separate fields in the database to store date and timezone.
    I am fairly new on this date part and its confusing me a little.
    So I will go into a little more details.
    As u suggested that it would be a good idea to have 3 separate fields for doing this.
    you mean to have 3 fields in the database with columns like
    1. startDate - datetime // to store the start date ( MM/dd/yyyy)
    2. startTime - datetime // to store the start time ( HH:mm:ss). Is it possible to store only time in the database or are you suggesting to combine date and time in one database field.
    3. startTimeZone - varchar // to store time zone.
    So how do I achieve this.
    lets say I get these values;
    String startDate = "09/06/2008";
    String startTime = "11:10:12";
    String startTimeZone = EST;
    now how will I store it in the database.
    consider I have a java bean
    public class StartTimeBean{
    private Date startDate ;
    private Date startTime ;
    private String startTimeZone;
    also I am using a OR mapping tool ( ibatis )
    And I have my insert statement mapped to the bean StartTime.
    Essentially what I am looking for a say method say , createTime(StartTimeBean startTimeBean )
    so how will I store the info in the database

  • How to store data in the text line by line?

    when i write the data into *.txt, the data I wrote before is deleted.
    how can wrote the data into the txt following the existing data?
    how to write data line by line? many thanks!
    my code is like:
    private String text = "i am yanbo du, i am a boy.";
    public BufferWriteMultiKey( ) {         
         try {
              StringTokenizer st = new StringTokenizer(text, " ,.");
              File fil =new File("f.txt");
         //FileWriter fw = new FileWriter(fil);
         //BufferedWriter bw= new BufferedWriter(fw);
         DataOutputStream out = new DataOutputStream(new BufferedOutputStream(new FileOutputStream(fil)));
    while(st.hasMoreTokens())
    String s = st.nextToken();
         //bw.newLine();
         out.writeChars(s);
    out.writeChars("\n");
    out.close();

    use a random access file and append text at the end.
    read the file in line by line using a BufferedReader and store each line in a List of Strings, of course.
    %

Maybe you are looking for

  • PO to Sales Order creation

    Hi Gurus, I've been having a lot of confusion lately about PO (EDI 850) to SO creation in SAP. Our scenario is the customer sends their PO thru ADX (an EDI outsourcing provider), needless to say the flow is: Customer EDI 850 -> ADX -> PO Flat File ->

  • ITUNES WILL NOT LET ME DOWNOAD IT BECAUSE OF CODE 2738!!! PLEASE HELP!!!

    When I try to upgrade to itunes 7.3 or 7 it said that there was something wrong with the package. It said code 2738 was the problem. PLEASE HELP!!!

  • Read image data from SQL Server database and display it in a JSP web page

    Hi experts, I am doing a project in which I have to upload images to the database via JSP/servlets. I am able to do this. Now I want users to view and dowload these images which are stored in the database. Please help me of how can I read the images

  • How to call a program in another program in java

    first program: test1.java seccond :main.java run main.java in which i call test1.java Edited by: user13488971 on Dec 15, 2010 6:15 PM Edited by: user13488971 on Dec 15, 2010 6:15 PM

  • JUTableBinding.JUTableModel - misleading javadoc

    In order to provide several custom functionalities to a data-bound JTable (multiple selection, filtering, sorting, etc.), I thought (and I was supported by the BC4J javadoc) that the best way to do it would be to extend JUTableBinding and its inner c