Order database block by derived item within db item

Hi,
Is there an easy way to order a database block by derived item within database item
i.e. column three (db item of the db block) in the Obj navigator represents brand
column four (derived item of the db block) in the Obj navigator represents item description
if I just put 3,4 in the Order By Clause property of the block it doesn't specifically order the
derived item in the correct order even though it does order by brand.
As it is a derived item I know that it isn't part of the table but was wondering if there was a way
to deal with this matter?
Any help would be appreciated.
Kind regards,
Tom

I think there is no way to order a block using a non database field.You can with two possible options:
Put something like the following in the ORDER BY-property (assuming that FK_ID is the base table-column)
(SELECT THE_ORDER_COLUMN FROM THE_LOOKUP_TABLE WHERE THE_ID=FK_ID)Second option:
Create a DBfunction THE_DB_FUNCTION which gets the FK_ID as input and returns the assciated THE_ORDER_COLUMN as result then
put
THE_DB_FUNCTION(FK_ID)in the ORDER-BY property

Similar Messages

  • When sales order is Blocked (oldest of open items overdue) MRP run avoid

    We got a challenge with Client requirement regarding over due of payment terms
    1. Credit master records Customer Credit limit usage example 24.14%
    2. Customer Oldest open item is over due status
    3. Sales order created with the warning message Oldest Item overdue sales order will save this setting is in OVA8
    4. Even though sales order is created Credit master record Customer Credit limit usage  remain same 24.14% right
    5. Delivery will not happen because sales order is blocked.
    6. Exceptional case sales order will release for this customer 9500775
    7. Then Credit limit usage will update in Credit master record.
    8.After release in VK31 delivery will able  create with refernec to sales order.
    Here the challenge is after the sales order created in 3 step when you run the MRP planned order is creating. we want to avoid that till the sales order will release.

    There is Tick in Delivery block 01 Deliveries: Blocking Reasons/Criteria
    I have observed in testing Before you save a sales order, you look at the schedule line overview, you can see what the system would Proposed confirm date and confirmed qty, if the block were  not set. However, as soon as you save the sales order,(warring message Oldest open items over due will appear) the confirmed quantities are automatically reset to zero because sales order is Blocked. Here the goods remain available for other customers.
    Note : When you release the sales order the automatically in sales order confirmed qty and proposed date will come.
    Here the problem is  when they do MRP run after sales order saved with block Planned order is creating.

  • How to check an item in a database block has changed before updating

    hi,
    i have a database block having designation and other relative field are there . a ctrl item status (checkbox) in the same block. i want to update records only the status is marked as ticked get updated. what trigger in which levels should be used
    thanks in advance

    In genral forms marks the records as "changed" by itself. If you want to override this "marking", you'll have to overrwrite the DML-logic (for you cannot change the status of the record back to QUERY). So, you have to create ON-INSERT, ON-UPDATE and ON-DELETE-triggers and do something in it like
    IF :BLOCK.MARKED='Y' THEN
      UPDATE_RECORD;
    END IF;

  • Ordering a non-database block....

    Hi ,
    Is it possible to order and how a non-database block according to user's willing...????
    Thanks , a lot
    Simon

    That will work in sql*plus but to use it in a program you'll need to parameterise the Order By clause. That's why I wrote mine the way I did. It will work in sql*plus if you enter 'A' and 'B' (including the quotes) and it will work in a program if you replace the placeholders with variables.
    SQL> WITH data AS(
      2    SELECT 1 a, 9 b FROM dual UNION ALL
      3    SELECT 1 a, 1 b FROM dual UNION ALL
      4    SELECT 1 a, 8 b FROM dual UNION ALL
      5    SELECT 1 a, 2 b FROM dual UNION ALL
      6    SELECT 1 a, 7 b FROM dual UNION ALL
      7    SELECT 2 a, 8 b FROM dual UNION ALL
      8    SELECT 3 a, 7 b FROM dual UNION ALL
      9    SELECT 4 a, 6 b FROM dual UNION ALL
    10    SELECT 5 a, 5 b FROM dual UNION ALL
    11    SELECT 6 a, 4 b FROM dual UNION ALL
    12    SELECT 7 a, 3 b FROM dual UNION ALL
    13    SELECT 8 a, 2 b FROM dual UNION ALL
    14    SELECT 9 a, 1 b FROM dual
    15  )
    16  SELECT a, b FROM data
    17  ORDER BY
    18    Decode(&ordr1,'A',a,'B',b),
    19    Decode(&ordr2,'A',a,'B',b)
    20  ;
    Enter value for ordr1: 'A'
    old  18:   Decode(&ordr1,'A',a,'B',b),
    new  18:   Decode('A','A',a,'B',b),
    Enter value for ordr2: 'B'
    old  19:   Decode(&ordr2,'A',a,'B',b)
    new  19:   Decode('B','A',a,'B',b)
             A          B
             1          1
             1          2
             1          7
             1          8
             1          9
             2          8
             3          7
             4          6
             5          5
             6          4
             7          3
             8          2
             9          1
    13 rows selected.
    SQL> /
    Enter value for ordr1: 'B'
    old  18:   Decode(&ordr1,'A',a,'B',b),
    new  18:   Decode('B','A',a,'B',b),
    Enter value for ordr2: 'A'
    old  19:   Decode(&ordr2,'A',a,'B',b)
    new  19:   Decode('A','A',a,'B',b)
             A          B
             1          1
             9          1
             1          2
             8          2
             7          3
             6          4
             5          5
             4          6
             1          7
             3          7
             1          8
             2          8
             1          9
    13 rows selected.
    SQL> var ordr1 varchar2(1);
    SQL> var ordr2 varchar2(1);
    SQL> exec :ordr1 := 'A';
    PL/SQL procedure successfully completed.
    SQL> exec :ordr2 := 'B';
    PL/SQL procedure successfully completed.
    SQL> WITH data AS(
      2    SELECT 1 a, 9 b FROM dual UNION ALL
      3    SELECT 1 a, 1 b FROM dual UNION ALL
      4    SELECT 1 a, 8 b FROM dual UNION ALL
      5    SELECT 1 a, 2 b FROM dual UNION ALL
      6    SELECT 1 a, 7 b FROM dual UNION ALL
      7    SELECT 2 a, 8 b FROM dual UNION ALL
      8    SELECT 3 a, 7 b FROM dual UNION ALL
      9    SELECT 4 a, 6 b FROM dual UNION ALL
    10    SELECT 5 a, 5 b FROM dual UNION ALL
    11    SELECT 6 a, 4 b FROM dual UNION ALL
    12    SELECT 7 a, 3 b FROM dual UNION ALL
    13    SELECT 8 a, 2 b FROM dual UNION ALL
    14    SELECT 9 a, 1 b FROM dual
    15  )
    16  SELECT a, b FROM data
    17  ORDER BY
    18    Decode(:ordr1,'A',a,'B',b),
    19    Decode(:ordr2,'A',a,'B',b)
    20  ;
             A          B
             1          1
             1          2
             1          7
             1          8
             1          9
             2          8
             3          7
             4          6
             5          5
             6          4
             7          3
             8          2
             9          1
    13 rows selected.
    SQL> exec :ordr1 := 'B';
    PL/SQL procedure successfully completed.
    SQL> exec :ordr2 := 'A';
    PL/SQL procedure successfully completed.
    SQL> /
             A          B
             1          1
             9          1
             1          2
             8          2
             7          3
             6          4
             5          5
             4          6
             1          7
             3          7
             1          8
             2          8
             1          9
    13 rows selected.
    SQL>

  • Copy order item within a sales order

    Hi
    Is there a way to copy a existing item with all the configuration and all other connected information to that specific item to a NEW item within the same order?
    Best regards
    Henrik

    Hi,
    It is not possible, and not practical as well.
    If you changing the material in secound line item, there is no mean to copy the same as in first line item,
    and if you are creating the new line item with same material, there is no mean, you may add the quantity in first line item itself.
    regards
    Vivek.

  • HOW TO CREATE MULTIPLE RECORDS IN A NONE DATABASE BLOCK?

    I have a Form where I have a none database block with unbound items. The block
    has 10 records. In the when-new-block instance I run a query by which I would
    like to fill up the block with data. The code fragment looks like the
    following:
    begin
    declare
    tmp_curr_rec_id number;
    begin
    -- a hibak kiolvasasa
    for c_hibak in ( select h.*, h.rowid
    from hibak h
    where 1=1 -- WF - Ide kerul a szurofeltetel
    order by bejelentes_datum asc
    ) loop
    -- bemasoljuk az adatokat az unbound item-ekbe
    :mc_adat.ub_azonosito := c_hibak.azonosito;
    :mc_adat.ub_verzio_letrehozas_datum :=
    c_hibak.verzio_letrehozas_datum;
    :mc_adat.ub_bejelento := c_hibak.bejelento;
    :mc_adat.ub_bejelentes_datum := c_hibak.bejelentes_datum;
    :mc_adat.ub_wf_verzio_csomopont :=
    c_hibak.wf_verzio_csomopont;
    :mc_adat.ub_wf_utolso_esemeny_szoveg :=
    c_hibak.wf_utolso_esemeny_szoveg;
    :mc_adat.ub_hiba_leiras := c_hibak.hiba_leiras;
    :mc_adat.ub_hiba_hely := c_hibak.hiba_hely;
    :mc_adat.ub_rekord_jelleg := 'H';
    :mc_adat.ub_rowid := c_hibak.rowid;
    -- beallitjuk a rekordot-ot olyanra, mintha semmi nem valtozott
    volna
    -- nem szeretnenk a form bezaraskor mindenfele figyelmezteteseket
    -- olvasni a kepernyon
    tmp_curr_rec_id := get_block_property( :system.current_block,
    current_record );
    set_record_property( tmp_curr_rec_id, :system.current_block,
    status, new_status );
    create_record;
    end loop;
    end;
    end;
    The block's update allowed, insert allowed, delete allowed property is set to
    true.
    The result of the code above is that only the last record fetched shows up in
    the block. The problem is - as I found out - is that aech record is fetched,
    the values are copied to the block items, but the create_record built-in
    command would not move the cursor to the next row.
    Can some one please help me with this?
    TIA,
    Tamas Szecsy

    The problem was with the following code segment:
    tmp_curr_rec_id := get_block_property( :system.current_block, current_record );
    set_record_property( tmp_curr_rec_id, :system.current_block, status, new_status );
    After omitting these two lines, the code worked properly.
    Thansk for all whoe replied.
    Regards,
    Tamas

  • Copy down Ship-to Partner from main item to sub-items on Sales Order

    This is my first post on the forums here.  I'd appreciate any help you can give on my issue below.
    I have a requirement to copy down the ship-to partner from the main item to sub-items during sales order create or change.  Currently I have code in include MV45AFZB within user exit USEREXIT_FILL_VBAP_FROM_HVBAP as follows:
    <i>* Need to be able to copy the ship-to of a BoM parent down to the
    respective BoM children if the parent has a different ship-to
    from the header.
    data:  wa_xvbpa like vbpa.
    Clear: wa_xvbpa.
    read table xvbpa into wa_xvbpa with key posnr = hvbap-posnr
                                            parvw = 'WE'.
    A BoM parent line has a different ship-to from the header.
        if sy-subrc = 0.
          read table xvbap with key uepos = hvbap-posnr.
    See if current line is the child of that BoM parent
            If xvbap-uepos = hvbap-posnr.
              move wa_xvbpa-kunnr to xvbpa-kunnr.
              move xvbap-vbeln to wa_xvbpa-vbeln.
              move xvbap-posnr to wa_xvbpa-posnr.
              move 'WE' to wa_xvbpa-parvw.
              modify vbpa from wa_xvbpa.
            endif.
          Endif.</i>
    This isn't working for me.  At one point, I was able to copy the ship-to down to the first sub-item but not any subsequent ones.  I'm sure I need to add some code to another sales order user exit to get this to work, but I'm at a loss at this point.   Has anyone had to do this or something similar before? 
    Thanks very much in advance for your help.
    Angela

    Hi,
    Can you check few more things and tell me?
    - In this exit, does XVBPA and XVBAP contains all the line items. ( main and sub items ).
    - In Sales order creation time, do these table have VBELN populated when this exit triggers.
    - If you modify XVBPA or XVBAP in this exit, do they get overwritten after that.
    Try this code. See if it works.  Let me know if you still have a problem.
    DATA: wa_hvbpa LIKE vbpa,
          wa_xvbpa like vbpa.
    CLEAR: wa_hvbpa, wa_xvbpa.
    * check if HVBAP and VBAP line items are not same
    IF vbap-posnr <> hvbap-posnr.
    * read the ****-to partner from main-item
      READ TABLE xvbpa INTO wa_hvbpa WITH KEY posnr = hvbap-posnr
                                              parvw = 'WE'.
      IF sy-subrc = 0.
    *   read the line item data for sub-item based on main item
        READ TABLE xvbap WITH KEY posnr = vbap-posnr
                                  uepos = hvbap-posnr.
    * See if current line is the child of that BoM parent
        IF sy-subrc = 0.
          MOVE wa_xvbpa-kunnr TO xvbpa-kunnr.
          MOVE xvbap-vbeln TO wa_xvbpa-vbeln.
          MOVE xvbap-posnr TO wa_xvbpa-posnr.
          MOVE 'WE' TO wa_xvbpa-parvw.
          MODIFY vbpa FROM wa_xvbpa.
        ENDIF.
      ENDIF.
    ENDIF.
    Regards,
    RS

  • How to set "Maximum Lenght" column property for database block at RUNTIME?

    Hi folks,
    Is it possible to somehow set a "Maximum Length" property for database block column at runtime?
    I have a dynamic form, which maintains mostly "STATIC DATA" within all application which are stored in different static data tables (which have similar structure). But now, description column in some of those tables was extended (not in all at this stage). I would like to avoid truncating form error while reading data from those extended tables, so I would like to set an MAXIMUM SIZE to accurate value at the time when I'm specifying TABLE NAME for that database block.
    What property should I use to set it?
       -- before executing query in "MAIN_BLOCK" I always set QUERY_DATA_SOURCE_NAME to user defined value => STATIC DATA TABLE name
       Set_block_Property('MAIN_BLOCK',QUERY_DATA_SOURCE_NAME,:control.table_name);
       Set_block_Property('MAIN_BLOCK',DML_DATA_TARGET_NAME,:control.table_name);
       -- here I would like to set also MAXIMUM LENGHT for particular column (based on some condition, etc.. correct value I can get from ALL_TAB_COLS dictionary
       SET_ITEM_PROPERTY('MAIN_BLOCK.DESCRIPTION', <<XXXXXXX>>, 300);What should I use instead of "<<XXXXXXX>>" if I want to overwrite MAIN_BLOCK.DESCRIPTION column's maximum length to 300?
    Thanks,
    Tomas

    Hi Magoo, thanks for reply.
    Yes, but then user can get other errors while trying to set description with value longer than in database (for all not extended tables).
    Aby idea how to implement SET_CUSTOM_PROPERTY like mentioned here?
    Oracle Forms - "maximum length" property.
    Thanks,
    Tomas

  • Problem in Execute query on non-database block and database block together

    Hi All,
    In my form,i have
    1. First block is Non-database block with one non-database item.
    2. Second and third blocks are database blocks.
    Now the problem is that i want to perform execute-query for all the blocks.
    If the cursor is on the non-database item of 1st block and i clicks on the "Enter-query" then i am getting message " This function can not be performed here".
    If i click on the item of the database block and then clicks on the "Enter-query" and then "execute-query" it's working fine.
    But i don't want to do in this way.
    My cursor will be on the First block only and then it should perform execute-query.
    I am using this non-database item to copy value of this item to the item of the database block item.
    I think i make you understand about my problem.
    I am using forms 10g on Window xp.
    Please help me.

    Hi!
    Simply create a enter-query trigger on the non-database-block:
    begin
    go_block ( 'database_block' );
    enter_query;
    end;If your search criteria is in the non-database-item in the first block,
    you actually do not need the enter_query build-in.
    Just create a execute-query trigger on the first block like:
    begin
    go_block ( 'database_block' );
    execute_query;
    go_item ( :System.trigger_item );
    end;And in a pre-query trigger on the database-block copy the
    value of your seach item into the item you want to search for.
    Regards

  • Can i reorganise items within Reminders by due date?

    can i reorganise items within Reminders by due date? Currently it lists them in order of when I created them, but I'd rather order them by due date

    Send Apple feedback. They won't answer, but at least will know there is a problem. If enough people send feedback, it may get the problem solved sooner.
    Feedback

  • Validations in a database block before commit

    Hi Folks,
    I have a database block with three fields : Agency, Start Date, End Date. Agency has a List Of values. I need to change the LOV contents depending upon the values already entered. For example any agency with end date as null should not appear in the list and if end date is entered for an agency then it should start appearing in the list...etc. I have to consider both committed and Uncomitted data. Is there a way to traverse through the block without actually navigating through it. The user should not know see the cursor moving anywhere.
    Any suggestions and ideas are most welcome.
    Thanks a lot
    Pranati

    Forms does a select for update when a database item is changed, so the locks have already been established regardless of whether you do a post. You can confirm this behaviour by adding an on-lock trigger.
    Your requirement to read other records in the block without navigating CAN be achieved using calculation properties, and I have used this technique several times in situations like yours.
    Create another agency field in a control block.
    Create a hidden non-database numeric item in your block with a calculation property of formula. The formula should be a user-written function with parameters of control.agency, datablock.agency, datablock.date. Write the function in the form program units: if the agencies match and the date exists return 1 else return 0.
    Create a field in the control block with a summary calculation property doing a sum of the other cxalculated item.
    Now all you need to do is copy the agency code from your current record into control.agency and hey presto ,the summary field instantly tells you how many other records for that agency have dates.
    An alternative method would be to maintain a copy of your block in a record group, but that could get rather complicated.

  • How to change existing database block size in all tablespaces

    Hi,
    Need Help to change block size for my existing database which is in 8kb of block size.
    I have read that we can only change block size during database creation, but i want to change it after database installation.
    because for some reason i dont want to change the database installation script.
    Can any one list the steps to change database block size for all existing table space (except system, temp ).
    want to change it to 32kb.
    Thank you for you time.
    -Rushang Kansara

    > We are facing more and more physical reads, I thought by using 32K block size
    we would resolve that..
    A physical read reported by Oracle may not be - it could well be a logical read from the o/s file system cache and not a true physical read. With raw devices for example, a physical I/O reported by Oracle is indeed one as there is no o/s cache for raw devices. So one needs to be careful how aone interprets number like physical reads.
    Lots of physical reads may not necessarily be a bad thing. In contrast, a high percentage of "good/fast" logical reads (i.e. a high % buffer cache hit ratio) may indicate a serious problem with application design - as the application is churning through the exact same data again and again and again. Applications should typically only make a single pass through a data set.
    The best way to deal with physical reads is to make them less. Simple example. A database deals with a lot of inserts. Some bright developer decided to over-index a table. Numerous indexes for the same columns exist in difference physical column orders.
    Oracle now spends a lot of time dealing (reading) with these indexes when inserting (or updating a row). A single write I/O may incur a 100 read I/Os as a result of these indexes needing to be maintained.
    The bottom line is that "more and more physical I/O" is merely a symptom of a problem. Trying to speed these up could well be a wasted exercise. Besides, the most optimal approach to "lots of I/O" is to tune it to make less I/O.
    I/O is the most expensive operation for a RDBMS. It is very difficult to make this expense less (i.e. make I/Os faster). It is more effective to make sure that you use this expensive resource in an optimal way.
    Simple example. Single very large table with 4 indexes. Not very efficient design I/O wise. Single very large partitioned table with local indexes. This can reduce I/O on that table by up to 80% in my experience.

  • Database block with multiples images

    Hi,
    I have a database block with 5 image items for each record (all database items too).
    Block property "number of record displayed"=6....so I have 30 image item into the canvas. But when runs forms..only show me 1 image for each record (last image item of block!!)
    Someone could help me?
    I user for development environment:
    -Forms Versión 10.1.2.0.2
    -Oracle Database 10g Express Edition Release 10.2.0.1.0
    -Windows XP

    Yes...I have 5 image (blob) fields in each database record.
    Fields are identicals...
    :ARTICULOS.IMAGE1
    :ARTICULOS.IMAGE2
    :ARTICULOS.IMAGE3
    :ARTICULOS.IMAGE4
    :ARTICULOS.IMAGE5 (only show me this for each record)
    I make this test to understand if I made something wrong: delete field :ARTICULOS.IMAGE5 and after that :ARTICULOS.IMAGE4 shows the image...

  • SRM Local Purchase Order with both a standard line item and limit item...

    In SRM is it standard that you can create a local purchase order from the sourcing cockpit that contains a mix of limit items and standard items?
    I know this can be done in R/3.

    Paul,
    I am a functional/business person, and we are running SRM550 in extended classic, linking to ERP backed.
    From our business point of view it makes little sense to mix a limit item with one or more standard catalog item. SAP standard SRM 550 actually stops our users from doing this.
    For those who are not aware of the differences I will elaborate.
    A standard item is either from a Free Text entry process with the process being completed by a professional purchaser or a catalog item either internal to SRM, or maybe from an external website.
    Limit orders are value based and are mostly used for the payment of Utility bills, or for services. We don't use services at all.
    In our business we use limit orders for an Electricity Bill for example.
    When the user confirms a limit order the quantity should always be 1 and the user enters the value of the item.
    The Invoice entry team then needs to match the Invoice to the GR line.  It's at this point that if you have Limit items and standard items mixed our invoice entry team could run into problems.
    We are aware that it is not recommended practice for Limit orders to have GR and if you can avoid this step then you should.  Unfortunately our operating model insist on everything being confirmed and in the case of limit orders this can cause us invoice blocking issues.
    Limit orders are normally set up to run for a full FY so the addition of standard catalog items to a limit order makes little or no business sense.
    If a user added two limit items to a shopping cart for the same supplier our system would produce two PO's for the supplier to use.
    We actually avoid transmitting Limit order details to our suppliers as this would indicate the maxiumum value they could invoice us for, businesses just don't do that.  We just send them the PO number and description of the item. This provides them with a PO Ref number to puton their invoices.
    As we are still running SRM 550 maybe someone with SRM 7 knowledge would care to expand on this analysis?
    Hope this helps?
    Allen
    PS We don't use the Sourcing Cockpit, just read your earlier response
    Edited by: Allen Brooks on Mar 3, 2010 3:22 PM

  • Dynamically creating a database block in forms 10g

    hi guys ,
    i got a new requirement ,that is dynamically create a database blocks and items...
    how it is possible..?
    thanks...

    Hello,
    It is not possible. You cannot create blocks or items at runtime. What you can do is to have them created but hidden, then you set them visible as soon as you need them.
    Francois

Maybe you are looking for

  • How to use Macbook Pro 17" as a second monitor for iMac?

    I have a new iMac with Lightning connector and USB. And I have a Macbook Pro 17" with Firewire and USB. Is there a way to connect the Macbook Pro to the iMac and make it into a second monitor for my iMac? Thanks!

  • Iphone 5 - Since I have updated to ios7 my facetime and imessage is not working :( Please help!!

    Since I have updated my software, my imessage and facetime is not activating. I have tried to reset the phone, holding the lock button and the home button, trying to connect it under different wifi. Nothing seems to be working, it is really frustrati

  • WebRowSet properties for Oracle 10g XML

    //I am writing data into a database //Clob field then useing a WebRowSet writing //it as XML to the clob ResultSet rs = statement.executeQuery(); WebRowSet webRowSet = new WebRowSetImpl(); webRowSet.setCommand(sql); webRowSet.populate(rs); // First a

  • Instructions For Removal of 1.8 G5 Dual Processors

    Hi Gang I searched here and on the internet for any instructions on how to remove the processors from a 1.8 Dual Power Mac G5. Couldn't find anything??? I have a confirmed CPU1 failure. I'd like to get/see a pictorial if possible. Thanx Mike

  • Quicktime Player unresponsive while screen recording. Help!

    Hello. I often upload youtube videos with QuickTime Player and Final Cut Pro X. 2 days ago, I noticed a problem with quicktime player. Whenever I try to screen record, about 2 mins and 30 secs of recording, QuickTime Player becomes unresponsive. I am