Select-options with where condition

Hello ABAPers,
I want to create a select-options like s_operid for vbpa-kunnr but with a condition specified is VBPA-KUNNR where VBPA-PARVW = 'WE'.
Thanks in advance. Pls reply asap. Points will definitely be rewarded.
Ritu

hi,
use this
PARAMETERS : TAB_ID TYPE ZALOAD_PROD_COMB-TAB_ID OBLIGATORY.
AT SELECTION-SCREEN ON VALUE-REQUEST FOR TAB_ID.
DATA : BEGIN OF INT_TAB_ID OCCURS 0,
            TAB_ID TYPE ZALOAD_PROD_COMB-TAB_ID,
         END OF INT_TAB_ID.
  DATA : LOC_MAX TYPE ZALOAD_PROD_COMB-TAB_ID.
  CLEAR INT_TAB_ID.
  REFRESH INT_TAB_ID.
  SELECT MAX( TAB_ID) INTO (LOC_MAX) FROM ZALOAD_PROD_COMB.
  COUNT = LOC_MAX + 1.
  DO 10 TIMES.
    MOVE COUNT TO INT_TAB_ID-TAB_ID.
    APPEND INT_TAB_ID.
    COUNT = COUNT + 1.
  ENDDO.
  CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'
    EXPORTING
     RETFIELD            = 'TAB_ID'                        u201C Internal table field name
     DYNPPROG         = 'PROG_NAME                  u201C Program name
     DYNPNR              = SY-DYNNR
     DYNPROFIELD   =  'TAB_ID'                        u201C Field where u need F4 help
     VALUE_ORG       = 'S'
   WINDOW_TITLE  = u2018Any descriptionu2019
    TABLES
      VALUE_TAB      = INT_TAB_ID.                   u201C Internal table name
Mark the post answered once ur problem is solved ....

Similar Messages

  • SELECT-OPTIONS in WHERE condition

    Hi All,
    SELECT-OPTIONS : S_TCODE FOR TSTCT-TCODE.
    START-OF-SELECTION.
      SELECT * FROM TSTCT INTO TABLE IT_TSTCT
               WHERE TCODE = S_TCODE.
    The same code results in SYNTAX ERROR in 4.7c.
    In ECC 6.0, no such error resulted, but SUBRC is 4.
    Why is it like this in ECC 6.0?
    Regards,
    R.Nagarajan.

    hi,
    You are right in ECC 6 this will not give any error as long as you are referencing to the work area of the Select-option, but will start giving error as soon as you refer to the table using the [] command beside the select-option the it will give you a syntax error in ECC 6.0 also.
    The reason might be the unicode enabling started in ECC 6.0
    Hope That Helps
    Anirban M.

  • Checking against Select-Options with "CP" using "IF value IN select_option"

    Dear experts,
    first of all: I'm sorry, if this question already should have been asked and answered!
    I tried quite a lot of search terms but didn't find anything helpful.
    We are using a statement like "IF value IN select_option" to perform comparisons after the Select-Options have been used in a SELECT statement. This logical expression fails (compared to the results of the DB-SELECT) whenever a select-option line contains the option CP (Contains Pattern). To be more specific: The case sensitivity of the LOW value doesn't seem to play a role any more. A variable with the value 'ABCD' would be positively checked against a select-option with OPTION 'CP' and LOW 'abc*', whereas this value wouldn't have been selected if the select-option had been used in a DB-SELECT.
    Does anybody know a workaround?
    Thanks in advance
    Andreas

    Dear Keshav,
    it's an own field in an own table, defined as CHAR of length 140 (lowercase allowed), reflecting to a line of remittance info of an account statement. A regular Select-Option for this field is provided in a report which works perfectly fine regarding the case sensitivity. For reasons I don't want to point out in detail we need to check a value in this field against the select-option without selecting it from the db again.
    Let's assume that a field remittance_info contains the value 'ABCD'.
    A line of the select-option table looks like this:
    select_option_table-SIGN = 'I'
    select_option_table-OPTION = 'CP'
    select_option_table-LOW = 'abc*'.
    Then an ABAP statement such as
    IF remittance_info IN select_option_table.
    * would be true !!!
    ENDIF.
    but wouldn't deliver a result in a SELECT such as
    SELECT * FROM my_table INTO TABLE my_internal_table WHERE remittance_info IN select_option_table.
    because of the differences in lower/upper case.
    regards
    Andreas

  • How to write select options with extension in module pool program

    hi,
    M having  the following fields through screen painter.
    1. sales offfice
    2.sales district
    3.customer no
    for those three fields no extension is not provided and no search help is there.
    i want write  seletion options to get extension in that module pool
    screen.
    plese send coding for me , please let me know how to get that
    select options with the above all three fields.
    Thanks & Regards
    Raji

    Check it
    In top include
    DATA: number(4) TYPE n VALUE '9005',
    PROCESS BEFORE OUTPUT.
      MODULE status_9001.
      CALL SUBSCREEN AREA1 INCLUDING SY-REPID number.
    PROCESS AFTER INPUT.
      MODULE user_command_9001.
      CALL SUBSCREEN AREA1.
    *&      Module  status_9001  OUTPUT
          text
    MODULE status_9001 OUTPUT.
      SELECTION-SCREEN BEGIN OF SCREEN 9005 AS SUBSCREEN.
      PARAMETER pa_bukrs TYPE t001-bukrs.
      select-options matnr for wa_matnr.
      SELECTION-SCREEN END OF SCREEN 9005.
    ENDMODULE.                 " status_9001  OUTPUT

  • Query variable : selection option with no interval

    Hello,
    Is it possible to define a query variable as selection option, with no interval (like in abap).
    I am in 3.X version.
    Many Thanks in advance,
    Manuel

    Hi Manuel,
    This should be possible through multiple single value variables, but to ensure that the user has not in input the same charateristic value for exclusion and selection you may choose to write customer exit at the background.
    I think interval and select option would allow 'To values'.
    So I was wrong in what I said before. SORRY
    However multiple single value would not allow exclusion, I think.
    Your scenario would only be possible by excluding multiple single values in variable type select option and process the variable using customer exit, to trmove all to Values.
    But you are right, you cannot have your scenrio handled , I think.
    ( ie multiple exclusion in from values with no To Values )
    One more way is restrict your characteristic by two input ready variables, one select option for exclusion and have a customer exit to delte all inclusion that were input accidently and one multiple value ready for input variable.
    But, all in all, there would be no straight drive through this I think.
    Hope it helps,
    Regards,
    Sunmit.

  • Export/Import with where condition

    DearAll,
    I am facing a problem in the delete of a huge table that take 3 hours
    DELETE FROM HST HST
    WHERE JV_TYPE <> 999
    and ( HST.VALUE_DATE <= TO_DATE ('31/12/2010','DD/MM/YYYY')
    AND HST.TRANS_DATE <= TO_DATE ('31/12/2010','DD/MM/YYYY'))
    what i am trying to do is to export the HST table and import it into another table
    but what i need to do is to have a dump with where condition including only the needed records in the table not deleted in the DML above as well as the indexes, triggers.
    Thanks

    If I try the following:
    CONN / AS SYSDBA
    CREATE OR REPLACE DIRECTORY dpump_dir1 AS '/folder/';
    GRANT READ, WRITE ON DIRECTORY dpump_dir1 TO bokprod;
    expdp bokprod/bokprod@uat TABLES=HST PARFILE=hst_query.par
    In the parfile:
    QUERY=hst:"WHERE JV_TYPE <>999 and ( HST.VALUE_DATE > TO_DATE ('31/12/2010','DD/MM/YYYY') AND HST.TRANS_DATE > TO_DATE ('31/12/2010','DD/MM/YYYY'))"
    DUMPFILE=exp.dmp
    DIRECTORY=dpump_dir1
    LOGFILE=exp.log
    impdp bokprod/bokprod@uat DIRECTORY=dpump_dir1 DUMPFILE=exp.dmp
    TABLES=bokprod.hst REMAP_TABLE=bokprod.hst:hst_imported
    My question is:
    1- the parameter file, if i put it in the dpump_dir1 directory, is it read by the expdp command?
    2- the hst_imported table created by the remap_table command , is it created with the indexes and triggers already existant on hst table?
    Appreciate yoyr help Dears

  • Creating a Select-option with no-intervals and a parameter on a single line

    Hi
    I have a unusual reqirment of creating a select-option with no intervals obligatory and a parameter on a single line. Is this possible? Can any one please provide me a solution for this. I reffered to the SAP help and what i found out is a single line can contain only parameters.

    Hi,
    humm,
    I guess it's not possible on one line.
    SORRY I've tried and it works!
    Try this :
    SELECTION-SCREEN BEGIN OF BLOCK main WITH FRAME
                     TITLE text-s01 NO INTERVALS.
    SELECTION-SCREEN begin of line.
    PARAMETERS : p_gjahr LIKE bkpf-gjahr OBLIGATORY MEMORY ID gjr.
    SELECT-OPTIONS : s_blart FOR bkpf-blart MODIF ID knt .
    SELECTION-SCREEN end of line.
    SELECTION-SCREEN END OF BLOCK main.
    Regards,
    erwan

  • Issue in select query with where clause

    Hi guys,
    I'm facing an issue while using select query with the where clause. When I'm selecting all the data from the table it returns the correct result. But when I'm using the where clause to get the specific rows from the table it returns no rows. But the data I'm trying to fetch using the where condition exists in the table.
    Here is my query which causing the issue,
    select * from mytable where myfield = 'myvalue'
    But if I use the following query it returns the result correctly.
    select * from mytable
    Also the myfield value 'myvalue' exists in the table.
    I have tried by running this query in both SQL Developer and SQL Plus. I have tried this query in mssql as well. It works perfectly and returns correct result sets for both the queries I have mentioned above. I'm unable to predict the issue as I'm new to ORACLE. Please help.
    Thanks,
    Ram.

    Hi Ram,
    I experienced an issue similar to this with a varchar2 field. Some of our records had a hidden newline character at the end of them, which was making queries like the one below fail:
    select * from employees
    where email = '[email protected]'The best way I found to detect this was to use
    select 'XX'||email||'XX' from employeesTo make sure that there were no newlines. But that is just a guess. If you could provide some example table data and the outputs of your selects, it would be helpful.
    Jeff

  • Select Option with masked entry in GRR3 report

    Hi,
    I am trying to find out if it is possible in standard to call a grr3 report like s_alr_87013611 (cost center report) and be able to enter the cost element like 4* to get all values for cost elements starting with 4.
    When trying this I get an error message and the only select option that appears is "=".
    In a KE80 report like S_ALR_87013326 on profit centers I can select the account and here it works fine with 4*.
    What is responsible for this and where can I do the settings? Any help is greatly appreciated.
    Thomas

    Follow-up:
    I noted in another post, that you can set the default value in the entity object, and this can carry through to the List-based object and retain that as the "selected" option.
    How do you set the selected option programmatically/via properties or tag attributes, without doing something like this:
    <select name="Cardtype1">
    <c:forEach var="listEntry" items="${bindings.Cardtype1.displayData}">
    <c:choose>
    <c:when test="${listEntry.prompt=='VISA'}">
    <option value="<c:out value='${listEntry.index}'/>" selected="true">
    </c:when>
    <c:otherwise>
    <option value="<c:out value='${listEntry.index}'/>" >
    </c:otherwise>
    </c:choose>
    <c:out value="${listEntry.prompt}"/>
    </option>
    </c:forEach>
    </select>

  • Export data with where condition

    Hello,
    I am doing an export using exp utility in oracle.
    exp fas/fas@fdbl file=aud log=aud.log parfile=exp
    Contents of parfile - exp
    compress=n
    indexes=n
    constraints=n
    grants=n
    triggers=n
    statistics=none
    consistent=y
    query=\"where org_grp_i=33 \"
    I am getting error when i include query = \"where org_grp_i=33 \". Without giving this condition the export is doing fine, its successful. how do i give this where condition in the parfile since i want to export lots of tables with this same condition. org_grp_i is common in all the tables.
    Thanks

    1. create directory ----
    sql> conn / as sysdba
    sql>create directory "data" as 'c:\';
    2. grant read, write privs. to exp or imp users.
    sql>grant read , write on directory data to scott;
    sql>grant read , write on directory data to tester;
    3.conn imp or exp user
    sql>conn scott/tiger
    SQL> host expdp scott/tiger directory=data dumpfile=eg.dmp tables=avgsal
    Export: Release 10.1.0.2.0 - Production on Wednesday, 25 October, 2006 19:14
    Copyright (c) 2003, Oracle.  All rights reserved.
    Connected to: Oracle Database 10g Enterprise Edition Release 10.1.0.2.0 - Produc
    tion
    With the Partitioning, OLAP and Data Mining options
    Starting "SCOTT"."SYS_EXPORT_TABLE_01":  scott/******** directory=data dumpfile=
    eg.dmp tables=avgsal
    Estimate in progress using BLOCKS method...
    Processing object type TABLE_EXPORT/TABLE/TBL_TABLE_DATA/TABLE/TABLE_DATA
    Total estimation using BLOCKS method: 64 KB
    Processing object type TABLE_EXPORT/TABLE/TABLE
    Processing object type TABLE_EXPORT/TABLE/STATISTICS/TABLE_STATISTICS
    . . exported "SCOTT"."AVGSAL"                            5.312 KB       5 rows
    Master table "SCOTT"."SYS_EXPORT_TABLE_01" successfully loaded/unloaded
    Dump file set for SCOTT.SYS_EXPORT_TABLE_01 is:
      C:\EG.DMP
    Job "SCOTT"."SYS_EXPORT_TABLE_01" successfully completed at 19:15
    SQL> drop table avgsal purge;
    Table dropped.
    SQL> host impdp tester/tester directory=data dumpfile=eg.dmp
    Import: Release 10.1.0.2.0 - Production on Wednesday, 25 October, 2006 19:16
    Copyright (c) 2003, Oracle.  All rights reserved.
    Connected to: Oracle Database 10g Enterprise Edition Release 10.1.0.2.0 - Produc
    tion
    With the Partitioning, OLAP and Data Mining options
    Master table "TESTER"."SYS_IMPORT_FULL_01" successfully loaded/unloaded
    Starting "TESTER"."SYS_IMPORT_FULL_01":  tester/******** directory=data dumpfile
    =eg.dmp
    Processing object type TABLE_EXPORT/TABLE/TABLE
    Processing object type TABLE_EXPORT/TABLE/TBL_TABLE_DATA/TABLE/TABLE_DATA
    . . imported "SCOTT"."AVGSAL"                            5.312 KB       5 rows
    Processing object type TABLE_EXPORT/TABLE/STATISTICS/TABLE_STATISTICS
    Job "TESTER"."SYS_IMPORT_FULL_01" successfully completed at 19:16
    SQL>
    note : cmd>impdp help=y
    cmd> expdp help=y
    see doc. for more info
    http://download-west.oracle.com/docs/cd/B19306_01/server.102/b14215/toc.htm
    Message was edited by:
    user52

  • [PERSISTENCE CLASS] SELECT OPTION in WHERE statement

    Hi Gurus,
    I would like to know how could I code the WHERE statement with a SELECT OPTION, in Persistence Class ?
    Currenlty, I would like to code this kind of request :
              DELETE FROM      ziTab
                             WHERE   zdate IN so_date.      
    Do you know, how could I code it ?
    Many thx for helps.
    Best regards.
    Rachid.

    Sorry Glen,
    Unfortunately, I am trying to find the correct syntax to use a SELECT OPTION in a Query Request of Persistence Class:
    Something like that:
    SELECT-OPTIONS so_date     FOR    sy-datum                      .
    DATA lo_query_manager TYPE REF TO if_os_query_manager           .
    DATA lo_query         TYPE REF TO if_os_query                   .
    DATA lo_agent         TYPE REF TO zca_persistence_zint_rsbankinv.
    DATA lo_base          TYPE REF TO zcb_persistence_zint_rsbankinv.
    DATA lo_rsbankinv     TYPE REF TO zcl_persistence_zint_rsbankinv.
    DATA lo_table         TYPE        osreftab                      .
    DATA ls_table         TYPE REF TO zcl_persistence_zint_rsbankinv.
    DATA ls_tmp           TYPE REF TO object                        .
    DATA lv_string        TYPE        string                        .
    DATA lo_exception     TYPE REF TO cx_root                       .
    TRY .
       lo_agent    = zca_persistence_zint_rsbankinv=>agent.
    * Create Query
       lo_query_manager = cl_os_system=>get_query_manager( ).
       lo_query         = lo_query_manager->create_query( i_filter     = 'ZEXDAT IN PAR1' ).
       lo_table         =
       lo_agent->if_os_ca_persistency~get_persistent_by_query(
       i_query = lo_query
       i_par1  =  so_date
       LOOP AT lo_table INTO ls_tmp.
         ls_table ?= ls_tmp        .
         lv_string = ls_table->zget_all_fields( ).
         WRITE lv_string.
       ENDLOOP.
    CATCH cx_root INTO lo_exception.
       lv_string = lo_exception->get_text( ).
       WRITE lv_string.
    ENDTRY.
    But I have an error message :
    Syntax error when parsing a query : Excepected symbol 'IN' (row: O, column: 7)
    Any idea ?

  • Outbound merge not working with where conditions in 10g

    Hi,
    These are my database details both remote and local database
    SQL> select * from v$version;
    BANNER
    Oracle Database 10g Enterprise Edition Release 10.2.0.4.0 - 64bi
    PL/SQL Release 10.2.0.4.0 - Production
    CORE    10.2.0.4.0      Production
    TNS for HPUX: Version 10.2.0.4.0 - Production
    NLSRTL Version 10.2.0.4.0 - ProductionI am doing a merge into a remote database from a local table using below query...
    MERGE into sap_mmd_po_all@cosmic_dev.somedomainname trg using (select * from sap_mmd_cmas_po where upload_flag in ('I','U')) src
      on (trg.PO_NO=src.PO_NO and trg.LINE_DISTRIB_SEQ=src.LINE_DISTRIB_SEQ)
      WHEN MATCHED THEN
        update set
          trg.PO_STATUS_FLG=src.PO_STATUS_FLG,
          trg.SHIP_TO_FACILITY_CD=src.SHIP_TO_FACILITY_CD,
          trg.DELV_TO_PHONE_NO=src.DELV_TO_PHONE_NO,
          trg.DELV_TO_NM=src.DELV_TO_NM,
          trg.DELV_TO_ADDRESS_1=src.DELV_TO_ADDRESS_1,
          trg.PO_ITEM_NO=src.PO_ITEM_NO,
          trg.ITEM_DESCRP=src.ITEM_DESCRP,
          trg.PARTY_NM=src.PARTY_NM,
          trg.VENDOR_ITEM_ID=src.VENDOR_ITEM_ID,
          trg.PO_LN_CRTE_DT=src.PO_LN_CRTE_DT,
          trg.BILL_UOM_CD=src.BILL_UOM_CD,
          trg.COMMODITY_CD=src.COMMODITY_CD,
          trg.COMMODITY_NM=src.COMMODITY_NM,
          trg.BSNSS_UNIT_NO=src.BSNSS_UNIT_NO,
          trg.PO_LN_ORD_QTY=src.PO_LN_ORD_QTY,
          trg.DISTRIB_AMT=src.DISTRIB_AMT,
          trg.PO_LN_DEL_IND=src.PO_LN_DEL_IND,
          trg.PO_DEL_IND=src.PO_DEL_IND,
          trg.PO_TYPE=src.PO_TYPE,
          trg.DOC_DATE=src.DOC_DATE,
          trg.CRTE_DT_TM=src.CRTE_DT_TM,
          trg.UPD_DT_TM=systimestamp,
          trg.SOURCE_SYSTEM=src.SOURCE_SYSTEM,
          trg.PO_LN_LST_CHNGE_DT=src.PO_LN_LST_CHNGE_DT,
          trg.TXJCD=src.TXJCD,
          trg.PLANT=src.PLANT
          where (src.upload_flag='U')--if i remove this then it is working
      WHEN NOT MATCHED THEN
        insert( trg.PO_NO,
                trg.LINE_DISTRIB_SEQ,
                trg.PO_STATUS_FLG,
                trg.SHIP_TO_FACILITY_CD,
                trg.DELV_TO_PHONE_NO,
                trg.DELV_TO_NM,
                trg.DELV_TO_ADDRESS_1,
                trg.PO_ITEM_NO,
                trg.ITEM_DESCRP,
                trg.PARTY_NM,
                trg.VENDOR_ITEM_ID,
                trg.PO_LN_CRTE_DT,
                trg.BILL_UOM_CD,
                trg.COMMODITY_CD,
                trg.COMMODITY_NM,
                trg.BSNSS_UNIT_NO,
                trg.PO_LN_ORD_QTY,
                trg.DISTRIB_AMT,
                trg.PO_LN_DEL_IND,
                trg.PO_DEL_IND,
                trg.PO_TYPE,
                trg.DOC_DATE,
                trg.CRTE_DT_TM,
                trg.UPD_DT_TM,
                trg.SOURCE_SYSTEM,
                trg.PO_LN_LST_CHNGE_DT,
                trg.TXJCD,
                trg.PLANT)
        values( src.PO_NO,
                src.LINE_DISTRIB_SEQ,
                src.PO_STATUS_FLG,
                src.SHIP_TO_FACILITY_CD,
                src.DELV_TO_PHONE_NO,
                src.DELV_TO_NM,
                src.DELV_TO_ADDRESS_1,
                src.PO_ITEM_NO,
                src.ITEM_DESCRP,
                src.PARTY_NM,
                src.VENDOR_ITEM_ID,
                src.PO_LN_CRTE_DT,
                src.BILL_UOM_CD,
                src.COMMODITY_CD,
                src.COMMODITY_NM,
                src.BSNSS_UNIT_NO,
                src.PO_LN_ORD_QTY,
                src.DISTRIB_AMT,
                src.PO_LN_DEL_IND,
                src.PO_DEL_IND,
                src.PO_TYPE,
                src.DOC_DATE,
                systimestamp,
                src.UPD_DT_TM,
                src.SOURCE_SYSTEM,
                src.PO_LN_LST_CHNGE_DT,
                src.TXJCD,
                src.PLANT)
                where src.upload_flag='I'--if i remove this then it is working
                ;And it is throwing an error like...
    SQL Error: ORA-00904: "A3"."UPLOAD_FLAG": invalid identifierBut when I replace the remote table name with local table name then query is functioning fine...
    table structure in local database..
    CREATE TABLE SAP_MMD_CMAS_PO
       (     "PO_NO" VARCHAR2(10 BYTE) NOT NULL ENABLE,
         "LINE_DISTRIB_SEQ" NUMBER NOT NULL ENABLE,
         "PO_STATUS_FLG" VARCHAR2(40 BYTE),
         "SHIP_TO_FACILITY_CD" VARCHAR2(100 BYTE),
         "DELV_TO_PHONE_NO" VARCHAR2(50 BYTE),
         "DELV_TO_NM" VARCHAR2(100 BYTE),
         "DELV_TO_ADDRESS_1" VARCHAR2(1000 BYTE),
         "PO_ITEM_NO" VARCHAR2(100 BYTE),
         "ITEM_DESCRP" VARCHAR2(200 BYTE),
         "PARTY_NM" VARCHAR2(1000 BYTE),
         "VENDOR_ITEM_ID" VARCHAR2(100 BYTE),
         "PO_LN_CRTE_DT" TIMESTAMP (6),
         "BILL_UOM_CD" VARCHAR2(50 BYTE),
         "COMMODITY_CD" VARCHAR2(50 BYTE),
         "COMMODITY_NM" VARCHAR2(50 BYTE),
         "BSNSS_UNIT_NO" VARCHAR2(50 BYTE),
         "PO_LN_ORD_QTY" NUMBER,
         "DISTRIB_AMT" NUMBER,
         "PO_LN_DEL_IND" VARCHAR2(10 BYTE),
         "PO_DEL_IND" VARCHAR2(10 BYTE),
         "PO_TYPE" VARCHAR2(10 BYTE),
         "DOC_DATE" TIMESTAMP (6),
         "CRTE_DT_TM" TIMESTAMP (6),
         "UPD_DT_TM" TIMESTAMP (6),
         "SOURCE_SYSTEM" VARCHAR2(100 BYTE),
         "PO_LN_LST_CHNGE_DT" TIMESTAMP (6),
         "TXJCD" VARCHAR2(50 BYTE),
         "PLANT" VARCHAR2(10 BYTE),
         "UPLOAD_FLAG" VARCHAR2(1 BYTE),
          PRIMARY KEY ("PO_NO", "LINE_DISTRIB_SEQ")
    --table structure in remote database table
    CREATE TABLE SAP_MMD_PO_ALL
       (     "PO_NO" VARCHAR2(10 BYTE) NOT NULL ENABLE,
         "LINE_DISTRIB_SEQ" NUMBER NOT NULL ENABLE,
         "PO_STATUS_FLG" VARCHAR2(40 BYTE),
         "SHIP_TO_FACILITY_CD" VARCHAR2(100 BYTE),
         "DELV_TO_PHONE_NO" VARCHAR2(50 BYTE),
         "DELV_TO_NM" VARCHAR2(100 BYTE),
         "DELV_TO_ADDRESS_1" VARCHAR2(1000 BYTE),
         "PO_ITEM_NO" VARCHAR2(100 BYTE),
         "ITEM_DESCRP" VARCHAR2(200 BYTE),
         "PARTY_NM" VARCHAR2(1000 BYTE),
         "VENDOR_ITEM_ID" VARCHAR2(100 BYTE),
         "PO_LN_CRTE_DT" TIMESTAMP (6),
         "BILL_UOM_CD" VARCHAR2(50 BYTE),
         "COMMODITY_CD" VARCHAR2(50 BYTE),
         "COMMODITY_NM" VARCHAR2(50 BYTE),
         "BSNSS_UNIT_NO" VARCHAR2(50 BYTE),
         "PO_LN_ORD_QTY" NUMBER,
         "DISTRIB_AMT" NUMBER,
         "PO_LN_DEL_IND" VARCHAR2(10 BYTE),
         "PO_DEL_IND" VARCHAR2(10 BYTE),
         "PO_TYPE" VARCHAR2(10 BYTE),
         "DOC_DATE" TIMESTAMP (6),
         "CRTE_DT_TM" TIMESTAMP (6),
         "UPD_DT_TM" TIMESTAMP (6),
         "SOURCE_SYSTEM" VARCHAR2(100 BYTE),
         "PO_LN_LST_CHNGE_DT" TIMESTAMP (6),
         "TXJCD" VARCHAR2(50 BYTE),
         "PLANT" VARCHAR2(10 BYTE),
         "DELETE_FLAG" VARCHAR2(1 BYTE) DEFAULT 'N',
          PRIMARY KEY ("PO_NO", "LINE_DISTRIB_SEQ")
      )It seems to me like a bug, but not quite sure...
    your suggestions are appreciated.
    Thanks,
    Ravi Kumar
    Edited by: ravikumar.sv on Dec 14, 2009 1:31 PM
    Commented the where conditions in merge query

    Hi,
    Yes, i hit the same error....
    SQL> ed
    Wrote file afiedt.buf
      1  merge into hr.test1@test_dblink using test2 on (test1.id = test2.id)
      2  when matched then update set test1.col1=test2.col2 where test2.id=2
      3* when not matched then insert (id, col1) values(test2.id,test2.col2)
    SQL> /
    merge into hr.test1@test_dblink using test2 on (test1.id = test2.id)
    ERROR at line 1:
    ORA-00904: "A3"."ID": invalid identifier
    ORA-02063: preceding line from TEST_DBLINKBUT here is a work around...to add the where condition while joining(ON) itself.
    SQL> ed
    Wrote file afiedt.buf
      1  merge into hr.test1@test_dblink using test2 on (test1.id = test2.id and tes
    t2.id=2)
      2  when matched then update set test1.col1=test2.col2
      3* when not matched then insert (id, col1) values(test2.id,test2.col2)
    SQL> /
    2 rows merged.
    SQL>For you the condition would be...
    on (trg.PO_NO=src.PO_NO and trg.LINE_DISTRIB_SEQ=src.LINE_DISTRIB_SEQ AND src.upload_flag='U')cheers,
    Edited by: Avinash Tripathi on Dec 14, 2009 2:53 PM

  • Dynamic LOV with where conditions

    Hi all! I have a question regarding Dynamic LOVs. I have a List of values that can be used from three pages, the query is something like this:
    SELECT a.CODE CODE_DISPLAY,
    a.CODE CODE_RETURN
    FROM OREF_COUNTRIES a,
    OREF_REGIONS b
    WHERE a.REG_ID = b.ID AND
    b.CODE = :P336_LOV_REGION;
    The thing is I don't want to hardcode the name of the item ":P336_LOV_REGION" because this is the name of 1 item of one page, and I'd like to use this LOV from another two pages, so the name of the item won't be ":P336_LOV_REGION". How can I create a reusable dynamic LOV with a where condition depending on one item of the page?
    Thanks!!

    hi! anyone has any information about this?
    Daniela.

  • Select statement with if condition in cursors

    Create procedure test (t1 in varchar2 ,t2 out varchar2)
    IS
    BEGIN
    IF t1 = 'E'
    select ENO INTO t2 from emp ;
    elsif t1 = 'D'
    select DNO INTO t2 from dept ;
    end if;
    end
    how do i write this using cursors

    i think i have to go for two cursors Intially i have written like the below codeThis requirement merely made me think of a pure SQL solution - something interesting...
    As I mentioned, you likely should be using ref cursors as typically this requirement extends to a client that wants to make a call to Oracle without needing to know SQL or table names, pass parameters, and get a dynamic "+result set+" in response.
    In Oracle. this is done using ref cursors. The code will look something like this"
    {code}
    create or replace procedure FooProc( someVar1 varchar2, someVar2 number, curResult OUT sys_refcursor ) is
    begin
    case
    when someVar1 = someValueA then
    open curResult for select * from emp;
    when someVar1 = someValueB then
    open curResult for select * from emp where empid = someVar2;
    .. etc ..
    end case;
    end;
    {code}
    This is pretty straight forward stuff - and well explained with examples in the Oracle® Database PL/SQL User's Guide and Reference (http://download.oracle.com/docs/cd/B19306_01/appdev.102/b14261/sqloperations.htm#sthref139)
    You procedure it a tad different in output parameters (and not what one typically would get in a production system), but the concept is the same. If the SQL projection is the same for each cursor, you can use a ref cursor as above - and then simply code a single fetch to get the row's columns, close the cursor, and then return that column values as output parameters.
    Edited by: Billy Verreynne to fix the broken Jive s/w that does not understand how to parse a link and show it correctly.. (am getting more and more peeved at the crappiness factor of the new forum s/w)

  • Select options with out intervals and with extension in WebDynpro ABAP

    Hi webdynpro experts,
    I am with working with webdynpro select options.
    Is there any way to hide selection screen intervals with extension same as ABAP?
    Your input is appreicated.
    Thanks
    Rajesh Yadla

    Hi Prabhu,
    I have two radio buttons ex: R1 and R2 and three Fields Ex: Vendor, User Name and Password.
    When I select R1 Vendor field should be Visible and when I select R2 Vendor field should be invisible.
    I created one attribute of type WDUI_VISIBILITY and binded in Visbility property of Vendor field.
    On action of R1 I am setting attribute value as Visible using Set_attribute method and On Action of R2 I am setting BLANK in Set_attribute method. But somehow I am unable get the solution......
    Thanks
    Basu

Maybe you are looking for