What is the use of initial value in a database table?

Hi can anyone help me in knowing what is the use of initial value which is present besides primary key while creating a table?

Initial Value:
Indicator that NOT NULL is forced for this field
Use
Select this flag if a field to be inserted in the database is to be filled with initial values. The initial value used depends on the data type of the field.
Please note that fields in the database for which the this flag is not set can also be filled with initial values.
When you create a table, all fields of the table can be defined as NOT NULL and filled with an initial value. The same applies when converting the table. Only when new fields are added or inserted, are these filled with initial values. An exception is key fields. These are always filled automatically with initial values.
Restrictions and notes:
The initial value cannot be set for fields of data types LCHR, LRAW, and RAW. If the field length is greater than 32, the initial flag cannot be set for fields of data type NUMC.
If a new field is inserted in the table and the initial flag is set, the complete table is scanned on activation and an UPDATE is made to the new field. This can be very time-consuming.
If the initial flag is set for an included structure, this means that the attributes from the structure are transferred. That is, exactly those fields which are marked as initial in the definition have this attribute in the table as well.
hope it helps,
Saipriya

Similar Messages

  • Use of initial values check box in tables

    Hi,
    what is of use of initial values check box(after the primary key check box)  in tables.
    Regards,
    Suresh

    The flag indicates whether field inserted in the database is to be filled with initial values. The initial value used depends on the data type of the field. I.e. type n(2) is '00'.
    When you create a table, all fields of the table can be defined as NOT NULL and filled with an initial value. The same applies when converting the table. Only when new fields are added or inserted, are these filled with initial values. An exception is key fields. These are always filled automatically with initial values.

  • What is the use of Position Column Name in USER_CONS_COLUMNS Table

    Please let me know the purpose of POSITION Column Name in USER_CONS_COLUMNS Table.
    Example :
    Created this below Table having two constraints 1.Primary Key 2.Check Constraint
    CREATE TABLE A(ID NUMBER PRIMARY KEY,NAME VARCHAR2(30),SAL NUMBER CHECK (SAL > 0))
    When i execute the below query
    SELECT POSITION,CONSTRAINT_NAME FROM USER_CONS_COLUMNS WHERE TABLE_NAME = 'A'
    it displays the data :
    POSITION CONSTRAINT_NAME
    1 SYS_C005488
    SYS_C005487
    Only for the first record it displays the POSITION but not for the second row.
    Kindly help me on this.

    SQL> CREATE TABLE A(
      2     ID1 NUMBER
      3   , ID2 NUMBER
      4   , NAME VARCHAR2(30)
      5   , SAL NUMBER CONSTRAINT A_SAL_POSITIVE CHECK (SAL > 0)
      6   , CONSTRAINT A_PRIMARY_KEY PRIMARY KEY (ID1, ID2)
      7  )
      8  /
    Table created.
    SQL> SELECT CONSTRAINT_NAME, POSITION, COLUMN_NAME
      2    FROM USER_CONS_COLUMNS
      3   WHERE TABLE_NAME = 'A'
      4   ORDER BY CONSTRAINT_NAME, POSITION
      5  /
    CONSTRAINT_NAME                  POSITION COLUMN_NAME
    A_PRIMARY_KEY                           1 ID1
    A_PRIMARY_KEY                           2 ID2
    A_SAL_POSITIVE                            SALA primary key constraint can have multiple columns - the position shows the order the columns are in the primary key definition (and thus also in the pk supporting index.)
    A check constraint does not have any such ordering of the columns involved, so therefore position is null.

  • How do I program the use of Z index on a database table

    Hello friends,
    I need an example of an ABAP  program where the use of a customer defined index (, i.e. Z**) on a DB table is forced.
    I do not want to use primary index. I've created an index and I want to use / force my own index in the program.
    Any ideas please?
    Thanks for your help.

    Hi,
    As per my knowledge Nothing to specify as secondary index in program.
    Regards
    Md.MaahboobKhan

  • What is the use of setting null values to Objects?

    What is the use of setting null values to Objects?
    regards,
    namanc

    It's more of a safety trap within java to handle the "programmers are still humans" exception.
    String myname;
    // print what???? Forgot to initialize the name!
    System.out.println(myname);Java will complain about myname not being initialized. It won't when you do this:
    String myname = null;
    // allright, your name is null
    System.out.println(myname);In the second case you are showing to java that you know what you are doing.

  • IN cluse: what is the maximum number of values that can use in "in" caluse?

    Hi All,
    Please see the following querry
    select * from <table> where <columnname> in (value1,value2,....);
    My question is what is the maximum number of values we can put inside the bracket in the querry?
    I mean what is the maximum number of values that can use in "in" caluse.
    Best Reagrds
    Marcelo

    http://download-west.oracle.com/docs/cd/B19306_01/server.102/b14200/expressions014.htm
    A comma-delimited list of expressions can contain no more than 1000 expressions. A comma-delimited list of sets of expressions can contain any number of sets, but each set can contain no more than 1000 expressions.
    The following are some valid expression lists in conditions:
    (10, 20, 40)
    ('SCOTT', 'BLAKE', 'TAYLOR')
    ( ('Guy', 'Himuro', 'GHIMURO'),('Karen', 'Colmenares', 'KCOLMENA') )

  • What is the use of inverted date format

    In table TCURR - Exchange rates, the field GDATU - Date As of Which the Exchange Rate Is Effective is stored as an inverted date. So 01/01/2008 is actually stored as 79919898.
    What is the use of inverted dates. Why does SAP use them. Why not just use normal date format? If I want the latest record from the table, instead of sorting by descending, I actually have to sort by ascending because the date is stored in inverted format.

    Hi,
    Inverted date is a old concept which helps in soring the dates sometimes. but now ASCENDING and DESCENDING sorting is more easy and quick. Check this application help. maybe useful for you
    1. CONVERT DATE f1 INTO INVERTED-DATE f2.
    2. CONVERT INVERTED-DATE f1 INTO DATE f2.
    Effect
    Calculates the nine's complement of the internal date format (YYYYMMDD - for more information about internal display, meaning and initial values of types, see TYPES) and places it in the field f2. For example, 19950511 becomes 80049488 and 80049488 becomes 19950511.
    In the inverse date format, the most recent date has the numerically smallest value. You can make use of this effect when sorting dates.
    Note
    The technique of manipulating the sort sequence of dates by inverting the internal date format is now rarely used. You can sort internal tables in order of ascending or descending date values much more efficiently using the ... ASCENDING or ... DESCENDING additions to the SORT statement.
    Example
    DATA DATE_INV LIKE SY-DATUM.
    CONVERT DATE SY-DATUM INTO INVERTED-DATE DATE_INV.
    Suppose, for example, SY-DATUM contains the date 11.05.1995 in its internal format 19950511. After execution of the CONVERT statement, DATE_INV would contain the internal format 80049488.
    //Kothand

  • What is the use P type variable in ABAP?

    ex:
    data <variable name > type p decimals 2.
    here what is the use of declaring it to p type.
    what is the difference between p type and float type.

    Hi,
    using packed variable we can decide the length of number and  number of decimals we want in o/p which is not possible with other types
    Packed numbers - type P
    Type P data allows digits after the decimal point. The number of decimal places is generic, and is determined in the program. The value range of type P data depends on its size and the number of digits after the decimal point. The valid size can be any value from 1 to 16 bytes. Two decimal digits are packed into one byte, while the last byte contains one digit and the sign. Up to 14 digits are allowed after the decimal point. The initial value is zero. When working with type P data, it is a good idea to set the program attribute Fixed point arithmetic.Otherwise, type P numbers are treated as integers.
    You can use type P data for such values as distances, weights, amounts of money, and so on.
    Floating point numbers - type F
    The value range of type F numbers is 1x10*-307 to 1x10*308 for positive and negative numbers, including 0 (zero). The accuracy range is approximately 15 decimals, depending on the floating point arithmetic of the hardware platform. Since type F data is internally converted to a binary system, rounding errors can occur. Although the ABAP processor tries to minimize these effects, you should not use type F data if high accuracy is required. Instead, use type P data.
    You use type F fields when you need to cope with very large value ranges and rounding errors are not critical.
    Using I and F fields for calculations is quicker than using P fields. Arithmetic operations using I and F fields are very similar to the actual machine code operations, while P fields require more support from the software. Nevertheless, you have to use type P data to meet accuracy or value range requirements.

  • What is the use of variant in the alv report

    hello all,
    what is the use of variant in the alv report

    Hi,
    For Variants
    follow the link:
    http://help.sap.com/search/highlightContent.jsp
    Variants allow you to save sets of input values for programs that you often start with the same selections. You can use them for any programs except subroutine pools (type S).
    Contents
    Variants: Overview
    Initial Screen
    Displaying a Variant Overview
    Creating and Maintaining Variants
    Creating Variants
    Attributes of Variants
    Changing Variants
    Deleting Variants
    Printing Variants
    Variable Values in Variants
    Creating Variables for Date Calculations
    User-specific Selection Variables
    Creating User-specific Variables
    Changing Values Interactively
    Changing Values from the Program
    Fixed Values from Table TVARV
    Creating Table Variables from TVARV
    Changing TVARV entries
    Running a Program with a Variant
    Variants: Overview
    Use
    Whenever you start a program in which selection screens are defined, the system displays a set of input fields for database-specific and program-specific selections. To select a certain set of data, you enter an appropriate range of values.
    For further information about selection screens, see Working with selection screens in the ABAP User's Guide.
    If you often run the same program with the same set of selections (for example, to create a monthly statistical report), you can save the values in a selection set called a variant.
    You can create any number of variants for any program in which selection screens are defined. Variants are assigned exclusively to the program for which they were created.
    You can also use variants to change the appearance of the selection screen by hiding selection criteria. This is particularly useful when you are working with large selection screens on which not all of the fields are relevant.
    Reports, module pools, and function groups may have several selection screens. It is therefore possible to create a variant for more than one selection screen.
    Variants are an interface between the user and the selection screen. They can be used both in dialog and in background mode, although their uses are slightly different.
    Variants in Dialog Mode
    In dialog mode, variants make things easier for the user, since they save him or her from continually having to enter identical values. They can also make the selection screen easier to read, because you can use them to hide input fields. Running an executable program with a variant containing an optimal set of values also reduces the capacity for user error. The optimized database selections speed up the runtime of the program.
    Variants in Background Mode
    Variants are the only method for passing values to a report program in a background job. Therefore, when you run a program in the background, you must use a variant (or SUBMIT... VIA JOB). To avoid you having to create a new variant each time you run the report, ABAP contains a mechanism allowing you to pass variable values to variants. See variable values in variants.
    To ensure that an executable program is always started using a variant, you can specify in the program attributes that the program may only be started in this way.
    Features
    Creation of variants
    Display, change, copy, print, and delete variants
    Use and definition of variables in variants
    Variable date calculation
    User-specific fixed values
    Fixed values in table TVARV
    You access the variant maintenance tool from the initial screen of the ABAP Editor. Enter the name of the program, select Variants in the Sub-objects group box, and then choose Display or Change.
    Functions
    The above screen allows you to:
    Create variants
    Display the variant directory
    Display and change values and attributes
    Copy, delete, and rename variants
    Before creating a new variant for a program, you should check whether you can use or adapt an existing variant instead.
    There are two ways to display variants:
    Position the cursor on the Variant field on the initial screen and press F4. The following dialog box lists all of the available variants:
    Choose Variants ® Directory on the initial screen:
    Creating Variants
    Prerequisites
    You must have defined one or more selection screens for the relevant program. The program may have any type except type S.
    Procedure
    On the initial screen of the ABAP Editor, enter the name of the program for which you want to create a variant, select Variants in the Sub-objects group box, and choose Change.
    On the variant maintenance initial screen, enter the name of the variant you want to create.
    Note the naming convention for variants (see below).
    Choose Create.
    If the program has more than one selection screen, a dialog box appears in which you can assign the variant to one or more screens. The dialog box does not appear if the program only has one selection screen. In this case, the selection screen of the program appears straight away.
    If there is more than one selection screen, select the screens for which you want to create the variant.
    Example:
    If you choose Variant for all selection screens, the variant also applies to any selection screens that you create after creating the variant.
    Otherwise, the variant only supplies values to the selection screens that you select in the list.
    Choose Continue.
    The (first) selection screen of the program appears.
    If your program has more than one selection screen, use the scroll buttons in the left-hand corner of the application toolbar to navigate between them. If you keep scrolling forwards, the Continue button appears on the last selection screen.
    Enter the required selections, including multiple and dynamic selections.
    Choose Continue.
    Result
    When you have finished, an overview screen appears (ABAP: Save Attributes of Variant), on which you can enter the attributes of your variant and save it.
    Note that when you create a new variant, you must enter both values and attributes.
    Names of variants: Names can consist of up to 14 alphanumeric characters. The "% " character is not allowed. If you want the variant to be transported automatically with its program, you must create a system variant. The name of a system variant starts "CUS&" for customers, and "SAP&" for SAP system variants. You can only use the "&" character within this prefix in the name of a system variant. It may not occur in any other context. System variants are administered by the Workbench Organizer. Although you can create and access variants from any client, they are always stored in client "000".
    Creating Variants
    Prerequisites
    You must have defined one or more selection screens for the relevant program. The program may have any type except type S.
    Procedure
    On the initial screen of the ABAP Editor, enter the name of the program for which you want to create a variant, select Variants in the Sub-objects group box, and choose Change.
    On the variant maintenance initial screen, enter the name of the variant you want to create.
    Note the naming convention for variants (see below).
    Choose Create.
    If the program has more than one selection screen, a dialog box appears in which you can assign the variant to one or more screens. The dialog box does not appear if the program only has one selection screen. In this case, the selection screen of the program appears straight away.
    If there is more than one selection screen, select the screens for which you want to create the variant.
    Example:
    If you choose Variant for all selection screens, the variant also applies to any selection screens that you create after creating the variant.
    Otherwise, the variant only supplies values to the selection screens that you select in the list.
    Choose Continue.
    The (first) selection screen of the program appears.
    If your program has more than one selection screen, use the scroll buttons in the left-hand corner of the application toolbar to navigate between them. If you keep scrolling forwards, the Continue button appears on the last selection screen.
    Enter the required selections, including multiple and dynamic selections.
    Choose Continue.
    Result
    When you have finished, an overview screen appears (ABAP: Save Attributes of Variant), on which you can enter the attributes of your variant and save it.
    Note that when you create a new variant, you must enter both values and attributes.
    Names of variants: Names can consist of up to 14 alphanumeric characters. The "% " character is not allowed. If you want the variant to be transported automatically with its program, you must create a system variant. The name of a system variant starts "CUS&" for customers, and "SAP&" for SAP system variants. You can only use the "&" character within this prefix in the name of a system variant. It may not occur in any other context. System variants are administered by the Workbench Organizer. Although you can create and access variants from any client, they are always stored in client "000".
    reward all help full answers

  • What is the use of usage in item category determination?

    Hi Gurus,
    What is the use of usage in item category determination? pls give examples.
    Thanks,
    Paul

    Hi John,
    Assign Item Categories
    In this menu option, you can specify which item categories the system proposes during document processing for each sales document type and item category group. At the same time, you can specify additional item categories with which the system default can be overwritten. There is a maximum of three possible alternative item categories.
    If, for example, you enter a material with the item category group NORM in a standard order, the SAP System determines the allowed item category via the assignment of item categories to sales document types and item category groups.
    The system default and the allowed alternatives are always determined from the sales document type and one or two further criteria. The system default depends on the following criteria:
    sales document type
    item category group
    item category of the higher-level item
    item category usage
    Note
    The SAP System automatically copies the item category determined for a sales document item to the delivery.
    Recommendation
    Depending on the initial situation you can start the assignment differently:
    When you define a new sales document type, you should specify the proposed and the allowed item categories for the materials that are represented by the item category group.
    When you define a new item category, you should specify for which sales document types an item category is proposed or which item category is possible for the materials represented by the item category group.
    When you define a new item category group, you are to enhance the assignment of item categories to sales document types by this new item category group.
    Actions
    To define item category determination, proceed, for example, as follows:
    1. Choose the sales document type to which you want to assign item categories.
    2. Then choose one of the item category groups.
    3. Specify all the allowed item categories for the combination of sales document type and item category group.
    If you are dealing with a non-material item, you must specify the corresponding item usage.
    If it is a subitem, specify the item category of the higher-level item.
    If it is an item category that is to be proposed in the sales document, you must indicate the combination of item category, item category group and sales document type as a default value.
    4. If necessary, specify between one and a maximum of three item categories, with which the system default can be manually overwritten during document processing.
    Thanks & Regards
    Sasikanth.Ch

  • What is the use of at new statement?

    What is the use of at new statement?

    Hi,
    AT - itab
    Syntax
    LOOP AT itab result ...
      [AT FIRST.
       ENDAT.]
        [AT NEW comp1.
         ENDAT.
           [AT NEW comp2.
           ENDAT.
           AT END OF comp2.
           ENDAT.]
         AT END OF comp1.
         ENDAT.]
      [AT LAST.
      ENDAT.]
    ENDLOOP.
    Extras:
    1. ...  FIRST
    2. ... |{END OF} compi
    3. ...  LAST
    Effect
    The statement block of a LOOP loop can contain control structures for control level processing. The respective control statement is AT. The statements AT and ENDAT define statement blocks that are executed at control breaks, that is, when the control structure is changed. The additions to the AT statements determine the control break at which their statement blocks are executed. Within these statement blocks, the statement SUM can be specified to add together the numeric components of a control level. For the output behavior result, the same applies as for LOOP AT.
    The prerequisite for control level processing is that the internal table is sorted in exactly the same sequence as the component of its line type - that is, first in accordance with the first component, then in accordance with the second component, and so on. The line structure and the corresponding sorting sequence gives a group structure of the content of the internal table, whose levels can be evaluated using AT statements. The AT- ENDAT control structures must be aligned one after the other, in accordance with the group structure.
    The statement blocks within the AT- ENDAT control structures are listed if an appropriate control break is made in the current table line. Statements in the LOOP- ENDLOOP control structure that are not executed within an AT- ENDAT control structure are executed in each pass of the loop.
    In order that control level processing is carried out properly, the following rules must be observed:
    After LOOP, a restricting condition cond can only be specified if this selects a consecutive line block of the internal table. Otherwise, the behavior of control level processing is undefined.
    The internal table cannot be modified within the LOOP loop.
    A work area wa specified in the LOOP statement after the addition INTO must be compatible with the line type of the table.
    The content of a work area wa specified after the addition INTO in the LOOP statement must not be modified.
    If the INTO addition is used in the LOOP statement to assign the content of the current line to a work area wa, its content is changed upon entry into the AT-ENDAT control structure as follows:
    The components of the current control key remain unchanged.
    All components with a character-type, flat data type to the right of the current control key are set to character "*" in every position.
    All the other components to the right of the current control key are set to their initial value.
    When the AT-ENDAT control structure is exited, the content of the current table line is assigned to the entire work area wa.
    Addition 1
    ... FIRST
    Effect
    The control level is defined by the first line of the internal table. The control break takes place when this line is read.
    Note
    In the group level AT FIRST, the current group key contains no components and all character-type components of the work area wa are filled with "*" and all remaining components are set to their initial value.
    Addition 2
    ... |{END OF} compi/>
    Effect
    : Control levels are defined by the beginning or end of a group of lines with the same content in the component compi (where i = 1, 2, and so on) and in the components to the left of compi. The control breaks take place when the content of the component compi or another component to the left of compi changes.
    The compi components can be specified as described in Specification of Components, with the limitation that access to object attributes is not possible here.
    Note
    If the INTO or ASSIGNING additions are used in the LOOP statement, a field symbol can be entered after AT |{END OF} outside classes, to which the corresponding component of the work area wa or the field symbol <fs> is assigned. This form of dynamic component specification is obsolete and has been replaced by specification in the format (name).
    Addition 3
    ... LAST
    Effect
    : The control level is defined by the last line of the internal table. The control break takes place when this line is read.
    Note
    In the group level AT LAST, the current group key contains no components and all character-type components of the work area wa are filled with "*" and all remaining components are set to their initial value.
    Regards,
    Prashant

  • What is the use of hot key...

    what is the use of hotkey in elementary search helps...how to use this in elementary search helps...can anybody send any navigations on these ..

    Creating Elementary Search Helps
    Procedure
    In the initial screen of the ABAP Dictionary, select object class Search help, enter the name of the search help and choose Create.
    A dialog box appears in which you must select the type of search help.
    Select Elementary search help and choose .
    The maintenance screen for elementary search helps appears.
    Enter an explanatory text in the field Short text.
    You can for example find the search help at a later time using this short text.
    In the Definition tab page enter the selection method of the search help.
    You can enter the name of a table or a view (database view, projection view or help view) here. If you enter a table that has a text table, the name of the text table is automatically entered in the corresponding field.
    Using the input help (F4 help), select fields of the selection method as parameter in the Search help parameter area. Select the fields that should be used in the dialog box for value selection or in the hit list.
    If the selection method is a table that has a text table, both the fields of the table and the fields of the text table are offered in the input help.
    The data element of the parameter is automatically copied from the selection method. The data element defines the output attributes and the F1 help of the parameter in the hit list and in the dialog box for value selection.
    You can assign the parameter another data element. To do so, select the Mod flag. The Data element field is now ready for input. Then select a data element with the input help (F4 help). Only data elements whose data type, length and number of decimal places is the same as those of the previous data element can be assigned.
    This removes the link between the data element of the search help parameter and the data element of the selection method field having the same name. If you cancel the Mod flag, the data element of the assigned table field is used again.
    Define the attributes of the search help parameters.
    Select the IMP flag if it is an import parameter. Select the EXP flag if it is an export parameter.
    You can define the dialog for the input help with the fields LPos, SPos and SDis. Enter the parameter position in the hit list in LPos. If you enter nothing or the value 0 here, the parameter is not displayed in the hit list.
    Enter the parameter position in the dialog box for value selection in SPos. If you enter nothing or the value 0 here, the parameter is not displayed in the dialog box for value selection.
    Set the SDis flag if the parameter should be a pure display field in the dialog box for value selection. The user is thus informed that the contents of the parameter restrict the value, but he cannot change this restriction. This makes sense for example when the parameter is an import parameter or if it has a default value.
    You can assign the parameter a default value in the Default value field.
    Select the dialog type of the search help.
    The dialog type defines how the hit list is displayed in the input help.
    Save your entries.
    A dialog box appears in which you have to assign the search help a development class.
    Choose .
    Do not forget to link the search help to a screen field. The search help attachment is not part of the search help definition; it is part of the object definition to which the search help is attached.
    Result
    The search help is activated. You can find information about the activation flow in the activation log, which you can display with Utilities ® Activation log. If errors occurred during activation, the activation log is automatically displayed.
    Other Options
    Assign a hot key: If the search help is to be accessed with a hot key, you must enter a one-place ID in the Hot key field. All the elementary search helps contained in a collective search help should have different short cuts.
    Assign a search help exit: In exceptions, you might have to change the standard flow defined by the search help with a search help exit. In this case enter the name of the search help exit in the corresponding field.
    Test the search help: You can test the flow of an input help defined by the elementary search help with . A dialog box appears in which you can simulate the behavior of the search help under different conditions. You can obtain information about the options provided in this window with .
    See also:
    Example for Search Helps
    Each customer of a carrier (see Flight Model) or of a travel agency has a customer number. You want to find a search option for this customer number.
    The user must be offered two different search paths.
    The user should be able to search for the customer number using the customer data, such as the name and address.
    The user should be able to search for the customer number using existing customer bookings.
    You can provide the required search option by creating a collective search help SCUSTOM. Two elementary search helps SCUSTOM_NAME (for searching with the customer data) and SCUSTOM_BOOK (for searching with the existing bookings) are created for the actual search paths. These elementary search helps are included in the collective search help.
    Elementary Search Help SCUSTOM_NAME
    This elementary search help should enable you to search for the customer number using the name and address (street, city, country). All this data is contained in table SCUSTOM. Table SCUSTOM must therefore be selected as the selection method of the elementary search help.
    You now have to decide which fields of the selection method are needed for the input help process. These are the fields that should appear either in the dialog box for restricting values or in the hit list.
    In the dialog box for restricting values, the user should be able to restrict values with the customer’s name and address, i.e. the fields for the street, city and country. These fields as well as the customer’s number (the information to be found must always be in the hit list) should appear in the hit list. The fields ID, NAME, STREET, CITY and COUNTRY of table SCUSTOM must be included in the search help as parameters.
    The parameter ID is declared to be an import parameter. A pattern entered in the corresponding field of a screen template can therefore be used directly for the value selection. Restrictions for the other parameters of the search help must be entered in the dialog box for value selection.
    All the parameters of the search help are declared to be export parameters. As a result, all the parameters of the hit list can be returned to the screen template if the corresponding fields are available there.
    Elementary Search Help SCUSTOM_BOOK
    This elementary search help should enable you to search for the customer number using existing customer bookings. The flight data for the booking (flight number, date of flight, city of departure, city of arrival) and the name of the customer should be used for the search here. This data is distributed on the tables SBOOK (bookings), SCUSTOM (name) and SPFLI (cities of departure and arrival). The following graphic shows the relationship between the relevant tables, that is the existing foreign key relationships.
    In this case a database view SCUS_BOOK must be created on these three tables (see Example for Views) as selection method. The tables in the view (join) are linked as defined by the existing foreign key relationships (see Foreign Key Relationship and Join Condition).
    In the dialog box for restricting values, the user should be able to restrict the search for booking data with the carrier ID, customer name, city of departure and city of arrival The flight date and of course the customer number should also be displayed in the hit list. Fields CARRID, FLDATE, CUSTOMID, NAME, CITYFROM and CITYTO of view SCUS_BOOK must be included in the elementary search help as parameters of the search help.
    The parameter CUSTOMID is declared to be an import parameter. All the parameters of the search help are export parameters.
    Collective Search Help SCUSTOM
    The two elementary search helps are now included in the collective search help. You must now allocate the parameters of the elementary search helps to the parameters of the collective search help.
    The parameter ID of the collective search help is marked as an import parameter. All the parameters are export parameters. The values can thus be copied from the hit list to the screen template.
    Attaching the Search Help
    In order to be able to use the search help SCUSTOM in screen templates, the attachment of the search help (see Attaching Search Helps with Screen Fields) must be defined.
    Attaching to the Check Table SCUSTOM
    The search help should be available for all the fields that are checked against table SCUSTOM. The search help therefore must be attached to table SCUSTOM. The search help parameters must therefore be assigned to the key fields of table SCUSTOM.
    The parameter ID of search help SCUSTOM is here assigned to the field ID of table SCUSTOM in this field assignment. No assignment is possible for all other parameters of the search help (NAME, CITY and COUNTRY) since table SCUSTOM does not contain this information as key fields.
    Attaching to a Field of Table SCUSTOM
    In order that the search help is available when the field SCUSTOM-ID is directly copied to the input template, you have to attach the search help to this field.
    With this type of attachment, all the parameters of the search help can be assigned to the corresponding fields of the table.
    Structure of an Elementary Search Help
    An elementary search help defines the standard flow of an input help. You can define the following components of this flow in the search help:
    where does the data displayed in the hit list come from (selection method)
    what information should be displayed in the dialog box for value selection and in the hit list (search help parameters)
    what field contents can be taken into account for hit list selections and which values in the hit list can be returned to the screen fields (search help parameters)
    what dialog steps should be executed in the input help (dialog behavior)
    Selection Method
    The possible input values displayed for a field in the hit list are determined at runtime by database selection.
    If all the data required in the hit list comes from one single table, you only have to select this table (or a projection view on this table) as selection method. If there is a text table for the table, its fields are also available in the input help. A table entry is linked with the corresponding text by the existing foreign key.
    If the data needed in the hit list comes from more than one table, you must link these tables with a view (database view or help view). This view must be defined as the selection method.
    If the underlying tables are client-specific, the client field must be contained in the view. Otherwise selection for the input help would be for all clients.
    Search Help Parameters
    A search help has an interface consisting of parameters. These parameters define the fields of the selection method that should be used in the input help.
    A parameter of the search help must correspond to each field in the dialog box for value selection and to each field of the hit list. The parameters are copied from the corresponding selection method, that is they always have the same name as the corresponding field of the selection method.
    If the search is restricted with a parameter of the search help, this is used in the data selection for formulating a WHERE condition for the field of the selection method with the same name. Vice versa, the parameters of the search help are assigned the contents of the fields of the selection method having the same name.
    The search help should not contain any parameters for the clients. In the input help, selection is automatically in the logon client of the user.
    A data element must be assigned to each search help parameter, that is a type is always defined for the search help parameters.
    A search help can contain further parameters that do not correspond to any field of the selection method. This is normally only necessary if the standard flow of the input help described by the search help still has to be modified by with a search help exit.
    Import and Export Parameters
    When an input help is called, the entries that the user already made in the input template are taken into consideration. For example, if a user calls the input help for the flight number and already specified the carrier, of course only the numbers of flights of this carrier should be offered.
    On the other hand, if the user selects one row of the hit list, more than one field of the input template might have to be filled with data from the selected row of the hit list. For example, if the flight number is obtained from the hit list, the city of departure and the destination should also be returned in the screen template.
    The interface of a search help defines the context data that can be used in the input help and the data that can be returned in the input template.
    A parameter of a search help can be classified as:
    Import parameters: Parameters with which context information from the processed input template (screen) may be copied to the help process.
    Export parameters: Parameters with which values from the hit list may be returned to the input template.
    A parameter can simultaneously be an input and an export parameter. A search help can also contain parameters that are neither import nor export parameters. Such parameters could be required for the internal input help process, for example.
    When you attach a search help, you must define where the import parameters of the search help get their values from and the fields in which the contents of the export parameters are returned. See also Value Transport for Input Helps.
    Description of the Online Behavior
    The online behavior defines the steps executed in the input help process and the structure of the hit list and dialog box for value selection.
    The dialog type defines whether or not the dialog box for value selection should be displayed. If you want to skip the dialog box for value selection, the hit list is displayed directly after calling the input help.
    When you define an elementary search help, you can define how the dialog box for value selection and the hit list should look. For example, you can define the position of a parameter in the dialog box for value selection here. The column position in which the values of a parameter are displayed in the hit list can also be defined here
    Please reward points..
    regards

  • What is the use of this form?

    Hi all,
    What is the use of this form in include RV61B901?
    How does this code send any information to the program calling it? Is Sy-subrc global so that main program will know the reuslts?
    Code:
    FORM KOBED_901.
      DATA : l_anzpk LIKE likp-anzpk.
      SELECT SINGLE anzpk FROM likp
                          INTO l_anzpk
                          WHERE vbeln = komkbv2-vbeln.
      IF l_anzpk NE 0.
        sy-subrc = 4.
        exit.
      ENDIF.
      sy-subrc = 0.
    ENDFORM.
    Thanks,
    Charles.

    Hello,
    This form sets the value of sy-subrc(which is global) based
    on the value of l_anzpk.
    Regards
    Greg Kern

  • What is the use of additon in up to 1 rows in SELECT statement

    Hi All,
             What is the use of up to 1 rows in select statement.
    for example
    SELECT kostl
          FROM pa0001
          INTO y_lv_kostl UP TO 1 ROWS
          WHERE pernr EQ pernr
          AND endda GE sy-datum.
        ENDSELECT.
    I'm unable to get in wat situations we hav to add up to 1 rows
    please help me out...
    Thanks,
    santosh.

    Hi,
    Use "select up to 1 rows" only if you are sure that all the records returned will have the same value for the field(s) you are interested in. If not, you will be reading only the first record which matches the criteria, but may be the second or the third record has the value you are looking for.
    The System test result showed that the variant Single * takes less time than Up to 1 rows as there is an additional level for COUNT STOP KEY for SELECT ENDSELECT UP TO 1 ROWS.
    The 'SELECT .... UP TO 1 ROWS' statement is subtly different. The database selects all of the relevant records that are defined by the WHERE clause, applies any aggregate, ordering or grouping functions to them and then returns the first record of the result set.
    Regards,
    Bhaskar

  • What is the use of Alternative Calculation Type =2 and 4

    Dear Friends
    In pricing procedure in gross value, Net value for Item and Net value has Alternative calucation type is 2.
    What is the use of it?
    Without using it these value line are also fetching net value then what is the work of it. Please give me detail information with its effects in pricing condition tab page in sales document.
    Thanking You
    Arun

    Arun biswal,
    Correct Biswal. We have at varoius stages within Pricing procedure the "net value" which is calculated. Not only the alternative calculation type "2" is used if you notice carefully they are stored as subtotals at various levels.
    For Ex Gross Value  --> Subtotal =1 --> Calc type = 2
    similarly for Net value for Item --> Subtotal =2 --> Calc type = 2
    Net value 2 --> Subtotal =3 --> Calc type = 2
    See, these are used to calculate the net value at various levels in pricing. The calculation Type has got a set of routines that will facilitate us in pricing. SAP has provided certain clauclated formulas or routines to facilitate us during calculation within pricing . Here the "2" is used for calculation without tax and store it as subtotal and display it or use it for further calculations.
    We can use this "netvalue" amount for further calculations. It is used for clarity purpose when you issue a statement to customer. (like Confirmation order) at various levels like discount amt involved, Freight involved, Rebate amount invloved.....
    Even without this Calc type or using sub total u can proceed....
    Finally we have  TOTAL  --> Subtotal =A --> Calc type = 4
    In the above line we have Calc type as 4, which means when you use TAX this calc type is used .
    Routines are used to facilitate your process....
    Regards
    Sathya

Maybe you are looking for