Reading DB records

Hello All,
I have a scenario.
I read a DB table MARA, i will get few records .
now i have to query a Z* table, based on the mara entries, what i got earlier.
but in Z* table contains the material, with two extra characters than mara-matnr.
for eg: if mara-matnr = 12345
Z*-matnr can be 1234500 or/and 12345AB like this.......
I know i can loop through mara entries and select Z* for each of mara entry using like statement.
is there any other better way.
I cant use 'for all entries' with 'like' it is giving a sytax error saying this combination cant be used.
Thanks in advance.
Best Regards
Amrender Reddy B

Hi,
First select the Material from MARA table into itab then,
Build the range..
LOOP AT ITAB.
Concatenate itab-matnr *' into l_matnr.
R_matnr-SIGn = 'I'.
R_matnr-option ='CP'.
R_matnr = l_matnr.
append r_matnr.
Clear r_matnr.
ENDLOOP.
Use the range R_MATNR on the Z* table to select the data

Similar Messages

  • Read one record at a time

    Hi !
    One of our Java folks here need at function where he reads one record at at time in id order;
    create table url_recs (id number, url varchar2(4000));
    insert into url_recs values(1,'www.fona.dk');
    insert into url_recs values(2,'www.dr.dk');
    insert into url-recs values(17,'www.ihk.dk');
    select read_rec() from dual; - get id 1
    select read_rec() from dual; - get id 2
    select read_rec() from dual; - get id 17
    select read_rec() from dual; - get id 1 - "no more rows - start all over again)
    select read_rec(45) from dual; - get NULL (no rows with that id)
    select read_rec(1) from dual; - get id 1
    The purpose id for some "round robin" trying to get to some internal URL's.
    Can you give me a hint for creating the function(s)
    best regards
    Mette

    Will successive calls come on the same Oracle session? Or across different Oracle sessions?
    If you're going to call the function multiple times within the same Oracle session, you could store the last value returned in a package variable and select the record whose ID is greater than that value every time the function is called. That's unlikely to do exactly what the Java developer is hoping, though, because the Java calls are likely to bounce between multiple Oracle sessions due to connection pooling. And it'll likely require that the Java developer (or app server admin) adds some code when they get a connection from the pool where they reset the package state. Or it'll require that someone develop a method to keep the Java and Oracle session state in sync.
    Justin

  • MDM API to read the Record Key Mapping table

    Hi,
    Does anybody know what class/method I can use to read the Record Key Mapping table?
    For the Business Partner table the Key Mapping table has this columns:
    <u>Default / MDM Partner ID / Remote System / Key</u>
    I have everything but the Key. How can I read it?
    Thanks in advance,
    Diego.

    GetKey Mapping is one of the available Web Services as of SP4.
    Else you could use the Java API to get the Key Mapping.
    <b>CatalogData class</b> has the following method
    <b>GetKeyMapping</b>
    public java.lang.String[][] GetKeyMapping(java.lang.String agency,
                                              java.lang.String table,
                                              int[] recordIDs,
                                              boolean isDefaultKeyOnly)
                                       throws StringExceptionRetrieves the key mapping for each record.
    Parameters:
    agency - the agency name.
    table - the table name.
    recordIDs - the list of records.
    isDefaultKeyOnly - True to retrieve only the default value, False to all key values.
    Returns: the key values for each record.

  • Reading and recording at the same time with AudioUnit

    Hi,
    I am trying to read and record at the same time on the iPhone with AudioUnit. For the reading part I made an AUGraph which works fine, constructed like that:
    NewAUGraph(&_graph);
    _outputUnitComponentDescription.componentType = kAudioUnitType_Output;
    _outputUnitComponentDescription.componentSubType = kAudioUnitSubType_RemoteIO;
    _outputUnitComponentDescription.componentManufacturer = kAudioUnitManufacturer_Apple;
    _outputUnitComponentDescription.componentFlags = 0;
    _outputUnitComponentDescription.componentFlagsMask = 0;
    AUGraphAddNode(_graph, &_outputUnitComponentDescription, &_outputNode);
    _mixerUnitComponentDescription.componentType = kAudioUnitType_Mixer;
    _mixerUnitComponentDescription.componentSubType = kAudioUnitSubType_MultiChannelMixer;
    _mixerUnitComponentDescription.componentManufacturer = kAudioUnitManufacturer_Apple;
    _mixerUnitComponentDescription.componentFlags = 0;
    _mixerUnitComponentDescription.componentFlagsMask = 0;
    AUGraphAddNode(_graph, &_mixerUnitComponentDescription, &_mixerNode);
    AUGraphConnectNodeInput(_graph, _mixerNode, 0, _outputNode, 0);
    AUGraphOpen(_graph);
    AUGraphNodeInfo(_graph, _outputNode, NULL, &_outputUnit);
    AUGraphNodeInfo(_graph, _mixerNode, NULL, &_mixerUnit);
    _generatorUnitComponentDescription.componentType = kAudioUnitType_MusicDevice;
    _generatorUnitComponentDescription.componentSubType = kAudioUnitSubType_RemoteIO;
    _generatorUnitComponentDescription.componentManufacturer = kAudioUnitManufacturer_Apple;
    _generatorUnitComponentDescription.componentFlags = 0;
    _generatorUnitComponentDescription.componentFlagsMask = 0;
    for(int i=0; i< [_urlList count]; i++)
    SoundBuffer* soundBufferTemp = [_bufferSoundList objectAtIndex:i];
    AURenderCallbackStruct renderCallbackStruct;
    renderCallbackStruct.inputProc = MyFileRenderCallback;
    renderCallbackStruct.inputProcRefCon = soundBufferTemp;
    AudioStreamBasicDescription* inputAsbd = [soundBufferTemp getASBD];
    err = AudioUnitSetProperty(_mixerUnit,
    kAudioUnitProperty_StreamFormat,
    kAudioUnitScope_Input,
    i,
    inputAsbd,
    sizeof(AudioStreamBasicDescription));
    UInt32 zero = 0;
    err = AudioUnitSetProperty(_mixerUnit,
    kAudioOutputUnitProperty_EnableIO,
    kAudioUnitScope_Input,
    kInputBus,
    &zero,
    sizeof(zero));
    err = AUGraphSetNodeInputCallback(_graph,
    _mixerNode,
    i,
    &renderCallbackStruct);
    This works well, for the recording AudioUnit I did the following:
    OSStatus err;
    AudioComponentDescription audioComponentDescription;
    AudioComponent audioComponent;
    audioComponentDescription.componentType = kAudioUnitType_Output;
    audioComponentDescription.componentSubType = kAudioUnitSubType_RemoteIO;
    audioComponentDescription.componentManufacturer = kAudioUnitManufacturer_Apple;
    audioComponentDescription.componentFlags = 0;
    audioComponentDescription.componentFlagsMask = 0;
    audioComponent = AudioComponentFindNext(NULL, &audioComponentDescription);
    err = AudioComponentInstanceNew(audioComponent, &_audioUnit);
    UInt32 size;
    size = sizeof(AudioStreamBasicDescription);
    err = AudioUnitGetProperty(_audioUnit,
    kAudioUnitProperty_StreamFormat,
    kAudioUnitScope_Input,
    1,
    &_soundFileDataFormat,
    &size);
    _soundFileDataFormat.mSampleRate = 44100.00;
    AudioUnitSetProperty(_audioUnit,
    kAudioUnitProperty_StreamFormat,
    kAudioUnitScope_Input,
    kInputBus,
    &_soundFileDataFormat,
    size);
    AudioUnitSetProperty(_audioUnit,
    kAudioUnitProperty_StreamFormat,
    kAudioUnitScope_Output,
    kOutputBus,
    &_soundFileDataFormat,
    size);
    AURenderCallbackStruct renderCallbackStruct;
    renderCallbackStruct.inputProc = MyRecorderCallback;
    renderCallbackStruct.inputProcRefCon = self;
    UInt32 one = 1;
    UInt32 zero = 0;
    err = AudioUnitSetProperty(_audioUnit,
    kAudioOutputUnitProperty_EnableIO,
    kAudioUnitScope_Input,
    kInputBus,
    &one,
    sizeof(one));
    err = AudioUnitSetProperty(_audioUnit,
    kAudioOutputUnitProperty_EnableIO,
    kAudioUnitScope_Output,
    kOutputBus,
    &zero,
    sizeof(zero));
    err = AudioUnitSetProperty (_audioUnit,
    kAudioOutputUnitProperty_SetInputCallback,
    kAudioUnitScope_Global,
    0,
    &renderCallbackStruct,
    sizeof(AURenderCallbackStruct));
    err = AudioUnitInitialize(_audioUnit);
    Then in I setup a file to write in:
    - (void) openFile
    OSStatus err;
    err = ExtAudioFileCreateWithURL((CFURLRef) _soundFileUrl,
    kAudioFileCAFType,
    &_soundFileDataFormat,
    NULL,
    kAudioFileFlags_EraseFile,
    &_extAudioFileRef);
    err = ExtAudioFileSetProperty(_extAudioFileRef,
    kExtAudioFileProperty_ClientDataFormat,
    sizeof(AudioStreamBasicDescription),
    &_soundFileDataFormat);
    err = ExtAudioFileWriteAsync(_extAudioFileRef,
    0,
    NULL);
    All this things works well (I check by printing err in the log which I removed here for clarity).
    And then in the callback for recording I do the following:
    static OSStatus MyRecorderCallback(void *inRefCon,
    AudioUnitRenderActionFlags* inActionFlags,
    const AudioTimeStamp* inTimeStamp,
    UInt32 inBusNumber,
    UInt32 inNumFrames,
    AudioBufferList* ioData)
    OSStatus err= noErr;
    AudioUnitRecorder* auRec = (AudioUnitRecorder*) inRefCon;
    [auRec allocateAudioBufferList:1 size:inNumFrames*4];
    err = AudioUnitRender(auRec.audioUnit,
    inActionFlags,
    inTimeStamp,
    inBusNumber,
    inNumFrames,
    auRec.audioBufferList);
    err = ExtAudioFileWriteAsync(auRec.extAudioFileRef,
    inNumFrames,
    auRec.audioBufferList);
    return err;
    (Then I close the file after recording at the same time I close the AudioUnit)
    Now the strange thing is that all this works perfectly well in the simulator: I can record and play at the same time but on the device, the callback for recording is not ran (I check by trying to print something in the log in the callback function.) which men no writing in the file and an empty file in the end.
    Any one has any idea of what could be causing this?
    Thanks
    Alexandre

    Just in case some one might need it, I solved my problem:
    I simply needed to initialize the AudioSession before playing/recording. I did so with the following code:
    OSStatus err;
    AudioSessionInitialize(NULL, NULL, MyInterruptionListener, self);
    UInt32 sessionCategory = kAudioSessionCategory_PlayAndRecord;
    err = AudioSessionSetProperty (kAudioSessionProperty_AudioCategory,
    sizeof (sessionCategory),
    &sessionCategory);
    AudioSessionSetActive(TRUE);

  • Mapping with Scd operator set to type 2 reading source records two times

    Mapping with Scd operator set to type 2 reading source records two times.Records selected count being displayed at the end of execution is double the source record count.This possibly is affecting the performance of the mapping.
    Is this a bug in scd type 2 operagtor in OWB 11gR2.How to rectify this umwamted double loop through the source data selectiom?

    Hi Roelant,
    I think it is important to be aware that although Paris - 10gR2 - is not actually buggy (in this respect!), it is really quite idiosyncratic in exactly how it processes SCDs.
    I followed up on your and Mark's comments, and did an in depth analysis of this topic. It is at http://www.donnapkelly.pwp.blueyonder.co.uk/documents/OWB_10gR2_SCD.pdf
    My conclusions are perhaps of interest to anyone considering doing SCD processing with Paris.
    I'll be doing a follow-up this weekend, and publishing a sort of 'how-to-do-it' guide.
    Cheers,
    Donna
    Message was edited to add the words: "in this respect"

  • JDBC sender: after read insert records into another table

    Hi all,
    I send records from a SQL view (not a table) to RFC via proxy method.
    After reading a record from the view I would like to move this record to a database table called CHECKED. Can anyone provide me a solution for this or is this impossible. (there are 6 fields that have to be inserted in DB CHECKED after reading: admin, bukrs, dagbknr, bkstnr, datum, regel)
    Can I use an INSERT statement in my Update SQL Statement with variables or do I have to create an SP?
    Hope someone can help me out of here...
    Thanks in advance!
    Wouter.

    ur strucutre would of:
    <root>
    <Satement1>
    <TableName action=”INSERT”>
    <table>checked</table>
    <access>
    <admin>val</admin>
    <bukrs>val</bukrs>
    <dagbknr>val</dagbknr>
    <bkstnr>val</bkstnr>
    <datum>val</datum>
    <regel>val</regel>
    </access>
    </dbTableName>
    </StatementName1>
    </root>
    or u can use a SQL DML which wud pose a strucutre similar to
    <root>
      <stmt>
        <Customers action="SQL_DML">
          <access> INSERT CHECKED SET admin=’$admin$’, bukrs=’$bukrs$', dagbknr=’$dagbknr$’, bkstnr=’$bkstnr$', datum=’$datum$’, regel.=’$regel.$'
          </access>
        </Customers>
      </stmt>
    </root>
    for more inputs refer to <a href="/people/sap.user72/blog/2005/06/01/file-to-jdbc-adapter-using-sap-xi-30 link on jdbc</a>

  • Trying to read a recorded file that display the x-axis recorded time stamp?

    How do I read a recorded file with (XY) data, meaning I want to plot the x-time recorded data and be able to scroll back and forth.

    Hi Gina,
    If I understand your question correctly, it sounds like you are trying to plot some data that you have saved in a file. I am assuming that this data is in the form of X and Y values.
    If this is correct, the easiest solution would be to use an XY-Graph in LabVIEW. I would start by using LabVIEW's File I/O VIs to load the data into an array or even a string indicator. You can then parse the data that you need and separate it into two arrays, one for X values and one for Y values. You can then bundle these two arrays together and feed the resulting cluster into an XY-Graph.
    I have attached an example that may help to point you in the right direction when it comes to the actual programming.
    I hope this helps!
    Matthew C
    Applications E
    ngineer
    National Instruments
    Attachments:
    Example.zip ‏61 KB

  • What DVD formats can read iMac recorded DVDs?

    Hello All,
    I have a new intel based 20 inch iMac. When I record a video to a DVD with my iMac I'm I safe in assuming that everyone I send it to will be able to view it on their players? Is there a list someone that lists the formats that will read iMac recorded DVDs? Are they universal?
    Thanks for your help.
    Mike

    If you are talking about DVD video format (i.e. using iDVD)...
    It's not so much a function of the Mac, or the DVD recorder as much as what media you use. Most recent DVD players should be able to handle just about anything, but some older ones don't handle all formats well. For instance, some may like +R disks, and others may like -R disks. Others may not like RW disks. Some very old players may not properly play any burned media.
    If there's one or two particular models you are going to be using to play your disks, visit their company's website and read the specs for that drive. You can usually get user manuals for the older drives. If you can't find any specs, then you will have to experiment with different media, testing them in your target players.

  • Read each record in an Access Database using PowerShell

    I have a fix database that I need to read each record and compare it to an issue. I'm having some issues just reading each record in the specific table, when i run the below code i just get the first entry over and over again. If somone could point me in
    the correct direction on how to read each record it would really help me out.
    $adOpenStatic = 3
    $adLockOptimistic = 3
    $objConnection = New-Object -com "ADODB.Connection"
    $objRecordSet = New-Object -com "ADODB.Recordset"
    $objConnection.Open("Provider = Microsoft.ACE.OLEDB.12.0; Data Source = C:\temp\Fix.mdb")
    $objRecordset.Open("Select * From Fix_Information", $objConnection, $adOpenStatic, $adLockOptimistic)
    $i = 0
    do {
    $objRecordSet.Fields.Item("FixName").Value
    $objRecordSet.MoveNext | Out-Null
    $i++
    while ($i -le $objRecordSet.RecordCount)
    $objRecordSet.Close()
    $objConnection.Close()

    I haven't tested this, but it looks like you're just missing the parentheses after the MoveNext method name:
    $objRecordSet.MoveNext() | Out-Null

  • ADF BC How to read a record from database in a bean

    Due to the problem I have in this thread Re: Inserting multiple rows programmatically got unique key error I need a work around. One work around is checking whether a record is exist in database prior to insert/commit. This can be achieve whether reading the record and if found that it exists or there is function that I can call to check whether a record is exist. Please note that the search criteria (read criteria) is a combination of two fields.
    Thanks.

    It's kind of unproductive to open a new thread, as we now need to keep track of two threads.
    If you korean a new thread you should provide all info to understand the problem, the jdev version you use and the user case. All this info is missing in this thread, but given in the other thread. Conclusion is that we should continue in the other thread.
    Timo

  • Program to read Mx records

    Hi
    Can anybody post the sample code or provide a URL for how to read MX records using java.
    Regards,
    Godspeed

    Try :
    http://www.rgagnon.com/javadetails/java-0452.html
    Bye.
    http://www.rgagnon.com/howto.html

  • XSU: Reading each record at a time

    I am using XSU12 to retrieve database contents in XML format. I am passing the Connection and ResultSet objects to create OracleXMLQuery object. I want to read each record at a time and so setting the maxRows to 1 and then getting the xmlstring.
    code looks like...
    qry =new OracleXMLQuery(connection,resultset);
    qry.setMaxRows(1);
    xmlString = qry.getXMLString();
    I keep this in a loop and read each record at a time. The problem is whenever getXMLString() method is called, the application is hitting the database, which will be a performance issue.
    Is there any way to read contents of a table at once and then loop each record at a time without hitting the DB everytime?
    Kishore
    null

    public static char readChar() {
    int ch;
    char r = '\0';
    boolean done = false;
    while (!done) {
    try {
    ch = System.in.read();
    r = (char) ch;
    if (r == '\r') {
    System.out.println("Not a character. Please try again!");
    System.in.skip(1);
    done = false;
    } else {
    System.in.skip(2);
    done = true;
    } catch (java.io.IOException e) {
    done = true;
    return r;
    Try this as an method and then use it..
    This code will read will be in response untill you hit the return key but will take only the first character....

  • Read a record several times

    Hi experts
    I hope someone can help me,..
    How I can get that XI to read a record eight times, and each time that XI read a record can it map a source field to target field.
    eg
    Source record:
    "ID" "ObjJDV" "AcumJDV "DesJDV" ObjNCB "AcumNCB" "DesNCB "
    A01  26           195             44           66           29                -55
    next record...
    Target record:
    "ID" "Des" "Obj" "Acum"
    A01  44       26      195
    A01  -55      66      29
    Thanks and Regards,
    Liz 

    Hi Lius
    Yes, I want to split the message in eight messages output, because each input message "Obj" "Acum" "Des" there are eight classifications which should be 3 classifications in a new output record
    eg
    InputMessage
    CarID "Obj1" "Acum1" "Des1" "Obj2" "Acum2" "Des2" "Obj3" "Acum3" "Des3"......"Obj8" "Acum8" "Des8"
    A01,data1,data2,data3,data4,data5,data6,data7,data8,data9......data22,data23,data24
    A02,datax,datay,dataz..
    OutputMessage
    "ID" "Des" "Obj" "Acum"
    A01,data3,data1,data2
    A01,data6,data4,data5
    A01,data24,data22,data23
    next record
    Can XI do this? and how?
    Thanks and regards..
    Liz   

  • Reading a record by key access.

    Hi Gurus,
               In 'read table' for reading a record by key access they have used 'comparing' , 'transporting' , 'assigning'.
    Can you please explain me what exactly the above will happen with an clear example.
    Thanks,
    Prabu S.

    mostly you wont need these
    but still: from documentation:
    READ TABLE - transport_options
    Syntax
    ... [COMPARING { {comp1 comp2 ...}|{ALL FIELDS}|{NO FIELDS} }]
        [TRANSPORTING { {comp1 comp2 ...}|{ALL FIELDS} }] ... .
    Effect:
    The addition COMPARING compares the specified components comp1 comp2 ... (or the subareas or attributes thereof) in a found
    line before they are transported with the corresponding components of the work area. If ALL FIELDS is specified, all components
    are compared. If no NO FIELDS is specified, no components are compared. If the content of the compared components is
    identical, sy-subrc is set to 0. Otherwise it is set to 2. The found line is assigned to the work area independently of the result of
    the comparison.
    If the addition TRANSPORTING is specified, only the specified components comp1 comp2 ... (and their subareas) in the found line
    are assigned to the corresponding components of the work area (or their subareas). If ALL FIELDS is specified, all the
    components are assigned.
    COMPARING must be specified before TRANSPORTING. The components comp1 comp2 ... are specified according to the rules in
    the section Specifying Components. This is subject to the restriction that after TRANSPORTING, attributes of classes cannot be
    addressed using the object component selector, and after COMPARING, this is only possible as of release 6.10.

  • SQL Query to Read each record in a table

    Can you please share any T-SQL block of statement, that reads reach record row by row
    for example
    Table1
    Row_1 a b c
    Row_2 d e f
    I need to call an stored proc which takes record values as parameters(row by row)
    Equalent logic in c#
    foreach row in Table1
          Sp(row)

    Try
    --Create table
    CREATE TABLE Test1 (
    id INT identity(1, 1)
    ,Val INT
    ,flag CHAR(1) DEFAULT 'F'
    --Feed value
    INSERT INTO Test1
    VALUES (
    1
    ,'F'
    2
    ,'F'
    3
    ,'F'
    SELECT *
    FROM Test1
    --Create SP
    CREATE PROCEDURE yourSp @param INT
    AS
    BEGIN
    SELECT 'Yes'
    ,@param
    END
    DECLARE @i INT = 1
    ,@count INT = 0
    ,@val INT = 0
    SELECT @count = count(1)
    FROM Test1
    WHILE (@i <= @count)
    BEGIN
    SELECT @val = Val
    FROM Test1
    WHERE id = @i
    EXEC YourSP @val
    SET @i = @i + 1
    END
    Thanks
    Manish
    Please click Mark as Answer if my post solved your problem and click
    Vote as Helpful if this post was useful.

  • How to read relevant record type from file into LSMW ?

    Here my req is like this.
    file with 5 records.
    some of records in file are begin with 'AD'.
    i want to read only that records from file while reading data.
    i created one field in source structure with record type filed.
    even i had given this Identifing Field Content:AD
    but after reading data from file its reading all records from file.
    But it should read only record type AB from source file.
    How can we achieve this?
    Thanks in Advance.

    For this do the follwing steps
    goto step 3 Maintain Source Fields
    press the change mode button  after the double click the filed which is pass the AD value
    then it will appier one popup window in this window you have one check box like " selection parameter for import/convert data"
    tick thic chekc box and save it.
    now when you read the data in Step9 , here you find select options there you enter AD* now you will get the only records start with AD.

Maybe you are looking for

  • Video from Encore has ghosting of images & skips, but not in files on computer

    I am having an issue with Encore that I have no idea how to fix. I am capturing footage from a Sony HDR-FX1 and capturing it with Premiere Pro. The footage is 1440X1080 coming from MiniDV tapes. I am shooting high school football games, so there is a

  • Workflow appearing twice in SQL

    I recently checked up on workflow performance after an extended parental leave and found that one of the workflows appeared twice in the DB. The functioning workflow had a watermark being just one or two transactions behind, but the other was behind

  • CS - need an official response for my insurer?

    Hi, All my home computers were stollen in a burglary at the beginning of the year, My insurer is willing to replace my copy of CS with a copy of CS6, since I have the receipt for the original purchase. However, they need an email from Adobe to say th

  • Installation Failed photo shop

    I received a failed message that says "Installation completed through some optional components failed to install correctly"...After clicking more information I received Exit Code: 6 Please see specific errors below for troubleshooting. For example, 

  • Why can't i change the setting at the security

    Why can't i change the setting at the security & privacy? After I switch to OS X Yosemite, i cant install some application. It says that I can install due unidentified developers. Can anyone help?