Editable ALV & Foreign Key Check

I am working on an Editable ALV. Here if I try to enter some value into a field which doesnt exist in the corresponding Check table of the field, ALV throws me an error. This scenario is working fine.
But in some scenarios I populate the ALV table from a Z table (Z table has the same strucutre as the ALV table) and then show this to the user as an editable ALV but in this scenarios if some erroneous values exist in my Z table for a particular fieId I am not getting the Foreign Key check I mentioned earlier.  Here I was hoping to get error message after SET_TABLE_FOR_FIRST_DISPLAY !
I am using CL_GUI_ALV_GRID, has anyone found a workaround for this
Antony

Hi Antony,
you can INHERIT a class from CL_GUI_ALV_GRID and then redefine SET_TABLE_FOR_FIRST_DISPLAY adding the raising EVENT data_changed for all cells.
Regards,
Clemens

Similar Messages

  • Problem with Foreign Key check in an editable ALV

    Hi,
    I've implemented an editable ALV.
    The underlying context node is referenced to a structure and within the structure the foreign keys are defined.
    In my example, I have two editable columns with different foreign key checks.
    My problem is, the foreign key check works only for one column.
    So if I enter in both columns incorret values, only a message for the first column is thrown,
    but not for the second column!
    Only if I enter two errors in one(!) column (in two rows), than I get two error messages.
    Examples:
    does not work:
    COL1 | COL2
    err1  | err2   -> only one error message is displayed (for err1)
    It works in this case:
    COL1 | COL2
    err1  |  ok
    err2  |  ok
    => two messages for err1 and err2
    and in this case
    COL1 | COL2
    err1  |  ok
    ok     |  err2
    => two messages for err1 and err2
    I've found nothing in OSS. My system is a 7.00 with SP18, so OSS 1153492 is already implemented.
    Do I somenthing wrong or is this an error in SAP?
    Thanks,
    Andreas

    Hi Lekha,
    thank you very much for your support!
    I try to give you an example.
    In general, you need an editable ALV with at least two columns.
    The node for the ALV table in the component controller has to be assigned to a dictionary structure!
    That is very important, otherwise the foreign key check will not work!
    And the two fields in this dictionary structure have to be assigned to a "check table".
    Prerequisition: NW70 SP16 or higher! See oss note 1153492.
    Maybe an easy way to reproduce it is using the WD component WDT_FLIGHTLIST_EDIT.
    So copy this component to a Z-component.
    Than create a dictionary structure for the node "NODE_FLIGHTTAB" with the same 10 fields as the node attributes.
    In your new dictionary structure, assign to the fields CARRID and CONNID the check tables SCARR and SPFLI. (see table SFLIGHT).
    Than make both columens (CARRID and CONNID) editable.
    This has to be done in the "RESULTVIEW" in the method "INIT".
    You can user the following code:
      lr_column = lr_column_settings->get_column( 'CARRID' ).
      create object lr_input_field
        exporting
          value_fieldname = 'CARRID'.
      lr_column->set_cell_editor( lr_input_field ). 
      lr_column = lr_column_settings->get_column( 'CONNID' ).
      create object lr_input_field
        exporting
          value_fieldname = 'CONNID'.
      lr_column->set_cell_editor( lr_input_field ).
    Copy this code below this code:
      lr_column_settings ?= l_value.
      lr_column = lr_column_settings->get_column( 'PRICE' ).
      create object lr_input_field
        exporting
          value_fieldname = 'PRICE'.
      lr_column->set_cell_editor( lr_input_field ).
    Than just activate all,  create a Web Dynpro Application and your are ready to test it.
    To test it, do the following:
    Append/Insert an empty row.
    Enter a CARRID and CONNID that does not exist and press ENTER.
    My result: only one error message is displayed for the wrong CARRID, but no error message for CONNID!
    Insert a new row.
    Enter in the first row, column CARRID an invalid value and in the second(!) row in column CONNNID.
    Than you get two(!) error messages. That's the behavior I expect.
    So thank you very much in advance for your help!
    Regards,
    Andreas

  • Use of foreign key check in ABAP reports

    Hi,
    I'm trying to understand if it's possible to use a foreign key integrity check in an ABAP reports. I have understood that this kind of check is deactivated for performance reasons, is it right?
    In this case I'd like to know if it is possible to activate the foreign key check "on demand", or just for a particular table.
    As an example, I'd like to use the foreign key defined on attribute AKONT of table KNB1, that points on the related attribute of table SKB1.
    Thanks,
    Gabriele

    Welcome on SCN!
    I'm trying to understand if it's possible to use a foreign key integrity check in an ABAP reports. I have understood that this kind of check is deactivated for performance reasons, is it right?
    Most likely yes. Integrity is turned OFF for Open SQL statements but is turned ON for screen fields.
    If you just create screen parameter like
    parameters pa_akont type knb1-akont.
    ...then input help for that field will be automatically provided. This means that you will not be able to pick or enter value different that this allowed from SKB1 table (foreign key relationship will be checked).
    You can explicitly assign different input help or search help for certain screen field independently of type it is refering i.e by means of fm F4IF_FIELD_VALUE_REQUEST .
    This however still relates only to screen fields, not fields used directly in ABAP statement.
    Regards
    Marcin

  • Foreign Key check in ALV Grid

    Hi all.
    I'm trying to have data automatically validated using Foreign Keys in an (editable) ALV Grid.  I managed to get the proper values in a dropdown on F4, but i want the manual entries validated without coding every field individually.
    The field in question is LFA1-REGIO.  This field has a Foreign Key in T005S.  I'm using F.M. DDIF_TABL_GET to populate my Field Catalog.  This gives me all Foreign Key fields for my fields.
    If the user enters 'ZZ' as a Region(LFA1-REGIO), the auto-validation of CL_GUI_ALV_GRID does not recognize that this value is invalid.
    I've debugged the class methods that handle the validation, but it seems the problem is in the way i'm setting up my Foreign Key info.
    Could someone tell me how to set this up properly?  i also have access to the dependant field LAND1, and would like to integrate it in the Validation, but this is a second priority.  Thanks in advance.

    Hi Jester,
      In your ALV Grid Field Catalog (LVC_S_LAYO), for REGIO check whether field <b>checktable</b> has value T005S and <b>ref_field</b> has REGIO and <b>ref_table</b> has LFA1.
      If the above entries are fine and still the validation does not occur then try changing the ref_table to T005S and see..
      Hope this helps..
    Sri

  • Foreign key dependency checking

    Dear all:
    I have a question about foreign key checking.
    Let's say I have two Z table, one is master table and one is transaction table.
    The master table contains a primary key named CustNo.
    The transaction table have two primary keys named CustNo and OrderNo.
    The CustNo has foreign key (mandt + CustNo) point to master table, with setting
    "Key fields/candidates  1:N"
    I expected that, delete record in master table should check if there is any dependency in the transaction table,
    but I am wrong.  I am able to delete anything in master table even there are records in transaction table using the same CustNo.
    My question is, how can I make the dependency check?
    Thanks in advance.
    Edited by: Hung Kai, Michael Cheng on Nov 3, 2008 5:29 AM

    Hello,
        For this u need to change the cardinality.
    Below are the list of cardinalities and their functionality.Chack it and use the proper one.
    The left side (n) of the cardinality is defined as follows:
    n=1: There is exactly one record assigned to the check table for each record of the foreign key table.
    n=C: The foreign key table may contain records which do not correspond to any record of the check table because the foreign key field is empty. This can occur for example if the field of the foreign key table is optional, in which case it does not have to be filled.
    The right side (m) of the cardinality is defined as follows:
    m=1: There is exactly one dependent record for each record of the check table.
    m=C: There is at most one dependent record for each record of the check table.
    m=N: There is at least one dependent record for each record of the check table.
    m=CN: There may be any number of dependent records for each record of the check table.
    Shafi

  • Maintenance View for custom table with foreign key relationship

    Hi Folks,
         I have created a custom table with foreign key relationship with other check tables. I want to create a maintenance view / tablemaintenance generator. What all things I need to take care for the foreign keys related fields while creating the maintenance view / tablemaintenance generator.
    Regards,
      santosh

    Hi,
    You do not have to do anything explicitely for the foreign key relationships in the table maintainance generator.
    Create the table maintainance generator via SE11 and it will take care of all teh foreign key checks by itself.
    Regards,
    Ankur Parab

  • EMIGALL : problem of foreign key

    Hi everybody
    I m working on a EMIGALL migration and i met one problem with foreign key…
    My field VKONT is defined (in specific table ZR006SAT) like a foreign key with check table FKKVK (Contract Account Header). It means that an entry can be inserted in ZR006SAT , only if VKONT value exists in FKKVK table.
    But, during the migration of my migration object ZR006SAT (same name as the table), I have no error when I put any value for my VKONT field in the input file. EMIGALL does not control the foreign key constraint and I don’t understand why (???).
    However,
    1.     when i try to insert manually (by SE11) an entry in ZR006SAT, SAP forces me to input correct value (existing in FKKVK table) for VKONT field.
    2.     for standards migration objects, there is no problem… foreign key check is working well
    3 days I ve been on this problem.
    Please help me

    Hai
    You can find detailed documentation of EMIGALL in SAP itself. Use Transaction EQ81 to display it. It provides all the concepts and procedures to work with EMIGALL. I will also prepare a document and send it to u later. Meanwhile just for ur info here are some points about EMIGALL :
    1. It Migrates data Business Object wise
    2. It uses Direct Input Technique
    3. It has more than 100 objects of IS-U
    and the steps for implementation goes like this:
    1)You have to create a user specially for migration which will have all the authorizations related to migration workbench, BASIS and IS-U
    2)You have to create your own company in EMIGALL. There is a default company called SAP.
    3)Company SAP contains all the Business Objects
    4)You have to figure out what business objects u need and then u have to copy those business objects to ur company from Standard Company SAP
    5)Each objects contains more than one structure and each structure can contain more than one fields. The relation goes like this
    Object ---> Structure ---> Field
    6)You have to define field rules for each required field of the object. You have to mark "Not required" for fields u don't need
    7)After field rules for a given object is set u have to generate load report i.e. actual Direct Input Program which will migrate data. This program is generated on basis of field rules set by u.
    8)After the load report is generated u have to prepare an input file (import File) for migration. The import file should be according to structure provided by SAP and must be in binary format. SAP Provides the structure of file according to your configurations. You have to write ur own Data conversion program(in any language) for this task.
    9)You take import file as input and migrate the data using generated load program
    10)Finally u can check the Migration Statistics and Error Log
    Regards
    Sreeni

  • Error when adding Foreign Key

    Hi,
    Problem:
    When trying to add a Foreign Key via Edit Table | Foreign Key tab an error is thrown
    Error:
    "ORA-00942: table or view does not exit", Vendor code 942
    SQL Developer Generated DDL:
    ALTER TABLE "CNArticlesCODES"
    DROP CONSTRAINT "CNArticlesCODES_FK1"
    ALTER TABLE "CNArticlesCODES"
    ADD CONSTRAINT "CNArticlesCODES_FK1" FOREIGN KEY
    "ID"
    ) REFERENCES CNArticlesDATA
    "ID"
    ) ENABLE
    My work around:
    table name next to REFERENCES command in double quotes
    ALTER TABLE "CNArticlesCODES"
    ADD CONSTRAINT "CNArticlesCODES_FK1" FOREIGN KEY
    "UID"
    ) REFERENCES "CNArticlesCODES"
    "UID"
    ) ENABLE
    SQL Developer 1.0.0.15.57 on Windows XP SP2
    Oracle Database 10g Enterprise Edition Release 10.2.0.10 (Eval Lic) on Windows 2003 Web Edition 32 bit
    The 2 tables in this example where generated by MS DTS tool while importing data. This issue is not present when performing the above action on 2 tables generated using SQL Developer.
    I'm no database expert and new to Oracle (R&D stage of SQL Server to Oracle migration). So can some body tell me/point me at docs that explains what's going on here with the table names.
    Thanks

    Hopefully someone from oracle will see this and log it as a bug. If that doesn't happen and you have a support license, you can open up a ticket with them directly.
    As an aside.. if you are daring enough, the template for that is stored in one of the jars in an xml file. You can always edit it and add the quotes. Or..and you don't want to hear this.. you may want to rename everything to uppercase. It would hurt now, but could end up saving you time down the road. (adding quotes to every query is a pain)
    Eric

  • Disabling Foreign keys before Insert

    DB version:10gR2
    Is it a standard practice to disable Foreign keys when you have Huge INSERTs . Is there performance enhancement by deferring the Foreign key Check during Huge INSERTs?
    Our client want to disable the FKs before a huge INSERT. They say they can manually rectify all issues related to Foreign key violation resulting from Disabling the FK.
    What do you guys reckon?

    It should hapen an enhancement performance by deferring the Foreign key Check during Huge INSERTs.
    The same thing with triggers.
    If you are sure that data that you want to insert is not inconsistent with the data on the DB, or that you manually rectify inconsistencies after the insert, then there is no problem by disabling Foreign key constraints/triggers.
    Also there are gains of performance if you drop of the indices (if there's any) and recreate after the Huge INSERT.
    Regards.

  • Enter Key Event in Editable ALV Grid

    Hi all,
    I am trying to create and editable ALV grid using the REUSE ALV FM.
    On the grid after changing a value, if I press enter key the pai is not triggered. I have tried the various example programs (BCALV*) but could not find anything relevant.
    Basically I need similar functionality to normal module pool programming as in validations on screen done when enter key is pressed after screen entry.
    Is it possible to capture the Enter keypress on the ALV grid?

    Hello Preet
    I can only tell you how I would solve this using the ALV grid control (CL_GUI_ALV_GRID) because I have abandoned using ALV function modules.
    The problem with running through PAI is whether the focus (i.e. the cursor) is still on the control or already on the (surrounding) main program. If the control has the focus, you do not run through PAI.
    I would add a "Refresh" button to the toolbar of the ALV list. Normally, this button is already there or you only have to make it visible.
    When the user pushes this button you catch the corresponding user-command and call the CHECK_DATA_CHANGED method to see if values have been changed on the editable grid. If so, the previous method will fire event DATA_CHANGED.
    Now, in the event handler method (e.g. HANDLE_DATA_CHANGED) you receive as input a data change object (CL_ALV_CHANGED_DATA_PROTOCOL). This object contains all changed values. These values you will need to make your checks.
    I assume that the logic will be similar using ALV function modules.
    Regards
       Uwe

  • Check unchanged data in an editable alv grid

    Hi,
    I have a problem with my editable ALV. As long as I'm changing my data the event DATA_CHANGED is raised and my fields are checked correctly. But what about unchanged data like appended rows. In that case no changes have been made and the event is not triggered.
    Even if i raise the event by using the method:      
    CALL METHOD gr_grid1->check_changed_data
        IMPORTING
          e_valid   = lv_valid
        CHANGING
          c_refresh = lv_refresh.
    there are no changed data so that my checks:
    FORM data_changed USING  lr_data_changed TYPE REF TO
                                             cl_alv_changed_data_protocol.
      DATA: ls_mod_cells TYPE lvc_s_modi.
      DATA: ls_cells TYPE lvc_s_modi,
            lv_value TYPE lvc_value ,
            lv_matnr TYPE matnr,
            lv_maktx TYPE maktx,
            lv_error TYPE c.
      CLEAR lv_error.
      LOOP AT lr_data_changed->mt_good_cells INTO ls_mod_cells.
        CASE ls_mod_cells-fieldname.
          WHEN 'MATNR'.
            CALL METHOD lr_data_changed->get_cell_value
              EXPORTING
                i_row_id    = ls_mod_cells-row_id
                i_fieldname = 'MATNR'
              IMPORTING
                e_value     = lv_value.
    * CHECK MARA SEGMENT
            SELECT SINGLE mara~matnr
                          makt~maktx INTO (lv_matnr,
                                           lv_maktx)
                                      FROM mara AS mara
                                INNER JOIN makt AS makt
                                        ON mara~matnr = makt~matnr
                                WHERE mara~matnr = lv_value AND
                                      makt~spras = sy-langu.
            IF NOT sy-subrc IS INITIAL.
              CALL METHOD lr_data_changed->add_protocol_entry
                EXPORTING
                  i_msgid     = 'M3'
                  i_msgno     = '305'
                  i_msgty     = 'E'
                  i_msgv1     = lv_value
                  i_fieldname = ls_mod_cells-fieldname
                  i_row_id    = ls_mod_cells-row_id.
              lv_error = 'X'.
            ELSE.
              CALL METHOD lr_data_changed->modify_cell
                EXPORTING
                  i_row_id    = ls_mod_cells-row_id
                  i_fieldname = 'MAKTX'
                  i_value     = lv_maktx.
            ENDIF.
          WHEN OTHERS.
        ENDCASE.
      ENDLOOP.
    ENDFORM.
       are not working.
    Thank you for your help
    Gregor
    Edited by: Gregor Sure on Oct 13, 2009 1:58 PM

    Try to capture the event DATA_CHANGED_FINISHED. You can use the method REGISTER_EDIT_EVENT of the class CL_GUI_ALV_GRID to register the edit events.
    Regards,
    Naimesh Patel

  • Interactive alv report......with one table having more than 2 foreign key

    *& Report  ZRAHUL_ALV_SFLIGHT2
    REPORT  zrahul_alv_sflight2 NO STANDARD PAGE HEADING.
    TYPE-POOLS slis.
    DATA: fcat TYPE slis_fieldcat_alv,
          it_fcat TYPE slis_t_fieldcat_alv,
          fcat1 TYPE slis_fieldcat_alv,
          it_fcat1 TYPE slis_t_fieldcat_alv,
          fcat2 TYPE slis_fieldcat_alv,
          it_fcat2 TYPE slis_t_fieldcat_alv,
          lout TYPE slis_layout_alv,
          head TYPE slis_listheader,
          it_head TYPE slis_t_listheader.
    TABLES: SFLIGHT, SCURX, SAPLANE.
    DATA: BEGIN OF it_sflight OCCURS 0,
            carrid TYPE sflight-carrid,      "PK
            connid TYPE sflight-connid,
            fldate TYPE sflight-fldate,
            currency TYPE sflight-currency,        "FK 1
            planetype TYPE sflight-planetype,      "FK 2
          END OF it_sflight.
    DATA: BEGIN OF it_scurx OCCURS 0,
            currkey TYPE scurx-currkey,        "PK 1
            currdec TYPE scurx-currdec,
          END OF it_scurx.
    DATA: BEGIN OF it_saplane OCCURS 0,
            planetype TYPE saplane-planetype,      "PK 2
            seatsmax TYPE saplane-seatsmax,
            tankcap TYPE saplane-tankcap,
            weight TYPE saplane-weight,
          END OF it_saplane.
    SELECTION-SCREEN: BEGIN OF BLOCK blk WITH FRAME TITLE t.
    SELECT-OPTIONS: id FOR it_sflight-carrid,
                    id2 FOR it_sflight-connid.
    SELECTION-SCREEN END OF BLOCK blk.
    INITIALIZATION.
      t = 'enter required criterias'.
      lout-zebra = 'X'.
    START-OF-SELECTION.
      SELECT * FROM sflight INTO CORRESPONDING FIELDS OF TABLE it_sflight
                WHERE carrid IN id AND connid IN id2.
    END-OF-SELECTION.
    ****FCAT F0R IT_SFLIGHT
      fcat-col_pos = 1.
      fcat-tabname = 'IT_SFLIGHT'.
      fcat-fieldname = 'CARRID'.
      fcat-outputlen = 10.
      fcat-seltext_m = 'PLANE ID'.
      APPEND fcat TO it_fcat.
      CLEAR fcat.
      fcat-col_pos = 2.
      fcat-tabname = 'IT_SFLIGHT'.
      fcat-fieldname = 'CONNID'.
      fcat-outputlen = 10.
      fcat-seltext_m = 'CONN ID'.
      APPEND fcat TO it_fcat.
      CLEAR fcat.
      fcat-col_pos = 3.
      fcat-tabname = 'IT_SFLIGHT'.
      fcat-fieldname = 'FLDATE'.
      fcat-outputlen = 10.
      fcat-seltext_m = 'FLDATE'.
      APPEND fcat TO it_fcat.
      CLEAR fcat.
      fcat-col_pos = 4.
      fcat-tabname = 'IT_SFLIGHT'.
      fcat-fieldname = 'CURRENCY'.
      fcat-outputlen = 10.
      fcat-seltext_m = 'CURRENCY'.
      APPEND fcat TO it_fcat.
      CLEAR fcat.
      fcat-col_pos = 5.
      fcat-tabname = 'IT_SFLIGHT'.
      fcat-fieldname = ';PLANETYPE'.
      fcat-outputlen = 10.
      fcat-seltext_m = 'PLANETYPE'.
      APPEND fcat TO it_fcat.
      CLEAR fcat.
    *****GRID DISPLAY
      CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
       EXPORTING
        I_INTERFACE_CHECK                 = ' '
        I_BYPASSING_BUFFER                = ' '
        I_BUFFER_ACTIVE                   = ' '
        i_callback_program                = 'ZRAHUL_ALV_SFLIGHT2'
        I_CALLBACK_PF_STATUS_SET          = ' '
         i_callback_user_command           = 'CLICK'
         i_callback_top_of_page            = 'HEADER'
        I_CALLBACK_HTML_TOP_OF_PAGE       = ' '
        I_CALLBACK_HTML_END_OF_LIST       = ' '
        I_STRUCTURE_NAME                  =
        I_BACKGROUND_ID                   = ' '
         i_grid_title                      = 'GRID 1'
        I_GRID_SETTINGS                   =
         is_layout                         = lout
         it_fieldcat                       = it_fcat
        IT_EXCLUDING                      =
        IT_SPECIAL_GROUPS                 =
        IT_SORT                           =
        IT_FILTER                         =
        IS_SEL_HIDE                       =
        I_DEFAULT                         = 'X'
        I_SAVE                            = ' '
        IS_VARIANT                        =
        IT_EVENTS                         =
        IT_EVENT_EXIT                     =
        IS_PRINT                          =
        IS_REPREP_ID                      =
        I_SCREEN_START_COLUMN             = 0
        I_SCREEN_START_LINE               = 0
        I_SCREEN_END_COLUMN               = 0
        I_SCREEN_END_LINE                 = 0
        I_HTML_HEIGHT_TOP                 = 0
        I_HTML_HEIGHT_END                 = 0
        IT_ALV_GRAPHICS                   =
        IT_HYPERLINK                      =
        IT_ADD_FIELDCAT                   =
        IT_EXCEPT_QINFO                   =
        IR_SALV_FULLSCREEN_ADAPTER        =
      IMPORTING
        E_EXIT_CAUSED_BY_CALLER           =
        ES_EXIT_CAUSED_BY_USER            =
        TABLES
          t_outtab                          = it_sflight
      EXCEPTIONS
        PROGRAM_ERROR                     = 1
        OTHERS                            = 2
      IF sy-subrc <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
            WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
      ENDIF.
    *&      Form  header
          text
    FORM header.
      CLEAR it_head.
      head-typ = 'H'.
      head-info = 'KINGFISHER'.
      APPEND head TO it_head.
      head-typ = 'S'.
      head-key = 'KEY'.
      head-info = 'AIRLINES'.
      APPEND head TO it_head.
      CALL FUNCTION 'REUSE_ALV_COMMENTARY_WRITE'
        EXPORTING
          it_list_commentary       = it_head
         i_logo                   = 'KING_LOGO'
      I_END_OF_LIST_GRID       =
      I_ALV_FORM               =
    ENDFORM.                    "header
    *&      Form  CLICK
          text
         -->OK         text
         -->SEL        text
    FORM click USING ok TYPE sy-ucomm
                     sel TYPE slis_selfield.
      CLEAR it_fcat.
      CASE ok.
        WHEN '&IC1'.
    ********SAPLANE RELATION
          READ TABLE it_sflight INDEX sel-tabindex.
          SELECT * FROM saplane INTO CORRESPONDING FIELDS OF TABLE it_saplane WHERE planetype = it_sflight-planetype.
          fcat-col_pos = 1.
          fcat-tabname = 'IT_SAPLANE'.
          fcat-fieldname = 'PLANETYPE'.
          fcat-outputlen = 10.
          fcat-seltext_m = 'TYPE OF PLANE'.
          APPEND fcat TO it_FCAT.
          CLEAR fcat.
          fcat-col_pos = 2.
          fcat-tabname = 'IT_SAPLANE'.
          fcat-fieldname = 'SEATSMAX'.
          fcat-outputlen = 10.
          fcat-seltext_m = 'MAX SEATS'.
          APPEND fcat TO it_FCAT.
          CLEAR fcat.
          fcat-col_pos = 3.
          fcat-tabname = 'IT_SAPLANE'.
          fcat-fieldname = 'TANKCAP'.
          fcat-outputlen = 10.
          fcat-seltext_m = 'FUEL TANK CAPACITY'.
          APPEND fcat TO it_FCAT.
          CLEAR fcat.
          fcat-col_pos = 4.
          fcat-tabname = 'IT_SAPLANE'.
          fcat-fieldname = 'WEIGHT'.
          fcat-outputlen = 10.
          fcat-seltext_m = 'WEIGHT F PLANE'.
          APPEND fcat TO it_FCAT.
          CLEAR fcat.
          CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
           EXPORTING
      I_INTERFACE_CHECK                 = ' '
      I_BYPASSING_BUFFER                = ' '
      I_BUFFER_ACTIVE                   = ' '
             i_callback_program                = 'ZRAHUL_ALV_SFLIGHT2'
      I_CALLBACK_PF_STATUS_SET          = ' '
      I_CALLBACK_USER_COMMAND           = ' '
             i_callback_top_of_page            = 'HEADER'
      I_CALLBACK_HTML_TOP_OF_PAGE       = ' '
      I_CALLBACK_HTML_END_OF_LIST       = ' '
      I_STRUCTURE_NAME                  =
      I_BACKGROUND_ID                   = ' '
             i_grid_title                      = 'GRID 2'
      I_GRID_SETTINGS                   =
             is_layout                         = LOUT
             it_fieldcat                       = IT_FCAT
      IT_EXCLUDING                      =
      IT_SPECIAL_GROUPS                 =
      IT_SORT                           =
      IT_FILTER                         =
      IS_SEL_HIDE                       =
      I_DEFAULT                         = 'X'
      I_SAVE                            = ' '
      IS_VARIANT                        =
      IT_EVENTS                         =
      IT_EVENT_EXIT                     =
      IS_PRINT                          =
      IS_REPREP_ID                      =
      I_SCREEN_START_COLUMN             = 0
      I_SCREEN_START_LINE               = 0
      I_SCREEN_END_COLUMN               = 0
      I_SCREEN_END_LINE                 = 0
      I_HTML_HEIGHT_TOP                 = 0
      I_HTML_HEIGHT_END                 = 0
      IT_ALV_GRAPHICS                   =
      IT_HYPERLINK                      =
      IT_ADD_FIELDCAT                   =
      IT_EXCEPT_QINFO                   =
      IR_SALV_FULLSCREEN_ADAPTER        =
    IMPORTING
      E_EXIT_CAUSED_BY_CALLER           =
      ES_EXIT_CAUSED_BY_USER            =
            tables
              t_outtab                          = IT_SAPLANE
    EXCEPTIONS
      PROGRAM_ERROR                     = 1
      OTHERS                            = 2
          IF sy-subrc <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
            WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
          ENDIF.
    *******SCURX RELATION
                    CLEAR: IT_FCAT2,IT_FCAT.
                    READ TABLE IT_SFLIGHT INDEX SEL-TABINDEX.
                      SELECT * FROM SCURX INTO CORRESPONDING FIELDS OF TABLE IT_SCURX WHERE CURRKEY = IT_SFLIGHT-CURRENCY.
                      FCAT2-COL_POS = 1.
                      FCAT2-TABNAME = 'IT_SCURX'.
                      FCAT2-FIELDNAME = 'CURRKEY'.
                      FCAT2-OUTPUTLEN = 15.
                      FCAT2-SELTEXT_M = 'CURRENCY'.
                      APPEND FCAT2 TO IT_FCAT2.
                      CLEAR FCAT2.
                      FCAT2-COL_POS = 2.
                      FCAT2-TABNAME = 'IT_SCURX'.
                      FCAT2-FIELDNAME = 'CURRDEC'.
                      FCAT2-OUTPUTLEN = 15.
                      FCAT2-SELTEXT_M = 'CURRENCY DEC'.
                      APPEND FCAT2 TO IT_FCAT2.
                      CLEAR FCAT2.
                      CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
                       EXPORTING
                        I_INTERFACE_CHECK                 = ' '
                        I_BYPASSING_BUFFER                = ' '
                        I_BUFFER_ACTIVE                   = ' '
                         I_CALLBACK_PROGRAM                = 'ZRAHUL_ALV_SFLIGHT2'
                        I_CALLBACK_PF_STATUS_SET          = ' '
                        I_CALLBACK_USER_COMMAND           = ' '
                         I_CALLBACK_TOP_OF_PAGE            = 'HEADER'
                        I_CALLBACK_HTML_TOP_OF_PAGE       = ' '
                        I_CALLBACK_HTML_END_OF_LIST       = ' '
                        I_STRUCTURE_NAME                  =
                        I_BACKGROUND_ID                   = ' '
                         I_GRID_TITLE                      = 'GRID 3'
                        I_GRID_SETTINGS                   =
                         IS_LAYOUT                         = LOUT
                         IT_FIELDCAT                       = IT_FCAT2
                        IT_EXCLUDING                      =
                        IT_SPECIAL_GROUPS                 =
                        IT_SORT                           =
                        IT_FILTER                         =
                        IS_SEL_HIDE                       =
                        I_DEFAULT                         = 'X'
                        I_SAVE                            = ' '
                        IS_VARIANT                        =
                        IT_EVENTS                         =
                        IT_EVENT_EXIT                     =
                        IS_PRINT                          =
                        IS_REPREP_ID                      =
                        I_SCREEN_START_COLUMN             = 0
                        I_SCREEN_START_LINE               = 0
                        I_SCREEN_END_COLUMN               = 0
                        I_SCREEN_END_LINE                 = 0
                        I_HTML_HEIGHT_TOP                 = 0
                        I_HTML_HEIGHT_END                 = 0
                        IT_ALV_GRAPHICS                   =
                        IT_HYPERLINK                      =
                        IT_ADD_FIELDCAT                   =
                        IT_EXCEPT_QINFO                   =
                        IR_SALV_FULLSCREEN_ADAPTER        =
                      IMPORTING
                        E_EXIT_CAUSED_BY_CALLER           =
                        ES_EXIT_CAUSED_BY_USER            =
                        TABLES
                          t_outtab                          = IT_SCURX
                      EXCEPTIONS
                        PROGRAM_ERROR                     = 1
                        OTHERS                            = 2
                      IF sy-subrc <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
            WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
                      ENDIF.
      ENDCASE.
    ENDFORM.                    "click
    this program runs fine when one navigation is used......but when both the foreign keys come in picture then its shows sequencialy...cant we jump directly to the third one which i require....
    plz guide me.thank u.

    in short i want help on table having multiple foreign keys....and how to navigate in this when working on ALV reports.....
    its easy when using interactive reports by using sy-cucol and sy-curow.....
    reply asap.
    thank u in advance.

  • Web dynpro abap - Editable alv - check row

    Hi, I'm working with an editable ALV table and I'd like to check wether the row the user has just entered is valid.
    IF the entered row is not valid, then it should disappear from the table.
    ATM i'm trying something out in WDDOMODIFYVIEW,

    Hi,
    Yes you have to do coding in WDDOMODIFYVIEW only.

  • Check constraint/foreign key combination

    I would like to add a constraint (check, FK, or otherwise) that forces a value to be either -1 OR be in a foreign table.  The statement below is invalid because you can't use subqueries, but I think it's clear what I'm trying to do.  Can anyone
    suggest a different approach?
    Thanks!
    ALTER TABLE cfg.ClientFieldThreshold ADD CONSTRAINT CK_cfg_ClientFieldThreshold_DBListID
    CHECK (DBListID = -1 OR DBListID IN (SELECT ID FROM dbo.vwClientDatabases)
    /* the subquery here isn't allowed */

    3 ways to do this. 
    1) use NULL instead of -1 as the value that does not have to be in the foreign table.  Then you just need a normal foreign key (because a foreign key column that contains NULL is not checked against the foreign table.  Sample code to do this
    Create Table FooParent(ParentID int primary key);
    Create Table FooChild(ChildId int primary key, ParentID int Null, Constraint FooChildFK Foreign Key(ParentID) References FooParent);
    go
    -- Can add row with NULL
    Insert FooChild(ChildId, ParentID) Values (1, Null);
    go
    -- But cannot add row with any other value that is not in FooParent
    Insert FooChild(ChildId, ParentID) Values (2, 25);
    go
    -- Check result
    Select * From FooChild;
    go
    Drop Table FooChild;
    go
    Drop Table FooParent;
    2) Add a dummy row to the parent table with a primary key of -1.  Then, of course, all you need is a foreign key constraint.
    3) Add a persisted computed column that is NULL whenever your column that you want to enforce the constraint against is equal to -1, otherwise just the value in that column.  Then create a foreign key on the computed column.  Sample code
    Create Table FooParent(ParentID int primary key);
    Create Table FooChild(ChildId int primary key, ParentID int Not Null, AlteredParentID As NULLIF(ParentID, -1) Persisted, Constraint FooChildFK Foreign Key(AlteredParentID) References FooParent);
    go
    -- Can add row with -1
    Insert FooChild(ChildId, ParentID) Values (1, -1);
    go
    -- But cannot add row with any other value that is not in FooParent
    Insert FooChild(ChildId, ParentID) Values (2, 25);
    go
    -- Check result
    Select * From FooChild;
    go
    Drop Table FooChild;
    go
    Drop Table FooParent;
    Tom

  • Quality Check view foreign key

    Headstart Ruleframe Designer6i
    Running utility quality check view definition
    Report states that complete property for _CG foreign key must be set to "NO" to keep from being generated in DB. However if foreign key is used in formmodule error CDG-3436 is raised : " Invalid Linkage ". I'm I correct in assuming that Complete property has to be set to "YES" and Validation property to "CLIENT" to avoid the errors?

    You are correct. I will log this as a bug in the quality check report.
    Thanks,
    Lauri

Maybe you are looking for

  • Problem deploying the sample application

    anyone had success deploying the Identity Server 5.1 sample applications? I was trying to deploy and run the Authentication sample by going through the directions given in the readme file. I deployed it using amadmin utility and after that i dont kno

  • Zen Vision: M problem with Album Cov

    I've read a lot of intructions on these boards about dragging the album cover into the generic icon (after I select "View" and "Albums" in the Media Explorer. Thing is, when I try to drag a picture nothing happens. Next thing I try is to manually cop

  • Mail server timed out

    I can receive mail, but cannot send mail.  I use imap with gmail.  I get an error that says something like   CONNECTION TO SERVER "SMTP.GMAIL.COM" ON PORT 25 TIMED OUT.  Can anyone offer some help on this one.  Thanks.

  • Trouble connecting to MySQL

    I am new to this software and am trying to connect to a MySQL database on my webhost. I download the MySQL connector and created the server type. I go to add datasource and test the connection and am getting connection refused:connect. My connection

  • Field selection for plant parameters

    In plant parameters - in external procurement tab-i want to change field selection for Account assignment for non valuated materials field to optional,.Presently it is required field can sombeody tell me path