Adding a field to rhe join query

Dear Friends,
I need your help in adding a field to a join query.
I have created a reort using join(SQVI). Now i want to add an addition field to that report. The issue is the field i am looking at is stored in structure. Is there any way i can add this field....
Sanjay

It is not possible here (in SQVI).
you have to Go with Query.
SQ02 using this Create infoset, add all the tables , here include that structure field, and then add the logic to populate the field.
Now go to SQ01 and create Query.

Similar Messages

  • Adding additional fields to an Infoset Query

    Hi Experts,
    I have added a couple of additional fields to an infoset query using SQ02.
    I have also written code for filling in the fields.
    I have also added them to some Field Groups.
    Despite this, when I run the query, they are not being displayed in the output list.
    What could be the reason for this?
    Kindly help with your inputs.
    Thanks in advance.
    Regards,
    Keerthi

    goto sq01,
    give the query name...
    goto change.. just below output, you have a drop down for field group and field catalog. select field catalog.
    select the fields you want to show in output

  • Adding a field in already existing query layout

    Hi All,
    I have a requirement where I have to add couple of fields in an already existing query layout.
    Through SQ01 and layout painter I have added the fields to the layout. When I test from query painter it displays the newly added fields. But when I execute the transaction that is designated to run the query its not displaying those fields.
    What am I missing here?
    Thanks in advance.
    Thanks,
    Arun

    Arun,
    As you have done some changes to the query,the internal report generator will generate a new program correspponding to the Query which should be attached to the T-code.
    Currently the t-code might be having the earlier program name ie the program generated by the query before changes were made hence it is not displaying.
    Just check the program name of the Query and the  program name attached to the tcode.
    K.Kiran.

  • Alias for field in inner join query

    In my Oracle 9i Schema, I have two tables:TableOne
    pocOne    pocTwo
    2           3
    2           4
    1           2
    TableTwo
    TableTwoId   Name
    1            Jones
    2            Smith
    3            Edwards
    4            CamdenMy SQL that works to fetch all records with Smith works great:select Name from TableTwo
    Inner Join TableOne
    on TableTwo.TableTwoId in (TableOne.pocOne, TableOne.pocTwo)
    where Name = 'Smith' Now I need to create an alias for the Name field. Here is my attempt:select myAliasName from TableTwo
    Inner Join TableOne
    on TableTwo.TableTwoId in (TableOne.pocOne, TableOne.pocTwo), (select Name as myAliasName from TableTwo)
    where myAliasName = 'Smith' This attempt pulls up all the records instead of just Smith records. Please advise how I can create an alias for the Name field in my above query?

    Are you just looking for
    select Name AS AliasName
       from TableTwo Inner Join TableOne
              on TableTwo.TableTwoId in (TableOne.pocOne, TableOne.pocTwo)
    where Name = 'Smith' Justin

  • Adding New Fields to a BEx Query does not show up in the CR field explorer

    This could be a silly question.
    I have a CR report based on a BEx query.  I had to add a couple of new fields to the BEx query, and when i want to add those fields to the CR report, I don't see them even after I do a refresh in the field explorer. 
    How do i see this new fields in the CR report?
    Help Please
    Thanks

    Hi,
    you can open the report and go to the menu Database > Verify Database.
    that should add the new fields to the list of fields in CR
    Ingo

  • Adding extra Field to a Infoset Query

    Hi Experts,
      I need to add an extra field to a SAP Query(infoset). SInce the code uses a dynamic program call, how do I add my code . Can I have some example code used to add extra field to a SAP Query

    Hi Mithun and gurus,
    My code is working now for these 3 new additional fields. The thing is it works if these fields were selected solo. but if all of these 3 or 2 of it simultaneously, an error occurs.
    Error when generating the report (see long text)
    Message no. AQ_AD_HOC221
    Diagnosis
    The report cannot be generated because the internal description is invalid or incomplete, or because the selection screen is too large.
    Regenerate the assigned InfoSet, and read the log. If the InfoSet is OK, make sure that at least one field is given as output.
    If you used the 'Refresh' icon to start the query, use the 'Output' menu option to execute the query. This gives you a full screen display of the data.
    If an output was generated, the query cannot work with actual data in the construction view. In this case, always use the 'Output' function to execute the query.
    Procedure
    If the selection screen is too large, you need to reduce the number of your selections.
    Make sure that the assigned InfoSet is correct. The name of the assigned InfoSet is stored in the menu option 'Extras -> Template Information'.
    Output at least one field. Otherwise you will not be able to save or generate reports.
    If you do not have this problem, execute the query using the 'Output' function.
    Otherwise, there is an error in the InfoSet Query.
    >>>I checked and the code seems fine at least. I think there must be something I need to configure. I tried the SEQUENCE for Codes but nothing happens..
    I hope you could helop me with these..Thanks a lot!!!

  • Adding existing field to a UI Search and Modifying UI Query

    Hello.
      I want to add the "central archiving flag" to the Contact search BP_CONT_SEARCH/Search. I've added the field into the SEARCH node via BSP_WD wizard but the field created does not appear as available in the Search because it is not into the context structure. ¿Is there any solution to this? ¿I must append a new field to the standard structure?
      Although I get the "archiving flag" available I think I will need to modify the selection query ¿Is that possible? If it's possible ¿How can I do it?
      I have another problem with a result field of another search for activities (BT126S_APPT/ApptSR). I would like to know how can I reach the selection ( based on BOL result model BTQRAct ) and how can I modify that selection/quety.
    Thanks in advance.
    Kind regards.

    You can create a copy of the standard design layer, add your field and define it as dropdown listbox 0 coding is required
    Otherwise you will need to code in the GET_V method and the GET_P, there's a lot of information about this if you have a little of patience to search
    If fits your requirement (dropdown listbox) I would go for the design layer approach, of course there's info about this through scn too

  • Adding Selection Options Fields in Report(Using Query)

    Hi,
    how can we add Selection Fields Options in Query Reports Which we create using SQ01. I need a default option by which we can add all the selection option given by user.
    Anybody can help me..?
    Regards
    lijo Joseph

    Do you have anything defined in the 'Calcs' section?
    If so, any fields returned by the query that are not included in the calculation will be automatically added to the Group fields (using the same logic as required with calculations/group by in any SQL query). The fields won't be able to be removed from the Group list unless the Calc is also removed.

  • Adding additional fields in Sql Query (SQ01)

    Hi..
    please tell me all the steps to use additional fields option in  sap query (transaction code: SQ01)? can i use mandt field as additional field?
    Thanks and Regards
    Sri.

    Hi,
    You can add it in infoset using extra button.
    Here you can add the filed and the respective code for this field and add this in SQ01 in oytput list.
    Thanks
    Ajay

  • Inner join query

    Hi all,
    I want to query a inner join via some tools in sap GUI. till now, i could not query a inner join between two tables via SE11. can someone tell are there some other ways to achieve this?
    any response will be awarded!
    thanks and regards,
    samson

    hi samson,
    Proper use of Inner Join
    When multiple SAP tables are logically joined, it is always advisable to use inner join to read the data from them. This certainly reduces the load on the network.
    Let us take an example of 2 tables, zairln and zflight. The table zairln has the field airln, which is the airline code and the field lnnam, which is the name of the airline. The table zflight has the field airln, the airline code and other fields which hold the details of the flights that an airline operates.
    Since these 2 tables a re logically joined by the airln field, it is advisable to use the inner join.
                 Select aairln alnnam bfligh bcntry into table int_airdet
    example 2:--
    Inner join: If you have common fields between 2 or more tables, its betterto use Inner join.
    Check the below example:
    VBAK & VBAP table has common fields, hence we can use inner join.
    SELECT akunnr avbeln anetwr abnddt a~knumv
    avkbur aerdat avdatu aaugru
    aktext bmatnr barktx bkwmeng b~kzwi6
    bvolum bposnr b~kdmat
    INTO CORRESPONDING FIELDS OF TABLE g_t_quot
    FROM vbak AS a INNER JOIN vbap AS b
    ON avbeln = bvbeln
    WHERE a~vbeln IN so_vbeln
    AND a~trvog ='2'
    AND a~vkorg IN so_vkorg
    AND a~vtweg IN so_vtweg
    AND a~vkbur IN so_vkbur
    AND a~audat IN so_audat
    AND a~kunnr IN so_kunag.
    FOR ALL ENTRIES:
    If you get some data into one internal table and if you want to fetch data from other table based on it, use FOR ALL ENTRIES.
    g_t_quot is an internal table.
    SELECT spras augru bezei FROM tvaut INTO TABLE g_t_tvaut
    FOR ALL ENTRIES IN g_t_quot
    WHERE augru = g_t_quot-augru AND spras = sy-langu.
                From zairln as a inner join zflight as b on aairln = bairln.
    In order to restrict the data as per the selection criteria, a where clause can be added to the above inner join.

  • Join query problem

    Hi all,
    I'm new to Berkeley DB and apologise if the answer to my question has been covered elsewhere.
    I've been using the 'Getting Started Guide' (BerkeleyDB-Core-Cxx-GSG.pdf) to familiarise myself with the C++ API. The document has been vastly useful, but it has left me stranded on the subject of join queries. I have used the example in the guide (p 57) carefully to construct my join query between two secondary databases, but I get a segmentation fault that doesn't seem to originate from within my code. The GDB backtrace shows:
    (gdb) backtrace
    #0 0x007fbffb in __db_c_count () from /nfs/acari/dta/bdb/lib/libdb_cxx-4.4.so
    #1 0x00807aef in __db_join_cmp () from /nfs/acari/dta/bdb/lib/libdb_cxx-4.4.so
    #2 0x0013c1af in msort_with_tmp () from /lib/libc.so.6
    #3 0x0013c0a7 in msort_with_tmp () from /lib/libc.so.6
    #4 0x0013c360 in qsort () from /lib/libc.so.6
    #5 0x00806de6 in __db_join () from /nfs/acari/dta/bdb/lib/libdb_cxx-4.4.so
    #6 0x00804384 in __db_join_pp () from /nfs/acari/dta/bdb/lib/libdb_cxx-4.4.so
    #7 0x0079070b in Db::join () from /nfs/acari/dta/bdb/lib/libdb_cxx-4.4.so
    #8 0x0804a9fe in show_join ()
    #9 0x0804a165 in main ()
    The code that I have written to perform the join query looks like:
    int show_join(MyDb &itemnameSDB, MyDb &catnameSDB,
         std::string &itemName, std::string &categoryName)
    std::cout << "Have item : " << itemName << " and category : "
         << categoryName << std::endl;
    // Position cursor at item
    int ret;
    Dbc *item_curs;
    Dbt key, data;
    try {
    itemnameSDB.getDb().cursor(NULL, &item_curs, 0);
    char * c_item = (char *)itemName.c_str();
    key.set_data(c_item);
    key.set_size(strlen(c_item) + 1);
    if ((ret = item_curs->get(&key, &data, DB_SET)) != 0)
         std::cout << "Did not find any records matching item ["
              << c_item << "]" << std::endl;
    catch(DbException &e) {        
    itemnameSDB.getDb().err(e.get_errno(), "Error!");
    } catch(std::exception &e) {
    itemnameSDB.getDb().errx("Error! %s", e.what());
    // Position cursor at category
    Dbc *category_curs;
    try {
    catnameSDB.getDb().cursor(NULL, &category_curs, 0);
    char c_category = (char )categoryName.c_str();
    key.set_data(c_category);
    key.set_size(strlen(c_category) + 1);
    if ((ret = category_curs->get(&key, &data, DB_SET)) != 0)
         std::cout << "Did not find any records matching category ["
              << c_category << "]" << std::endl;
    catch(DbException &e) {        
    catnameSDB.getDb().err(e.get_errno(), "Error!");
    } catch(std::exception &e) {
    catnameSDB.getDb().errx("Error! %s", e.what());
    // Set up an array of cursors ready for the join
    Dbc *carray[3];
    carray[0] = item_curs;
    carray[1] = category_curs;
    carray[3] = NULL;
    // Perform the join
    Dbc *join_curs;
    try {
    if ((ret = itemnameSDB.getDb().join(carray, &join_curs, 0)) != 0)
         std::cout << "Successful query results should go here." << std::endl;
    catch(DbException &e) {        
    itemnameSDB.getDb().err(e.get_errno(), "Error!");
    } catch(std::exception &e) {
    itemnameSDB.getDb().errx("Error! %s", e.what());
    // Iterate through results using the join cursor
    while ((ret = join_curs->get(&key, &data, 0)) == 0)
    std::cout << "Iterating through cursors" << std::endl;
    // If we exited the loop because we ran out of records,
    // then it has completed successfully.
    if (ret == DB_NOTFOUND)
    item_curs->close();
    category_curs->close();
    join_curs->close();
    return(0);
    The seg fault occurs at the line in the final try/catch block where the Db.join() call is made.
    It seems highly likely that I am making a simple mistake due to inexperience (both with Berkeley DB and C++) and am hoping that the problem glares out at someone with deeper knowledge.
    I'm running this under linux if this makes any difference.
    Many thanks for reading this far,
    Dan

    Hi Keith,
    The following test program isn't pretty, but should produce the seg fault that I'm seeing. Much of the code is copy-and-pasted from the C++ API guide. It will need some input data to run - and presumably create the correct error. Save the following as ./small_inventory.txt (this is also just hacked from the guide):
    Oranges#OranfruiRu6Ghr#0.71#451#fruits#TriCounty Produce
    Spinach#SpinvegeVcqXL6#0.11#708#vegetables#TriCounty Produce
    Banana Split#Banadessfif758#11.07#14#desserts#The Baking Pan
    Thanks for your help,
    Dan
    Code follows:
    #include <db_cxx.h>
    #include <iostream>
    #include <fstream>
    #include <cstdlib>
    class InventoryData
    public:
    inline void setPrice(double price) {price_ = price;}
    inline void setQuantity(long quantity) {quantity_ = quantity;}
    inline void setCategory(std::string &category) {category_ = category;}
    inline void setName(std::string &name) {name_ = name;}
    inline void setVendor(std::string &vendor) {vendor_ = vendor;}
    inline void setSKU(std::string &sku) {sku_ = sku;}
    inline double& getPrice() {return(price_);}
    inline long& getQuantity() {return(quantity_);}
    inline std::string& getCategory() {return(category_);}
    inline std::string& getName() {return(name_);}
    inline std::string& getVendor() {return(vendor_);}
    inline std::string& getSKU() {return(sku_);}
    /* Initialize our data members */
    void clear()
    price_ = 0.0;
    quantity_ = 0;
    category_ = "";
    name_ = "";
    vendor_ = "";
    sku_ = "";
    // Default constructor
    InventoryData() { clear(); }
    // Constructor from a void *
    // For use with the data returned from a bdb get
    InventoryData(void *buffer)
    char buf = (char )buffer;
    price_ = *((double *)buf);
    bufLen_ = sizeof(double);
    quantity_ = *((long *)(buf + bufLen_));
    bufLen_ += sizeof(long);
    name_ = buf + bufLen_;
    bufLen_ += name_.size() + 1;
    sku_ = buf + bufLen_;
    bufLen_ += sku_.size() + 1;
    category_ = buf + bufLen_;
    bufLen_ += category_.size() + 1;
    vendor_ = buf + bufLen_;
    bufLen_ += vendor_.size() + 1;
    * Marshalls this classes data members into a single
    * contiguous memory location for the purpose of storing
    * the data in a database.
    char *
    getBuffer()
    // Zero out the buffer
    memset(databuf_, 0, 500);
    * Now pack the data into a single contiguous memory location for
    * storage.
    bufLen_ = 0;
    int dataLen = 0;
         dataLen = sizeof(double);
         memcpy(databuf_, &price_, dataLen);
         bufLen_ += dataLen;
         dataLen = sizeof(long);
         memcpy(databuf_ + bufLen_, &quantity_, dataLen);
         bufLen_ += dataLen;
    packString(databuf_, name_);
    packString(databuf_, sku_);
    packString(databuf_, category_);
    packString(databuf_, vendor_);
    return (databuf_);
    * Returns the size of the buffer. Used for storing
    * the buffer in a database.
    inline size_t getBufferSize() { return (bufLen_); }
    /* Utility function used to show the contents of this class */
    void
    show() {
    std::cout << "\nName: " << name_ << std::endl;
    std::cout << " SKU: " << sku_ << std::endl;
    std::cout << " Price: " << price_ << std::endl;
    std::cout << " Quantity: " << quantity_ << std::endl;
    std::cout << " Category: " << category_ << std::endl;
    std::cout << " Vendor: " << vendor_ << std::endl;
    private:
    * Utility function that appends a char * to the end of
    * the buffer.
    void
    packString(char *buffer, std::string &theString)
    size_t string_size = theString.size() + 1;
    memcpy(buffer+bufLen_, theString.c_str(), string_size);
    bufLen_ += string_size;
    /* Data members */
    std::string category_, name_, vendor_, sku_;
    double price_;
    long quantity_;
    size_t bufLen_;
    char databuf_[500];
    //Forward declarations
    void loadDB(Db &, std::string &);
    int get_item_name(Db dbp, const Dbt pkey, const Dbt pdata, Dbt skey);
    int get_category_name(Db dbp, const Dbt pkey, const Dbt pdata, Dbt skey);
    int show_join(Db &item_index, Db &category_index,
         std::string &itemName, std::string &categoryName);
    int main (){
    Db primary_database(NULL, 0); // Primary
    Db item_index(NULL, 0); // Secondary
    Db category_index(NULL, 0); // Secondary
    // Open the primary database
    primary_database.open(NULL,
                   "inventorydb.db",
                   NULL,
                   DB_BTREE,
                   DB_CREATE,
                   0);
    /* // Setup the secondary to use sorted duplicates.
    // This is often desireable for secondary databases.
    item_index.set_flags(DB_DUPSORT);
    category_index.set_flags(DB_DUPSORT);
    // Open secondary databases
    item_index.open(NULL,
              "itemname.sdb",
              NULL,
              DB_BTREE,
              DB_CREATE,
              0);
    category_index.open(NULL,
              "categoryname.sdb",
              NULL,
              DB_BTREE,
              DB_CREATE,
              0);
    // Associate the primary and the secondary dbs
    primary_database.associate(NULL,
                   &item_index,
                   get_item_name,
                   0);
    primary_database.associate(NULL,
                   &category_index,
                   get_category_name,
                   0);
    // Load database
    std::string input_file = "./small_inventory.txt";
    try {
    loadDB(primary_database, input_file);
    } catch(DbException &e) {
    std::cerr << "Error loading databases. " << std::endl;
    std::cerr << e.what() << std::endl;
    return (e.get_errno());
    } catch(std::exception &e) {
    std::cerr << "Error loading databases. " << std::endl;
    std::cerr << e.what() << std::endl;
    return (-1);
    // Perform join query
    std::string itemName = "Spinach";
    std::string categoryName = "vegetables";
    show_join(item_index, category_index, itemName, categoryName);
    // Close dbs
    item_index.close(0);
    category_index.close(0);
    primary_database.close(0);
    return(0);
    } // End main
    // Used to locate the first pound sign (a field delimiter)
    // in the input string.
    size_t
    getNextPound(std::string &theString, std::string &substring)
    size_t pos = theString.find("#");
    substring.assign(theString, 0, pos);
    theString.assign(theString, pos + 1, theString.size());
    return (pos);
    // Loads the contents of the inventory.txt file into a database
    void
    loadDB(Db &inventoryDB, std::string &inventoryFile)
    InventoryData inventoryData;
    std::string substring;
    size_t nextPound;
    std::ifstream inFile(inventoryFile.c_str(), std::ios::in);
    if ( !inFile )
    std::cerr << "Could not open file '" << inventoryFile
    << "'. Giving up." << std::endl;
    throw std::exception();
    while (!inFile.eof())
    inventoryData.clear();
    std::string stringBuf;
    std::getline(inFile, stringBuf);
    // Now parse the line
    if (!stringBuf.empty())
    nextPound = getNextPound(stringBuf, substring);
    inventoryData.setName(substring);
    nextPound = getNextPound(stringBuf, substring);
    inventoryData.setSKU(substring);
    nextPound = getNextPound(stringBuf, substring);
    inventoryData.setPrice(strtod(substring.c_str(), 0));
    nextPound = getNextPound(stringBuf, substring);
    inventoryData.setQuantity(strtol(substring.c_str(), 0, 10));
    nextPound = getNextPound(stringBuf, substring);
    inventoryData.setCategory(substring);
    nextPound = getNextPound(stringBuf, substring);
    inventoryData.setVendor(substring);
    void buff = (void )inventoryData.getSKU().c_str();
    size_t size = inventoryData.getSKU().size()+1;
    Dbt key(buff, (u_int32_t)size);
    buff = inventoryData.getBuffer();
    size = inventoryData.getBufferSize();
    Dbt data(buff, (u_int32_t)size);
    inventoryDB.put(NULL, &key, &data, 0);
    inFile.close();
    int
    get_item_name(Db dbp, const Dbt pkey, const Dbt pdata, Dbt skey)
    * First, obtain the buffer location where we placed the item's name. In
    * this example, the item's name is located in the primary data. It is the
    * first string in the buffer after the price (a double) and the quantity
    * (a long).
    u_int32_t offset = sizeof(double) + sizeof(long);
    char itemname = (char )pdata->get_data() + offset;
    // unused
    (void)pkey;
    * If the offset is beyond the end of the data, then there was a problem
    * with the buffer contained in pdata, or there's a programming error in
    * how the buffer is marshalled/unmarshalled. This should never happen!
    if (offset > pdata->get_size()) {
    dbp->errx("get_item_name: buffer sizes do not match!");
    // When we return non-zero, the index record is not added/updated.
    return (-1);
    /* Now set the secondary key's data to be the item name */
    skey->set_data(itemname);
    skey->set_size((u_int32_t)strlen(itemname) + 1);
    return (0);
    int
    get_category_name(Db dbp, const Dbt pkey, const Dbt pdata, Dbt skey)
    * First, obtain the buffer location where we placed the item's name. In
    * this example, the item's name is located in the primary data. It is the
    * first string in the buffer after the price (a double) and the quantity
    * (a long).
    u_int32_t offset = sizeof(double) + sizeof(long);
    char itemname = (char )pdata->get_data() + offset;
    offset += strlen(itemname) + 1;
    char sku = (char )pdata->get_data() + offset;
    offset += strlen(sku) + 1;
    char category = (char )pdata->get_data() + offset;
    // unused
    (void)pkey;
    * If the offset is beyond the end of the data, then there was a problem
    * with the buffer contained in pdata, or there's a programming error in
    * how the buffer is marshalled/unmarshalled. This should never happen!
    if (offset > pdata->get_size()) {
    dbp->errx("get_item_name: buffer sizes do not match!");
    // When we return non-zero, the index record is not added/updated.
    return (-1);
    /* Now set the secondary key's data to be the item name */
    skey->set_data(category);
    skey->set_size((u_int32_t)strlen(category) + 1);
    return (0);
    int
    show_join(Db &itemnameSDB, Db &catnameSDB,
         std::string &itemName, std::string &categoryName)
    std::cout << "Have item : " << itemName << " and category : "
         << categoryName << std::endl;
    // Position cursor at item
    int ret;
    Dbc *item_curs;
    Dbt key, data;
    try {
    itemnameSDB.cursor(NULL, &item_curs, 0);
    char * c_item = (char *)itemName.c_str();
    key.set_data(c_item);
    key.set_size(strlen(c_item) + 1);
    if ((ret = item_curs->get(&key, &data, DB_SET)) != 0)
         std::cout << "Did not find any records matching item ["
              << c_item << "]" << std::endl;
    // while (ret != DB_NOTFOUND)
    //      printf("Database record --\n");
    //     std::cout << "Key : " << (char *)key.get_data() << std::endl;
    //      ret = item_curs->get(&key, &data, DB_NEXT_DUP);
    catch(DbException &e) {        
    itemnameSDB.err(e.get_errno(), "Error!");
    } catch(std::exception &e) {
    itemnameSDB.errx("Error! %s", e.what());
    // Position cursor at category
    Dbc *category_curs;
    try {
    catnameSDB.cursor(NULL, &category_curs, 0);
    char c_category = (char )categoryName.c_str();
    key.set_data(c_category);
    key.set_size(strlen(c_category) + 1);
    if ((ret = category_curs->get(&key, &data, DB_SET)) != 0)
         std::cout << "Did not find any records matching category ["
              << c_category << "]" << std::endl;
    //!! Debug, print everything
    // Dbt temp_key, temp_data;
    // while ((ret = category_curs->get(&temp_key, &temp_data, DB_NEXT)) == 0) {        
    // std::cout << "Key : " << (char *)temp_key.get_data() << std::endl;
    catch(DbException &e) {        
    catnameSDB.err(e.get_errno(), "Error!");
    } catch(std::exception &e) {
    catnameSDB.errx("Error! %s", e.what());
    // Set up an array of cursors ready for the join
    Dbc *carray[3];
    carray[0] = item_curs;
    carray[1] = category_curs;
    carray[3] = NULL;
    // Perform the join
    Dbc *join_curs;
    try {
    if ((ret = itemnameSDB.join(carray, &join_curs, 0)) != 0)
         std::cout << "Successful query results should go here." << std::endl;
    catch(DbException &e) {        
    itemnameSDB.err(e.get_errno(), "Error[3]!");
    } catch(std::exception &e) {
    itemnameSDB.errx("Error! %s", e.what());
    // Iterate through results using the join cursor
    while ((ret = join_curs->get(&key, &data, 0)) == 0)
    std::cout << "Iterating through cursors" << std::endl;
    // If we exited the loop because we ran out of records,
    // then it has completed successfully.
    if (ret == DB_NOTFOUND)
    item_curs->close();
    category_curs->close();
    join_curs->close();
    return(0);
    }

  • Adding Z field in Opportunity search and result view BT111S_OPPT/Search

    Hi,
    I have been searching this forum on adding Z fields in search and result view but couldnt find the precise information.
    We have Z field in ultimately residing in BUT000.
    Now when this field is used in BP_HEAD_SEARCH for search and result, it could be easily done via configuration. (since the field was added to CRMT_BUPA_IL_HEADER_SEARCH during EEWB extension.
    Now, the requirement is to add the fields in Opportunity BT111S_OPPT/Search & BT111S_OPPT/Result.
    I am confused with regard to the approach we need to use to get this field in search and result.
    I thought the easiest option is to add the Model node and and give the BOL attribute. This works fine but I can't see this field (with dynamic getter/setter) in the UI configuration.
    During the attribute creation wizard, I gave BOL entity as BTQROpp (system defaulted) and the relation was
    BTADVSOpp/BTOrderHeader/BTHeaderPartnerSet/BTPartnerAll/BTBusinessPartner/ZZZGEOG_REGI
    is this correct? or am I doing something wrong?
    Why can't I see the fields in configuration?
    So alternatively I created a field through AET and i could see this field is in the structure and in UI config, but what logic I need to put to retrieve the value?
    Any advice?
    Many thanks in advance for your help
    Rakesh

    Hi Rakesh,
    Please follow below steps:
    1. Append your custom field to structure associated with your search/result structure.
    2. After you append this field to structure, this field would be available in context node.
    3.  Check if the field is reflected in available fields in configuration.
    4. If field is not present in configuration then please follow steps stated by me in:
    Re: New Column can not be added in chtmlb:configTable
    5. Once you add this field to design layer, you would be able to configure it to your search query. Check if your query works with this field.
    If not then please go through below forum :
    Re: BADI for Claims search in trade promotion management
    Let me know if this helps.
    Regards,
    Bhushan

  • Filter on "---" in Left Outer Join Query

    Hi guys,
    very basic question but I have not found an answer, yet. I built an left outer join MDO query and need to select all those dataset that did not find a "partner", that is fields are set to "---". However, I do not manage to filter on '---', NULL...
    When using SQL, it appears to be a String "---" but in MDO???

    Hey guys, found out that IS NULL needs to be used in query. Anyway, it appears to cause problems somewhere else.
    I placed an IS NULL filter expression inside a join query but query did not return any results when called in by transaction. After removing this line, both NULL and NOT NULL data were returned. When used in test mode, IS NULL was working fine...

  • Left outer join query

    Hi Experts,
        I am facing a problem with left outer join query. Am using one standard table and ztable for this join. My problem is values are not extracted from the Ztable.
    Query:
          SELECT  b~lifnr b~belnr b~gjahr b~xblnr b~shkzg b~blart b~zfbdt b~budat b~wrbtr
             b~wskto b~zlspr s~EXTRACT_STATUS s~maturity_date FROM bsik AS b
             LEFT OUTER JOIN zprm_rvne_sapdoc AS s
             ON s~belnr  EQ  b~belnr
             AND s~gjahr EQ b~gjahr
             INTO CORRESPONDING FIELDS OF TABLE it_join
                WHERE b~zlsch = p_zlsch
                AND b~xblnr IN so_invno
                ORDER BY b~lifnr b~xblnr.
    I have all entries of BSIK table in Ztable with extract status as Y but this query is not fetching extract status and maturity date of ztable so it is blank in the internal table.
    Need solution.
    Regards
    Sridevi S

    Hi,
    see the sample wiki for writing the Left outer join
    http://wiki.sdn.sap.com/wiki/display/Snippets/EmployeeInfotype0000to9999ChangeHistory
    Specifying Two or More Database Tables as a Left Outer Join
    The left outer join, on the other hand, reads lines from the left-hand database table or join even if there is no corresponding line in the right-hand table.
    SELECT...
      FROM <tab> LEFT [OUTER] JOIN <dbtab> [AS <alias>] ON <cond>
           <options>
    <tab> and <dbtab> are subject to the same rules and conditions as in an inner join. The OUTER addition is optional. The tables are linked in the same way as the inner join with the one exception that all lines selected from <tab> are included in the final selection. If <dbtab> does not contain any lines that meet the condition <cond>, the system includes a single line in the selection whose columns from <dbtab> are filled with null values.
    In the left outer join, more restrictions apply to the condition <cond> than in the inner join. In addition to the above restrictions:
    EQ or = is the only permitted relational operator.
    There must be at least one comparison between columns from <tab> and <dbtab>.
    The WHERE clause may not contain any comparisons with columns from <dbtab>. All comparisons using columns from <dbtab> must appear in the condition <cond>.
    If we have two tables named stud1,stud2 with the following data
    Stud1: id Name stud2: id Name
    1 xxx 1 aaa
    2 yyy 2 bbb
    3 zzz 4 ccc
    4 www 6 ddd
    When we use Left Outer Join we get the output as:
    1 aaa
    2 bbb
    3 <Null>
    4 ccc
    When we use Right Outer Join we get the output as:
    1 aaa
    2 bbb
    4 ccc
    <Null> ddd
    When we use Full Outer Join we get the output as:
    1 aaa
    2 bbb
    3 <Null>
    4 ccc
    <Null> ddd
    Prabhudas

  • Join query help

    hi
    i am encountering error like the values not getting populated in internal table though values are in dbtable...so if u can help me out in the join query it will be of gr8 help
    SELECT a1~guid a1~posting_date a1~process_type
           b1~sales_org b1~division b1~dis_channel
           INTO CORRESPONDING FIELDS OF TABLE it_ordel
           FROM ( ( crmd_orderadm_h AS a1 INNER JOIN crmd_link AS c1 ON a1~guid  = c1~guid_hi )
                    INNER JOIN crmd_orgman AS b1 ON c1~guid_hi = b1~guid )
           WHERE c1~objtype_hi = '05'
           AND   c1~objtype_set = '21'.
        AND   a1~process_type IN so_prst
           AND   a1~posting_date IN so_podt
           AND   b1~division     IN so_div.
    thnx

    SELECT a1~guid a1~posting_date a1~process_type
           b1~sales_org b1~division b1~dis_channel
           INTO CORRESPONDING FIELDS OF TABLE it_ordel
           FROM ( ( crmd_orderadm_h AS a1 INNER JOIN crmd_link AS c1 ON a1~guid  = c1~guid_hi )
                    INNER JOIN crmd_orgman AS b1 ON c1~guid_hi = b1~guid )
           WHERE c1~objtype_hi = '05'
           AND   c1~objtype_set = '21'.
        AND   a1~process_type IN so_prst
           AND   a1~posting_date IN so_podt
           AND   b1~division     IN so_div.
    SELECT a1~guid a1~posting_date a1~process_type
           b1~sales_org b1~division b1~dis_channel
           INTO CORRESPONDING FIELDS OF TABLE it_ordel
           FROM ( ( crmd_orderadm_h AS a1 INNER JOIN crmd_link AS c1 ON a1~guid  = c1~guid_hi )
                    INNER JOIN crmd_orgman AS b1 ON c1~guid_hi = b1~guid )
           WHERE c1~objtype_hi = '05'
           AND   c1~objtype_set = '21'    ".              delete that period its wrong
        AND   a1~process_type IN so_prst
           AND   a1~posting_date IN so_podt
           AND   b1~division     IN so_div.

Maybe you are looking for

  • My 2nd Gen iPod Touch will not SYNC

    My iPod is working fine otherwise. When I plug it into my iMac, Mac OSX Version 10.5.8, it charges but it doesn't show up on my computer or on iTunes. My computer doesn't acknowledge it at all other than to charge it. I just downloaded the lastest ve

  • Web service in SOlution Manager

    Hi¡¡¡ Someone knows how to configurate the web service in solution manager??? thanks!!!

  • Touch input lag on air 2.6?

    Hi all. I just got my project to compile on air 2.6 for the first time and the performance improvement is excellent but I have one important problem. I have what is essentially a button that when you touch it it does something. But my problem is that

  • Need documentation on BADIs

    Hi all . I need the documenation on BADI including why and how is it used . Whether they will be found in all transactions ? How to find the requirement for BADI so as to when it is used . Thanks .

  • Reference record in another record

    Hi, I have two packages each having one record. Is it possible to reference the record of the second package in the record of the first package ? For example: create or replace pkg1 is type rec1 is record ( col11 integer, col12 ref pk2.col21 end pkg1