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

Similar Messages

  • 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

  • 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 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

  • I am getting entity ref not referenced..end with ';' delimeter for the below code

    <mx:Image click="{navigateToURL(new URLRequest(' http://www.facebook.com/group.php?gid=149134532537&ref=ts'))}">

    You need to use XML entities for some characters in MXML. In your case, you can't use '&' directly: use '&amp;' instead.

  • How to rpad spaces for the below code

    begin
    dbms_output.put_line(rpad(null,10,' ') ||'b');
    end;
    The output is not appending spaces. I have a requirement to append spaces between columns. Some times the column will be empty. In that case the space is not getting appended.Please let me know the solution.
    thanks,
    Vinodh

    Hi,
    It is just DBMS_OUTPUT issue nothing else.
    SQL> ed
    Wrote file afiedt.buf
      1  declare
      2   a VARCHAR2(20);
      3  begin
      4   a:= rpad(' ',10,' ');
      5  dbms_output.put_line(a||'b');
      6* end;
    SQL> /
    b
    PL/SQL procedure successfully completed.
    SQL> ed
    Wrote file afiedt.buf
      1  declare
      2   a VARCHAR2(20);
      3  begin
      4   a:= rpad(' ',10,' ');
      5  dbms_output.put_line(LENGTH(a)||'b'); -- Tried through variable also
      6* end;
    SQL> /
    10b
    PL/SQL procedure successfully completed.
    SQL> ed
    Wrote file afiedt.buf
      1  declare
      2   a VARCHAR2(20);
      3  begin
      4   a:= rpad(' ',10,' ');
      5  dbms_output.put_line('          '||'b');  -- Here 10 Hardcoded Blanks
      6* end;
    SQL> /
    b
    PL/SQL procedure successfully completed.
    SQL>

  • 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

  • ABAP Routine code for the below logic

    Hello BW Experts ,
    I need to write a complex ABAP routine in BW .
    Following is the detail explaination .
    Can anyone tell me the ABAP code for the below logic?
    It would be a greate help as I am unable to do this
    since last two days.
    WBS Elements are maintained at  IOS and  Warranty levels in R/3 side.
    The IOS WBS is a top level of WBS element and below that the Warranty WBS level.
    The IOS and Warranty WBS elements can be differentiated by means of priority field.
    When priority = i   , WBS Element is known as  IOS Level WBS Element and
    When  priority = Y the WBS element is known as Warranty WBS element.
    The Equipment Number is maintained compulsorily at IOS Level WBS elements only.
    It is not maintained at  Warranty WBS Element.
    But the Cost is maintained at Warranty WBS Elements.
    In BW I need all Warranty WBS ( priority = Y) along with their cost figures and Equipment Numbers.
    But as the Equipment Number is not maintained compulsorily at Warranty WBS level we have asked to
    Copy it from  IOS WBS ( priority = i ) and assign it to Warranty WBS level ( priority = Y ).
    So I have included the Equipment Number in the ODS and in update rules I need to write the routine for it as
    per the above logic.
    The Equipment Number is coming from Master data of  WBS Element.
    The WBS element master data we are loading in BW .
    Also the same WBS Element transaction data is coming from the transaction data data source in BW.
    Following fields / infoobjects and the table names in BW :
    1. Equipment Number : /BIC/ZEQUIPMNT  and table name /BIC/MZWBS_ELEM.
    2. WBS Element       : ZWBS_ELEM  is coming from transaction data data source as well as master data.
                                     In ODS update rules it is coming from  transaction data data source Comm_structure-ZWBS_ELEM.
                                     Also we are loading separetly the master data for ZWBS_ELEM.
                                     The  ZEQUIPMNT is an attribute of ZWBS_ELEM.
    3. Priority                :  PRIORITY     and table name /BIC/MZWBS_ELEM.
                                      The info object name for Priority is 0Priority but in master data table /BIC/MZWBS_ELEM
                                      the field name is    PRIORITY.
                                     When PRIORITY = ' i ' then    ZWBS_ELEM is at IOS Level
                                     When PRIORITY = ' y ' then  ZWBS_ELEM is at Warranty Level.
    4. ODS name :  /BIC/AZCOST00 and same is table name active data table .
    So please tell me the routine Code .
    Best Regards ,
    Amol.

    Hi Dinaker,
    Did you find any solution for this issue. I too have a similar requirement of pulling all the service orders for a specific Purchase Order in the BW report.
    Thanks,
    SAPBWI

  • Need help in improving the performance for the sql query

    Thanks in advance for helping me.
    I was trying to improve the performance of the below query. I tried the following methods used merge instead of update, used bulk collect / Forall update, used ordered hint, created a temp table and upadated the target table using the same. The methods which I used did not improve any performance. The data count which is updated in the target table is 2 million records and the target table has 15 million records.
    Any suggestions or solutions for improving performance are appreciated
    SQL query:
    update targettable tt
    set mnop = 'G',
    where ( x,y,z ) in
    select a.x, a.y,a.z
    from table1 a
    where (a.x, a.y,a.z) not in (
    select b.x,b.y,b.z
    from table2 b
    where 'O' = b.defg
    and mnop = 'P'
    and hijkl = 'UVW';

    987981 wrote:
    I was trying to improve the performance of the below query. I tried the following methods used merge instead of update, used bulk collect / Forall update, used ordered hint, created a temp table and upadated the target table using the same. The methods which I used did not improve any performance. And that meant what? Surely if you spend all that time and effort to try various approaches, it should mean something? Failures are as important teachers as successes. You need to learn from failures too. :-)
    The data count which is updated in the target table is 2 million records and the target table has 15 million records.Tables have rows btw, not records. Database people tend to get upset when rows are called records, as records exist in files and a database is not a mere collection of records and files.
    The failure to find a single faster method with the approaches you tried, points to that you do not know what the actual performance problem is. And without knowing the problem, you still went ahead, guns blazing.
    The very first step in dealing with any software engineering problem, is to identify the problem. Seeing the symptoms (slow performance) is still a long way from problem identification.
    Part of identifying the performance problem, is understanding the workload. Just what does the code task the database to do?
    From your comments, it needs to find 2 million rows from 15 million rows. Change these rows. And then write 2 million rows back to disk.
    That is not a small workload. Simple example. Let's say that the 2 million row find is 1ms/row and the 2 million row write is also 1ms/row. This means a 66 minute workload. Due to the number of rows, an increase in time/row either way, will potentially have 2 million fold impact.
    So where is the performance problem? Time spend finding the 2 million rows (where other tables need to be read, indexes used, etc)? Time spend writing the 2 million rows (where triggers and indexes need to be fired and maintained)? Both?

  • Need to find a BAPI for the below requirement

    Hi All,
    Need to find a BAPI for the below requirement.
    We are assigning roles to users using SU01 T-Code and we are in the process of automating this and since we need a BAPI which can do this. Apart from assigning roles to users, SU01 T-code is doing many functionalities, but if we can get a BAPI which can perform assigning roles to users will suffice the requirement.
    Thanks in advance,
    Srilakshmi.

    Hi SreeLakshmi
    see the list of BAPIs given below.
    1065 Business Object Employee
    BAPI_JOBROLE_CLONE Create a User Role in Another System By Copying
    BAPI_BUPA_ROLES_GET SAP BP, BAPI: Determine All Roles
    BAPI_BUPA_ROLE_ADD SAP BP, BAPI: Add Role
    BAPI_BUPA_ROLE_EXISTENCE_CHECK SAP BP, BAPI: Check Existence of Role
    BAPI_BUPA_SET_ROLE SAP BP: Set Object Part / Roles
    BAPI_GET_EVENTTYPE_FOR_ROLE Determine Business Event Types Using Standard Role
    BAPI_EMPLOYEET_CHANGEPASSWORD Change employee password
    BAPI_EMPLOYEET_CHECKPASSWORD Check employee password
    BAPI_EMPLOYEET_CREATE_PW_REG Create entry for employee password
    BAPI_EMPLOYEET_DELETE_PW_REG Delete entry for employee password
    BAPI_EMPLOYEET_DEQUEUE Unlock employee
    BAPI_EMPLOYEET_ENQUEUE Lock employee
    BAPI_EMPLOYEET_GET_PW_REG Read entry for employee password
    BAPI_EMPLOYEET_INITPASSWORD Initialize employee password
    Reward if helpful
    Regards
    Lakshman

  • 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

  • Pls. JS for the below simple IF statement

    Hello,
    I am new to JavaScript, could you pls. consolidate the below 2 IF statements into only 1 summary IF statement (I mean, put the red IF statement into blue IF statement)
    my_form:Page1:SunForm1:Middle_Name_text_field ::: Change JavaScript
    I wrote the below code in the CHANGE event of a text field of "Middle_Name_text_field"
    // Hide associated check box
    // As soon as user started entering the data, make associated check box as invisible
    // or if erased the data again then make the check box visible
    if (xfa.event.newText.length > 0) {
         MiddleName_CheckBox.presence = "hidden";
    else {
    // I guess, the below red piece should come here
         MiddleName_CheckBox.presence = "visible";
    var yc  //Yellow color
    yc = " "
    yc = (this.ui.oneOfChild.border.fill.color.value);
    // If the Middle Name text field is colored with yellow, then make it again invisible, no matter wht the above IF statement yileds in
    if (yc == "255,255,191") {
         MiddleName_CheckBox.presence = "hidden";
    Thank you

    Hi,
    This should work:
    // Hide associated check box
    // As soon as user started entering the data, make associated check box as invisible
    // or if erased the data again then make the check box visible
    var yc = (this.ui.oneOfChild.border.fill.color.value);
    if (xfa.event.newText.length > 0 || yc == "255,255,191") {
         MiddleName_CheckBox.presence = "hidden";
    else {
         MiddleName_CheckBox.presence = "visible";
    The || is JavaScript for "or", so that if either condition is met the field is hidden.
    Hope that helps,
    Niall

  • JS for the below simple IF statement pls.?

    Hello,
    I am new to JavaScript, could you pls. consolidate the below 2 IF statements into only 1 summary IF statement (I mean, put the red IF statement into blue IF statement)
    my_form:Page1:SunForm1:Middle_Name_text_field ::: Change JavaScript
    I wrote the below code in the CHANGE event of a text field of "Middle_Name_text_field"
    // Hide associated check box
    // As soon as user started entering the data, make associated check box as invisible
    // or if erased the data again then make the check box visible
    if (xfa.event.newText.length > 0) {
         MiddleName_CheckBox.presence = "hidden";
    else {
    // I guess, the below red piece should come here
         MiddleName_CheckBox.presence = "visible";
    var yc  //Yellow color
    yc = " "
    yc = (this.ui.oneOfChild.border.fill.color.value);
    // If the Middle Name text field is colored with yellow, then make it again invisible, no matter wht the above IF statement yileds in
    if (yc == "255,255,191") {
         MiddleName_CheckBox.presence = "hidden";
    Thank you

    Hi,
    This should work:
    // Hide associated check box
    // As soon as user started entering the data, make associated check box as invisible
    // or if erased the data again then make the check box visible
    var yc = (this.ui.oneOfChild.border.fill.color.value);
    if (xfa.event.newText.length > 0 || yc == "255,255,191") {
         MiddleName_CheckBox.presence = "hidden";
    else {
         MiddleName_CheckBox.presence = "visible";
    The || is JavaScript for "or", so that if either condition is met the field is hidden.
    Hope that helps,
    Niall

  • 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

  • For the ISO code TRY there is no unique SAP currency code for ALE

    Hi,
    I was trying to download cost centres from FICO to SAP HR via BD17.
    These are Turkish cost centres.
    I received an error: For the ISO code TRY there is no unique SAP currency code for ALE
    What is missing and how can it be fixed? I guess it is sth on ALE side so probably requires some config from Basis?
    Or correct me if I'm wrong.
    Thanks in advance!
    Monika.

    Hi satya,
    Not sure if this might help ... check out this OSS note "Note 313772 - Performance problem in CURRENCY_CODE_SAP_TO_ISO"
    Regards
    Genie

Maybe you are looking for

  • Creation of background job from SE38

    hello all... In the selection screen of my report program, there are two radiobuttons - read mode or update mode. In read mode, the program reads an excel file and gives the output in teh form of errors, if at all, after some chekcs on this excel fil

  • Restoring an external hard drive with time machine

    I'm having a problem restoring an external hard drive using time machine. I'm on a macbook Air Running 10.7.5. The external hard drive where I store all my photos crashed a few days ago. Not a total disaster, because it's backed up, but I can't figur

  • My hard-drive (SSD) on my MacBook Air crashed; had to replace it with new SSD! Installed Mavericks but now cannot find 'free' iPhoto App to download and install. Any help?

    Trying to re-download & re- install my iPhoto since replacing my SSD. Its no longer free & I have had it downloaded/ installed it when I installed OS Mavericks the first time. Now since the SSD is replaced, not sure it recognizes it & does not let me

  • Doubt in ALE/IDOC's

    Hi Friends,     I have 2 inbound idocs in which      one idoc posts the document in SAP      seecond oneconfirms that document. what my problem is if the second idoc comes first and try to confirm before the documnet posted it gets fail. SO that i wa

  • I want a book  for toplink

    Hai In our project we plan to use the top link with entity bean we plan to use top link as cache also so any material related to this or any web site or any book give me the detail I can’t under stand the flow so please help me related to this . th