Performance question on looping thrue blocks and items (forms 10.1.2.3)

Hi all,
I'm back again in Forms forum : ) !!! and I'm working on a new and very interesting project
version used : Forms [32 bits] Version 10.1.2.3.0 (Production)
A little question for gurus :
On former projects I used to call loops on blocks and item like shown below to do various things such as displaying buttons or showing canvas or different VA depending on the user or scenarios .
PROCEDURE FRM_BLK_ITM_LOOP IS
v_curblk varchar2(90); -- bloc courant
v_curitm varchar2(90); -- item courant
BEGIN
  v_curblk := get_form_property(:SYSTEM.CURRENT_FORM,first_block); -- on récupère le 1er block de la form
  LOOP
  v_curitm := v_curblk||'.'||get_block_property(v_curblk,first_item); -- on récupère le 1er item du block
    WHILE v_curitm != v_curblk||'.'||get_block_property(v_curblk,last_item)
     LOOP -- tant que l'item n'est pas le dernier du block on loop
        v_curitm :=  v_curblk||'.'||get_item_property(v_curitm,nextitem); -- on récupère l item suivant
        if get_item_property(v_curitm,<some property>) = 'TRUE' then
          --- I can do something.... or adding more conditions if then etc...
        end if;
    END LOOP;
  EXIT WHEN v_curblk = get_form_property(:SYSTEM.CURRENT_FORM,last_block); -- on sort losrqu on arrive au dernier block
  v_curblk := get_block_property(v_curblk, nextblock); -- on passe au block suivant
  END LOOP;
END;In my current project we work on quite huge forms which can have a consequent number of blocks and items.
And we must be very careful regarding performance issues as these forms are accessed via LAN and WAN.
So my question :
This method seems to be quite efficient as it goes thrue blocks and items sequences as they are defined in the builder comparing to go_block -> go_item ->do_something which can easily turn into nightmare-programming.
But I don't really know about network roundtrips with this kind of method.
Is everything done in the app server and then fetched to the client?
What triggers block-level and item-level can be fired during the execution of the loop ? and so one...
Thanks in advance for your advices on this matter.
Jean-Yves

Hmmm, I have to say I never bothered if Forms is in Socket mode or not; I enabled the network statistics, counted the roundtrips and looked for ways to get them lower (my old friend wireshark did also a good job regarding this) ;). But regarding the note Forms 6i uses Socket Connections by default, this might apply to 10g too (or the enhancement request was approved, who knows).
Frankly I am not entirely sure what Socket Mode means; I guess it's the mode the forms applet talks to the forms runtime; wheter it's stateful (via Sockets) or stateless (via HTTP / HTTPS) but this is just a wild guess, and I can't find informations on it quickly. I also enabled networkStats on my Developer Suite only, so I cannot tell if you can enable them on a full-fledged Application Server.
Anyway; as said I just counted the roundtrips and looked where I can avoid them when I made our application ready for WAN.
Another useful tool was Shunra VE Desktop which I used to simulate low bandwith networks with high latencys; I installed it on a virtual XP, started the application and tested how the Application performs. If something looked odd, I looked behind the scenes, built a little testform basing on the code behind and tried out various things; very often you can take advantage of the event bundling forms seems to make when you use several set_xyz calls as Francois also noted; e.g.
set_custom_property('bean_item', 1, 'PROPERTY', prop);
set_custom_property('bean_item', 1, 'PROPERTY', prop);
set_custom_property('bean_item', 1, 'PROPERTY', prop);
set_custom_property('bean_item', 1, 'PROPERTY', prop);
set_custom_property('bean_item', 1, 'PROPERTY', prop);
vRet := get_custom_property('bean_item', 1, 'PROPERTY);most certainly will cause just 1 roundtrip; but if you use get_custom_property in the middle of the set_custom_property calls you will encounter 2 roundtrips as forms needs to synchronize (you get a value from the bean so the forms runtime needs a response) with the forms applet whereas set_custom_property is a one-way-street which can be fired off simultaneous. The same applies to fbean.invoke and fbean.invoke_bool, fbean.invoke_char and the like. Of course if you are using more then one get_custom_property in this case the roundtrips will increase accordingly.
If you want to make use of event bundling make sure you fire off as much set_xyz as you can before forcing forms to synchronize (e.g. with get_xyz, or synchronize, create_timer,...)
cheers

Similar Messages

  • Any questions on Order Management Header and Item level?

    Hi,
    If you are interviewing somebody...And the position he wants is SD consultant.
    What kind of questions will you raise on OM header level and item level??
    Order management--Questions on Header level
                                  Questions on item level
    Thanks, would be better if you could also attach the answer.
    Thanks!!

    Dear Hoo,
    ORDER MANAGEMENT & SALES
    1.Briefly describe the types and structure of the sales document and give examples of data
    that you find on the different levels.
    Sales*related business transactions are recorded in the system as sales documents. There are, broadly
    speaking, four different groupings of sales documents:
    Sales queries, such as inquiries and quotations
    Sales orders
    Outline agreements, such as contracts and scheduling agreements
    Customer problems and complaints, such as free of charge deliveries and credit memo requests.
    Header Data
    The general data that is valid for the entire document is recorded in the document header. This data
    includes the:
    number of the sold*to party
    number of the ship*to party and the payer
    document currency and exchange rate
    pricing elements for the entire document
    delivery date and shipping point
    Item Data
    Whereas data in the document header applies to all items in the document, some data applies only to
    specific items. This data is stored at item level and includes the:
    material number
    target quantity for outline agreements
    number of the shipto party and the payer (an alternative shipto party or payer can be defined for a
    particular item)
    plant and storage location specifications
    pricing elements for the individual items
    Schedule Line Data
    An item consists of one or more schedule lines. The schedule line contains all the data that is needed
    for a delivery. For example, a customer orders 20 pieces of a material and you enter this as an item in
    the sales order. However, you can only deliver 10 pieces now and the remaining 10 pieces next month.
    In other words, you need to schedule two deliveries. The data for these deliveries (dates, confirmed
    quantities) are stored in two separate schedule lines. In sales documents where delivery data is not
    relevant *for example: contracts, credit and debit memo requests * the system does not create any
    schedule lines.
    Data recorded in the schedule lines includes the:
    schedule line quantity
    delivery date
    confirmed quantity
    2.What is the difference between an inquiry and quotation ?
    . Inquiry: Request made to a vendor for a quotation for required materials or services.
    No availability check is done for inquiry.
    . Quotation: Offer from a vendor to a purchasing organization regarding the supply of materials
    or performance of services subject to predefined terms and conditions.
    A quotation consists of a number of items, in which the total quantity and delivery date of an
    offered material or service are specified.
    The total quantity can be subdivided into several partial quantities with different delivery dates in the
    lines of a delivery schedule.
    3.Do you always have to have a material master record number when you enter an item on a
    sales document (inquiry and quote)? If not what would you have to use to be able to enter
    information at item level?
    No. Customer Material Information or Material Description.
    4.If a customer doesn't place an order with you after you have sent him a quotation, what happens to
    the quotation document?
    Remains active till the end of validity period.
    5.Can you have alternative items in a sales order?
    Yes.
    6.If you reference an inquiry when creating a quotation ,would the inquiry be updated?
    Yes.
    7.Can you copy one inquiry to many quotations ?
    No.
    8.Can you copy several previous documents into one sales order?
    Yes.
    9.Do you always have to copy the entire quantities at item level when you reference a
    previous document?
    No.
    10.Can you make sure that business data in a sales order is only possible to maintain at header
    level?
    Yes.
    11.From where is the delivering plant transferred into the sales order?
    Customer Master, Material Master.
    12.Which partner function is relevant for the delivering plant? The soldtoparty ,
    billtoparty, payer, carrier or the ship* to* party?
    Ship*to party.
    13.Can you manually change the delivering plant in the sales order once it was defaulted from
    the master data?
    Yes.
    14.For what or why do you use the incompletion log?
    To have a complete document so that it doesnu2019t affect subsequent processes.
    15.Can you have different incompletion logs for different item categories? Schedule line
    categories?
    Yes.
    16.If a document is incomplete can you still save the document?
    Yes.
    17.Which reference status can a document have at item level? Which statuses at header level?
    Item level: Partial, Full.
    Header level: Full.
    18.What's the advantage of using text as a reference instead of duplicating it?
    Can be modified if needed.
    19.What three sources provide data for the creation of a sales document?
    Material Master, Customer Master, Previous referenced documents.
    20.Can you change addresses of partners manually in the sales document?
    Yes.
    21.Name several input tools that make order entry faster and give a definition of them?
    Customer Material Information, Product Proposal , Referencing Documents.
    22.In which business environment would you use only the single*line entry screen to create
    and save the order?
    Telephone Sales, Simple Business.
    23.If you do not specify the delivering plant in the sales order, what could the system then not
    do?
    Delivery Scheduling.
    24.For what would you use the fast change function in sales entry?
    Alternate Plants, Delivery or Billing Blocks
    25.Name two ways to control that customers can receive only certain materials?
    Material Listing, Exclusion.
    26.What does the item category control?
    General Data
    . Should pricing be carried out for the item?
    . When should an item be regarded as completed? A quotation item, for example, can only be
    regarded as completed if the entire quantity has been copied into a sales order.
    . Is it an item that refers to a material or is it a text item?
    . Are schedule lines allowed for the item?
    . May general business data, for example, the terms of payment at the item level, deviate from
    those at the header level?
    . Should a system message appear if the item cannot be fully delivered?
    . Which fields are relevant for the incompletion log?
    . Which partner functions are allowed at the item level and which are mandatory?
    . Which output (for example, an order confirmation) is allowed for the business transaction and
    which output determination procedure is used?
    Shipping Data
    . Is an item relevant for delivery?
    . Should the weight and the volume of an item be determined?
    Billing Data
    . Is an item relevant for billing?
    . Should the cost of the item be determined?
    . Is it a statistical item? Pricing is carried out for statistical items. However, they are not added
    to the value of the order, that is, the customer is not charged for them.
    . Should a billing block be set automatically for an item? For example, this may be important for
    items whose prices have to be clarified before billing
    . Is it a returns item?
    . Name the influencing factors for determining the item category in the sales document?
    . Sales Document type, Item Category Group, Higher Level Item, Item Usage.
    . Name the influencing factors for determining the scehdule line category in the sales document?
    . Item Category, MRP Type.
    . What does the sales document type control?
    General Data
    . Can the document be entered only with reference to a preceding document?
    . Should the existing customer
    . material info record be taken into consideration?
    . Should the delivery date be proposed?
    . Must a customer number be entered when creating a document? For example, product
    proposals can be entered without reference to a particular customer.
    . Which order probability is defined?
    . Should the division be taken from the material master record for every item or should an
    alternative division specified in the header take precedence over the item specifications?
    . How should the system respond if the division entered in the header deviates from the division
    in the items?
    . Should a credit limit check be made?
    . From which number range should the document number for internal or external number
    assignment come?
    . Which fields are relevant for the incompletion log? The validity period, for example, is
    important for contracts and must therefore be specified in the document.
    . Can an incomplete document be saved or must all data be complete?
    . Which partner functions are allowed and which ones are mandatory?
    Shipping Data
    . Which delivery type should the delivery resulting from the order have?
    . Should delivery scheduling be carried out?
    . Should transportation scheduling be carried out?
    . Should a delivery block be set automatically for a specific reason? For example, a delivery
    block may be appropriate for a freeofcharge delivery.
    . You can define shipping conditions for a sales document type. These are copied into the
    document regardless of what is defined in the customer master record.
    Billing Data
    -->Which billing type should the invoice resulting from the order or the delivery have?
    Should a billing block be set automatically for a specific reason? For example, a billing block may be
    appropriate if a credit memo request should first be checked before it is used as the basis for a credit
    memo.
    -->Can the sales document type be determined by the system?
    No.
    -->In R/3, can you automatically substitute one product for another? How? What would you
    have to create?
    Yes. Product Selection / Material Determination.
    -->Give a definition of replenishment lead time?
    Total time for the inhouse production or for the external procurement of a product. In inhouse
    production the replenishment lead time is determined to cover all BOM levels.
    What's the difference between checking availability with or without replenishment lead time (RLT)?
    With RLT : Availability check is done only upto end of RLT. If material is not available the date on
    which RLT ends is displayed as Material Availability Date.
    Without RLT : Availability check is unrestricted. Displays Delivery Dates as on which partial deliveries
    can be made with available stock.
    -->Name at least three item categories?
    Standard Items : AFN, AGN, TAN.
    Free of charge Items: AFNN, AGNN, TANN.
    Non*stock Items : AFX, AGX, TAX.
    Text Items : AFTX, AGTX, TATX.
    -->Why would you use different item and schedule line categories?
    Item categories are defined to provide additional control functions for the sales documents and thus
    meet the demands resulting from the different business transactions.
    The items in a sales document are divided into one or more schedule lines. These schedule lines differ
    from each other with respect to date and quantity. For some schedule lines, material requirements
    planning is not carried out; for other schedule lines, it is carried out. Also goods receipt, not goods
    issue, is posted for a schedule line defined in a returns document.
    -->Can you change existing standard item categories?
    Yes.
    -->Can you create new sales order types?
    Yes.
    -->Different dates will be calculated in order entry scheduling . Can you name the lead time
    variables that will be taken into account?
    Transportation lead time, Pick/pack time, Loading time, Transit time .
    If you run out of stock in a specific plant can you check if there are quantities available in other plants?
    Yes.
    -->When you carry out availability check, which quantities or movements can the system take
    into consideration?
    The following elements can be included in the availability check:
    Stocks : safety stock, stock in transfer, stock in quality inspection, blocked stock.
    Inward and outward movements : purchase orders, purchase requisitions, planned orders, production
    orders, reservations, dependent reservations, dependent requirements, sales requirements, delivery
    requirements.
    -->Give some examples of sales document types (description, not necessary the short code)
    that already set up in the standard system?
    Indicator used to control the processing of the various sales documents which are defined in the
    system. E.g., OR, SO, BV, KR. Document types allow the system to process different kinds of business
    transactions, such as standard orders and credit memo requests, in different ways.
    -->Can you maintain texts for a specific customer and store them in the system? If yes, where?
    Yes. Customer Material Information.
    -->When the system checks availability which scheduling would it use first?
    Backward Scheduling.
    -->Name the influencing factors for the determination of the availability date?
    The following data is required for determining this date:
    Route from the shipping point to the ship*to party location
    Shipping point from which the goods are issued
    Loading group from the material master record
    Weight group determined from the order using the order quantity.
    -->Name the three delivery possibilities when there is not enough stock available?
    One Time Delivery, Complete Delivery, Partial Deliveries.
    -->Can you think of an example why you would have to create a text for a customer and copy it
    to the sales order?
    Customer specific instructions.
    -->What is the function of item category group?
    The item category group determines how a material is processed in the sales order. It defines, for
    example, that pricing does not take place for a free of charge item, such as a business gift; or that
    inventory management is not carried out for a service. When processing sales and distribution
    documents, the system uses the item category group to determine the item category. The system
    determines the item category based on the item category group of the material and the current
    business transaction, and proposes it in the respective document.
    When creating the material types non*stock material and services, DIEN is proposed in both cases for
    the item category group, because the order processing for both material types is identical: for
    example, pricing is carried out for both, but no availability check.
    -->On sales order, when the system confirms 20 pieces to be available at a certain date, would
    these 20 pieces still be available for other new sales order coming in later?
    No.
    -->What is a delivery group and why would you use it?
    The complete delivery and delivery group functions enable you to combine some or all of the items in a
    sales order so that they are delivered to the customer together. The system determines automatically
    the latest delivery date possible for the delivery group and adjusts the schedule lines accordingly.
    Corresponding requirements for material requirements planning (MRP) are changed or re*determined.
    -->What is backorder processing?
    The backorder processing functions enable you to list relevant sales documents for specific materials
    and process them from the point of view of availability. You can assign available to promise (ATP)
    stock to outstanding order quantities. In addition, you can withdraw already confirmed quantities and
    reassign them to different items.
    Backorder processing is only available for materials with individual requirements.
    -->Can you link items in a sales order? If yes, when would you do that?
    Yes. Promotional Items.
    -->For what would you use BOMu2019S in sales? What two methods of BOM processing do you have
    in sales order entry? How can you control if the system should/should not explode a BOM in
    the sales order.
    A bill of material (BOM) describes the different components that together create a product. A BOM for
    a bicycle, for example, consists of all the parts that make up the bicycle: the frame, the saddle,
    wheels, and so on. When you enter the material number of a bill of materials that is relevant for sales
    order processing, the system displays the material that describes the whole bill of materials as a main
    item. The components are displayed as sub*items.
    Processing by Main Item : ERLA & Processing by Sub*Item : LUMF
    BOM explosion can be prevented by specifying Item Category Group as NORM.
    Credit limit checks is an example of a very close link between which two SAP modules?
    SD & FI.
    -->What are the two techniques in delivery scheduling?
    Backward Scheduling & Forward Scheduling.
    -->How does a third party deal work? Do you use a special sales order type for that? How could
    the system know that you want to process a third party deal?
    By specifying item category as TAS using double*line entry in the sales order.
    No special order type is available.
    By the item category group and/or material type in Material Master .
    Name the several steps in consignment processing.
    Consignment fillup, Consignment issue, Consignment pickup, Consignment return.
    Whatu2019s the difference between consignment pick*up and consignment return?
    In consignment pick*up, customer returns consignment stock. When goods issue is posted, the
    relevant quantity is deducted from the customer's special stock and is added back to regular stock at
    the plant where the goods are returned. Total valuated stock remains the same since the returned
    stock was regarded as part of inventory even while it was at the customer's premises.This transaction
    is not relevant for billing.
    In consignment return, customer wishes to claim on consignment goods which have already been
    issued. When goods issue is posted, the relevant quantity is added to the customer's special stock at
    the plant where the goods are returned. Since the ownership of the goods is passed from the customer
    back to the company, the transaction is relevant for billing. In this case, the customer receives a credit
    memo for the returned goods.
    -->Can you control that an end user cannot copy a quote of customer A to a sales order for
    customer B? If yes, where?
    Yes. By customizing Copying Control for header data.
    Give some example for data that is copied from the customer (soldto, payer, shipto) to the sales
    order as well as for data that is copied from the material?
    General data, payment terms, shipping details, delivery agreements, delivering plant.
    -->What is returnable packaging processing?
    Returnable packaging consists of materials that are stored at the customer location but which remain
    the property of the company. The customer is only required to pay for the returnable packaging if he
    does not return it by a specified time.
    Name the two outline agreements in R/3 standard and explain the difference between them.
    Agreements are arrangements between business partners regarding the granting of conditions over a
    specified time period. The agreement contains conditions which apply over a particular time period and
    which are settled together at the same points in time. An agreement can be settled once or
    periodically. The two outline agreements include Contracts and Scheduling Agreements.
    Unlike a contract * which only contains an overall target quantity or value * a scheduling agreement
    also contains specific order quantities and delivery dates.
    -->How many documents do you create when you release, deliver and invoice the first order
    from a contract?
    Three : Sales order, Delivery note, Invoice.
    -->What types of output can you have in sales?
    Printer, Telex, Fax, Mail, EDI.
    -->Can you automate output processing ? Do you always have to specify it manually?
    yes. No.
    -->Where would you specify which data should be copied (at header, item and schedule line
    level)when you copy from one document to another one?
    Customizing Copy Control.
    I hope it will help you,
    Regards,
    Murali.

  • Loop through header and item internal table

    Hi,
        My scenario will be like this, i have two internal tables which is populated based on certain conditions, now i have to call one bapi to update values that am going to store values in a tree structure say for eg mat01 is header and mat02 and mat03 are item values.
          What is the efficient method to call that bapi one time for header creation and consequte times for item creation respectively.
      shall i have to loop thro two internal tables i.e header and item?
    suggestions are welcomed from the experts...
    Thanks in advance...
    Regards,
    Babu

    Hi Babu
    you can do something like that.
    loop it_header.
    *Call bapi to create header
      loop it_item where field_key = it_header-field_key.
    *  Call bapi to create item  
      endloop.
    endloop.
    The important part is the where sentence in the second loop.
    Regards
          David N.

  • Status of the block and the form

    Hi!!!
    Whenever i try to create record by pressing key-F6 the status of the form and block is changed. Could you please tell ,what status are the block and form are changed to, in create record event?

    E.g. if there are default values - see "About default values for items in new records" in the on line help.
    Also if the values are assigned to an items in triggers - Pre-Record, When-New-Record-Instance ...

  • Question on synchronized method / block and Thread Cache

    Hi all,
    I came across a blog post at http://thejavacodemonkey.blogspot.com/2007/08/making-your-java-class-thread-safe.html which is talking about making Java classes thread safe. But, I was surprised to see that a thread can have my class' instance variable in its cache. Also, I have couple of questions on the things posted in the blog. I want to get the opinion from Java experts here.
    1. Given the example class
    class MyClass{
         private int x;
         public synchronized void setX(int X) { this.x = x; }
         public synchronized int getX() { return this.x; }
    Having the following instructions in two threads won't guarantee that it will print 1 and 2 as other thread can get the slot and call setX to modify the value - Am I right?
    obj is an MyClass Instance available to both the threads
    Thread 1:
    obj.setX(1);
    System.out.println(obj.getX());
    Thread 2:
    obj.setX(2);
    System.out.println(obj.getX());
    It will print 1 and 2 (in any order) only if I synchronize these calls on "obj" as follows - Is my understanding correct or ???
    Thread 1:
    synchronized(obj)
    obj.setX(1);
    System.out.println(obj.getX());
    Thread 2:
    synchronized(obj)
    obj.setX(2);
    System.out.println(obj.getX());
    2. If my understanding on point 1 (given above) is right, What the blog-post says is wrong as I cannot even expect my thread 1 to print 1 and thread 2 to print 2. Then, again a question arises as why a thread cache has a object's instance variable value in its cache and need to make my instance variable volatile. Can anyone explain me in detail? Won't the thread always refer the heap for Object's instance variable value?
    Thanks in advance,
    With regards,
    R Kaja Mohideen

    your basic understanding (as far as i can understand what you've written) seems to be correct. if you run your first 2 threads, you can get "11", "12", "21", or "22" (ignoring newlines). if you run your second 2 threads, you can get "12" or "21".
    i'm not sure i follow your second point about your thread's "cache". i think you are asking about the visibility of changes between threads, and, no, there is not concept of a shared "heap" in the memory model. basically, (conceptually) each thread has its own working memory, and it only shares updates to that memory when it has to (i.e. when a synchronization point is encountered, e.g. synchronized, volatile, etc). if every thread was forced to work out of a shared "heap", java on multi-core systems would be fairly useless.

  • Question about Looping through tables in Adobe Form

    Hello,
    We have an adobe form which is to be filled offline. It consists of a table. Table can have repeating rows and user can add\remove rows as they wish.  The cardinality of the context node where we need to bind this table data is set to 1…n
    We want to know the process to get all the values in the table back into our context node once the form is uploaded. I assume we need to loop through the table, and add elements to the context node.  Can someone please let us know if we’re on the right track, and provide some sample code if possible?
    <b>We can’t figure out a way to loop through a table inside an Adobe form.</b>
    We are using Web Dynpro Java with Adobe Livecycle Designer 7.1
    Your help is much appreciated.
    Thanks,
    Rob.

    Try using...
    for (z = 0; z < 16; z++) {
         this["cb"+z].setStyle("styleName", "cssCBstyle");
    That is the way to target them.  I haven't dealt with setting styles, so I can't answer for that aspect working or not.

  • Questions on BPS BAPI calls and PDF forms

    I will need to create a button on a BPS form and that button is supposed to call a BAPI.  One of the buttons will create a PDF of the form (using the contents of the form) and print said form to a 'default' printer.  The issue is that not all cFolder users will have an ECC logon name.  What am I to do in this instance?  Will I need to pass some type of credentials to the ECC backend in order to run this BAPI?
    Also, how can I get the contents of the form(s) to the BAPI?  I assume that I will need to create the PDF in the code of the BAPI.  Please be patient with me as this is my first time to work with cFolders and/or BPS.
    Regards,
    Davis

    Hi Davis,
    Well, if you are able to log on the BPS application (thus, a Web Interface if I'm not mistaken) then it means that some user is logged on the ABAP-side. It is either a "personal" user or a technical (common) user, that is used for anonymous access.
    You will certainly be able to track down this user with the SM04 transaction.
    You should be able to add a button to the BPS page. One idea would be to call an URL with an ICF service behind that will be able to process the parameters contained in this URL.
    It will be this very ICF service that will call the BAPI.
    Try these links
    http://help.sap.com/saphelp_nw04s/helpdata/en/55/33a83e370cc414e10000000a114084/frameset.htm
    https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/ea8db790-0201-0010-af98-de15b6c1ee1a
    Hope this helps.
    Best regards,
    Guillaume

  • LOOPING THRU LINE ITEM

    HI IAM TRYING TO VALIDATE  FIRST CHECKING WHTETHER THE BILLING PLAN IS AT THE HEADER LEVEL OR AT THE ITEM LEVEL.
    HOW CAN I LOOP THRU ALL THE ITEMS IF THE BILLING PLAN IS AT THE ITEM LAVEL I NEED TO LOOP THRU ALLL THE ITEMS!!SOME OF THEM MAY HAVE BILLING PLAN AT THE ITEM LEVEL AND SOME AT THE HEADER LEVEL.
    PLSS TELL ME HOW TO DO IT FOR THE ITEM LEVEL.
    POINTS PROMISED!!

    i have done the code this way will it work???
    TYPES: BEGIN OF gst_fpla,
            fplnr TYPE fpla-fplnr,
            vbeln TYPE fpla-vbeln,
            rfpln TYPE fpla-rfpln,
            END OF gst_fpla.
      TYPES: BEGIN OF gst_fplt,
            fplnr TYPE fplt-fplnr,
            fproz TYPE fplt-fproz,
            fareg TYPE fplt-fareg,
            END OF gst_fplt.
    TYPES: BEGIN OF gst_fplt1,
           fplnr type fplt-fplnr,
           end of gst_fplt1.
      DATA: gi_fpla TYPE STANDARD TABLE OF gst_fpla.
      DATA: gi_fplt TYPE STANDARD TABLE OF gst_fplt.
      DATA: gw_fpla TYPE gst_fpla.
      DATA: VAR1(1) TYPE C.
      DATA: VAR2(9) TYPE C.
      DATA: GW_XFPLA LIKE XFPLA.
      DATA: gw_fplt TYPE gst_fplt.
      TYPES: BEGIN OF GST_RFPLN,
              RFPLN TYPE FPLA-RFPLN,
            END OF GST_RFPLN.
    DATA: GI_RFPLN TYPE STANDARD TABLE OF GST_RFPLN.
    DATA: GW_RFPLN TYPE GST_RFPLN.
    data: gi_fplt1 type standard table of gst_fplt1.
    data: gw_fplt1 type gst_fplt1.
      IF ( sy-tcode = 'VA01' OR sy-tcode = 'VA02' OR sy-tcode = 'VA21' OR  sy-tcode = 'VA22' ) AND ( vbak-auart = 'ZQT' OR vbak-auart = 'ZNS' ).
    IF RV45A-KFREL = 'X'.
      IF XFPLA[] IS NOT INITIAL.
      LOOP AT XFPLA INTO GW_XFPLA.
      GW_RFPLN-RFPLN = GW_XFPLA-RFPLN.
      APPEND GW_RFPLN TO GI_RFPLN.
      ENDLOOP.
    SPLIT GW_XFPLA-RFPLN AT '$' INTO VAR1 VAR2.
    DATA: BEGIN OF MRFPLN,
              rfpln1 type c length 1 value '0' ,
              rfpln2 type c length 9 value '',
              end of MRFPLN.
          MRFPLN-rfpln2 = VAR2.
    DATA: RFPLN TYPE STRING.
      RFPLN = MRFPLN.
    CONDENSE RFPLN.
      SELECT fplnr vbeln rfpln FROM FPLA INTO TABLE gi_fpla  FOR ALL  ENTRIES IN GI_RFPLN WHERE fplnr = GI_RFPLN-RFPLN.
    ENDIF.
      loop at gi_fpla into gw_fpla.
      if gw_fpla-vbeln = '' and gw_fpla-rfpln = ''.
      READ TABLE xfpla WITH KEY rfpln = gw_fpla-fplnr.
      if sy-subrc NE 0.
      MESSAGE  W047(YD01).
      write:'invalid reference number'.
      else.
      gw_fplt1-fplnr = gw_fpla-fplnr.
      append gw_fplt1 to gi_fplt1.
        ENDIF.
        ENDIF.
        ENDLOOP.
      ENDIF.
      SELECT fplnr fproz fareg from fplt into  TABLE GI_FPLT for all entries in gi_fplt1 where fplnr = gi_fplt1-fplnr.
      LOOP AT GI_FPLT INTO GW_FPLT.
      READ TABLE XFPLT WITH KEY FAREG = gw_fplt-fareg.
      if sy-subrc NE 0.
      WRITE:'BILLING RULE IS INVALID'.
      ELSE.
    WRITE:'CORRECT BILLING RULE'.
      READ TABLE XFPLT WITH KEY FPROZ = gw_fplt-fproz.
      if sy-subrc ne 0.
      write: 'billing percentage is invalid'.
      else.
      write: 'valid billing percentage'.
      endif.
      ENDIF.
      ENDLOOP.
    ELSE.                                                "ELSE FOR RV45A
    CLEAR: GI_FPLA.
    CLEAR: GI_FPLT.
    CLEAR: GI_RFPLN.
    CLEAR: GI_FPLT1.
    REFRESH: GI_FPLA.
    REFRESH: GI_FPLT.
    REFRESH: GI_RFPLN.
    REFRESH: GI_FPLT1.
    do the validations for item level.
      ENDIF.                                                "for  rv45a-if.
      ENDIF.

  • Manipulating data from a ref cursor in the data block of a form

    I am using Oracle Forms 10g. I have a ref cursor which returns columns A, B, C, D, E where B, C, D, E are values. The "Query Data Source Name" attribute in the datablock contains "CCTR_Extract_pkg.cctr_refcur". The "Column Name" attribute of item A contains "A", item B contains "B", etc. All of these columns are displayed on the form and it all works perfectly.
    I have a new request, the users would like a 6th column displayed - column F - where it equals D - B.
    Is there any way of doing this in the form only or do I need to change the ref cursor to accomodate the new column and then the form?
    If it can be achieved in the Form (only) - then how do I reference the 2 columns?
    Thanks in anticipation
    Michael
    Edited by: user8897365 on 24-Aug-2011 10:32

    Is there any way of doing this in the form only or do I need to change the ref cursor to accomodate the new column and then the form? The REF_CURSOR is the data source of your block so you will have to modify the CCTR_Extract_pkg package and cctr_refcur REF_CURSOR.
    If it can be achieved in the Form (only) - then how do I reference the 2 columns?After you have modified your database package, I recommend you run the Data Block Wizard on your block and let Forms detect the 2 new columns. You can do this manually, but it is safer to let Forms do it for you. If you want to do it manually, open the Query Data Source Columns property and add your new columns.
    Hope this helps,
    Craig B-)
    If someone's response is helpful or correct, please mark it accordingly.

  • How to create dynamic blocks in oracle forms

    Hi All,
    Is it possible to create a dynamic blocks and items in forms? I mean based on table driven values I want to create a blocks and items in the forms.
    I appreciate the help.
    Thanks
    Srini.

    No, Here is an example.
    Say for example I have a table called docs in that I have three columns col_name, col_type, and table_name the data will look like below
    col_name|col_type|table_name
    empno|     single row|     emp
    empname|     single row|     emp
    I want to create a block pointed emp table and columns (fields on the block) with specified in my docs table. The col name and table name may change based on some rules. So I want to create block (s) based data in docs table.
    Thanks
    Srini.

  • How to join three or more blocks in a form (like master/detail)

    I have four data blocks for four tables, lets call them blocks A, B, C, D
    Block A is a master block and block B is a detail block, block B holds a foreign key from block A (ofcourse)
    Now when i choose in a query data from block A it lists also data from detail block that is corresponding, but now.....
    detail block B also holds another foreign key from block C which takes his key from block D. and
    i want to make a form that will, when i query master block A, show some data from block B, C and D that is
    corresponding to block A.How do i do that?
    i'm using 10g and i am a begginer

    In each Data Block there are three nodes - triggers, items, and relations. The relations node is what you use to link the master to the detail. If you highlight the Relations node and press create a window will open to create your "New Relation". The master block is already entered because it is the block that you are currently in. You can then pick a detail block by pressing the "select..." button or just type the name of the block in. So if you did this in block A, you would enter B as your detail block. You will then need to enter a join condition. If the PK in block A is named A_DETAIL and the FK in block B is the same name, then you can just type in A_DETAIL, press OK, and the relationship will be automatically created. If the names are different then you could put in a join condition like A.A_DETAIL = B.B_A_DETAIL (whatever the names of the blocks and items are). You can then repeat this process for every parent-child relationship.

  • PL/SQL...Unsure how to loop thru multiple questions and display output?

    This is my first pl/sql program, I've written psudocode on paper, but not sure what to do for two parts.
    What I'm trying to do is write pl/sql that will check a row based on an employee id #.
    declare
    cursor cur is
    select *
    from employee
    where employee_id = foo;What we are checking are the results the employee answered. They have answered 180 questions and I want to find when the answer a 0, 7, and 9.
    Basically the pl/sql has to loop thru the 180 questions
    loop
    v_count := vcount + 1
    select *
    from employee
    where q1 thru q180 in (0, 7, 9);
    end loop;
    dbms_output.put_line ('Employee ID' || employee_id);
    dbms_output.put_line ('Q1 - Q180' || q1 - q180); I'm not sure how to write the pl/sql to loop thur all 180 questions.
    I'm not sure how to display the output to show what question they scored a 0, 7, and/or a 9 on.
    thanks
    Message was edited by:
    cmmiller

    536 columns in one table? Yowsa. Without a normalized table, you are going to need dynamic pl/sql and a messy solution.
    I would rethink your design, and come up with something more like so:
    employee
    questions
    employee_responses
    So that would you could easily do something like this:
    declare
      cursor c1 is
        select ers.question_id,
               que.question_name,
               ers.rating
          from employee emp,
               questions que,
               employee_responses ers
         where emp.employee_id = ers.employee_id and
               que.question_id = ers.question_id and
               emp.employee_id = v_employee_id and
               ers.rating in (0, 7, 9) and
               que.enabled_flag = 'Y';
    begin
      for r1 in c1 loop
        dbms_output.put_line('Question: '||r1.question_name);
        dbms_output.put_line('Employee Rated this: '||r1.rating);
      end loop;
    end;Thats how I would do it - I think you are going down the wrong path. What happens if you need to create a new question or delete one? You constantly have to modify the table. Hope this helps

  • How to find the name of the block and yours items at runtime

    Hi, everybody.
    I wonder if there is any way to list the name of a block and their respective items that forms at run time. for example, using a loop in wnfi.
    Since already thank you.
    Sorry for my bad English.

    Hi,
    Try this code. It will travel through all block's items.
    DECLARE
         Str_First_Block      VARCHAR2(100) := NULL;
         Str_First_Item          VARCHAR2(100) := NULL;
         Str_Current_Block VARCHAR2(100) := NULL;
         Str_Current_Item      VARCHAR2(100) := NULL;
    BEGIN
         Str_First_Block := :SYSTEM.CURRENT_BLOCK;
         LOOP
              IF Str_Current_Block IS NULL THEN
                   Str_Current_Block := Str_First_Block;
              END IF;
              Str_First_Item := GET_BLOCK_PROPERTY(Str_Current_Block, FIRST_ITEM);
              LOOP
                   IF Str_Current_Item IS NULL THEN
                        Str_Current_Item := Str_First_Item;
                   END IF;
                   MESSAGE('Item - ' || Str_Current_Block || '.' || Str_Current_Item);
                   PAUSE;
                   Str_Current_Item := GET_ITEM_PROPERTY(Str_Current_Block || '.' || Str_Current_Item, NEXTITEM);
                   EXIT WHEN Str_Current_Item IS NULL;
              END LOOP;
              Str_Current_Block := GET_BLOCK_PROPERTY(Str_Current_Block, NEXTBLOCK);
              EXIT WHEN Str_Current_Block IS NULL;
         END LOOP;
    END;Regards,
    Manu.
    If my response or the response of another was helpful, please mark it accordingly

  • Tool to list blocks and block items

    i'm wondering if there is a tool that can exhaustively list block and block item names for auditing purposes?
    thanks again.

    Hai,
    Try this Code
         Str_First_Block   VARCHAR2(100);
         Str_Current_Block VARCHAR2(100);
         Str_First_Item          VARCHAR2(100);
         Str_Current_Item     VARCHAR2(100);
         Str_List                         VARCHAR2(32767); -- *the max of varchar is 32767*
    BEGIN
         Str_List := NULL;
         Str_First_Block := NAME_IN('SYSTEM.CURRENT_BLOCK');
         Str_Current_Block := Str_First_Block;
         LOOP
              Str_First_Item := GET_BLOCK_PROPERTY(Str_Current_Block, FIRST_ITEM);
              Str_List := Str_List || CHR(10) || Str_Current_Block || '.' || Str_First_Item;
              Str_Current_Item := Str_First_Item;
              LOOP
                   Str_Current_Item := GET_ITEM_PROPERTY(Str_Current_Item, NEXTITEM);
                   EXIT WHEN Str_Current_Item IS NULL;
                   Str_List := Str_List || CHR(10) || Str_Current_Block || '.' || Str_Current_Item;
              END LOOP;
              Str_Current_Block := GET_BLOCK_PROPERTY(Str_Current_Block,NEXTBLOCK);
              EXIT WHEN Str_Current_Block IS NULL;
         END LOOP;     
    END;this will give you the full items list of the current form. keep and eye on that Str_List variable, as the size of that variable is too small.
    Regards,
    Manu.
    If this answer is helpful or correct, please mark it. Thanks.

  • Looping thru instance manager and checking radio button selected

    I need to loop thru my instances and toggle visible/hidden if a particular radio button in each instance is selected.
    My code right now does not work but I feel I am on the right track (minus the else statement it will need to toggle on/off).
    Can anyone help? thanks in advance!
    var rowCount = BugGroup_f.instanceManager.count;
    for (i=0; i<rowCount; i++) {
    var str = xfa.resolveNode("BugGroup_f.detail3.bugInfo.BugItem.status.RadioButtonList[" + i + "]").rawValue;
        if (str.indexOf("Fixed") > -1) {
        xfa.resolveNode("BugGroup_f["+rowCount+"]").presence = "hidden"

    So we've got a set of Rows, each with a subitem called RadioToggle, and you want to go through and set them all, then click a separate button and hide the ones with "on" radio buttons?
    function ToggleRows(reset){
         var Rows = Form.subform....BugGroup_f.all;
         var curRow;
         for (var i=0; i<Rows.length; i++){
              curRow = Rows.item(i);
              if ((curRow.RadioButton.rawValue == "WhatevermeansHidden") && !reset){
                   curRow.presense = "hidden";}
              else{
                   curRow.presense = "visible";}
    ^ in a script object, and put
    scriptObjectName.ToggleRows(reset);
    in the click event of your button, and you should be golden.
    If you do want them to hide the moment you click the toggle, you could put this, right?
    if (xfa.event.newText == "whatevermeansoff"){
         parent....presense = "hidden";}
    The .all method seems like a much easier way to handle collections of objects, and specificaly collections of instances. It also means you can do relative referencing, i.e. to create a function that will operate on all the rows of a table, without knowing which table it is operating on, so a button in each table can pass it's parent table to the function.
    var GroupVariable = Object.all
    for(var i=0; i < GroupVariable.length; i++)
    EDIT:
    add a reset value, and pass it in to your function like above (added).
    make a separate button, or control, that will call the function with reset = 1.

Maybe you are looking for

  • Cheapest Way to fix My ipad 2 Screen

    This is the second time i crack my screen. The first time i cracked it i fixed it at the apple store at my mall. You dont want to know how much i paid... Im about to fix it through wickedtronics.com for about $99 ... Is this the cheapest i can get it

  • Solaris 10 Memory and Ldoms

    Hi Got a problem installing in a Guest Ldom on a T5120. I made the DVD ( Solaris 10 5/09 ) avaliable as a virtual disk and booted from it. I used the same media installing the controller Ldom. Did'nt get any problems with it. I allocated 512MB Memory

  • MAC leopard:  JFileChooser not using FileFiler correctly!?

    Hi guys, I am using FileFilter to filter files with extension ".fpp" in my JFileChooser.This works well in Windows.But in MAC , it shows the "application" files. I mean there are some files with ".app" extension and they are shown in JFileChooser.So

  • IPhoto 8.1.2 crashing when changing photo title

    iPhoto 8.1.2 is crashing (or hanging up -- I get the spinning color wheel and I have to force quit it) when I change the title on many of my photos.  It happens when I hit return or try to click on another picture after entering the new title.  It on

  • Architectural Difference Effect on Signing/Verifying XML Document

    Hi all, I am using Apache Santuario for signing XML. 1. I have a Windows Server 2008 64 Bit, which is using JAVA 7 32 bit JVM. Let's say my signed document is Signed_A. On Windows Server 2008 I am signing the document but the verification fails for S