Text item number checking

Hi,
is there a way werein the user can only input numbers and a decimal point into a text item.
thanks,
psdilag

Hello,
I am finding no problem in using this function in PL/SQL as well as forms. Here is what i have done in PL/SQL:
SQL> create or replace function isnumeric ( p_string in varchar2)
2 return boolean
3 as
4 l_number number;
5 begin
6 l_number := p_string;
7 return TRUE;
8 exception
9 when others then
10 return FALSE;
11 end;
12 /
Function created.
SQL> set serveroutput on
SQL> declare
2 a number;
3 begin
4 if isnumeric(123) then
5 dbms_output.put_line('number');
6 else
7 dbms_output.put_line('char');
8 end if;
9 end;
10 /
number
PL/SQL procedure successfully completed.
And in forms i used this code at WHEN-BUTTON-PRESSED trigger for testing purpose and here also it worked very well for me..........

Similar Messages

  • How to show value of COUNT_QUERY in a text Item?

    please tell me how to show value of COUNT_QUERY in a text Item?

    If you look a bit further down the thread Rosario posted, you might find the method DanielLiang posted to be easier to implement for you.
    you can use calculation:
    example :
    Database Data Block: block1 ( Query All Records : Yes )
    not Database Data Block : block2 (Single Record : Yes)
    block2 has a text item (number) ,it calculation property :
    calculation mode : summary
    summary function : count
    summarized block : block1
    summarized item : item1(block1's item)

  • Display number 1 to 10 in a text item or display item

    I want to know how do i display the number of 1 to 10 in a text item or a display item.
    What triggers should I use? What are the differences for each smarttriggers?
    What are the differences between a text item and a display item?
    Thank you in advance.

    Trigger
    PRE-TEXT-ITEM
    ============
    BEGIN
         FOR i IN 1..10
         LOOP
              dbms_output.put_line(i);
              END LOOP;
    END;
    I have a text item on my form. How can I display the output on to them when I have compiled and run the form?

  • How to print sequence number for a text item in a oracle reports

    Hi
    I have text item which repets for every round,if i have 3 or 4 rounds i should number the text item as 1,2,3,4 etc.... in a report.
    Can anybody help me
    Thanks in advance

    Hi Bob
    Thank you for your reply.
    Here is the data for example:
    Jobxxxx
    Round
    assembly for 3d $200 1 $200.00
    proof for 3d $10 3 $30.00
    Round
    plate for 3d $200 1 $200.00
    image for 3d $10 3 $30.00
    Job yyyy
    Round
    assembly for 3d $100 1 $100.00
    proof for 3d $50 3 $150.00
    So Bob everything is comming from tables except round.
    My question is how to add sequence number to round adn the result should be like this:
    Jobxxxx
    Round 1
    assembly for 3d $200 1 $200.00
    proof for 3d $10 3 $30.00
    Round 2
    plate for 3d $200 1 $200.00
    image for 3d $10 3 $30.00
    Job yyyy
    Round 1
    assembly for 3d $100 1 $100.00
    proof for 3d $50 3 $150.00
    Thank you in advance

  • Spell check a text item

    Anyone got any succesful (and easy!) ways to implement a spell check on a text item?

    Hi all
    Replacing rich text editor is definitively a goog and simple solution.
    steps are :
    1-download
    2-copy files
    3-replace one file
    4-Invalidate web cache
    5-celebrate the new RTE
    I use FCK Editor with spell checking and ity works good.

  • How to check old and new value for a text item attached to a lov?

    Hi,
    I am new to Forms.
    I need your help in following.
    I have a form which has a text item which is attached to a LOV. I want to track what changes are being done using that form. So i want to know what was old value and what is new value.
    I can get the new value as it is there in form field. how can i know what was the old value.
    Thanks
    Prashant Pathak

    This is wrong:
    name_in(':' ||l_audit_block.field_name)
    this is right and will get you the current value of the the item:
    name_in('l_audit_block.field_name');
    Assuming the name of you block is "l_audit_block" and the name of your item is "field_name".
    Please note name_in() returns your current value for an item. In your case this may or may not be the "old" value. I define "old" value as the value it was when it was queried. If that is what you are looking for you need to use the get_item_property() call that Steve described above.
    --pat                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           

  • Purchase order and its item number

    Hi everybody,
    I have a problem in my selection screen: I want that when I choose purchase order the item number is selected (like in MIGO) but It doesn't works.
    SELECTION-SCREEN:BEGIN OF BLOCK b1 WITH FRAME TITLE text-001.
    PARAMETERS :
                  p_cmd TYPE ekBE-ebeln MATCHCODE OBJECT MEKK  MEMORY ID BES,
                  p_poste TYPE ekbe-ebelp MEMORY ID BSP
    SELECTION-SCREEN :  END OF BLOCK b1.
    Any ideas please.
    Thank you

    Hi
    check in the data sour ce level whether the data is available or not
    regards
    hari

  • Text item validation into Formular.

    hi.
    From some days I have written my fiirst application using Oracle Forms6i.
    In oracle9i I created table USER with column id_user number(5), username varchar2(10) and passwd varchar2(12).
    In oracle forms builder I created the formular with 4 controls(2 fields - username and passwd ,one button to login user and Text item to the botton of this formular to print message for user). In ProperPalette for Text item 'username' and 'passwd' I set adequately Maximum Lenght peperty to 10 and 12(for 'passwd' field) and Required to Yes.
    Then I wanted to make a validation username and passwd fields in this way, that the user can put in 'username' field the string with length between 8 to 10 and for 'passwd' between 8 to 12 and checking all other cases incorrect data entering by login user.
    I created trigger WHEN-MOUSE-CLICK for button with this body:
    declare
         dlug_username number;
         dlug_passwd number;
    begin
         dlug_username := length(:user_data_log.username);
         dlug_passwd := length(:user_data_log.passwd);
         if (:user_data_log.username = NULL and :user_data_log.passwd = NULL) then
              :user_data_log.komunikaty_logowania := 'you didn enter any data!';
         elsif dlug_username >= 8 and dlug_passwd >= 8 then
         :user_data_log.komunikaty_logowania := 'Correct data!';
         elsif dlug_username < 8 or dlug_passwd < 8 then
                   :user_data_log.komunikaty_logowania := 'Fields USERNAME i PASSWD must have more then 8 sign. Correct them!';
                   :user_data_log.username := '';
                   :user_data_log.passwd := '';
         end if;
    exception
         when VALUE_ERROR then
         :user_data_log.komunikaty_logowania := dlug_username;
    end;
    When I run this form by Run Form client/server button, it's not matter what I'll enter in two field 'username', 'passwd', when I press button always is invoke exception section
    but no if condition.
    Now, I don't know what do with this. What is the best way to resolve problems with validation of form elements?
    Thanks in advance for all help, some hints, tutorials. I appologise for so long post, but I
    want directly describe my problem. Thanks.

    Hi,
    Regarding to your post and your problem , obviously the code doesn't go into the
    IF condition and validate it becouse the syntax is not appropriate and every time it goes to the IF it jumps into the exception part. Thats why you have to correct your code as fllowing.
    if (:user_data_log.username IS NULL) and (:user_data_log.passwd IS NULL) then
    etc till the end of the code.
    Kindly if this approach meet your requirment of solving , update your problem with a Subject of Solved
    Regards
    Omar

  • Oracle 10g FRM-41051 on a non-database text item with a LOV

    Hi all,
    I'm struggling with a problem I'm convinced must have a really simple solution, but for the life of me I can't figure it out!
    I have a data block called query. It is a non-DB block with a number of items, with either LOVs or drop down lists. It is used to choose values, which are them programatically 'translated' into values in two other database data blocks (which are populated in the WHEN-BUTTON-PRESSED trigger of a button in the non-DB block).
    This is necessary as I have a slightly complex query which takes values from many different tables and displays bits of information from all the different tables.
    My problem is that, on my text item (which has a LOV attached to it with Automatic Display set to Yes); when I click on it, I expect the LOV to show and I am able to choose a value from it. Instead I get the error 'FRM-41051 You cannot create records here' and the LOV does not display.
    I don't understand this. Everything on the block is a non-DB item, including the block itself, and I don't want to 'create' any records, all I want to do is choose values into my text items which I can then use in a DB query (written in my trigger).
    What am I doing wrong?
    Abigail

    Probably this other item or block has got property insert allowed to FALSE.
    I have suggested you to use a push button in order to check that everything in the LOV is OK.
    Lov can also return value to item in another block; probably in your case there is something that fires the error.
    Normally when I develop my form I disable on-error and on-message trigger in order to follow every step at runtime...
    I'm happy that you have resolved your problem :D
    Fabrizio

  • When validate item for a particular item number

    hi all
    i am using forms 6i
    In a master detail form
    the block XXNP_JL_OO1 has 2 fields like
    Manual--checkbox item
    Field--text item (populated from Lov RECORD group names Field)
    the query for the record group of FIELD is
    select flex_value from fnd_flex_values where flex_value_set_id=1009757
    flex value
    abdaly
    wafra
    fintas
    now if we do the query select flex_value, hierarchy_level from fnd_flex_values where flex_value_set_id=1009757
    flex_value hierarchy_level
    abdaly 315
    wafra 200
    fintas 100
    In the detail part
    there is a tabbed canvas one field is ACT_QTY
    ITEM NUMBER                   ACTQTY
    client requirement is whenever the item number is 1010103002 only and the manual checkbox item is ticked the act_qty should return values corresponding to the data in Field
    manual and field belongs to datablock XXNP_JL_001
    ITEM_NUMBER AND ACT_QTY belongs to data block xxnp_jl_est_002
    kindly guide how to proceed with this
    should i do a when validate item trigger in act_qty as follow
    BEGIN
        IF :XXNP_JL_001.Manual IS NOT NULL  and XXNP_JL_EST_002.ITEM_NUMBER='1010103002' THEN
            SELECT hierarchy_level
            INTO :XXNP_JL_EST_002.ACT_QTY
            FROM fnd_flex_values
            WHERE flex_value_set_id = 1009757
            AND FLEX_VALUE=:XXNP_JL_001.FIELD ;
        ELSE
             :XXNP_JL_EST_002.ACT_QTY:=NULL;
        END IF;
    ENDthanking in advance
    Edited by: makdutakdu on May 8, 2012 11:15 AM
    Edited by: makdutakdu on May 8, 2012 11:16 AM
    Edited by: makdutakdu on May 8, 2012 11:23 AM
    Edited by: makdutakdu on May 9, 2012 9:00 AM

    hi
    this is the code i wrote
    when job is manual(check box ticked) and item number=''1010103002' the act_qty as per client requirement as follows
    BEGIN
        IF :XXNP_JL_001.Manual IS NOT NULL  and XXNP_JL_EST_002.ITEM_NUMBER='1010103002' THEN
            SELECT hierarchy_level
            INTO :XXNP_JL_EST_002.ACT_QTY
            FROM fnd_flex_values
            WHERE flex_value_set_id = 1009757
            AND FLEX_VALUE=:XXNP_JL_001.FIELD ;
        ELSE
             :XXNP_JL_EST_002.ACT_QTY:=NULL;
        END IF;
    END;the original code as to how act_qty is populated now
    ORIGINAL CODE OF WHEN VALIDATE ITEM FOR ACT_QTY
    Declare
         V_count   number(10) ; 
    Begin
    SELECT    count(1) into V_count   FROM MTL_SYSTEM_ITEMS
    WHERE   SEGMENT1       = :XXNP_JL_EST_002.item_number
    AND     ATTRIBUTE3     =  'Yes'  ;
    If  V_count >=1    then
    :XXNP_JL_EST_002.CALC_CEMENT_SK   :=      :XXNP_JL_EST_002.act_QTY   ;  
    :XXNP_JL_EST_002.CALC_AMOUNT      :=          :XXNP_JL_EST_002.act_QTY * 94         ;  
    Else
    :XXNP_JL_EST_002.CALC_AMOUNT   :=             :XXNP_JL_EST_002.act_QTY  ;
    end if ;
    end ;      
    -----------------------------------------------------------i want to include the above original code of act_qty in my code in the else clause
    this is wht i tried
    Declare
         V_count   number(10) ; 
    Begin
    IF :XXNP_JL_001.Manual IS NOT NULL  and :XXNP_JL_EST_002.ITEM_NUMBER='1010103002' THEN
            SELECT hierarchy_level
            INTO :XXNP_JL_EST_002.ACT_QTY
            FROM fnd_flex_values
            WHERE flex_value_set_id = 1009757
            AND FLEX_VALUE=:XXNP_JL_001.FIELD ;
            ELSE
            ----------original code of act_qty included below in the else clause-----------------------------
    SELECT    count(1) into V_count   FROM MTL_SYSTEM_ITEMS
    WHERE   SEGMENT1       = :XXNP_JL_EST_002.item_number
    AND     ATTRIBUTE3     =  'Yes'  ;
    If  V_count >=1    then
    :XXNP_JL_EST_002.CALC_CEMENT_SK   :=      :XXNP_JL_EST_002.act_QTY   ;  
    :XXNP_JL_EST_002.CALC_AMOUNT      :=          :XXNP_JL_EST_002.act_QTY * 94         ;  
    Else
    :XXNP_JL_EST_002.CALC_AMOUNT   :=             :XXNP_JL_EST_002.act_QTY  ;
    end if ;
    END IF;
    end ;
    END;i am getting error fnd_flex_values should be declared
    kindly guide me
    thanking in advance

  • User Exit for assignment number check

    Hi SAP GURUS,
    I want to have a cheque in system for not to enter a cheque number twice in assignement field. Which user exit i can use for the cheque payment made thru F-53 OR F-58 OR F110.
    Thanks
    CHEERS
    Edited by: NITIN on Apr 26, 2010 7:50 AM
    Edited by: NITIN on Apr 26, 2010 11:18 AM

    Identification of user EXIT
    1.     Enter T.code for which you want to maintain User exit. For ex : ME51 (Purchase requisition)
    Path:  Status Status Double Clicks on the program NameGo toAttributesNote down development class.
    For Ex : ME51u2014development class/package name is  ME
    2.     Enter T.code : SMODutilities FindEnter Development class/package name Execute
    3.     It shows all the Exit names. Click on Exit Name and click on Functional module name.
    for ex: f-53 having following exits.
    F050S001  FIDCMT, FIDCC1, FIDCC2: Edit user-defined IDoc segment
    F050S002  FIDCC1: Change IDoc/do not send
    F050S003  FIDCC2: Change IDoc/do not send
    F050S004  FIDCMT, FIDCC1, FIDCC2: Change outbound IDoc/do not send
    F050S005  FIDCMT, FIDCC1, FIDCC2 Inbound IDoc: Change FI document
    F050S006  FI Outgoing IDoc: Reset Clearing in FI Document
    F050S007  FIDCCH Outbound: Influence on IDoc for Document Change
    F180A001  Balance Sheet Adjustment
    FARC0002  Additional Checks for Archiving MM Vendor Master Data
    FEDI0001  Function Exits for EDI in FI
    RFAVIS01  Customer Exit for Changing Payment Advice Segment Text
    RFEPOS00  Line item display: Checking of selection conditions
    RFKORIEX  Automatic correspondence
    SAPLF051  Workflow for FI (pre-capture, release for payment)
    Thanks
    ANJI

  • Cannot text one number

    I can not text one number and it is driving me crazy!!  I recieved a message that says "you can only send messages to fixed dialing numbers".  I do not know what that means.  I can send texts to Verizon, and T-Mobile phones.  I can send and recieve calls from the number but I can not text.  
    This is recent that this has happened.  I was able to send and recieve texts from this one numbers, but it seems as of OCtober, I can not.  
    Is anyone else having this issue??  It is truely driving me crazy!!

    Try checking Menu / Settings / Call Settings / FDN and make sure fix dialing option isnt enabled, if this is on this can restrict in and out going items.. 
    Another thing to check with Verizon and make sure no restrictions is setup on your accounts or you can check and make sure you havent added that number to the block list on the MyVerizon area of your account.

  • Change date of item number

    Hello friends,
                         I am retreiving the change item number from table CDPOS from the field TABKEY , I also need to retreive the change date(When the user changes the item number) of item number. Can anyone pls tell where can I  get the change date from.

    *"Table declarations...................................................
    TABLES:
      EKKO,                                " Purchasing Document Header
      CDHDR,                               " Change document header
      SSCRFIELDS.                          " Fields on selection screens
    *"Selection screen elements............................................
    SELECT-OPTIONS:
      S_EBELN FOR EKKO-EBELN,              " Purchasing Document Number
      S_LIFNR FOR EKKO-LIFNR,              " Vendor's account number
      S_EKGRP FOR EKKO-EKGRP,              " Purchasing group
      S_BEDAT FOR EKKO-BEDAT,              " Purchasing Document Date
      S_UDATE FOR CDHDR-UDATE.             " Creation date of the change
                                           " document
    *" Data declarations...................................................
    Field String to hold Purchase Document Number                       *
    DATA:
      BEGIN OF FS_EBELN,
        EBELN(90) TYPE C,                  " Purchase Document Number
        ERNAM     TYPE EKKO-ERNAM,         " Name of Person who Created
                                           " the Object
        LIFNR     TYPE EKKO-LIFNR,         " Vendor's account number
        EKGRP     TYPE EKKO-EKGRP,         " Purchasing group
        BEDAT     TYPE EKKO-BEDAT,         " Purchasing Document Date
      END OF FS_EBELN,
    Field String to hold Purchase Document Header                       *
      BEGIN OF FS_EKKO,
        EBELN TYPE EKKO-EBELN,             " Purchasing Document Number
        ERNAM TYPE EKKO-ERNAM,             " Name of Person who Created the
                                           " Object
        LIFNR TYPE EKKO-LIFNR,             " Vendor's account number
        EKGRP TYPE EKKO-EKGRP,             " Purchasing group
        BEDAT TYPE EKKO-BEDAT,             " Purchasing Document Date
      END OF FS_EKKO,
    Field String to hold Account Number and name of the Vendor          *
      BEGIN OF FS_LFA1,
        LIFNR TYPE LFA1-LIFNR,             " Account Number of Vendor
        NAME1 TYPE LFA1-NAME1,             " Name1
      END OF FS_LFA1,
    Field String to hold Change date and the name of the user           *
      BEGIN OF FS_CDHDR,
        OBJECTCLAS TYPE CDHDR-OBJECTCLAS,  " Object Class
        OBJECTID   TYPE CDHDR-OBJECTID,    " Object value
        CHANGENR   TYPE CDHDR-CHANGENR,    " Document change number
        USERNAME   TYPE CDHDR-USERNAME,    " User name
        UDATE      TYPE CDHDR-UDATE,       " Creation date of the change
                                           " document
      END OF FS_CDHDR,
    Field String to hold Change document items                          *
      BEGIN OF FS_CDPOS,
        OBJECTCLAS   TYPE CDPOS-OBJECTCLAS," Object class
        OBJECTID(10) TYPE C,               " Object Value
        CHANGENR     TYPE CDPOS-CHANGENR,  " Document change number
        TABNAME      TYPE CDPOS-TABNAME,   " Table Name
        FNAME        TYPE CDPOS-FNAME,     " Field Name
        VALUE_NEW    TYPE CDPOS-VALUE_NEW, " New contents of changed field
        VALUE_OLD    TYPE CDPOS-VALUE_OLD, " Old contents of changed field
      END OF FS_CDPOS,
    Field String to hold Date Element Name                              *
      BEGIN OF FS_DATAELE,
        TABNAME   TYPE DD03L-TABNAME,      " Table Name
        FIELDNAME TYPE DD03L-FIELDNAME,    " Field Name
        ROLLNAME  TYPE DD03L-ROLLNAME,     " Data element (semantic domain)
      END OF FS_DATAELE,
    Field String to hold Short Text of the Date Element                 *
      BEGIN OF FS_TEXT,
        ROLLNAME TYPE DD04T-ROLLNAME,      " Data element (semantic domain)
        DDTEXT   TYPE DD04T-DDTEXT,        " Short Text Describing R/3
                                           " Repository Objects
      END OF FS_TEXT,
    Field String to hold data to be displayed on the ALV grid           *
      BEGIN OF FS_OUTTAB,
        EBELN      TYPE EKKO-EBELN,        " Purchasing Document Number
        ERNAM      TYPE EKKO-ERNAM,        " Name of Person who Created the
                                           " Object
        LIFNR      TYPE EKKO-LIFNR,        " Vendor's account number
        EKGRP      TYPE EKKO-EKGRP,        " Purchasing group
        BEDAT      TYPE EKKO-BEDAT,        " Purchasing Document Date
        WERKS      TYPE LFA1-WERKS,        " Plant
        NAME1      TYPE LFA1-NAME1,        " Name1
        USERNAME   TYPE CDHDR-USERNAME,    " User name
        UDATE      TYPE CDHDR-UDATE,       " Creation date of the change
                                           " document
        DDTEXT     TYPE DD04T-DDTEXT,      " Short Text Describing R/3
                                           " Repository Objects
        VALUE_NEW  TYPE CDPOS-VALUE_NEW,   " New contents of changed field
        VALUE_OLD  TYPE CDPOS-VALUE_OLD,   " Old contents of changed field
      END OF FS_OUTTAB,
    Internal table to hold Purchase Document Number                     *
      T_EBELN LIKE STANDARD TABLE
                OF FS_EBELN,
    Internal table to hold Purchase Document Header                     *
    T_EKKO LIKE STANDARD TABLE
              OF FS_EKKO,
    Temp Internal table to hold Purchase Document Header                *
    T_EKKO_TEMP LIKE STANDARD TABLE
                   OF FS_EKKO,
    Internal table to hold Account number and Name of the Vendor        *
      T_LFA1 LIKE STANDARD TABLE
               OF FS_LFA1,
    Internal Table to hold Change date and the name of the user         *
      T_CDHDR LIKE STANDARD TABLE
                OF FS_CDHDR,
    Internal Table to hold Change document items                        *
      T_CDPOS LIKE STANDARD TABLE
                OF FS_CDPOS,
    Temp. Internal Table to hold Change document items                  *
      T_CDPOS_TEMP LIKE STANDARD TABLE
                     OF FS_CDPOS,
    Internal Table to hold Data Element Name                            *
      T_DATAELE LIKE STANDARD TABLE
                  OF FS_DATAELE,
    Temp. Internal Table to hold Data Element Name                      *
      T_DATAELE_TEMP LIKE STANDARD TABLE
                       OF FS_DATAELE,
    Internal Table to hold Short Text of the Date Element               *
      T_TEXT LIKE STANDARD TABLE
               OF FS_TEXT,
    Internal Table to hold data to be displayed on the ALV grid         *
      T_OUTTAB LIKE STANDARD TABLE
                 OF FS_OUTTAB.
                   C L A S S   D E F I N I T I O N                      *
      CLASS LCL_EVENT_HANDLER  DEFINITION DEFERRED.
    *" Data declarations...................................................
    Work variables                                                      *
      DATA:
        W_EBELN       TYPE EKKO-EBELN,     " Purchasing Document Number
        W_LIFNR       TYPE EKKO-LIFNR,     " Vendor's account number
        W_EKGRP       TYPE EKKO-EKGRP,     " Purchasing group
        W_VALUE       TYPE EKKO-EBELN,     " Reflected Value
        W_SPACE       VALUE ' ',           " Space
        W_FLAG        TYPE I,              " Flag Variable
        W_VARIANT     TYPE DISVARIANT,     " Variant
    *--- ALV Grid
        W_GRID        TYPE REF TO CL_GUI_ALV_GRID,
    *--- Event Handler
        W_EVENT_CLICK TYPE REF TO LCL_EVENT_HANDLER,
    *--- Field catalog table
        T_FIELDCAT    TYPE LVC_T_FCAT.
                          AT SELECTION-SCREEN EVENT                     *
    AT SELECTION-SCREEN ON S_EBELN.
    Subroutine to validate Purchase Document Number.
      PERFORM VALIDATE_PD_NUM.
    AT SELECTION-SCREEN ON S_LIFNR.
    Subroutine to validate Vendor Number.
      PERFORM VALIDATE_VEN_NUM.
    AT SELECTION-SCREEN ON S_EKGRP.
    Subroutine to validate Purchase Group.
      PERFORM VALIDATE_PUR_GRP.
                          START-OF-SELECTION EVENT                      *
    START-OF-SELECTION.
    Subroutine to select all Purchase orders.
      PERFORM SELECT_PO.
      CHECK W_FLAG EQ 0.
    Subroutine to select Object values.
        PERFORM SELECT_OBJ_ID.
      CHECK W_FLAG EQ 0.
    Subroutine to select Changed values.
        PERFORM SELECT_CHANGED_VALUE.
      CHECK W_FLAG EQ 0.
    Subroutine to Select Purchase Orders.
        PERFORM SELECT_PUR_DOC.
    Subroutine to select Vendor Details.
        PERFORM SELECT_VENDOR.
    Subroutine to select Text for the Changed values.
        PERFORM DESCRIPTION.
                          END-OF-SELECTION EVENT                        *
    END-OF-SELECTION.
      IF NOT T_EKKO IS INITIAL.
    Subroutine to populate the Output Table.
        PERFORM FILL_OUTTAB.
    Subroutine to build Field Catalog.
        PERFORM PREPARE_FIELD_CATALOG CHANGING T_FIELDCAT.
        CALL SCREEN 100.
      ENDIF.                               " IF NOT T_EKKO...
    CLASS LCL_EVENT_HANDLER DEFINITION
    Defining Class which handles events
    CLASS LCL_EVENT_HANDLER DEFINITION .
      PUBLIC SECTION .
        METHODS:
            HANDLE_HOTSPOT_CLICK
                 FOR EVENT HOTSPOT_CLICK OF CL_GUI_ALV_GRID
                           IMPORTING E_ROW_ID E_COLUMN_ID.
    ENDCLASS.                              " LCL_EVENT_HANDLER DEFINITION
    CLASS LCL_EVENT_HANDLER IMPLEMENTATION
    Implementing the Class which can handle events
    CLASS LCL_EVENT_HANDLER IMPLEMENTATION .
    *---Handle Double Click
      METHOD HANDLE_HOTSPOT_CLICK .
    Subroutine to get the HotSpot Cell information.
        PERFORM GET_CELL_INFO.
        SET PARAMETER ID 'BES' FIELD W_VALUE.
        CALL TRANSACTION 'ME23N'.
      ENDMETHOD.                           " HANDLE_HOTSPOT_CLICK
    ENDCLASS.                              " LCL_EVENT_HANDLER
    *&      Module  STATUS_0100  OUTPUT
          PBO Event
    MODULE STATUS_0100 OUTPUT.
      SET PF-STATUS 'OOPS'.
      SET TITLEBAR 'TIT'.
    Subroutine to fill the Variant Structure
      PERFORM FILL_VARIANT.
      IF W_GRID IS INITIAL.
        CREATE OBJECT W_GRID
          EXPORTING
       I_SHELLSTYLE      = 0
       I_LIFETIME        =
            I_PARENT       = CL_GUI_CONTAINER=>SCREEN0
       I_APPL_EVENTS     =
       I_PARENTDBG       =
       I_APPLOGPARENT    =
       I_GRAPHICSPARENT  =
       I_NAME            =
       I_FCAT_COMPLETE   = SPACE
          EXCEPTIONS
            ERROR_CNTL_CREATE = 1
            ERROR_CNTL_INIT   = 2
            ERROR_CNTL_LINK   = 3
            ERROR_DP_CREATE   = 4
            OTHERS            = 5.
        IF SY-SUBRC <> 0.
          MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
                     WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
        ENDIF.                             " IF SY-SUBRC <> 0
        CALL METHOD W_GRID->SET_TABLE_FOR_FIRST_DISPLAY
          EXPORTING
           I_BUFFER_ACTIVE               =
           I_BYPASSING_BUFFER            =
           I_CONSISTENCY_CHECK           =
           I_STRUCTURE_NAME              =
            IS_VARIANT                    = W_VARIANT
            I_SAVE                        = 'A'
           I_DEFAULT                     = 'X'
           IS_LAYOUT                     =
           IS_PRINT                      =
           IT_SPECIAL_GROUPS             =
           IT_TOOLBAR_EXCLUDING          =
           IT_HYPERLINK                  =
           IT_ALV_GRAPHICS               =
           IT_EXCEPT_QINFO               =
           IR_SALV_ADAPTER               =
          CHANGING
            IT_OUTTAB                     = T_OUTTAB
            IT_FIELDCATALOG               = T_FIELDCAT
           IT_SORT                       =
           IT_FILTER                     =
          EXCEPTIONS
            INVALID_PARAMETER_COMBINATION = 1
            PROGRAM_ERROR                 = 2
            TOO_MANY_LINES                = 3
            OTHERS                        = 4
        IF SY-SUBRC <> 0.
          MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
                     WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
        ENDIF.                             " IF SY-SUBRC <> 0.
      ENDIF.                               " IF W_GRID IS INITIAL
      CREATE OBJECT W_EVENT_CLICK.
      SET HANDLER W_EVENT_CLICK->HANDLE_HOTSPOT_CLICK FOR W_GRID.
    ENDMODULE.                             " STATUS_0100  OUTPUT
    *&      Module  USER_COMMAND_0100  INPUT
          PAI Event
    MODULE USER_COMMAND_0100 INPUT.
      CASE SY-UCOMM.
        WHEN 'BACK'.
          LEAVE TO SCREEN 0.
        WHEN 'EXIT'.
          LEAVE PROGRAM.
        WHEN 'CANCEL'.
          LEAVE TO SCREEN 0.
      ENDCASE.
    ENDMODULE.                             " USER_COMMAND_0100  INPUT
    *&      Form  PREPARE_FIELD_CATALOG
          Subroutine to build the Field catalog
          <--P_T_FIELDCAT  Field Catalog Table
    FORM PREPARE_FIELD_CATALOG  CHANGING PT_FIELDCAT TYPE LVC_T_FCAT .
      DATA LS_FCAT TYPE LVC_S_FCAT.
    Purchasing group...
      LS_FCAT-FIELDNAME = 'EKGRP'.
      LS_FCAT-REF_TABLE = 'EKKO'.
      LS_FCAT-INTTYPE   = 'C'.
      LS_FCAT-OUTPUTLEN = '10'.
      APPEND LS_FCAT TO PT_FIELDCAT.
      CLEAR LS_FCAT.
    Purchasing Document Number...
      LS_FCAT-FIELDNAME = 'EBELN'.
      LS_FCAT-REF_TABLE = 'EKKO' .
      LS_FCAT-EMPHASIZE = 'C411'.
      LS_FCAT-INTTYPE   = 'C'.
      LS_FCAT-OUTPUTLEN = '10'.
      LS_FCAT-HOTSPOT   = 'X'.
      APPEND LS_FCAT TO PT_FIELDCAT .
      CLEAR LS_FCAT .
    Name of Person who Created the Object...
      LS_FCAT-FIELDNAME = 'ERNAM'.
      LS_FCAT-REF_TABLE = 'EKKO'.
      LS_FCAT-OUTPUTLEN = '15' .
      APPEND LS_FCAT TO PT_FIELDCAT.
      CLEAR LS_FCAT.
    Purchasing Document Date...
      LS_FCAT-FIELDNAME = 'BEDAT'.
      LS_FCAT-REF_TABLE = 'EKKO'.
      LS_FCAT-INTTYPE   = 'C'.
      LS_FCAT-OUTPUTLEN = '10'.
      APPEND LS_FCAT TO PT_FIELDCAT.
      CLEAR LS_FCAT.
    Vendor's account number...
      LS_FCAT-FIELDNAME = 'LIFNR'.
      LS_FCAT-REF_TABLE = 'EKKO'.
      LS_FCAT-INTTYPE   = 'C'.
      LS_FCAT-OUTPUTLEN = '10'.
      APPEND LS_FCAT TO PT_FIELDCAT.
      CLEAR LS_FCAT.
    Account Number of Vendor or Creditor...
      LS_FCAT-FIELDNAME = 'NAME1'.
      LS_FCAT-REF_TABLE = 'LFA1'.
      LS_FCAT-INTTYPE   = 'C'.
      LS_FCAT-OUTPUTLEN = '10'.
      LS_FCAT-COLTEXT   = 'Vendor Name'(001).
      LS_FCAT-SELTEXT   = 'Vendor Name'(001).
      APPEND LS_FCAT TO PT_FIELDCAT.
      CLEAR LS_FCAT.
    Creation date of the change document...
      LS_FCAT-FIELDNAME = 'UDATE'.
      LS_FCAT-REF_TABLE = 'CDHDR'.
      LS_FCAT-INTTYPE   = 'C'.
      LS_FCAT-OUTPUTLEN = '10'.
      LS_FCAT-COLTEXT   = 'Change Date'(002).
      LS_FCAT-SELTEXT   = 'Change Date'(002).
      APPEND LS_FCAT TO PT_FIELDCAT.
      CLEAR LS_FCAT.
    User name of the person responsible in change document...
      LS_FCAT-FIELDNAME = 'USERNAME'.
      LS_FCAT-REF_TABLE = 'CDHDR'.
      LS_FCAT-INTTYPE   = 'C'.
      LS_FCAT-OUTPUTLEN = '10'.
      LS_FCAT-COLTEXT   = 'Modified by'(003).
      LS_FCAT-SELTEXT   = 'Modified by'(003).
      APPEND LS_FCAT TO PT_FIELDCAT.
      CLEAR LS_FCAT.
    Short Text Describing R/3 Repository Objects...
      LS_FCAT-FIELDNAME = 'DDTEXT'.
      LS_FCAT-REF_TABLE = 'DD04T'.
      LS_FCAT-INTTYPE   = 'C'.
      LS_FCAT-OUTPUTLEN = '15'.
      APPEND LS_FCAT TO PT_FIELDCAT.
      CLEAR LS_FCAT.
    Old contents of changed field...
      LS_FCAT-FIELDNAME = 'VALUE_OLD'.
      LS_FCAT-REF_TABLE = 'CDPOS'.
      LS_FCAT-INTTYPE   = 'C'.
      LS_FCAT-OUTPUTLEN = '12'.
      APPEND LS_FCAT TO PT_FIELDCAT.
      CLEAR LS_FCAT.
    New contents of changed field...
      LS_FCAT-FIELDNAME = 'VALUE_NEW'.
      LS_FCAT-REF_TABLE = 'CDPOS'.
      LS_FCAT-INTTYPE   = 'C'.
      LS_FCAT-OUTPUTLEN = '12'.
      APPEND LS_FCAT TO PT_FIELDCAT.
      CLEAR LS_FCAT.
    ENDFORM.                               " PREPARE_FIELD_CATALOG
    *& Form  SELECT_PO
    Subroutine to select all the Purchase Orders
    There are no interface parameters to be passed to this subroutine.
    FORM SELECT_PO .
       SELECT EBELN                        " Purchasing Document Number
              ERNAM                        " Name of Person who Created
                                           " the Object
              LIFNR                        " Vendor's account number
              EKGRP                        " Purchasing group
              BEDAT                        " Purchasing Document Date
         FROM EKKO
      PACKAGE SIZE 10000
    APPENDING TABLE T_EBELN
        WHERE EBELN IN S_EBELN
          AND BEDAT IN S_BEDAT.
       ENDSELECT.
    IF SY-SUBRC NE 0.
       W_FLAG = 1.
       MESSAGE S401(M8).
    ENDIF.                                " IF SY-SUBRC NE 0
    ENDFORM.                               " SELECT_PO
    *&  Form  SELECT_OBJ_ID
      Subroutine to select Object ID
      There are no interface parameters to be passed to this subroutine.
    FORM SELECT_OBJ_ID .
    IF NOT T_EBELN IS INITIAL.
        SELECT OBJECTCLAS                  " Object Class
               OBJECTID                    " Object value
               CHANGENR                    " Document change number
               USERNAME                    " User name
               UDATE                       " Creation date
          FROM CDHDR
          INTO TABLE T_CDHDR
       FOR ALL ENTRIES IN T_EBELN
         WHERE OBJECTID EQ T_EBELN-EBELN
           AND UDATE IN S_UDATE
           AND TCODE IN ('ME21N','ME22N','ME23N').
       ENDSELECT.
       IF SY-SUBRC NE 0.
         W_FLAG = 1.
         MESSAGE S833(M8) WITH 'Header Not Found'(031).
       ENDIF.                              " IF SY-SUBRC NE 0.
    ENDIF.                                " IF NOT T_EBELN IS INITIAL
    ENDFORM.                               " SELECT_OBJ_ID
    *&  Form  SELECT_CHANGED_VALUE
      Subroutine to select Changed Values
      There are no interface parameters to be passed to this subroutine.
    FORM SELECT_CHANGED_VALUE .
    IF NOT T_CDHDR IS INITIAL.
        SELECT OBJECTCLAS                  " Object class
               OBJECTID                    " Object value
               CHANGENR                    " Document change number
               TABNAME                     " Table Name
               FNAME                       " Field Name
               VALUE_NEW                   " New contents of changed field
               VALUE_OLD                   " Old contents of changed field
          FROM CDPOS
       PACKAGE SIZE 10000
    APPENDING TABLE T_CDPOS
       FOR ALL ENTRIES IN T_CDHDR
         WHERE OBJECTCLAS EQ T_CDHDR-OBJECTCLAS
           AND OBJECTID   EQ T_CDHDR-OBJECTID
           AND CHANGENR   EQ T_CDHDR-CHANGENR.
        ENDSELECT.
        IF SY-SUBRC NE 0.
          W_FLAG = 1.
          MESSAGE S833(M8) WITH 'Item Not Found'(032).
        ENDIF.                             " IF SY-SUBRC NE 0.
    ENDIF.                               " IF NOT T_CDHDR IS INITIAL
      T_CDPOS_TEMP[] = T_CDPOS[].
    ENDFORM.                               " SELECT_CHANGED_VALUE
    *&   Form  SELECT_PUR_DOC
       Subroutine to select Purchase Order Details
       There are no interface parameters to be passed to this subroutine.
    FORM SELECT_PUR_DOC .
    IF NOT T_CDPOS IS INITIAL.
        SORT T_EBELN BY EBELN.
        LOOP AT T_CDPOS INTO FS_CDPOS.
          READ TABLE T_EBELN INTO FS_EBELN WITH KEY EBELN =
                                          FS_CDPOS-OBJECTID BINARY SEARCH.
          IF SY-SUBRC NE 0.
            DELETE TABLE T_EBELN FROM FS_EBELN.
          ENDIF.                           " IF SY-SUBRC NE 0.
        ENDLOOP.                           " LOOP AT T_CDPOS...
        LOOP AT T_EBELN INTO FS_EBELN.
          MOVE FS_EBELN-EBELN TO FS_EKKO-EBELN.
          MOVE FS_EBELN-ERNAM TO FS_EKKO-ERNAM.
          MOVE FS_EBELN-LIFNR TO FS_EKKO-LIFNR.
          MOVE FS_EBELN-EKGRP TO FS_EKKO-EKGRP.
          MOVE FS_EBELN-BEDAT TO FS_EKKO-BEDAT.
          APPEND FS_EKKO TO T_EKKO.
        ENDLOOP.                           " LOOP AT T_EBELN...
        T_EKKO_TEMP[] = T_EKKO[].
    ENDIF.                               " IF NOT T_CDPOS IS INITIAL
    ENDFORM.                               " SELECT_PUR_DOC
    *&  Form  SELECT_VENDOR
      Subroutine to select Vendor details
      There are no interface parameters to be passed to this subroutine.
    FORM SELECT_VENDOR .
      IF NOT T_EKKO IS INITIAL.
        SORT T_EKKO_TEMP BY LIFNR.
        DELETE ADJACENT DUPLICATES FROM T_EKKO_TEMP COMPARING LIFNR.
        SELECT LIFNR                       " Account Number of Vendor or
                                           " Creditor
               NAME1                       " Name 1
          FROM LFA1
          INTO TABLE T_LFA1
       FOR ALL ENTRIES IN T_EKKO_TEMP
         WHERE LIFNR EQ T_EKKO_TEMP-LIFNR.
       IF SY-SUBRC NE 0.
         MESSAGE S002(M8) WITH 'Master Details'(033).
       ENDIF.                              " IF SY-SUBRC NE 0.
      ENDIF.                               " IF NOT T_EKKO IS INITIAL
    ENDFORM.                               " SELECT_VENDOR
    *&  Form  DESCRIPTION
      Subroutine to get the description
      There are no interface parameters to be passed to this subroutine.
    FORM DESCRIPTION .
    IF NOT T_CDPOS IS INITIAL.
        SORT T_CDPOS_TEMP BY TABNAME FNAME.
        DELETE ADJACENT DUPLICATES FROM T_CDPOS_TEMP COMPARING TABNAME FNAME
        SELECT TABNAME                     " Table Name
               FIELDNAME                   " Field Name
               ROLLNAME                    " Data element
          FROM DD03L
          INTO TABLE T_DATAELE
       FOR ALL ENTRIES IN T_CDPOS_TEMP
         WHERE TABNAME EQ T_CDPOS_TEMP-TABNAME
           AND FIELDNAME EQ T_CDPOS_TEMP-FNAME.
        IF NOT T_DATAELE IS INITIAL.
        T_DATAELE_TEMP[] = T_DATAELE[].
        SORT T_DATAELE_TEMP BY ROLLNAME.
        DELETE ADJACENT DUPLICATES FROM T_DATAELE_TEMP COMPARING ROLLNAME.
          SELECT ROLLNAME                  " Data element
                 DDTEXT                    " Short Text Describing R/3
                                           " Repository Objects
            FROM DD04T
            INTO TABLE T_TEXT
         FOR ALL ENTRIES IN T_DATAELE_TEMP
           WHERE ROLLNAME EQ T_DATAELE_TEMP-ROLLNAME
             AND DDLANGUAGE EQ SY-LANGU.
          IF SY-SUBRC NE 0.
            EXIT.
          ENDIF.                           " IF SY-SUBRC NE 0.
        ENDIF.                             " IF NOT T_DATAELE IS INITIAL.
    ENDIF.                               " IF NOT T_CDPOS IS INITIAL.
    ENDFORM.                               " DESCRIPTION
    *&  Form  FILL_OUTTAB
      Subroutine to populate the Outtab
      There are no interface parameters to be passed to this subroutine.
    FORM FILL_OUTTAB .
      SORT T_CDHDR   BY OBJECTCLAS OBJECTID CHANGENR.
      SORT T_EKKO    BY EBELN.
      SORT T_LFA1    BY LIFNR.
      SORT T_DATAELE BY TABNAME FIELDNAME.
      SORT T_TEXT    BY ROLLNAME.
      LOOP AT T_CDPOS INTO FS_CDPOS.
        READ TABLE T_CDHDR INTO FS_CDHDR WITH KEY
                                       OBJECTCLAS = FS_CDPOS-OBJECTCLAS
                                       OBJECTID = FS_CDPOS-OBJECTID
                                       CHANGENR = FS_CDPOS-CHANGENR
                                       BINARY SEARCH.
          IF SY-SUBRC EQ 0.
            MOVE FS_CDHDR-USERNAME TO FS_OUTTAB-USERNAME.
            MOVE FS_CDHDR-UDATE    TO FS_OUTTAB-UDATE.
            READ TABLE T_EKKO INTO FS_EKKO WITH KEY
                                           EBELN = FS_CDHDR-OBJECTID
                                           BINARY SEARCH.
              IF SY-SUBRC EQ 0.
                MOVE FS_EKKO-EBELN TO FS_OUTTAB-EBELN.
                MOVE FS_EKKO-ERNAM TO FS_OUTTAB-ERNAM.
                MOVE FS_EKKO-LIFNR TO FS_OUTTAB-LIFNR.
                MOVE FS_EKKO-EKGRP TO FS_OUTTAB-EKGRP.
                MOVE FS_EKKO-BEDAT TO FS_OUTTAB-BEDAT.
                READ TABLE T_LFA1 INTO FS_LFA1 WITH KEY
                                               LIFNR = FS_EKKO-LIFNR
                                               BINARY SEARCH.
                  IF SY-SUBRC EQ 0.
                    MOVE FS_LFA1-NAME1 TO FS_OUTTAB-NAME1.
                  ENDIF.                   " IF SY-SUBRC EQ 0.
              ENDIF.                       " IF SY-SUBRC EQ 0.
          ENDIF.                           " IF SY-SUBRC EQ 0.
        MOVE FS_CDPOS-VALUE_NEW TO FS_OUTTAB-VALUE_NEW.
        MOVE FS_CDPOS-VALUE_OLD TO FS_OUTTAB-VALUE_OLD.
        READ TABLE T_DATAELE INTO FS_DATAELE WITH KEY
                                             TABNAME = FS_CDPOS-TABNAME
                                             FIELDNAME = FS_CDPOS-FNAME
                                             BINARY SEARCH.
          IF SY-SUBRC EQ 0.
            READ TABLE T_TEXT INTO FS_TEXT WITH KEY
                                           ROLLNAME = FS_DATAELE-ROLLNAME
                                           BINARY SEARCH.
              IF SY-SUBRC EQ 0.
                MOVE FS_TEXT-DDTEXT TO FS_OUTTAB-DDTEXT.
              ENDIF.                       " IF SY-SUBRC EQ 0.
          ENDIF.                           " IF SY-SUBRC EQ 0.
        APPEND FS_OUTTAB TO T_OUTTAB.
        CLEAR FS_OUTTAB.
      ENDLOOP.
    ENDFORM.                               " FILL_OUTTAB
    *&   Form  GET_CELL_INFO
       Subroutine to get the Cell Information
    -->  W_VALUE   Holds the value of Hotspot clicked
    FORM GET_CELL_INFO .
      CALL METHOD W_GRID->GET_CURRENT_CELL
        IMPORTING
         E_ROW     =
          E_VALUE   = W_VALUE
         E_COL     =
         ES_ROW_ID =
         ES_COL_ID =
         ES_ROW_NO =
    ENDFORM.                               " GET_CELL_INFO
    *&   Form  VALIDATE_PD_NUM
       Subroutine to validate Purchase Document Number
       There are no interface parameters to be passed to this subroutine.
    FORM VALIDATE_PD_NUM .
      IF NOT S_EBELN[] IS INITIAL.
        SELECT EBELN                       " Purchase Document Number
          FROM EKKO
          INTO W_EBELN
         UP TO 1 ROWS
         WHERE EBELN IN S_EBELN.
        ENDSELECT.
        IF SY-SUBRC NE 0.
          CLEAR SSCRFIELDS-UCOMM.
          MESSAGE E717(M8).
        ENDIF.                             " IF SY-SUBRC NE 0
      ENDIF.                               " IF NOT S_EBELN[]...
    ENDFORM.                               " VALIDATE_PD_NUM
    *&   Form  VALIDATE_VEN_NUM
       Subroutine to validate Vendor Number
       There are no interface parameters to be passed to this subroutine.
    FORM VALIDATE_VEN_NUM .
      IF NOT S_LIFNR[] IS INITIAL.
        SELECT LIFNR                       " Vendor Number
          FROM LFA1
          INTO W_LIFNR
         UP TO 1 ROWS
         WHERE LIFNR IN S_LIFNR.
        ENDSELECT.
        IF SY-SUBRC NE 0.
          CLEAR SSCRFIELDS-UCOMM.
          MESSAGE E002(M8) WITH W_SPACE.
        ENDIF.                             " IF SY-SUBRC NE 0
      ENDIF.                               " IF NOT S_LIFNR[]...
    ENDFORM.                               " VALIDATE_VEN_NUM
    *&   Form  VALIDATE_PUR_GRP
       Subroutine to validate the Purchase Group
       There are no interface parameters to be passed to this subroutine.
    FORM VALIDATE_PUR_GRP .
      IF NOT S_EKGRP[] IS INITIAL.
        SELECT EKGRP                       " Purchase Group
          FROM T024
          INTO W_EKGRP
         UP TO 1 ROWS
         WHERE EKGRP IN S_EKGRP.
        ENDSELECT.
        IF SY-SUBRC NE 0.
          CLEAR SSCRFIELDS-UCOMM.
          MESSAGE E622(M8) WITH W_SPACE.
        ENDIF.                             " IF SY-SUBRC NE 0
      ENDIF.                               " IF NOT S_EKFRP[]...
    ENDFORM.                               " VALIDATE_PUR_GRP
    *& Form  FILL_VARIANT
    Subroutine to fill the Variant Structure
    There are no interface parameters to be passed to this subroutine
    FORM FILL_VARIANT .
    Filling the Variant structure
      W_VARIANT-REPORT = SY-REPID.
      W_VARIANT-USERNAME = SY-UNAME.
    ENDFORM.                               " FILL_VARIANT
    Check the above Program. You have related data from <b>CDPOS, CDHDR.</b>
    Regards,
    Pavan

  • How to populate sequence in a text item in a form

    I have a text item in a form.I want that the doc_id i.e the text item should be automatically populated with the help of sequence.I have created sequence named seq_doc_id.on which trigger i should write the code so that everytime the doc_id gets incremented by one. What should be the code.Can anyone gv me some hint.Do i have to use the loop for this?Please help

    Hi,
    I implemented a when-new-block-instance that does just that,
    however due to navigation problems the trigger fires when it should not
    the result is I got holes in the sequence.
    Is there a system variable status to check with an If test
    to make sure the sequence is called only at inserting time?

  • Multiple values from database on a single text item

    i am trying to do the following
    on a single text item in a form
    (under form property pallete->records->number of items displayed is 5) run a triger "when-new-block-instance" with the following pl/sql statement
    declare
    menu_item VARCHAR2(35);
    begin
    select label into menu_item
    from menu_options;
    end;
    however, once i run the form it gives me
    WHEN-NEW-BLOCK-INSTANCE trigger raised unhandeled exception ORA-01422
    however, if in the pl/sql statement contains only
    begin
    execute querry;
    end;
    then it works fine
    The problem i beleive is the fact that the first querry retreives multiple values or recordset instead of A record.
    How can i go arond this and allow the form to list all the values in this form. Eventually i will need to add conditional SQL statments and that is why just execute querry will not work.
    Also, is there a way to dynamically assign a number to "number of records shown" property?
    All help is very much appreciated!
    null

    Hi, Marko
    I teach Forms, and I usually find a bad idea to use SQL statements directly (in particular when you can "make" Forms to do what you want).
    Inside PL/SQL, a SELECT..INTO statement is supposed to select a single row, otherwise an error occurs.
    EXECUTE_QUERY works.
    If by "conditional SQL statements" you mean restricted (filtered) queries, you don't need to write SQL to do this.
    You can set the DEFAULT_WHERE block property to a different value before using EXECUTE_QUERY, like:
    SET_BLOCK_PROPERTY('your_block', DEFAULT_WHERE, 'where menu_id > 100');
    And the answer to your second question is no, you cannot dynamically change the number of records a block is displaying.
    You can limit the number of records your block queries from the database table using Maximum Records Fetched block property (available in Forms 6 and above, not sure about Forms 5). However, this will only work as expected if you set Query All Records to Yes.
    Hope this helps,
    Pedro

Maybe you are looking for

  • Problems in Instantiating the Model Node

    Hi All, I Have a problem with creating the instance of a Model Node  which needs an urgent solution, This is the Scenario: I Have created a WebDynpro Project using NetWeaver CE Environment and Java EE 5.0 where i am using an Adaptive WebService Model

  • Service Call EJB Error : "caf~runtime~ear doesnu2019t run"

    Hi, NW 7.0 The development structure We develop an Enterprise portal DC with a Service whose configuration starup=true. That service calls an EJB object which is in a custom Component Application Service project, when it initializes. Appearance When

  • BOM data analysis

    Hi all, I want to do a BOM data analysis. There is a two BOMs in R/3, One for engineering design, the other for production. I want to extract  the BOM data ( including BOM's item ) to BW and compare them. Can I extract the data by BW business content

  • Bluetooth is pairing but is not functioning

    I bought my Iphone4 exactly a year back. In the very begining, I paired it with the Bluetooth of my Toyota Mark-X car. It was working perfectly. Every time, I receive a call, automatically the audio shuts down and I am able to take a call and as soon

  • IOS 8.3 keyboard freezes - iPhone 6

    Has anyone else experienced the keyboard freezing after using an emoji on the new iOS 8.3? It freezes on the emoji keyboard, showing "emoji added", and I can't get back to the alpha/numeric keyboard to type text.  I touch the globe (and everything el