Select query is not working in BDC Program

Hi,
I am working in BDC for update valuation class for T-code mm01.Actually In this BDC i am using two recoding based on material type.
i am using two internal table : I_DATA and ITAB
Use I_DATA to hold excle data in which material No, plant , valuation type , valuation No. and ITAB for material No, material type Only.
So, i am fetching material Type ( MARA-MTART ) through select query. But Select query is not working. and also i did check MARA table according that  Material Number then  material no. exit in Mara Table.
Note : at run time  I_DATA have 1 row but ITAB have 0 row ....
DATA: BEGIN OF I_DATA OCCURS 0,
MATNR TYPE MARA-MATNR,
WERKS TYPE MARC-WERKS,
BWTAR TYPE RMMG1-BWTAR,
VERPR TYPE BMMH1-VERPR,
BKLAS TYPE MBEW-BKLAS,
STATUS TYPE C,
END OF I_DATA.
DATA : BEGIN OF ITAB OCCURS 0,
MATNR LIKE MARA-MATNR,
MTART LIKE MARA-MTART,
END OF ITAB.
Loop at I_DATA.
select matnr mtart from mara into table itab where matnr = I_DATA-matnr.
endloop.
Guide me..........

If you use your
Loop at I_DATA.
  select matnr mtart from mara into table itab
    where matnr = I_DATA-matnr.
endloop.
At end of loop, itab will only contain the result of the last select, so use a
Loop at I_DATA.
  select matnr mtart from mara APPENDING table itab
    where matnr = I_DATA-matnr.
endloop.
better
if I_DATA[] is not initial.
  select matnr mtart from mara into table itab
    FOR ALL ENTRIES IN i_data where matnr = i_data-matnr.
endif.
Some Remarks
- If actually required (where does I_DATA come from, is it an external format, you need the internal value to use in SELECT statement), check via SE11 the correct [conversion exit|http://help.sap.com/saphelp_nw04/helpdata/en/35/26b217afab52b9e10000009b38f974/content.htm] associated with domain MATNR (Is it truly ALPHA, and not something like MATN1, so [CONVERSION_EXIT_MATN1_INPUT|http://www.sdn.sap.com/irj/scn/advancedsearch?query=conversion_exit_matn1_input])
- You could try to use BAPI like [BAPI_MATERIAL_SAVEDATA|http://www.sdn.sap.com/irj/scn/advancedsearch?query=bapi_material_savedata] and not BDC
Regards,
Raymond

Similar Messages

  • Why select query is not working?

    CREATE OR REPLACE TYPE prod_type AS OBJECT (
    pid INT,
    pprice NUMBER,
    MEMBER PROCEDURE display(pid IN NUMBER));
    create table prod of prod_type (pid primary key);
    CREATE OR REPLACE TYPE deal_type UNDER prod_type (
    ctr NUMBER,
    OVERRIDING MEMBER PROCEDURE display (pid IN NUMBER),
    insert into prod values(deal_type(101, 4, 1));
    insert into prod values(deal_type(102, 5, 0));
    ------below given select query is NOT WORKING ---------
    select ctr from prod p where p.pid=101;
    Thanks,
    -Nid

    ------below given select query is NOT WORKINGWondering how you inserted data ...
    SQL> CREATE OR REPLACE TYPE prod_type AS OBJECT (
      2  pid INT,
      3  pprice NUMBER,
      4  MEMBER PROCEDURE display(pid IN NUMBER));
      5  /
    Type created.
    SQL>
    SQL> create table prod of prod_type (pid primary key);
    Table created.
    SQL>
    SQL> CREATE OR REPLACE TYPE deal_type UNDER prod_type (
      2  ctr NUMBER,
      3  OVERRIDING MEMBER PROCEDURE display (pid IN NUMBER),
      4  );
      5  /
    Warning: Type created with compilation errors.
    SQL> sho err
    Errors for TYPE DEAL_TYPE:
    LINE/COL ERROR
    4/1      PLS-00103: Encountered the symbol ")" when expecting one of the
             following:
             , not pragma <an identifier>
             <a double-quoted delimited-identifier> final instantiable
             current order overriding static member constructor map
    SQL> CREATE OR REPLACE TYPE deal_type UNDER prod_type (
      2  ctr NUMBER,
      3  OVERRIDING MEMBER PROCEDURE display (pid IN NUMBER));
      4  /
    Warning: Type created with compilation errors.
    SQL> sho err
    Errors for TYPE DEAL_TYPE:
    LINE/COL ERROR
    1/1      PLS-00590: attempting to create a subtype UNDER a FINAL type
    SQL>You made an attempt to create a subtype UNDER a FINAL type - that the reason why can not work ...
    Avoid deriving a subtype from this FINAL type.
    HTH

  • Using parameters in a select query sometimes not working

    I use parameters throughout my code - usually without problem, but for some reason in one case it does not return a result. When I modify the querystring to contain the value instead of using parameters it works. Is it because I'm secting a clob? or is it because I'm using a 9i ODP.net dll against a 10g database? this is c# 2.0
    here's the source code that does not work for me - REQUEST_DATA is a clob:
        public String loadRequest(String PSRNumber)
            String returnVal = null;
            ConnectionStringSettings connectionInfo = System.Configuration.ConfigurationManager.ConnectionStrings["Scribe"];
            OracleConnection myConnection = new OracleConnection();
            String strSQL = "select PSR, REQUEST_DATA from stats.request where PSR = :PSR";
            try
                myConnection.ConnectionString = connectionInfo.ConnectionString;
                OracleCommand cmd = new OracleCommand(strSQL, myConnection);
                cmd.CommandType = CommandType.Text;
                cmd.Parameters.Add("PSR", OracleDbType.Varchar2).Value = PSRNumber;
                myConnection.Open();
                OracleDataReader dr = cmd.ExecuteReader();
                if (dr.Read())
                    returnVal = dr.GetOracleString(dr.GetOrdinal("REQUEST_DATA")).ToString();
                else
                    returnVal = null;
                dr.Dispose();
                cmd.Dispose();
            catch (OracleException ex)
                printError(ex.Message);
            finally
                myConnection.Close();
                myConnection.Dispose();
            return returnVal;
        }when I replace the line generating the sql, and remove the lines pertaining to parameters it works:
    String strSQL = String.Format("select PSR, REQUEST_DATA from stats.request where PSR = {0}", PSRNumber);
    I'm fine just using this as a workaround, but I need an explanation why the other does not work - I prefer to use parameters.
    Message was edited by:
    user633546

    I figured it out. thank you for your help in pointing me in the right direction.
    the problem was there was a trailing space in the data.
    when the data for that table is numeric for every record, the query allows me to leave out the single quotes. Trailing spaces do not seem to cause the database to see it as non-numeric - leaving out the quote still finds the record even if there is a trailing space.
    but when I put in the quote, it is not an exact string match, so it could not find the record. sometimes this flexibility gets me into trouble :\

  • My select query in not working

    hi
    this my select query
    select * from J_1IEXCHDR where werks = 'DT*'
    this is not working
    i want result where werks like DT01, DT09 and many statting with DT
    so plz tel me how to write for like .
    thank

    Hi,
    >
    Guptaprashant wrote:
    > hi
    >
    > this my select query
    >
    > select * from J_1IEXCHDR where werks = 'DT*'
    >
    >
    > this is not working
    >
    > i want result where werks like DT01, DT09 and many statting with DT
    > so plz tel me how to write for like .
    >
    > thank
    Use:-
    select * from J_1IEXCHDR where werks like 'DT%'.
    Regards,
    Tarun

  • Select query in not working for Count(*)

    Hi,
    Our batch team running one query that is selecting one table TSFHEAD and this query is hanging. Below are diffrent shenario in which the select query is running on this table.
    select * from tsfhead where create_id = 'BATCH' and create_date = '26-OCT-12';
    --not returning any rows and hanging
    select * from tsfhead where create_id = 'BATCH' ---returning rows
    select * from tsfhead where create_date = '26-OCT-12'; --- returning rows
    select count(*) from tsfhead ----not returning rows and hanging
    This table TSFHEAD has 59000 rows.
    SQL> explain plan for select * from tsfhead where create_id = 'BATCH' and create_date = '26-OCT-12';
    Explained.
    SQL> SELECT * FROM TABLE(dbms_xplan.display);
    PLAN_TABLE_OUTPUT
    Plan hash value: 415503093
    | Id | Operation | Name | Rows | Bytes | Cost (%CPU)| Time |
    | 0 | SELECT STATEMENT | | 1 | 67 | 215 (1)| 00:00:03 |
    |* 1 | TABLE ACCESS FULL| TSFHEAD | 1 | 67 | 215 (1)| 00:00:03 |
    Predicate Information (identified by operation id):
    PLAN_TABLE_OUTPUT
    1 - filter("CREATE_ID"='BATCH' AND "CREATE_DATE"='26-OCT-12')
    I don't know why this query behaving in this manner.Please help.

    RanVijai_dba wrote:
    Thanks for your reply. But +"select count(*) from tsfhead"+ is hanging and +"select * from tsfhead where create_date = '26-OCT-12' "+ is showing records.It might be showing records, but not necessarily the correct records.
    As sb points out, you are treating dates as strings rather than the DATE datatype. That means you could be querying the wrong data, and your query is also not safe in different environments. It could also effect the query execution plan. Also, as pointed out, you should be ideally using 4 digit years. There were many headaches caused by the use of 2 digit years that most companies corrected as part of the millenium bug fixes prior to the year 2000... well over a decade ago, and most good designs now ensure that 4 digit years are used as standard.
    So your query would be better written as:
    select * from tsfhead where create_date = TO_DATE('26-OCT-2012','DD-MON-YYYY')When you say:
    select count(*) from tsfhead... is hanging, you say the table has around 59000 rows in it, and in reality that's a small amount of records, so a count(*) shouldn't take long at all, even doing a full table scan.
    Post the explain plan for that simple count(*) query for us. (and ensure you use {noformat}{noformat} tags to keep the formatting on the forum, as described in {message:id=9360002})                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   

  • XQuery select query is not working in proper speed

    In our project we have large no. data (its a property listing site) and I'm storing that data to Barkeley DB (XML DB). The problem is when I am searching for a property it will list the first 10 property quickly(100% speed). Then I'm going to 2dn, 3rd page its working in the same speed. But if I'm going to 10th(30% speed) or 100th or 1500th(15%speed) page is working very slowly.
    Following are my query:
    let $property_ids:=
    for $property in collection('bdb/properties.dbxml')/properties/property
    order by $property/sale_price/number() descending
    return $property/@property_id,
    for $property in collection('bdb/properties.dbxml')/properties/property
    order by $property/sale_price/number() descending
    return $property/@property_id,
    for $property in collection('bdb/properties.dbxml')/properties/property
    order by $property/sale_price/number() descending
    return $property/@property_id
    return <properties>{
    for $id in subsequence($property_ids, 1, 10) return
    collection('bdb/properties.dbxml')/properties/property@property_id = $id
    }</properties>
    And some times query will change like the following way based on the filter option in my page(means sort by only sale_price field):
    let $property_ids:=
    for $property in collection('bdb/properties.dbxml')/properties/property
    order by $property/sale_price/number() descending
    return $property/@property_id
    return <properties>{
    for $id in subsequence($property_ids, 1, 10) return
    collection('bdb/properties.dbxml')/properties/property@property_id = $id
    }</properties>
    then from the first page its self its performance is very slow(15%).
    Could you please check my query and help me to solve the issue...
    Thank you,
    Vijesh

    If you use your
    Loop at I_DATA.
      select matnr mtart from mara into table itab
        where matnr = I_DATA-matnr.
    endloop.
    At end of loop, itab will only contain the result of the last select, so use a
    Loop at I_DATA.
      select matnr mtart from mara APPENDING table itab
        where matnr = I_DATA-matnr.
    endloop.
    better
    if I_DATA[] is not initial.
      select matnr mtart from mara into table itab
        FOR ALL ENTRIES IN i_data where matnr = i_data-matnr.
    endif.
    Some Remarks
    - If actually required (where does I_DATA come from, is it an external format, you need the internal value to use in SELECT statement), check via SE11 the correct [conversion exit|http://help.sap.com/saphelp_nw04/helpdata/en/35/26b217afab52b9e10000009b38f974/content.htm] associated with domain MATNR (Is it truly ALPHA, and not something like MATN1, so [CONVERSION_EXIT_MATN1_INPUT|http://www.sdn.sap.com/irj/scn/advancedsearch?query=conversion_exit_matn1_input])
    - You could try to use BAPI like [BAPI_MATERIAL_SAVEDATA|http://www.sdn.sap.com/irj/scn/advancedsearch?query=bapi_material_savedata] and not BDC
    Regards,
    Raymond

  • Select query is not executing

    Hi Friends,
    my code is :
    itab-vbeln = bseg-vbeln.
    if not itab-vbeln is initial.
    select single vbeln inco1 inco2 into ( itab-vbeln itab-inco1 itab-inco2)
    from vbrk where vbeln = itab-vbeln.
    appned itab.
    note : here inco1 inco2 are incoterms
    my question is  can we direct move the values of bseg-vbeln into itab-vbeln. ???
    and i am generating the report with one varient , when i debug this report the
    there is no value in bseg-vbeln. it is showing null value.thats why my select query is not working..but i want execute this select query final.
    in output i want display the inco1 inco2 data.(incoterms)
    any help please.
    urgent.
    regards,
    vijay.

    Hi Vijay,
    First you need to check it out whether <b>itab-vbeln = bseg-vbeln</b> is in with in LOOP or not (<b>if ITAB is intenal table</b>)
    if itab is internal table you should write above statement with in loop, and also check it out in debug mode why bseg-vbeln value is not coming.
    and one more thing you need to make small correction in ur code use ',' .
    select single vbeln inco1 inco2 into ( <b>itab-vbeln, itab-inco1, itab-inco2</b>)
    from vbrk where vbeln = itab-vbeln
    Note: when ever use select single u should pass values into work area, dont use internal table .
    <b>if you have more doubts just send your entire code then i will rewrite it.</b>
    <b>Reward with points if useful.</b>
    Regards,
    Vijay Krishna

  • 'Create' Push button is not working in BDC and LSMW while uploading G/L master data

    Hello Experts:
    I am facing the following problem:
    While uploading G/L master data with the BDC program, 'create' push button is not working  even after executing following lines.
    PERFORM BDC_DYNPRO      USING 'SAPLGL_ACCOUNT_MASTER_MAINTAIN' '2001'.
    PERFORM BDC_FIELD       USING 'BDC_OKCODE'
                                   '=ACC_CRE'.
    Create G/L account  screen is not coming in BDC. Please suggest me what to do.
    Thanks !!

    Re: 'Create' Push button is not working in BDC and LSMW while uploading G/L master data
    Re: 'Create' Push button is not working in BDC and LSMW while uploading G/L master data
    Hi Glen Anthony
    Thank you for the reply Glen Anthony please take a look at the following code.
    REPORT  ZFI_BDC_FS00
            NO STANDARD PAGE HEADING LINE-SIZE 255.
    *INCLUDE BDCRECX1.
    TYPES : BEGIN OF STR,
       BUKRS TYPE GLACCOUNT_SCREEN_KEY-BUKRS,        "Company Code
       SAKNR TYPE GLACCOUNT_SCREEN_KEY-SAKNR,        "G/L Account Number
       KTOKS TYPE GLACCOUNT_SCREEN_COA-KTOKS,        "G/L Account Group
       XPLACCT TYPE GLACCOUNT_SCREEN_COA-XPLACCT,    "P&L statement account
       XBILK TYPE GLACCOUNT_SCREEN_COA-XBILK,        "Indicator: Account is a balance sheet account?
       TXT20_ML TYPE GLACCOUNT_SCREEN_COA-TXT20_ML,  "G/L account short text
       TXT50_ML TYPE GLACCOUNT_SCREEN_COA-TXT50_ML,  "G/L account short text
       WAERS TYPE GLACCOUNT_SCREEN_CCODE-WAERS,      "Account currency
       XSALH TYPE GLACCOUNT_SCREEN_CCODE-XSALH,      "Indicator: Only Manage Balances in Local Currency
       MWSKZ TYPE GLACCOUNT_SCREEN_CCODE-MWSKZ,      "Tax Category in Account Master Record
       XMWNO TYPE GLACCOUNT_SCREEN_CCODE-XMWNO,      "Indicator: Tax code is not a required field
       MITKZ TYPE GLACCOUNT_SCREEN_CCODE-MITKZ,      "Account is reconciliation account
       XOPVW TYPE GLACCOUNT_SCREEN_CCODE-XOPVW,      "Indicator: Open item management?
       XKRES TYPE GLACCOUNT_SCREEN_CCODE-XKRES,      "Indicator: Can Line Items Be Displayed by Account?
       ZUAWA TYPE GLACCOUNT_SCREEN_CCODE-ZUAWA,      "Key for sorting according to assignment numbers
       FSTAG TYPE GLACCOUNT_SCREEN_CCODE-FSTAG,      "Field status group
       XINTB TYPE GLACCOUNT_SCREEN_CCODE-XINTB,      "Indicator: Is account only posted to automatically?
       END OF STR.
    DATA : ITAB TYPE TABLE OF STR WITH HEADER LINE,
            IT_BDCDATA TYPE TABLE OF BDCDATA WITH HEADER LINE,
            TXT(4096) TYPE C OCCURS 0,
            MSG TYPE STRING,
            COUNT(5) TYPE N.
    SELECTION-SCREEN : BEGIN OF BLOCK B1 WITH FRAME TITLE TEXT-001.
       PARAMETERS : MY_FILE TYPE RLGRAP-FILENAME.
    SELECTION-SCREEN : END OF BLOCK B1.
    AT SELECTION-SCREEN ON VALUE-REQUEST FOR MY_FILE.
    CALL FUNCTION 'F4_FILENAME'
      EXPORTING
        PROGRAM_NAME        = SYST-CPROG
        DYNPRO_NUMBER       = SYST-DYNNR
    *   FIELD_NAME          = ' '
      IMPORTING
        FILE_NAME           = MY_FILE
    CALL FUNCTION 'TEXT_CONVERT_XLS_TO_SAP'
       EXPORTING
    *   I_FIELD_SEPERATOR          =
    *   I_LINE_HEADER              =
         I_TAB_RAW_DATA             = TXT
         I_FILENAME                 = MY_FILE
       TABLES
         I_TAB_CONVERTED_DATA       = ITAB[]
      EXCEPTIONS
        CONVERSION_FAILED          = 1
        OTHERS                     = 2
    IF SY-SUBRC <> 0.
    * IMPLEMENT SUITABLE ERROR HANDLING HERE
    ENDIF.
    START-OF-SELECTION.
    COUNT = 0.
    LOOP AT ITAB.
    *PERFORM OPEN_GROUP.
    REFRESH  IT_BDCDATA.
    PERFORM BDC_DYNPRO      USING 'SAPLGL_ACCOUNT_MASTER_MAINTAIN' '2001'.
    PERFORM BDC_FIELD       USING 'BDC_CURSOR'
                                   'GLACCOUNT_SCREEN_KEY-BUKRS'.
    PERFORM BDC_FIELD       USING 'BDC_OKCODE'
                                   '=ACC_CRE'.
    *PERFORM BDC_FIELD       USING 'BDC_CURSOR'
    *                              'GLACCOUNT_SCREEN_KEY-BUKRS'.
    PERFORM BDC_FIELD       USING 'GLACCOUNT_SCREEN_KEY-SAKNR'
                                   ITAB-SAKNR. "'5'.
    PERFORM BDC_FIELD       USING 'GLACCOUNT_SCREEN_KEY-BUKRS'
                                   ITAB-BUKRS. "'TATA'.
    PERFORM BDC_DYNPRO      USING 'SAPLGL_ACCOUNT_MASTER_MAINTAIN' '2001'.
    PERFORM BDC_FIELD       USING 'BDC_OKCODE'
                                   '=2102_GROUP'.
    PERFORM BDC_FIELD       USING 'BDC_CURSOR'
                                   'GLACCOUNT_SCREEN_COA-KTOKS'.
    PERFORM BDC_FIELD       USING 'GLACCOUNT_SCREEN_COA-KTOKS'
                                   ITAB-KTOKS. "'GL'.
    PERFORM BDC_FIELD       USING 'GLACCOUNT_SCREEN_COA-XPLACCT'
                                   ITAB-XPLACCT. "'X'.
    PERFORM BDC_DYNPRO      USING 'SAPLGL_ACCOUNT_MASTER_MAINTAIN' '2001'.
    PERFORM BDC_FIELD       USING 'BDC_OKCODE'
                                   '=2102_BS_PL'.
    PERFORM BDC_FIELD       USING 'BDC_CURSOR'
                                   'GLACCOUNT_SCREEN_COA-XBILK'.
    PERFORM BDC_FIELD       USING 'GLACCOUNT_SCREEN_COA-KTOKS'
                                   ITAB-KTOKS. "'GL'.
    PERFORM BDC_FIELD       USING 'GLACCOUNT_SCREEN_COA-XPLACCT'
                                   ITAB-XPLACCT. "''.
    PERFORM BDC_FIELD       USING 'GLACCOUNT_SCREEN_COA-XBILK'
                                   ITAB-XBILK. "'X'.
    PERFORM BDC_DYNPRO      USING 'SAPLGL_ACCOUNT_MASTER_MAINTAIN' '2001'.
    PERFORM BDC_FIELD       USING 'BDC_OKCODE'
                                   '=TAB02'.
    PERFORM BDC_FIELD       USING 'GLACCOUNT_SCREEN_COA-KTOKS'
                                   ITAB-KTOKS. "'GL'.
    PERFORM BDC_FIELD       USING 'GLACCOUNT_SCREEN_COA-XBILK'
                                   ITAB-XBILK. "'X'.
    PERFORM BDC_FIELD       USING 'BDC_CURSOR'
                                   'GLACCOUNT_SCREEN_COA-TXT50_ML'.
    PERFORM BDC_FIELD       USING 'GLACCOUNT_SCREEN_COA-TXT20_ML'
                                   ITAB-TXT20_ML. "'G/L ACCOUNT'.
    PERFORM BDC_FIELD       USING 'GLACCOUNT_SCREEN_COA-TXT50_ML'
                                   ITAB-TXT50_ML. "'G/L ACCOUNT'.
    PERFORM BDC_DYNPRO      USING 'SAPLGL_ACCOUNT_MASTER_MAINTAIN' '2001'.
    PERFORM BDC_FIELD       USING 'BDC_OKCODE'
                                   '=TAB03'.
    PERFORM BDC_FIELD       USING 'GLACCOUNT_SCREEN_CCODE-WAERS'
                                   ITAB-WAERS. "'INR'.
    PERFORM BDC_FIELD       USING 'GLACCOUNT_SCREEN_CCODE-XSALH'
                                   ITAB-XSALH. "'X'.
    PERFORM BDC_FIELD       USING 'GLACCOUNT_SCREEN_CCODE-MWSKZ'
                                   ITAB-MWSKZ. "'*'.
    PERFORM BDC_FIELD       USING 'GLACCOUNT_SCREEN_CCODE-XMWNO'
                                   ITAB-XMWNO. "'X'.
    PERFORM BDC_FIELD       USING 'GLACCOUNT_SCREEN_CCODE-MITKZ'
                                   ITAB-MITKZ. "''.
    PERFORM BDC_FIELD       USING 'BDC_CURSOR'
                                   'GLACCOUNT_SCREEN_CCODE-ZUAWA'.
    PERFORM BDC_FIELD       USING 'GLACCOUNT_SCREEN_CCODE-XOPVW'
                                   ITAB-XOPVW. "'X'.
    PERFORM BDC_FIELD       USING 'GLACCOUNT_SCREEN_CCODE-XKRES'
                                   ITAB-XKRES. "'X'.
    PERFORM BDC_FIELD       USING 'GLACCOUNT_SCREEN_CCODE-ZUAWA'
                                   ITAB-ZUAWA. "'1'.
    PERFORM BDC_DYNPRO      USING 'SAPLGL_ACCOUNT_MASTER_MAINTAIN' '2001'.
    PERFORM BDC_FIELD       USING 'BDC_OKCODE'
                                   '=SAVE'.
    PERFORM BDC_FIELD       USING 'BDC_CURSOR'
                                   'GLACCOUNT_SCREEN_CCODE-XINTB'.
    PERFORM BDC_FIELD       USING 'GLACCOUNT_SCREEN_CCODE-FSTAG'
                                   ITAB-FSTAG. "'G019'.
    PERFORM BDC_FIELD       USING 'GLACCOUNT_SCREEN_CCODE-XINTB'
                                   ITAB-XINTB. "'X'.
    *PERFORM BDC_TRANSACTION USING 'FS00'.
    CALL TRANSACTION 'FS00' USING IT_BDCDATA MODE 'E' UPDATE 'S'.
    COUNT = COUNT + 1.
    *PERFORM CLOSE_GROUP.
    ENDLOOP.
    CONCATENATE COUNT ' RECORDS UPDATED SUCCESSFULLY' INTO MSG.
    MESSAGE MSG TYPE 'I'.
    FORM BDC_DYNPRO USING PROGRAM DYNPRO.
       CLEAR IT_BDCDATA.
       IT_BDCDATA-PROGRAM  = PROGRAM.
       IT_BDCDATA-DYNPRO   = DYNPRO.
       IT_BDCDATA-DYNBEGIN = 'X'.
       APPEND IT_BDCDATA.
    ENDFORM.
    *        INSERT FIELD                                                  *
    FORM BDC_FIELD USING FNAM FVAL.
    *  IF FVAL <> NODATA.
         CLEAR IT_BDCDATA.
         IT_BDCDATA-FNAM = FNAM.
         IT_BDCDATA-FVAL = FVAL.
         APPEND IT_BDCDATA.
    *  ENDIF.
    ENDFORM.

  • Excel 2010 MS Query is not working

    Hi, I am in the process of upgrading all my Excel 2003 spreadsheets to Excel 2010.  I am running into problem with the MS Query.  Spreadsheets have MS Query linking to MS database.  However, when I open some of the spreadsheets, the MS Query
    is not working ie. the blue circle keeps turning and then not responding.  It is very weird that this MS Query is working fine with some spreadsheets but not couple and they are all linking to the same database except a small different in criteria.  I
    tried to re-create the Query in the spreadsheet in Excel 2010 by going to Data>From Other Sources>From Microsoft Query and select the database.  Once I set up the criteria and click Return data, the Query gets stuck.
    Please help! Any comments/suggestions will be appreciated.
    Thanks

    Hi,
    There are many possible causes that can crash MSQuery in Excel 2010.
    First, please make sure we have installed the latest Office 2010 and Windows patches.
    Second, Please read the Blog, it explains one typical crash scenario.
    =====
    AppName: msqry32.exe AppVer: 14.0.4750.1000 ModName: msvcr90.dll
    There are several possible resolution you can try to resolve the above crash:
    1. When you launch MS Query, just disable the option "Validate queries before saving or returning data", this is the fifth box in the options menu.
    The only problem is that if you have made any mistake in your query, you'll only be noticed when receiving the data in excel.
    2. Repair all the keys into registry at the following place:
    [HKEY_CURRENT_USER\Software\ODBC\ODBC.INI\ODBC]
    For example:
    Windows Registry Editor Version 5.00
    [HKEY_CURRENT_USER\Software\ODBC\ODBC.INI\ODBC]
    "TraceFile"="C:\\DOCUME~1\\...USERNAME...\\IMPOST~1\\Temp\\SQL.LOG"
    "TraceDll"="C:\\WINDOWS\\system32\\odbctrac.dll"
    http://blogs.technet.com/b/asiasupp/archive/2011/11/07/msquery-randomly-crashed.aspx
    =====
    Third, start the Excel 2010 with
    safe mode, it helps us confirm if some add-ins cause this issue.
    Hope it's helpful.
    Regards,
    George Zhao
    TechNet Community Support
    It's recommended to download and install
    Configuration Analyzer Tool (OffCAT), which is developed by Microsoft Support teams. Once the tool is installed, you can run it at any time to scan for hundreds of known issues in
    Office programs.

  • Select() function is not working properly in solaris 10.

    Hi ,
    We are facing an issue with select() in Solaris 10. we had written a sample program to this issue.
    Program name :- sel.cpp
    int main()
    struct timeval sleeptime;
    sleeptime.tv_sec = 60;
    printf("1\n");
    select(0,NULL,NULL,NULL,&sleeptime);
    printf("2");
    return 0;
    When i run this program in Solaris 9, its printing 1 and after one minute its printing 2.
    When i run this program on Solaris 10, its printing 1 and 2 without waiting for 60 seconds.
    When i tried to print tv_usec, its printing as 0 in solaris 9 and some garbage values in solaris 10.
    I think because of that the above select function is not working properly in solaris 10.
    Why the tv_usec is not taking 0 as default values in Solaris 10?
    We are using our legacy code for past 20 years. So, before going to do any changes we are trying to find why this happenig like this.
    Thanks a lot.
    Regards,
    Srikanth.

    haisrig wrote:
    Hi ,
    We are facing an issue with select() in Solaris 10. we had written a sample program to this issue.
    Program name :- sel.cpp
    int main()
    struct timeval sleeptime;
    sleeptime.tv_sec = 60;
    printf("1\n");
    select(0,NULL,NULL,NULL,&sleeptime);
    printf("2");
    return 0;
    When i run this program in Solaris 9, its printing 1 and after one minute its printing 2.
    When i run this program on Solaris 10, its printing 1 and 2 without waiting for 60 seconds.
    When i tried to print tv_usec, its printing as 0 in solaris 9 and some garbage values in solaris 10.
    I think because of that the above select function is not working properly in solaris 10.
    Why the tv_usec is not taking 0 as default values in Solaris 10?
    We are using our legacy code for past 20 years. So, before going to do any changes we are trying to find why this happenig like this.Hi
    It sounds to me that you've been lucky for 20 years then.
    Local POD variables on the stack that aren't explicitly initialized can contain any value. Here's what I see in your app with dbx
    (dbx) run
    Running: sel
    stopped in main at line 9 in file "sel.cpp"
        9      sleeptime.tv_sec = 60;
    (dbx) print sleeptime
    sleeptime = {
        tv_sec  = -4198732
        tv_usec = 0
    }That's on a Solaris 10 SPARC machine. If I try it on a Solaris 10 x86 box then I get
    (dbx) print sleeptime
    sleeptime = {
    tv_sec = -830490588
    tv_usec = 134510556
    and I see the behaviour that you describe.
    Paul

  • Temporary Table In SAP Query - Does not Work?

    DECLARE @date DATE
    DECLARE @delrows INT
    DECLARE @delquan INT
    DECLARE @a INT
    DECLARE @recrows INT
    DECLARE @recquan INT
    SET @a=0
    IF OBJECT_ID('tempdb..##tab) IS NOT NULL DROP TABLE ##tab
    CREATE TABLE ##tab
    [Date] date,
    [Delivery Rows] varchar(40),
    [Delivery Total Units] varchar(40),
    [Receipts Rows] varchar(40),
    [Receipts Total Units] varchar(40),
    WHILE @a!=7
         BEGIN
         SET @date=DATEADD(day,-@a, getdate())
         SELECT @delrows=ISNULL(COUNT(DLN1.[LineNum]),0), @delquan=ISNULL(SUM(DLN1.[Quantity]),0)
         FROM ODLN
         INNER JOIN DLN1 ON ODLN.[DocEntry]=DLN1.[DocEntry]
         WHERE ODLN.[CreateDate] = @date
         SELECT @recrows=ISNULL(COUNT(PCH1.[LineNum]),0) , @recquan=ISNULL(SUM(PCH1.[Quantity]),0)
         FROM OPCH
         INNER JOIN PCH1 ON OPCH.[DocEntry]=PCH1.[DocEntry]
         WHERE OPCH.[DocDate]=@date
         SET @a=@a+1
              INSERT INTO ##tab VALUES(@date,@delrows,@delquan,@recrows,@recquan)
    END
    SELECT * FROM ##tab
    {/code}
    Can anyone explain why this query does not work in SAP? It works fine on SQL but gives me this message in SAP:
    1). [Microsoft][SQL Server Native Client 10.0][SQL Server]Incorrect syntax near ')'.
    2). [Microsoft][SQL Server Native Client 10.0][SQL Server]Statement 'Service Contracts' (OCTR) (s) could not be prepared.
    Edited by: Chris Candido on Feb 2, 2011 8:38 PM

    Chris,
    There are several areas in your code which needed changes. 
    1. On the field name for your temp table you had spaces.
    2. The SAP table name ODLN, OPCH, PCH1 had to be fully referenced like
    [dbo].[ODLN]
    3. You really need not have ## in front of your temp table, it could just be #
    The select at the end is actually what causes the most problem as for some reason from within SAP it does not produce the result.  I would suggest you put the whole code into a Stored Procedure and call the SP from SAP.  Corrected SQL below.  If you remove the Select line at the end the query would work with in SAP, but keep it give give you an error. SP is the best option for this.
    DECLARE @date DATE
    DECLARE @delrows INT
    DECLARE @delquan INT
    DECLARE @a INT
    DECLARE @recrows INT
    DECLARE @recquan INT
    SET @a=0
    IF object_id('tempdb..#tab') IS NOT NULL
    BEGIN
       DROP TABLE #tab
    END
    CREATE TABLE #tab
    [Date] date,
    DeliveryRows varchar(40),
    DeliveryTotalUnits varchar(40),
    ReceiptsRows varchar(40),
    ReceiptsTotalUnits varchar(40),
    WHILE @a!=7
    BEGIN
    SET @date=DATEADD(day,-@a, getdate())
    SELECT @delrows=ISNULL(COUNT(DLN1.LineNum),0), @delquan=ISNULL(SUM(DLN1.Quantity),0)
    FROM [dbo].[ODLN]
    INNER JOIN DLN1 ON [dbo].[ODLN].DocEntry=DLN1.DocEntry
    WHERE [dbo].[ODLN].CreateDate = @date
    SELECT @recrows=ISNULL(COUNT([dbo].[PCH1].LineNum),0) , @recquan=ISNULL(SUM([dbo].[PCH1].Quantity),0)
    FROM [dbo].[OPCH]
    INNER JOIN [dbo].[PCH1] ON [dbo].[OPCH].DocEntry=[dbo].[PCH1].DocEntry
    WHERE [dbo].[OPCH].DocDate=@date
    SET @a=@a+1
    INSERT INTO #tab VALUES(@date,@delrows,@delquan,@recrows,@recquan)
    END
    SELECT * FROM #tab
    Suda Sampath

  • Query is not working correctly

    Hi all,
    Below query is not working correctly. Please let me know, if you find the mistake
    select
    a.name,
    b.VOD_NAME,
    count(xm.ATTRIB_03)
    from
    siebel.s_vod b
    left outer join ISS_OBJ_DEF c on b.OBJECT_NUM=c.PAR_VOD_ID
    left outer join vod d on c.VOD_ID=d.row_id
    left outer join PROD_INT a on d.OBJECT_NUM=a.CFG_MODEL_ID
    left outer join PROD_INT_XM xm on a.row_id=xm.PAR_ROW_ID
    where
    b.VOD_TYPE_CD='CLASS_DEF'
    and
    c.LAST_VERS = 0
    and
    b.vod_name='Componentes'
    group by a.name,b.vod_name having count(xm.ATTRIB_03) >=5

    user9522927 wrote:
    Hi all,
    Below query is not working correctly. Please let me know, if you find the mistake
    select
    a.name,
    b.VOD_NAME,
    count(xm.ATTRIB_03)
    from
    siebel.s_vod b
    left outer join ISS_OBJ_DEF c on b.OBJECT_NUM=c.PAR_VOD_ID
    left outer join vod d on c.VOD_ID=d.row_id
    left outer join PROD_INT a on d.OBJECT_NUM=a.CFG_MODEL_ID
    left outer join PROD_INT_XM xm on a.row_id=xm.PAR_ROW_ID
    where
    b.VOD_TYPE_CD='CLASS_DEF'
    and
    c.LAST_VERS = 0
    and
    b.vod_name='Componentes'
    group by a.name,b.vod_name having count(xm.ATTRIB_03) >=5I couldn't see through the internet what happend when you ran said query. How about helping us out by showing us the evidence that it "is not working correctly".
    "Here's a picture of my car sitting in the driveway. Why won't it start?"

  • SELECT DISTINCT does not work - Another Problem!

    Dear All
    Previous Post
    I just posted a thread, which has been answered by an expert. It's here:
    SELECT DISTINCT does not work. Why?
    My original problem was that the Query returned duplicate records, and SELECT DISTINCT did not work.
    The solution was to change this select:
    T0.[U_SupInv]      AS 'Link'
    ... to this:
    CAST(T0.[U_SupInv] as nvarchar(100))      AS 'Link'
    The amended Query worked.
    New Problem
    I just discovered that resolving the problem created a new one.
    The field U_SupInv (Link) is in fact a UDF.
    I created it so that all Suppliers' Invoices could be Scanned to pdf files, and these pdf could be linked
    to the respective AP Invoice.
    Originally, when I clicked 'Link' in my Query results, the pdf scan pops up.
    When the Query is amended by adding CAST, the link becomes dead.
    Help
    Could anyone tell me how I can make SELECT DISTINCT work, as well keeping the LINKS live?
    The main purpose of my Query is to help users view the pdf scans by clicking on the links.
    Thanks
    Leon Lai
    Here's my Original Query
    SELECT
    T0.[UpdateDate] AS 'Update Dt',
    T0.[TaxDate] AS 'Doc Dt',
    CASE T5.[TransType]
         WHEN '18' THEN 'PU ' + CONVERT(VARCHAR(6), T0.[DocNum])
         WHEN '19' THEN 'PC ' + CONVERT(VARCHAR(6), T0.[DocNum])
    END 'SAP Ref.',
    T1.[ImportLog]     AS 'Ship #',
    T0.[CardCode] + '' AS 'Supplier #',
    T0.[CardName]      AS 'Supplier Name',
    T0.[DocTotal]      AS 'Rs',
    T1.[BlockNum]      AS 'Reqn #',
    T0.[DocNum]        AS 'Doc No',
    T0.[U_SupInv]      AS 'Link'
    FROM klship.[dbo].[OPCH] T0
    INNER JOIN klship.[dbo].[PCH1] T1 ON T0.[DocEntry] = T1.[DocEntry]
    INNER JOIN klship.[dbo].[OJDT] T5 ON T0.[TransID] = T5.[TransID]
    WHERE
    (T0.[UpdateDate] >= '[%2]' AND
    T0.[UpdateDate]  <= '[%3]' AND
    T0.[U_SupInv] IS NULL)
    OR
    (T0.[UpdateDate] >= '[%4]' AND
    T0.[UpdateDate]  <= '[%5]' AND
    T0.[U_SupInv] IS NOT NULL)
    FOR BROWSE

    Dear István Korös,
    Thanks a lot for your answer.
    I will test your suggestion tomorrow, as it's night and I am returning home now.
    However, I do not think it will suit my requirements for the foll reasons:
    - I worked hard to get rid of the need to enter anything in the @Scan2 field.
    - This UDF was created solely as a text of instruction for my staff.
       Unfortunately I had to fill in something to make the Query work.
    - The problem is that if the user forgets to click the drop-down arrow and leaves @Scan2
       blank, the query does not work.
    - With the help of another expert, I succeeded in ignoring @Scan2 altogether.
    - I posted only a simplified version of my Query on the forum, without the codes relating to eliminating the
      need to enter something in @Scan2, so you may not be aware of my requirement.
    - I hope you understand my reluctance. But I will try your suggestion nevertheless.
    My Suggestion
    I think using PCH1.VISORDER may be the solution.
    If we select only those rows where visorder = 0, then
       - there will be no duplication
       - I need not use SELECT DISTINCT
       - All my LINKS to pdf files will be live because I need not use CAST
       - I may retain that part of my Query which permits ignoring @Scan2 altogether.
    - A Dream!-
    The problem is that I don't know how and where  to place that VISORDER.
    If you think I may be right, could you help me along that line?
    Best Regards
    Leon Lai

  • Bex Query is not working in portal

    Dear Experts,
    i have uploaded BI master role into portal, By default Bex Queries are assgined to Master Role. when I clcik on preview for particular Bex Query, it's working fine. but after assigning the master role to end user, that same Bex Query is not working. it's showing Below error..
    Portal runtime error.
    An exception occurred while processing your request. Send the exception ID to your portal administrator.
    Exception ID: 05:22_18/08/10_0002_7116150
    Refer to the log file for details about this exception.
    please give me suggetions...
    Regards,
    VENU

    Hi Venu ,
    Can you please check the logs for details -  http(s):<host>:<port>/nwa . This may be a permissions issue . Check if the iview has read permission for everyone group and then test . Also post the error details here .
    Regards
    Mayank

  • Extension in Select-Options is not working

    Hi,
    The extension of select-options is not working for the following statement........
    SELECTION-SCREEN: BEGIN OF BLOCK sel WITH FRAME TITLE text-001.
    SELECT-OPTIONS: s_tp_no FOR e070-trkorr.
    SELECTION-SCREEN: END OF BLOCK sel.
    Please Help.......
    Thanks,
    Sheel

    SELECTION-SCREEN: BEGIN OF BLOCK sel WITH FRAME TITLE text-001.
    SELECTION-SCREEN: END OF BLOCK sel.
    Remove the colan ':' from ur code after SELECTION-SCREEN
    write it as
    SELECTION-SCREEN BEGIN OF BLOCK sel WITH FRAME TITLE text-001.
    SELECTION-SCREEN END OF BLOCK sel.

Maybe you are looking for

  • Choppy iPhone video playback after upgrading to 10.5 + QuickTime 7.6.9

    Hi, I recently upgraded from 10.4 to 10.5 on my Powerbook G4. I used the "Archive and Install" option. After updating all software to the latest (10.5.8 OSX + 7.6.9 QuickTime), I noticed that the playback of the videos shot with my iPhone 3GS becomes

  • Purchase order total value

    Hi all! Is there any table or any function module which gives the total value of the purchase order inclusive of all the taxes and conditions?

  • Problem with Revision level for a Material

    Hi All, I have a problem with Revision Levels for a Material. I want to know the Revision Level for a particular Material for BOM Creation. Can anyone please let me know from which Table or Funtion Module can I get the Rev Level, once I pass MATNR (M

  • IPhoto Not Deleting iPhone Camera Pictures

    When I connect my iPhone to my Mac, iPhoto launches and offers to import the pictures for me. (I want this behavior). It then asks what to do with duplicates, and I tell it don't import duplicates. After the photos have been imported, it offers to de

  • Distributed objects on a LAN

    I want to write an application that uses distributed objects over a Local Area Network, but the problem is that when a client makes an NSConnection to the server, the host argument has to be a registered internet domain name, which i don't have on my