Please optimize the below code!!!!urgent

friends,
i know that cluster tables cannot be joined with transparent tables....
however i need performance improvement for the following code....
if possible is there a way to join bkpf or bseg to improve performance....can we create view foe bkpf and bseg if yes then how.....
please modify the below code for improvement in performance.
START-OF-SELECTION.
SELECT bukrs belnr gjahr budat FROM bkpf INTO TABLE i_bkpf
WHERE bukrs = p_bukrs AND "COMPANY CODE
gjahr = p_gjahr AND "FISCAL YEAR
budat IN s_budat. "POSTING DATE IN DOC
IF sy-subrc = 0.
SELECT bukrs belnr gjahr hkont shkzg dmbtr FROM bseg INTO TABLE
i_bseg FOR ALL ENTRIES IN i_bkpf
WHERE bukrs = i_bkpf-bukrs AND "COMPANY CODE
belnr = i_bkpf-belnr AND "A/CING DOC NO
gjahr = i_bkpf-gjahr AND "FISCAL YEAR
hkont = p_hkont. "General Ledger Account"
IF sy-subrc = 0.
SELECT bukrs belnr gjahr hkont shkzg dmbtr FROM bseg INTO TABLE
i_bseg1 FOR ALL ENTRIES IN i_bseg
WHERE bukrs = i_bseg-bukrs AND "COMPANY CODE
belnr = i_bseg-belnr AND "A/CING DOC NO
gjahr = i_bseg-gjahr. "FISCAL YEAR
ENDIF.
ENDIF.
IF NOT i_bseg1[] IS INITIAL.
LOOP AT i_bseg1.
IF i_bseg1-hkont = p_hkont AND i_bseg1-shkzg = 'S'.
v_sumgl = v_sumgl + i_bseg1-dmbtr.
ELSEIF i_bseg1-hkont = p_hkont AND i_bseg1-shkzg = 'H'.
v_sumgl = v_sumgl - i_bseg1-dmbtr.
ELSEIF i_bseg1-hkont NE p_hkont .
IF i_bseg1-shkzg = 'H'.
i_bseg1-dmbtr = - i_bseg1-dmbtr.
ENDIF.
i_alv-hkont = i_bseg1-hkont.
i_alv-dmbtr = i_bseg1-dmbtr.
APPEND i_alv.
v_sumoffset = v_sumoffset + i_bseg1-dmbtr.
ENDIF.
ENDLOOP.
regards
Essam.([email protected])

Hi ,
<b>Pls use for all entries as below to join these two tables :</b>
For pool and cluster table you can create secondary index and you can use select distinct, group for pool and cluster table. You can use native SQL statement for pool and cluster table.
see the query for Bseg table :
example  :
*Code to demonstrate select command
*Code to demonstrate select into internal table command
TYPES: BEGIN OF t_bkpf,
*  include structure bkpf.
  bukrs LIKE bkpf-bukrs,
  belnr LIKE bkpf-belnr,
  gjahr LIKE bkpf-gjahr,
  bldat LIKE bkpf-bldat,
  monat LIKE bkpf-monat,
  budat LIKE bkpf-budat,
  xblnr LIKE bkpf-xblnr,
  awtyp LIKE bkpf-awtyp,
  awkey LIKE bkpf-awkey,
END OF t_bkpf.
DATA: it_bkpf TYPE STANDARD TABLE OF t_bkpf INITIAL SIZE 0,
      wa_bkpf TYPE t_bkpf.
TYPES: BEGIN OF t_bseg,
*include structure bseg.
  bukrs     LIKE bseg-bukrs,
  belnr     LIKE bseg-belnr,
  gjahr     LIKE bseg-gjahr,
  buzei     LIKE bseg-buzei,
  mwskz     LIKE bseg-mwskz,         "Tax code
  umsks     LIKE bseg-umsks,         "Special G/L transaction type
  prctr     LIKE bseg-prctr,         "Profit Centre
  hkont     LIKE bseg-hkont,         "G/L account
  xauto     LIKE bseg-xauto,
  koart     LIKE bseg-koart,
  dmbtr     LIKE bseg-dmbtr,
  mwart     LIKE bseg-mwart,
  hwbas     LIKE bseg-hwbas,
  aufnr     LIKE bseg-aufnr,
  projk     LIKE bseg-projk,
  shkzg     LIKE bseg-shkzg,
  kokrs     LIKE bseg-kokrs,
END OF t_bseg.
DATA: it_bseg TYPE STANDARD TABLE OF t_bseg INITIAL SIZE 0,
      wa_bseg TYPE t_bseg.
*Select FOR ALL ENTRIES command
SELECT bukrs belnr gjahr bldat monat budat xblnr awtyp awkey
  UP TO 100 ROWS
  FROM bkpf
  INTO TABLE it_bkpf.
IF sy-subrc EQ 0.
* The FOR ALL ENTRIES comand only retrieves data which matches
* entries within a particular internal table.
  SELECT bukrs belnr gjahr buzei mwskz umsks prctr hkont xauto koart
         dmbtr mwart hwbas aufnr projk shkzg kokrs
    FROM bseg
    INTO TABLE it_bseg
    FOR ALL ENTRIES IN it_bkpf
    WHERE bukrs EQ it_bkpf-bukrs AND
          belnr EQ it_bkpf-belnr AND
          gjahr EQ it_bkpf-gjahr.
ENDIF.
<b>Pls reward pts if found usefull :)</b>
regards
Sathish

Similar Messages

  • Please check the below Cursor Procedure and correct that code Please

    Hai Every One.
    Please check the below code I have two issues in that code
    1. Invalid cursor
    2. Record must be enter
    Please correct this code and send me pls its urgent.I cont understand where i done mistake
    PROCEDURE fetch_detail_PROC IS
    cursor c1 is select * from quota_mast where quota_mast.divn=:quota_mast.divn and quota_mast.QUOT_tyPE=:quota_mast.QUOT_tyPE and quota_mast.INQNO=:quota_mast.INQNO;
    cursor c6 is select * from quota_det
    where quota_det.divn=:quota_mast.divn AND quota_det.QUOT_TYPE=:quota_mast.QUOT_tyPE and quota_det.enq_num=:quota_mast.INQNO
    ORDER BY quota_det.quot_no;
    --cursor c5 is select * from acc_mst where cdp=:quota_mast.ccdp and divn=:quota_mast.divn;
    --vn acc_mst%rowtype;
    i quota_mast%rowtype;
    detail1 quota_det%rowtype;
    BEGIN
         GO_BLOCK('quota_mast');
    for i in c1 LOOP
              :quota_mast.INQNO:=i.INQNO;
                        :quota_mast.DIVN:=i.DIVN;
                   :quota_mast.QUOT_NO:=i.QUOT_NO;
                        :quota_mast.quot_type:=i.quot_type;
                        :quota_mast.CCDP:=i.CCDP;
                        select nm into :QUOTA_MAST.PARTY_NAME from acc_mst where acc_mst.DIVN=:QUOTA_MAST.DIVN AND acc_mst.cdp=:ccdp;
                        :quota_mast.pak_for:=i.pack_for_PER;
                        :quota_mast.exc_duty:=i.exc_duty_PER;
                        :quota_mast.vat:=i.vat_PER;
                        :quota_mast.cst:=i.cst_PER;
                        :quota_mast.wct:=i.wct_PER;
                        :quota_mast.ser_tax:=i.ser_tax_PER;
                        :quota_mast.insu:=i.insu_PER;
                        :quota_mast.tot_tax:=i.tot_tax;
                        :quota_mast.tot_val:=i.tot_val;
                   :quota_mast.value:=i.value;
                                  next_record;
    end loop;
         first_record;
    GO_BLOCK('quota_det');
                   for detail1 in c6
              loop
                        :quota_det.quot_no:=detail1.quot_no;
              :quota_det.ENQ_NUM:=detail1.enq_num;
              :quota_det.item_code:=detail1.item_code;
              SELECT ITNM into :NM FROM itm_MST WHERE DIVN=:quota_mast.DIVN AND iCDP=:ITEM_CODE;
              :quota_det.price:=detail1.price;
              :quota_det.qty:=detail1.qty;
              :quota_det.DISC_PER:=detail1.DISC_PER;
                   next_record;
    END LOOP;
         first_record;
    close c6;
    --close c1;
    exception
    when others then
    message(sqlerrm);
    message(' ');
    END;
    Thank you..

    Oracle Forms is closely tied to the database meaning you can base your data blocks on your tables and Forms will handle fetching the data. I agree with Christian, your tables lend themselves to using a master - detail configuration and if you need to filter your block then you can use the Data Block WHERE Clause property.
    Please correct this code and send me pls its urgent.As to the urgency of your request, the forum is a community of "Volunteers." Enough said.
    Regarding your code, I see a several potential problems.
    First, how are your QUOTA_MAST and QUOTA_DET blocks synchronized? Are you using a block relationship? Are you using a combination of triggers to synchonize the QUOTA_DET block when you user navigates to a different record in the QUOTA_MAST block?
    Second, your Procedure name is "Fetch_Detail_Proc" but you are also fetching Master data as well. What is the purpose of your procedure and where do you call this procedure?
    Third, you're using SELECT * in your cursor queries. You should always explicitly name each column. What happens when your table changes and you need to search your code for a column that was dropped?
    Fourth, your cursor queries are referencing the same data blocks you are fetching data to populate. This gives the impression that you already have data in your block. This doesn't make sense - could you explain what you are trying to accomplish?
    Fifth, with respects to your code, the "Invalid Cursor" error (is this really the error you're getting?) is most likely caused by your explicit call to close the C1 cursor. As Andreas stated, when using a CURSOR FOR LOOP, the cursor is automatically opened, fetched and closed using this construct. There is no need to explicitly close the cursor, in fact - doing so will result in an invalid cursor error.
    As to the "Record must be entered" error, is sounds like you have required items in your block or your QUOTA_MAST block is not synchronized with your QUOTA_DET block, so when you attempt to navigate to a different block or record within your the same block the navigation cursor can't move because you haven't entered data that is required.
    Please tell us what you are attempting to do with this code so we can tell you if you are using the correct method.
    Craig...

  • SQL command IN is working , but NOT IN is not working for the below code...

    In application code I have the below code.
    IF v_service_variant NOT IN(0,1,2,3,4) THEN --Checking whether existing service variant is applicable in 21Cn Fibre.
    v_service_variant := 3; --If not making it as a standard service
    UPDATE sspt_sessions_table SET service_variant = v_service_variant WHERE sess_id=v_sess_id; --Updating sspt_sessions_table
    SELECT DECODE(service_variant_id, 0, 'None', 1, 'Loadbalancing', 2, 'Failover',3, 'BGP4', 4, 'Backup') INTO l_service_variant --To get the service variant name
    FROM sspt_maj_resilience WHERE service_variant_id=v_service_variant;
    UPDATE sspt_prquote_details SET service_variant = l_service_variant WHERE ftip=l_ftip AND sess_id=v_sess_id; --Updating sspt_prquote_details
    COMMIT;
    END IF;
    Then the statements inside the if condition are not being executed. At the same time if I am replacing NOT IN with IN only and making changes to get if condition true then it is going inside the IF condition.... Could anyone please help me on this

    950474 wrote:
    In application code I have the below code.
    IF v_service_variant NOT IN(0,1,2,3,4) THEN --Checking whether existing service variant is applicable in 21Cn Fibre.
    v_service_variant := 3; --If not making it as a standard service
    UPDATE sspt_sessions_table SET service_variant = v_service_variant WHERE sess_id=v_sess_id; --Updating sspt_sessions_table
    SELECT DECODE(service_variant_id, 0, 'None', 1, 'Loadbalancing', 2, 'Failover',3, 'BGP4', 4, 'Backup') INTO l_service_variant --To get the service variant name
    FROM sspt_maj_resilience WHERE service_variant_id=v_service_variant;
    UPDATE sspt_prquote_details SET service_variant = l_service_variant WHERE ftip=l_ftip AND sess_id=v_sess_id; --Updating sspt_prquote_details
    COMMIT;
    END IF;
    Then the statements inside the if condition are not being executed. At the same time if I am replacing NOT IN with IN only and making changes to get if condition true then it is going inside the IF condition.... Could anyone please help me on thishow can we reproduce what you report?
    while "not working" may be 100%, it is also 100% devoid of any actionable detail.
    what results when it is not working?
    how would working results supposedly appear?
    How do I ask a question on the forums?
    SQL and PL/SQL FAQ

  • How can i write the below code using "For all entries"

    Hi
    How can we write the below code using "for all entries" and need to avoid joins...
    Please help
    SELECT aaufnr aobjnr aauart atxjcd a~pspel
    agstrp awerks carbpl cwerks
    INTO TABLE t_caufv
    FROM caufv AS a
    INNER JOIN afih AS b
    ON aaufnr = baufnr
    INNER JOIN crhd AS c
    ON bgewrk = cobjid
    AND c~objty = 'D'
    WHERE ( a~pspel = space
    OR a~txjcd = space
    OR NOT a~objnr IN
    ( select OBJNR from COBRB AS e
    WHERE objnr = a~objnr ) )
    AND a~werks IN s_plant
    AND a~auart IN s_wtype
    AND NOT a~objnr IN
    ( select OBJNR from JEST AS d
    WHERE objnr = a~objnr
    AND ( dstat = 'A0081'OR dstat = 'A0018' )
    AND d~inact 'X' ).
    Reward points for all helpfull answers
    Thanks
    Ammi.

    Hi,
    SELECT objnr objid aufnr
            from afih
            into table t_afih.
    SELECT objnr
            from JEST
            into table t_JEST
            where stat = 'A0045'
               OR stat = 'A0046'
               AND inact 'X'.
    SELECT objnr
            from COBRB
            into table t_cobrb.
    SELECT arbpl werks objid objty
          from crhd
          INTO table it_crhd
          FOR ALL ENTRIES IN it_afih
          WHERE objty eq 'D'
          AND gewrk = it_afih-objid.
    SELECT aufnr objnr auart txjcd pspel gstrp werks aufnr
            FROM caufv
            INTO table t_caufv
            FOR ALL ENTRIES IN it_afih
            WHERE aufnr = it_afih-aufnr
              And pspel = ' '
              AND txjcd = ' '
             ANd objnr ne it_crhd-objnr
              AND auart in s_wtype
              AND werks in s_plant.
             AND objnr ne it_jest-objnr.
    dont use NE in the select statements, it may effect performance also. Instead use if statements inside
    loops.
    loop at t_caufv.
    read table it_chrd............
      if t_caufv-objnr ne it_chrd-objnr.
      read table it_jest..........
       if   if t_caufv-objnr ne it_jest-objnr.
        (proceed further).
       endif.
      endif.
    endloop.
    hope this helps.
    Reward if useful.
    Regards,
    Anu

  • Required clarification for the below code:

    Hi All,
    For one of my requiremnet, i found one solution which worked as expected.. But i was not able to understand the logic.. Can any one explain me the below
    syntax what exactly the meaning for the below code:
    Code:
    SELECT NULL
    FROM apex_application_page_ir_cond cond
    WHERE cond.application_id = v('APP_ID')
    AND cond.page_id = v('APP_PAGE_ID')
    AND cond.condition_type = 'Filter'
    AND cond.condition_enabled = 'Yes'
    AND cond.report_id = (SELECT report_id
    FROM apex_application_page_ir_rpt
    WHERE application_id = v('APP_ID')
    AND page_id = v('APP_PAGE_ID')
    AND application_user = v('APP_USER')
    AND report_type = 'SESSION'
    AND TO_CHAR (session_id) = v('SESSION')
    AND report_name IS NULL))
    For your refernec i have enclosed the link also
    URL : Re: Interactive_Report with Search Bar only
    Thanks,
    Anoo..

    Anoo,
    Two things. First, it makes things a lot easier if you put "&#123;code}" (no quotes) around your SQL when you post it:
    SELECT rowid "EDIT", attr_code,ATTR_ATCL_CODE "Atcl Code", attr_description, attr_atcl_code,
                    attr_abbreviation,
                    attr_include_short_desc "Include short desc",
                    attr_include_long_desc "Include long desc",
                    attr_attr_type "AttrType", rowid "DELETE"
               FROM t_new WHERE EXISTS (SELECT 1 FROM APEX_APPLICATION_PAGE_IR_COND WHERE APPLICATION_ID = :APP_ID AND PAGE_ID = :APP_PAGE_ID AND CONDITION_ENABLED = 'Yes'
    AND APPLICATION_USER = :APP_USER) ORDER BY attr_description;Though the spacing still needs work, it's a little easier to read.
    Second, your query's exist clause just checks for an enabled condition, without checking the condition type. Without checking, I'd guess that either APEX creates at least one internal condition, or that your IR has a default condition on it (other than a filter). Try adding the condition_type constraint to your where clause to see if that fixes it.
    Also, I noted that you don't have the extra code for getting the report_id. It shouldn't be necessary, since there's currently only support for one IR per page, but you asked what the differences are.
    -David

  • Performance for the below code

    Can any one help me in improving the performance for the below code.
    FORM RETRIEVE_DATA .
    CLEAR WA_TERRINFO.
    CLEAR WA_KNA1.
    CLEAR WA_ADRC.
    CLEAR SORT2.
    *To retrieve the territory information from ZPSDSALREP
    SELECT ZZTERRMG
           ZZSALESREP
           NAME1
           ZREP_PROFILE
           ZTEAM
         INTO TABLE GT_TERRINFO
         FROM ZPSDSALREP.
    *Preparing Corporate ID from KNA1 & ADRC and storing it in SORT2 field
    LOOP AT GT_TERRINFO INTO WA_TERRINFO.
      SELECT SINGLE * FROM KNA1 INTO WA_KNA1
                      WHERE KUNNR = WA_TERRINFO-SALESREP.
      SELECT SINGLE * FROM ADRC INTO WA_ADRC
                      WHERE ADDRNUMBER = WA_KNA1-ADRNR.
      IF NOT WA_ADRC-SORT2 IS INITIAL.
      CONCATENATE 'U' WA_ADRC-SORT2 INTO SORT2.
      MOVE SORT2 TO WA_TERRINFO-SORT2.
    MODIFY GT_TERRINFO1 FROM WA_TERRINFO.
      APPEND WA_TERRINFO TO GT_TERRINFO1.
      CLEAR WA_TERRINFO.
      ENDIF.
      CLEAR WA_KNA1.
      CLEAR WA_ADRC.
    ENDLOOP.
    ENDFORM.                    " RETRIEVE_DATA

    Hi
    The code is easy so I don't think you can do nothing, only u can try to limit the reading of KNA1:
    FORM RETRIEVE_DATA .
      CLEAR WA_TERRINFO.
      CLEAR WA_KNA1.
      CLEAR WA_ADRC.
      CLEAR SORT2.
    *To retrieve the territory information from ZPSDSALREP
      SELECT ZZTERRMG
      ZZSALESREP
      NAME1
      ZREP_PROFILE
      ZTEAM
      INTO TABLE GT_TERRINFO
      FROM ZPSDSALREP.
      SORT GT_TERRINFO BY SALESREP.
    *Preparing Corporate ID from KNA1 & ADRC and storing it in SORT2 field
      LOOP AT GT_TERRINFO INTO WA_TERRINFO.
        IF KNA1-KUNNR <> WA_KNA1-KUNNR.
          SELECT SINGLE * FROM KNA1 INTO WA_KNA1
               WHERE KUNNR = WA_TERRINFO-SALESREP.
          IF SY-SUBRC <> 0.
            CLEAR: WA_KNA1, WA_ADRC.
          ELSE.
            SELECT SINGLE * FROM ADRC INTO WA_ADRC
                                     WHERE ADDRNUMBER = WA_KNA1-ADRNR.
            IF SY-SUBRC <> 0. WA_ADRC. ENDIF.
          ENDIF.
        ENDIF.
        IF NOT WA_ADRC-SORT2 IS INITIAL.
          CONCATENATE 'U' WA_ADRC-SORT2 INTO SORT2.
          MOVE SORT2 TO WA_TERRINFO-SORT2.
    * MODIFY GT_TERRINFO1 FROM WA_TERRINFO.
          APPEND WA_TERRINFO TO GT_TERRINFO1.
          CLEAR WA_TERRINFO.
        ENDIF.
      ENDLOOP.
    ENDFORM. " RETRIEVE_DATA
    If program takes many times to upload the data from ZPSDSALREP, you can try to split in sevaral packages:
    SELECT ZZTERRMG ZZSALESREP NAME1 ZREP_PROFILE ZTEAM
      INTO TABLE GT_TERRINFO PACKAGE SIZE <...>
      FROM ZPSDSALREP.
      SORT GT_TERRINFO BY SALESREP.
    *Preparing Corporate ID from KNA1 & ADRC and storing it in SORT2 field
      LOOP AT GT_TERRINFO INTO WA_TERRINFO.
        IF KNA1-KUNNR <> WA_KNA1-KUNNR.
          SELECT SINGLE * FROM KNA1 INTO WA_KNA1
               WHERE KUNNR = WA_TERRINFO-SALESREP.
          IF SY-SUBRC <> 0.
            CLEAR: WA_KNA1, WA_ADRC.
          ELSE.
            SELECT SINGLE * FROM ADRC INTO WA_ADRC
                                     WHERE ADDRNUMBER = WA_KNA1-ADRNR.
            IF SY-SUBRC <> 0. WA_ADRC. ENDIF.
          ENDIF.
        ENDIF.
        IF NOT WA_ADRC-SORT2 IS INITIAL.
          CONCATENATE 'U' WA_ADRC-SORT2 INTO SORT2.
          MOVE SORT2 TO WA_TERRINFO-SORT2.
    * MODIFY GT_TERRINFO1 FROM WA_TERRINFO.
          APPEND WA_TERRINFO TO GT_TERRINFO1.
          CLEAR WA_TERRINFO.
        ENDIF.
      ENDLOOP.
    ENDSELECT.
    Max

  • Exact fetch returns more than requested number of rows oracle error ; unable to find where exactly throwing error in the below code.

    hi i am receiving "exact fetch returns more than requested number of rows oracle error". but i am not able to locate the error in the below code. Any help would be appreciated!!!
    CREATE OR REPLACE PROCEDURE load_scene_collection_item (
    --pdname                                  VARCHAR2,
    -- LOCATION TO ADD/CHANGE below!!!
    pITEM_TYPE_ID                      INTEGER,
    pSCENE_COLLECTION_ID        INTEGER,
    pCOLLECTION_ITEM_NAME     VARCHAR2,
    pCOLLECTION_ITEM_DESC      VARCHAR2,
    pDEFAULT_COORD_X      NUMBER,
    pDEFAULT_COORD_Y      NUMBER,
    pDEFAULT_COORD_Z      NUMBER,
    pDEFAULT_WIDTH            NUMBER,
    pDEFAULT_HEIGHT            NUMBER,
    pDEFAULT_ROTATION      INTEGER,
    pDEFAULT_ALPHA            INTEGER,
    pfname                                 VARCHAR2)    IS
    src_file BFILE;
    dst_file BLOB;
    lgh_file BINARY_INTEGER;
    BEGIN
    src_file := bfilename('BUSINESSBLOBSIMAGES', pfname);
    -- insert a NULL record to lock
    Insert into SCENE_COLLECTION_ITEM
       ( ITEM_TYPE_ID,
       SCENE_COLLECTION_ID,
       COLLECTION_ITEM_NAME,
       COLLECTION_ITEM_DESC,
        COLLECTION_ITEM_IMAGE,
       DEFAULT_COORD_X,
       DEFAULT_COORD_Y,
       DEFAULT_COORD_Z,
       DEFAULT_WIDTH,
       DEFAULT_HEIGHT,
       DEFAULT_ROTATION,
       DEFAULT_ALPHA,
        CREATE_USER,
        CREATE_DATE)
    Values    ( pITEM_TYPE_ID, pSCENE_COLLECTION_ID, pCOLLECTION_ITEM_NAME, pCOLLECTION_ITEM_DESC, EMPTY_BLOB(),   
       pDEFAULT_COORD_X,
       pDEFAULT_COORD_Y,
       pDEFAULT_COORD_Z,
       pDEFAULT_WIDTH,
       pDEFAULT_HEIGHT,
       pDEFAULT_ROTATION,
       pDEFAULT_ALPHA,  
    sys_context('USERENV', 'OS_USER'), 
    sys_extract_utc(systimestamp))
    RETURNING COLLECTION_ITEM_IMAGE INTO dst_file;
    -- LOCATIONs(2) TO ADD/CHANGE above!!!
    -- lock record
    SELECT COLLECTION_ITEM_IMAGE
    INTO dst_file
    FROM SCENE_COLLECTION_ITEM
    WHERE ITEM_TYPE_ID     = pITEM_TYPE_ID
    AND SCENE_COLLECTION_ID = pSCENE_COLLECTION_ID
    AND COLLECTION_ITEM_NAME= pCOLLECTION_ITEM_NAME
    AND COLLECTION_ITEM_DESC= pCOLLECTION_ITEM_DESC
    AND    pDEFAULT_COORD_X = DEFAULT_COORD_X
    AND   pDEFAULT_COORD_Y  = DEFAULT_COORD_Y
    AND   pDEFAULT_COORD_Z  = DEFAULT_COORD_Z
    AND   pDEFAULT_WIDTH    = DEFAULT_WIDTH
    AND   pDEFAULT_HEIGHT   = DEFAULT_HEIGHT
    AND   pDEFAULT_ROTATION = DEFAULT_ROTATION
    AND   pDEFAULT_ALPHA    = DEFAULT_ALPHA
    FOR UPDATE;
    -- LOCATION TO ADD/CHANGE above!!!
    -- open the file
    dbms_lob.fileopen(src_file, dbms_lob.file_readonly);
    -- determine length
    lgh_file := dbms_lob.getlength(src_file);
    -- read the file
    dbms_lob.loadfromfile(dst_file, src_file, lgh_file);
    -- update the blob field
    UPDATE SCENE_COLLECTION_ITEM
    SET COLLECTION_ITEM_IMAGE = dst_file
    WHERE ITEM_TYPE_ID     = pITEM_TYPE_ID
    AND SCENE_COLLECTION_ID = pSCENE_COLLECTION_ID
    AND COLLECTION_ITEM_NAME= pCOLLECTION_ITEM_NAME
    AND COLLECTION_ITEM_DESC= pCOLLECTION_ITEM_DESC
    AND    pDEFAULT_COORD_X = DEFAULT_COORD_X
    AND   pDEFAULT_COORD_Y  = DEFAULT_COORD_Y
    AND   pDEFAULT_COORD_Z  = DEFAULT_COORD_Z
    AND   pDEFAULT_WIDTH    = DEFAULT_WIDTH
    AND   pDEFAULT_HEIGHT   = DEFAULT_HEIGHT
    AND   pDEFAULT_ROTATION = DEFAULT_ROTATION
    AND   pDEFAULT_ALPHA    = DEFAULT_ALPHA
    -- LOCATION TO ADD/CHANGE above!!!
    -- close file
    dbms_lob.fileclose(src_file);
    END load_scene_collection_item;
    Thanks in advance!!!!

    Hi PaulHorth,
    Thanks for the quick reply.
    Actually, i am getting  error while updating the records.
    below is the error message:
    Error starting at line 1 in command:
    exec load_scene_collection_item(3,15,'2 Lane 4way Stop','4 Way Stop Intersection with 2 lanes in each direction',0,0,0,400,517,0,1,'2 Lane 4way Stop.PNG');
    Error report:
    ORA-01422: exact fetch returns more than requested number of rows
    ORA-06512: at "DP_OWNER.LOAD_SCENE_COLLECTION_ITEM", line 55
    ORA-06512: at line 1
    01422. 00000 - "exact fetch returns more than requested number of rows"
    *Cause:    The number specified in exact fetch is less than the rows returned.
    *Action:   Rewrite the query or change number of rows requested

  • Miro not posted, error "Please Enter the Section Code  Business Place"

    Hi all,
       When I tried to post a document in MIRO, I am getting the following error "Please Enter the Section Code  Business Place" only for the one particular document.
                    However Business place or Segments are not configured. Even purchase documents are getting posted in MIRO, except the above one. If any one have any suggestions let me know...
    Thanks & Regards,
      Balaji
      9080444242

    Hello,
    Business Place & Section code are required to be mentioned in MIRO document for TDS purpose. It could be either determined automatically through substitution rule or the field could be made mandatory through validation.
    Business Place is created for TAN registration that your company has, Section Code is created in line with the bUsiness Place.
    Section Code derives the Business Place.
    Hence its compulsory to mention Sec. Code & Business Place while posting the transactions for TDS.
    Regards,
    jaymin r. bhatt

  • Why cannot the below code find cookie?

    Hi,
    Please see the following code in the aspx.cs file:
    public bool IsShow()
    try
    string strAppFloatCnt = string.Empty;
    if (System.Web.HttpContext.Current.Request.Cookies["appFloatCnt"] != null)
    strAppFloatCnt = System.Web.HttpContext.Current.Request.Cookies["appFloatCnt"].Value;
    int appFloatCnt = 0;
    if (!string.IsNullOrEmpty(strAppFloatCnt))
    appFloatCnt = Convert.ToInt32(strAppFloatCnt);
    DateTime expires = DateTime.Now.AddDays(60);
    if (appFloatCnt < 5)
    if (System.Web.HttpContext.Current.Request.Cookies["appFloatCnt"] == null)
    HttpCookie cookie = new HttpCookie("appFloatCnt");
    cookie.Value = (appFloatCnt + 1).ToString();
    cookie.Expires = expires;
    System.Web.HttpContext.Current.Response.Cookies.Add(cookie);
    else
    System.Web.HttpContext.Current.Response.Cookies["appFloatCnt"].Value = (appFloatCnt + 1).ToString();
    System.Web.HttpContext.Current.Response.Cookies["appFloatCnt"].Expires = expires;
    return true;
    else { return false; }
    catch (System.Exception ex)
    return false;
    And then I called this method in the aspx file like the following way:
    <input type="hidden" id="hiddenIsShowAppFloat" value="<%=IsShow()%>" />
    Each time I refresh this page in Google Chrome, System.Web.HttpContext.Current.Request.Cookies["appFloatCnt"] always return NULL. Why?
    Where should I edit the above code so that System.Web.HttpContext.Current.Request.Cookies["appFloatCnt"] can return the correct value instead of always NULL?
    (I am using VS 2012. Operating system is Windows 7 Professional.)
    Please help to sort out this problem. Thank you.
    QQ

    Please use the ASP.NET forums for ASP.NET related questions:
    http://forums.asp.net

  • Help in the below code

    I want to run the below code for zone_id 1 to 12. How will I do that ?
    Kindly help me on this.
    DECLARE
      CURSOR c1 IS SELECT item FROM [email protected];
      CURSOR c2(tmp_item VARCHAR2) IS
        SELECT location FROM rpm_zone_location WHERE zone_id = 1
        MINUS
        SELECT DISTINCT location from rpm_clearance WHERE item = tmp_item AND reset_ind = 1 and location in
          (select location from rpm_zone_location where zone_id=1);
    BEGIN
      FOR i IN c1
      LOOP
        FOR j IN c2 (i.item)
        LOOP
          INSERT INTO RMS12.RPM_CLEARANCE
    (CLEARANCE_ID,
    CLEARANCE_DISPLAY_ID,
    STATE,
    REASON_CODE,
    LOC_EXCEPTION_PARENT_ID,
    PARENT_EXCEPTION_PARENT_ID,
    CLEARANCE_RESET_ID,
    RESET_IND,
    ITEM,
    DIFF_ID,
    ZONE_ID,
    LOCATION,
    ZONE_NODE_TYPE,
    EFFECTIVE_DATE,
    OUT_OF_STOCK_DATE,
    RESET_DATE,
    CHANGE_TYPE,
    CHANGE_AMOUNT,
    CHANGE_CURRENCY,
    CHANGE_PERCENT,
    CHANGE_SELLING_UOM,
    PRICE_GUIDE_ID,
    VENDOR_FUNDED_IND,
    FUNDING_TYPE,
    FUNDING_AMOUNT,
    FUNDING_AMOUNT_CURRENCY,
    FUNDING_PERCENT,
    SUPPLIER,
    DEAL_ID,
    DEAL_DETAIL_ID,
    PARTNER_TYPE,
    PARTNER_ID,
    CREATE_DATE,
    CREATE_ID,
    APPROVAL_DATE,
    APPROVAL_ID,
    LOCK_VERSION)
    SELECT
    RPM_CLEARANCE_SEQ.Nextval,
    'reset:'||CLEARANCE_DISPLAY_ID,
    'pricechange.state.approved',
    REASON_CODE,
    LOC_EXCEPTION_PARENT_ID,
    PARENT_EXCEPTION_PARENT_ID,
    CLEARANCE_RESET_ID,
    1,
    ITEM,
    DIFF_ID,
    null,
    c2.location,
    0,
    null,
    OUT_OF_STOCK_DATE,
    null,
    CHANGE_TYPE,
    CHANGE_AMOUNT,
    CHANGE_CURRENCY,
    CHANGE_PERCENT,
    CHANGE_SELLING_UOM,
    PRICE_GUIDE_ID,
    VENDOR_FUNDED_IND,
    FUNDING_TYPE,
    FUNDING_AMOUNT,
    FUNDING_AMOUNT_CURRENCY,
    FUNDING_PERCENT,
    SUPPLIER,
    DEAL_ID,
    DEAL_DETAIL_ID,
    PARTNER_TYPE,
    PARTNER_ID,
    CREATE_DATE,
    'RMS12',
    APPROVAL_DATE,
    'RMS12',
    LOCK_VERSION
    from rpm_clearance where zone_id=1 and item = j.item;
        END LOOP;
        COMMIT;
      END LOOP;
    END;

    It might be a good idea to post this again using the "code" button so that it's properly formatted. Take your time so that it's as accurate as possible. And don't forget to say at what point as the program executes this eligibility is being considered.

  • Why does it say my coupon code is "Invalid coupon code. Please check the coupon code and re-enter."

    When I enter my coupon code to get my serial number it says "Invalid coupon code. Please check the coupon code and re-enter." It is the correct coupon code. And I have just deactivated my lisence on my old computer.

    If you had not deactivated it on the old computer and it is a Windows machine there would have been a chance of getting it using Belarc Advisor
    (http://www.belarc.com/free_download.html).  I do not know if you can still do so.
    You can try contacting Adobe support via chat and see if they can help.
    Serial number and activation chat support (non-CC)
    http://helpx.adobe.com/x-productkb/global/service1.html ( http://adobe.ly/1aYjbSC )

  • Please provide the abap code for below requirement

    note: if the user exit is not suitable please provide the suitable user exit and code
    1   Business requirement
          In order to update the postings and tracking on Buffer Account postings the User Exists need to be modified and extended where possible in order to trace the Buffer postings in applicable MM and FI reports , i.e. at PO level, GR level and IR level.
    The User-exit used in the document is only for transactions at Invoice Verification level (MIRO).
    Therefore when an Invoice is created and the requirements for Buffer Account postings are met, i.e. relevant doc types and AAC, a table for Buffer Account entries and a subsequent report is required in order to trail the various Buffer entries and postings.
    The User Exit : LMR1M003.
    The Component is  EXIT_SAPLMRMP_003 . 
    The user-exit (LMR1M003) gets triggered when an Invoice is created or changed (MIRO). When an Invoice is cancelled, all entries will have to be reversed.
    The code in this user-exit will identify the invoice number (bkpf-belnr)  that has been created or changed and thus post entries in the applicable buffer accounts for this purpose.
    2.0   Buffer Table
    The Buffer Account table for the Invoice will have the following fields
    Field      DataElement      Data Type     Description                              Saptable     
    mandt     mandt          clnt          client                         key     init     bkpf
    bukrs     bukrs          char          companycode                    key     init     bkpf
    belnr     belnr_d     char          accountdocumentno               key     init     bkpf
    gjahr     gjahr          numc          fiscalyear                    key     init     bkpf
    kostl     kostl          char          cost center                    key     init     csks     
    ebeln     ebeln          char          purchasing document number     key     init     ekko     
    blart     blart          char          document type                         bkpf
    bldat     bldat          dats          document date in document                    bkpf     
    budat     budat          dats          posting date in document                    bkpf
    xblnr     xblnr1          char          reference document number                    bkpf
    bstat     bstat_d     char          Document Status                         bkpf
    xstov     xstov          char          indicator: document is flagged for reversal          bkpf
    xmwst     xmwst          char          calculate tax automatically                    bkpf
    reindat     reindat          dats          invoice receipt date                         bkpf
    werks     werks_d     char          plant                                    csks
    wrbtr     wrbtr          curr          amount in document currency               bseg     
    bsart     esart          char          po doc type                              ekko     
    ebelp     ebelp          numc          item number of purchasing document          bseg     
    nplnr     nplnr          char          network number for account assignment          bseg     
    knttp     knttp          char          account assignment category                    ekpo
    3.0   Detail Design
    3.1   Invoice Details
    •     The User-exit LMR1M003 is only to be used at Invoice level (MIRO).
    •     The user-exit (LMR1M001) gets triggered when an Invoice is created or changed (MIRO) .the field name bkpf-belnr is fetched from the table bkpf and checked whether document created or changed and triggers the user exit LMR!M003 .
    •     When an Invoice is cancelled, all entries will have to be reversed this is done by checking the value of flag indicator  bkpf-xstov fetched from the table bkpf .
    •     The code in this user-exit will identify the invoice number that has been created or changed and thus post entries in the applicable buffer accounts for this purpose.

    Cross-post: http://forum.java.sun.com/thread.jspa?threadID=763485

  • Please provide the abap code for this requirement

    note : if the below mentioned user exit is not suitable please find the suitable user exit and provide the code for this requirement.
    •     The User-exit MEFLD004 is only to be used at PO level (ME21N/ME22N).
    •     When PO is create or changed (ekko-ebeln) user exit MEFLD004 is triggered which check for the business requirement of the PO check for PO doc types (ekko-bsart) :z4,z6,z11,z12 from the table ekko and Account Assignment Category (knttp) is either N or K then stock process follows.  
    •     When an PO is cancelled, all entries will have to be reversed
    •     The Buffer table for the PO will have the following fields:
    Purchase order Number                     EKKO-EBELN
    Line item number of the PO               EKPO-EBELP
    Vendor Number                                  EKKO-LIFNR
    PO Quantity                                        EKPO-MENGE
    PO Nett Price                                     EKPO-NETPR
    Base Unit of Measure                  EKPO-LMEIN
    Account Assignment Category          EKPO-KNTTP
    PO Doc type                       EKPO-BSART     
    Plant                            EKPO-WERKS     
    Purchase Org                                  EKKO-EKORG
    Purchase Group                    EKKO-EKGRP     
    Company code                                EKPO-WAERS
    Item category                     EKPO-PSTYP
    PO Doc Date                      EKKO-BEDAT
    •     No duplications are allowed for any created, changed or cancelled purchase orders. If such a case occurs, the record will be updated with the latest update time stamp. This custom table will be keyed by purchase order number.

    Cross-post: http://forum.java.sun.com/thread.jspa?threadID=763485

  • How to improve performance of the below code.

    Hello.
    This below code is show 80% database performance in runtime analysis ( transaction SE30). I am using view KNA1VV for retrieving data using customer and sales area from selection screen.
    Please advice how can I improve the performance of below code.
    Fetch the customer details from view KNA1VV
      SELECT kunnr
             vkorg
             vtweg
             spart
             land1
             name1
             ort01
             pstlz
             regio
             stras
            INTO TABLE t_cust
            FROM kna1vv
      WHERE kunnr IN s_kunnr
      AND   vkorg IN s_vkorg
      AND   vtweg IN s_vtweg
      AND   spart IN s_spart
      AND   loevm = space
      AND   loevm_knvv = space.
      IF sy-subrc EQ 0.
        SORT t_cust BY kunnr.
      ELSE.
        w_flag = c_true_x.
      ENDIF.
    Fetch customers for entered company code
      IF NOT t_cust[] IS INITIAL AND NOT s_bukrs IS INITIAL.
        SELECT kunnr
               FROM knb1
               INTO TABLE lt_knb1
               FOR ALL ENTRIES IN t_cust
        WHERE kunnr = t_cust-kunnr
        AND   bukrs IN s_bukrs
        AND   loevm = space.
    Thanks,

    80% is just a relation and must not be problematic, what about the absolute runtime, is that acceptable?
    Also, your range S_KUNNR could contain anything from a single value (super fast) to nothing (probably slow, depends on number of entries in KNA1VV), so what do you expect here?
    Thomas

  • Where can I see the error msg in the below code.

    Hi Gurus,
    Please have a look at the code.
           if abc is initial.
              return-message = cl_bsp_runtime=>get_otr_text( 'ZXYZ/ERR_EMPID' ).
              append test to test_tab.
            endif.
    In the above code, Emp id input field is being checked as its mandatory. I would like to know where can I see the error message per the above code. what is get_otr_test??

    go to SE63 and see it from there..
    SE63-> Translation->OTR Objects->Short Text
    in field <b>Package</b> key in 'ZXYZ'
    and in field <b>Text from OTR</b> key in 'ERR_EMPID'
    and go forward.
    I hope this helps.
    For more info see the link below
    http://help.sap.com/saphelp_nw2004s/helpdata/en/2a/6ad43aa654be55e10000000a11402f/content.htm
    http://help.sap.com/saphelp_nw04/helpdata/en/93/bccd3a00746f4ae10000000a11402f/frameset.htm
    <i>If useful answer..reward points and close the thread.</i>
    A.<b></b>

Maybe you are looking for

  • Badi for Business partner contact person creation

    Hi Experts Kindly tell me what badi can I use to trigger error while creating the BP in role contact person , the requirement here is to check the email for duplication and throw the error Thanks & Regards Rajasekhar

  • Import itab in memory in user exit

    I am trying to export an internal table to memory in BADI and import from memory into an internal table in User exit . It looks like the export works, but when I import in program2, the internal table is empty. Even when the command returns sy-subrc

  • Can sum one help me setup a triple monitor with 2 moitors mirrord and have the thertd on as a seprat monitr

    i have 2 monitors and a imac im trying to set up one of my monitors as a separat monitor and have the uver one mirroring my imac but i can only get it to mirror my mac on all my screens and i dont wont this and if it help but i dont no if it make a d

  • Optical SPDIF output stopped working- why?

    I recently installed a larger HD and more RAM in my 1.63MHz Mini. After getting buttoned back up I noticed the optical SPDIF output stopped working (as in NO laser visible). Is there any possibility that this could be related to the OS (10.5.8)? Seem

  • FRM-40738 cant identify the problem

    Hi Guys i am getting this error again and again : FRM-40738 Argument 1 to builtin Report_Object_Status cannot be null. I have check the code and to my understanding it is ok, this is the code: DECLARE      report_id Report_Object;      report_job_id