Connecting department code with employee table

hi all,
i am using db10g.
i have
EMPLOYEE_MASTER
EMP_CODE
EMP_NAME
EMP_DEPT
primary key EMP_CODE and foreign key EMP_DEPT references DEPARTMENT_MASTER (primary key) DPT_CODE
DEPARTMENT_MASTER
DPT_CODE
DPT_NAME
DPT_LOCnow my question is first i have to get deparmtne name and corresponding employees.
dept A
x
y
z
dept b
a
b
c
etc..
somthing like connect by clause which i am not that much aware of?
i have written the below
SELECT 1, LEVEL, EMP_NAME, NULL, TO_CHAR(EMP_CODE)
FROM DEPARTMENT_MASTER,EMPLOYEE_MASTER
WHERE DPT_CODE = EMP_DEPT
CONNECT BY PRIOR EMP_DEPT = DPT_CODE
but i am getting
ERROR:
ORA-01436: CONNECT BY loop in user data
no rows selected Thanks..
Edited by: GD on Mar 12, 2012 1:20 AM

Something like this.
-- sample table
create table department
  deptno integer primary key,
  dname varchar2(100)
create table employee
  empno integer primary key,
  deptno integer,
  ename varchar2(100),
  sal  number(10,2),
  doj date,
  constraint employee_fk foreign key(deptno) references department(deptno)
-- sample data
insert into department(deptno, dname) values (1, 'IT Development');
insert into department(deptno, dname) values (2, 'IT Testing');
insert into employee(empno, ename, deptno, sal, doj) values(1, 'Karthick', 1, 100, sysdate-100);
insert into employee(empno, ename, deptno, sal, doj) values(2, 'Karthick_1', 1, 90, sysdate-110);
insert into employee(empno, ename, deptno, sal, doj) values(3, 'Ram', 2, 100, sysdate-100);
insert into employee(empno, ename, deptno, sal, doj) values(4, 'Ram_1', 2, 90, sysdate-110);
-- query to get employee name as a string for each department.
select dname, ltrim(sys_connect_by_path(ename, ','), ',') ename
  from (
          select d.dname, e.ename, row_number() over(partition by d.deptno order by e.empno) rno
            from employee e
            join department d
              on e.deptno = d.deptno
where connect_by_isleaf = 1      
start with rno = 1
connect by dname = prior dname
   and rno = prior rno + 1
/

Similar Messages

  • Match-Code with Internal Table

    Hi.
    Is there any way to show a search help depending on the values of an internal table, not a DB table???
    Thanks.

    we can do something like this..
    PARAMETERS : p_ccgrp LIKE rkpln-ksgru. "Cost Center Group
    *Input help for Cost Center Group
    AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_ccgrp.
      TYPES: BEGIN OF ty_ccenter_group,
              setname TYPE setnamenew,
              descript TYPE settext,
             END OF ty_ccenter_group.
      DATA : it_ccenter_group TYPE TABLE OF ty_ccenter_group.
      CLEAR it_ccenter_group.
      SELECT a~setname
             b~descript
             INTO TABLE it_ccenter_group
             FROM setheader AS a INNER JOIN
                  setheadert AS b ON
                  a~subclass EQ b~subclass AND
                  a~setname EQ b~setname
                  WHERE a~setclass EQ '0101' AND
                        b~langu EQ sy-langu.
      CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'
           EXPORTING
                retfield    = 'SETNAME'
                dynpprog    = v_repid
                dynpnr      = '1000'
                dynprofield = 'P_CCGRP'
                value_org   = 'S'
           TABLES
                value_tab   = it_ccenter_group.

  • Add a new employee - Connection is busy with results for another command

    Hi all,
    I try to add a new employee in my SAP Business One system, but I get an error message like that : [Microsoft][SQL Native Client] Connection is busy with results for another command * (HEM5) (HEM5)
    So I try to see if I get the same message when I update an employee, and I don't get this message.
    Do you have an idea, why I get this error message when I add a new employee ?
    Message was edited by:
            Marc Riar

    Hello,
    I am afraid there maybe two users / workstations using the same user code and one of them is creating (add) and other is update. Try to ask the users/wrokstations.
    Another way out is try to run this query :
    select * from HEM5
    Rgds,
    JM
    http://groups.yahoo.com/group/SBO_Knowledge_Village
    [email protected]

  • SSIS 2012: SSIS Error Code "Excel Connection Manager" failed with error code 0xC0202009.

    Hi,
    This is kind of weird issue that I am experiencing with excel connection manager in SSIS 2012. This issue occurs sometimes but when I close and re-open SSDT (SQL Server Data Tools - newer BIDS) then this issues goes off temporarily.
    Just FYI, through SSDT environment I executed the package successfully with both settings Run64bit runtime setting to Yes and No when error does not occur.
    So far I have installed
    http://www.microsoft.com/en-us/download/details.aspx?id=13255 (Microsoft Access Database Engine 2010 Redistributable).
    I still remember for older versions of SQL Server (2005 & 2008) that I have executed Excel connection SSIS packages with Run64bit runtime = false i.e. in 32-bit mode. As far as I know I think Excel 64-bit issue has been resolved with SQL Server
    2012 release.
    Here is the detail of error message:
    TITLE: Package Validation Error
    Package Validation Error
    ADDITIONAL INFORMATION:
    Error at Data Flow Task [Excel Source [2]]: SSIS Error Code DTS_E_CANNOTACQUIRECONNECTIONFROMCONNECTIONMANAGER.  The AcquireConnection method call to the connection manager "Excel Connection
    Manager" failed with error code 0xC0202009.  There may be error messages posted before this with more information on why the AcquireConnection method call failed.
    Error at Data Flow Task [SSIS.Pipeline]: Excel Source failed validation and returned error code 0xC020801C.
    Error at Data Flow Task [SSIS.Pipeline]: One or more component failed validation.
    Error at Data Flow Task: There were errors during task validation.
    Error at Package [Connection manager "Excel Connection Manager"]: SSIS Error Code DTS_E_OLEDBERROR.  An OLE DB error has occurred. Error code: 0x80004005.
    An OLE DB record is available.  Source: "Microsoft Access Database Engine"  Hresult: 0x80004005  Description: "Unspecified error".
     (Microsoft.DataTransformationServices.VsIntegration)
    Here are my environment details:
    SQL Server 2012 {Microsoft SQL Server 2012 (SP1) - 11.0.3368.0 (X64) } , Excel 2010 (32-bit). I am developing SSIS code on Virtual desktops with Windows 7 32-bit OS.
    Also it occurred to me that since Virtual Desktops are on Shared Infrastructure, the source files and SSIS packages (code) can be on Shared drives for e.g. \\<Corpnet>\userdata\<Corp_Users_Grp>\<Username>\Visual Studio 2010\Projects\Integration
    Services Project2\Integration Services Project2\Package.dtsx.
    Does this kind of Shared drives have any impact to give this issue?
    Thanks in advance!
    Ketan
    P.S.: I had look at this forum question -->
    http://social.msdn.microsoft.com/Forums/sqlserver/en-US/903bbe1d-e070-4c43-9d3b-0a5193550029/64bit-error-in-excel-connection-manager-in-ssis

    Hi Arthur,
    Thanks for your response.
    Yes, it looks like SSIS still has bunch of issues with Excel files like as follows:
    1) Some times excel source files cannot be parsed by excel source connection manager.
    2) For derive column conversion, we can't replace the existing column. rather, we have to add the derived column as " add as new column" which is tough to manage  while destination mapping.
    3) If an column in excel contains a data which is not of the data type assigned for the column in excel, the excel source reads that data as "null". For the same, we can't validate the data and redirect the erroneous data in reject file.  <-- For
    this we tried IMEX setting also
    4) In multi-tab/sheet excel file, excel source is unable to detect a tab and identify the metadata of the excel.
    I am also checking Microsoft connect for Excel issues with SSIS 2012(https://connect.microsoft.com/SQLServer/SearchResults.aspx?SearchQuery=excel#&&PageIndex=22
    As worst case scenario, I am thinking of converting Excel to CSV file or Flat text file. (http://www.mssqltips.com/sqlservertip/2772/importing-data-from-excel-using-ssis--part-2/).
    Do you think it is advisable to convert Excel into CSV or Flat file.
    Thanks,
    Ketan

  • [Load data from excel file [1]] Error: SSIS Error Code DTS_E_CANNOTACQUIRECONNECTIONFROMCONNECTIONMANAGER. The AcquireConnection method call to the connection manager "Excel Connection Manager" failed with error code 0xC0202009. There may be error messa

    Error
    [Load data from excel file [1]] Error: SSIS Error Code DTS_E_CANNOTACQUIRECONNECTIONFROMCONNECTIONMANAGER.  The AcquireConnection method call to the connection manager "Excel Connection Manager" failed with error code 0xC0202009.  There
    may be error message
    I am using BIDS Microsoft Visual Studio 2008 and running the package to load the data from excel .
    My machine has 32 bit excel hence have set property to RUN64BITRUNTIME AS FALSE.
    But the error still occurs .
    I checked on Google and  many have used Delay validation property at Data flow task level to true but even using it at both excel connection manager and DFT level it doesnt work
    Mudassar

    Thats my connection string
    Provider=Microsoft.ACE.OLEDB.12.0;Data Source=E:\SrcData\Feeds\Utilization.xlsx;Extended Properties="Excel 12.0;HDR=NO";
    Excel 2010 installed and its 32 bit edition
    Are you referring to install this component -AccessDatabaseEngine_x64.exe?
    http://www.microsoft.com/en-us/download/details.aspx?id=13255
    Mudassar
    You can try an OLEDB provider in that case
    see
    http://dataintegrity.wordpress.com/2009/10/16/xlsx/
    you might need to download and install ms access redistributable
    http://www.microsoft.com/en-in/download/details.aspx?id=13255
    Please Mark This As Answer if it helps to solve the issue Visakh ---------------------------- http://visakhm.blogspot.com/ https://www.facebook.com/VmBlogs

  • Remove Company Code with all the Employees in it from r/3?

    Hi i have a bit unusual requirement.
    i want to know how can i Remove a Company Code with all its assigned Employees completely from a system(r/3) ?
    can this be possible at all? if yes then please also mentions what can be the side effects of this action.

    Jack,
    You will have to follow reverse engineering....
    As Sikandar Guru Mentioned.....identify all the PERNRs for mass deletion....
    Secondly I believe, that you want to Delete the Company Code.....check with Finance Folks.......If they have no issues, you can delete the co. code with TCODE EC01... but this will not delete the Relationships to Personnel area...etc.
    There may be custom Features, Reports or programs functioning based on Co. Code.......
    So, in a way....its not feasible..neither wise to attempt deletion of Co. Code....
    S_PHO_48000106 is the TCode for Mass Deletion.
    Good Luck !!!
    Kumarpal Jain.
    Edited by: Kumarpal Jain on Oct 26, 2009 3:20 PM

  • Create Employee code with the mix of alphabets & numeric

    Hai,
    Is there any possibility to create Employee code with the mix of alphabets & numeric instead of the system generated employee code in employee master data? If so,   pls explain.
    Any suggestion is appreciated.
    Thanks,
    Parvatha Solai.N

    Hi Solai,
    You can do a work around for it. Just Leave the Employee ID field as it is. Create a new User Defined field (Alpha Numeric Type) And make it visible on the the employee master data form.
    Step2 : Depending upon your need  write the code that is if it should be auto generated write the code for else leave it blank for the user to enter the employee code.
    Step3: In before action = True. Make the newly created field as mandatory and check whether the value in the field is unique.
    Refer Route Class. Hope you understand
    Regards,
    P. Anand
    Edited by: Anand peter on Jan 2, 2012 11:59 AM

  • This connection is untrusted with Error code: sec_error_unknown_issuer.

    Hello,
    When I try to open G-Mail & twitter and some other trusted websites, I got the following warning "This Connection is Untrusted" with Error code: sec_error_unknown_issuer.
    For most of the site, I can bypass by clicking « I understand the risk » but this is a bummer but for Gmail and Twitter, there is no other button than "Get me out of here"
    When I go through « about:support » and « reinitialise » system, I no longer have the problem, but not only it erases all my personnal set-up but the problem always come back when I restart my system
    Date and time are set right.
    I have also tried to reinstall completely FIREFOX to no avail
    I am using McAfee Total protection 2014 & Firefox 31.0 on Windows 7 64 bits.
    I have had this problem for the last 5 days and only Firefox.
    Other Browser ( IE8.0) is working fine
    I have searched for solutions but they all failed -
    Deleting cert8.db did not solve the problem either
    How do I solve this Problem?
    Thanks and Regards

    You can check the connection settings.
    *Tools > Options > Advanced > Network : Connection > Settings
    *https://support.mozilla.org/kb/Options+window+-+Advanced+panel
    If you do not need to use a proxy to connect to internet then try to select "No Proxy" if "Use the system proxy settings" or one of the others do not work properly.
    See "Firefox connection settings":
    *https://support.mozilla.org/kb/Firefox+cannot+load+websites+but+other+programs+can
    Do a malware check with several malware scanning programs on the Windows computer.
    Please scan with all programs because each program detects different malware.
    All these programs have free versions.
    Make sure that you update each program to get the latest version of their databases before doing a scan.
    *Malwarebytes' Anti-Malware:<br>http://www.malwarebytes.org/mbam.php
    *AdwCleaner:<br>http://www.bleepingcomputer.com/download/adwcleaner/<br>http://www.softpedia.com/get/Antivirus/Removal-Tools/AdwCleaner.shtml
    *SuperAntispyware:<br>http://www.superantispyware.com/
    *Microsoft Safety Scanner:<br>http://www.microsoft.com/security/scanner/en-us/default.aspx
    *Windows Defender:<br>http://windows.microsoft.com/en-us/windows/using-defender
    *Spybot Search & Destroy:<br>http://www.safer-networking.org/en/index.html
    *Kasperky Free Security Scan:<br>http://www.kaspersky.com/security-scan
    You can also do a check for a rootkit infection with TDSSKiller.
    *Anti-rootkit utility TDSSKiller:<br>http://support.kaspersky.com/5350?el=88446
    See also:
    *"Spyware on Windows": http://kb.mozillazine.org/Popups_not_blocked

  • Validating department in WBS element code with dept in Investment program

    Hello Guru's,
    While assigning Investment program, in WBS  in CJ20N or CJ11, in our current business process we need to to validate the Department code in both WBS code and Investment program code.
    At present we have planned to used same department code in WBS Code and Investment program code.
    Need to to do this enhancement for our current project.
    Please suggest the way to do it.
    Regards,
    Amlan

    Hi,
    I assume this "Department Code" is one of your customer specific field that is made available both in WBS as well as the iM program. If that is the case then either you can use any of the user exits for the WBS Elements to write your code or create a validation for the WBS and put your code in one of those exits invalidation.
    Regards
    Sreekanth

  • Connecting Query variable with Table Values

    Hi all,,
    I'm trying to connect a query variable to table column contents. The problem is, there is an additional Date as input which is single value. As a result, the query does not get executed. It gives an error that it expects a single value for the date field.
    Am I doing something wrong. Please guide.
    Regds,
    Srinivasan.

    Hi Srinivasan,
    Sorry but i didnt got exactly what you are trying to do? You have query to which you are passing multiple values from a table. or are you selecting a single row in the table and passing it to the query? How is the variable defined in the query?
    Thanks,
    Regards,
    Vikram

  • Oracle Connection Release Issue with Latest Driver not with the legacy one

    Hi
    I came across a scenario in the http://www.oracleutilities.com/Packages/dbms_alert.html, which discuss about the usage of the dbms_alert (Alert.java program). I used this example with classes12.jar and terminated the program abnormally without raising the signal. When i checked the oracle session in v$session table i didn't see any stale session, however when i used the ojdbc6_g.jar (followed the same step as i mentioned earlier for classses12.jar) i found the connection is not released. Any help/pointers would be highly appreciated
    More information of driver and db are given below
    classes12.jar
    Manifest-Version: 1.0
    Specification-Title: "Oracle JDBC driver classes for use with JDK1.2 and JDK1.3"
    Specification-Version: "Oracle JDBC Driver version - 9.0.2.0.0"
    Specification-Vendor: "Oracle Corporation" .
    Implementation-Title: "classes12 archives"
    Implementation-Version: "Oracle JDBC Driver version - 9.0.2.0.0"
    Implementation-Vendor: "Oracle Corporation"
    Implementation-Time: "Fri Jun 9 04:27:20 2006"
    ojdbc6_g.jar
    Manifest-Version: 1.0
    Implementation-Vendor: Oracle Corporation
    Implementation-Title: ojdbc6_g.jar
    Implementation-Version: Oracle JDBC Driver version - "11.1.0.7.0-Produ
    ction"
    Implementation-Time: Thu Aug 28 18:32:51 2008
    Specification-Vendor: Oracle Corporation
    Created-By: 1.6.0 (Sun Microsystems Inc.)
    Specification-Title: Oracle JDBC driver classes for use with JDK6
    Specification-Version: Oracle JDBC Driver version - "11.1.0.7.0-Produc
    tion"
    Main-Class: oracle.jdbc.OracleDriver
    Database & OS info
    OS : Linux bld-qa-ts26 2.6.32-200.13.1.el5uek #1 SMP Wed Jul 27 21:02:33 EDT 2011 x86_64 x86_64 x86_64 GNU/Linux
    ORACLE VERSION : 11GR2 ( 11.2.0.2.0 ) SE

    >
    I used this example with classes12.jar and terminated the program abnormally without raising the signal. When i checked the oracle session in v$session table i didn't see any stale session, however when i used the ojdbc6_g.jar (followed the same step as i mentioned earlier for classses12.jar) i found the connection is not released. Any help/pointers would be highly appreciated
    ORACLE VERSION : 11GR2 ( 11.2.0.2.0 ) SE
    >
    Let me see if I understand this right
    1. You are using an example from several years ago
    2. The example is for code that captures the LOGON to the database
    3. You don't mention anything about whether you got the LOGON notification but mention that you terminate the program abnormally.
    4. You use a jar file that has been obsolete for over 10 years
    5. You use the latest version of the Oracle database (which the jar file does not support)
    Did I get that right?
    And this surprises you?
    Why on Earth would you do this? You should be using an example and jar files that support and are supported by the Database and JDK that your are using. When you don't you can expect to have problems and many of them you will not be able to resolve.
    You don't provide the JDK version that you are using but there's a good chance it is the wrong version for this hodgepodge also.
    1. Use JDK 1.6
    2. Use OJDBC6 jar
    3. Use examples for Oracle 11g
    Here is the official Oracle JDBC page that shows the Oracle DB versions supported for each of the JDBC drivers available and also describes the JDBC jars and what JDK versions they support.
    http://www.oracle.com/technetwork/database/enterprise-edition/jdbc-faq-090281.html#02_01
    >
    Which JDBC drivers support which versions of Oracle Database?
    JDBC 9.0.1 drivers can talk to RDBMS
    11.1.0
    classes12.jar
    Classes for the Thin and OCI drivers when using a Java 1.2 or 1.3 VM.
    >
    And here is the PL/SQL Packages and Types doc that has an example in Chap 18 DBMS_ALERT (not for LOGON)
    http://docs.oracle.com/cd/B28359_01/appdev.111/b28419/d_alert.htm#BEHBCFCF
    >
    Examples
    Suppose you want to graph average salaries by department, for all employees. Your application needs to know whenever EMP is changed. Your application would look similar to this code:
    DBMS_ALERT.REGISTER('emp_table_alert');
    <<readagain>>:
    /* ... read the emp table and graph it */
    DBMS_ALERT.WAITONE('emp_table_alert', :message, :status);
    if status = 0 then goto <<readagain>>; else
    /* ... error condition */
    The EMP table would have a trigger similar to this:
    CREATE TRIGGER emptrig AFTER INSERT OR UPDATE OR DELETE ON emp
    BEGIN
    DBMS_ALERT.SIGNAL('emp_table_alert', 'message_text');
    END;
    When the application is no longer interested in the alert, it makes this request:
    DBMS_ALERT.REMOVE('emp_table_alert');
    This reduces the amount of work required by the alert signaller. If a session exits (or dies) while registered alerts exist, the alerts are eventually cleaned up by future users of this package.
    The example guarantees that the application always sees the latest data, although it may not see every intermediate value.

  • Error while executing BBP_UPDATE_PORG Tr Code with ADD Option

    Hi All,
    I changed the Back end Vendor Master Data - Purchasing View (Example Accounting Number) and run the BBPUPDVD Tr code in SRM. The Business Partner (Vendor) data is updated correctly in SRM System from Back End System.
    We have set of purchasing organisations like one local (SRM) Purchasing Organisation and respective Back end Purchasing Organisation (account number). When ever I run BBPUPDVD, the SRM system updates the backend vendor master data  with back end purchasing organisation into SRM Standard tables. Then I am running BBP_UPDATE_PORG Tr code to have updated data into SRM Local Purchasing Organisation. I am receiving error message.
    Example Scenario:
    step 1: Present values in Vendor Master Vendor Number 100250, Purchaing Organisation : 1010 A/c Number: 100250-1010
    and I changed the account number as 10025o-test for vendor 100250 and pur organisation 1010.
    step 2: I run the BBPUPDVD in SRM System.
    Step 3: I checked the values in BBPMAININT - vendor data (for backend vendor number 100250 and backend pur organisation - 1010). The SRM system replicates the values correct.
    Step 4: I executed BBP_UPDATE_PORG and replaced the local (SRM) business partner (for local vendor number - 100250 and local purchasing organisation) - REPLACE Option. Then SRM replaces the SRM Business Partner (local) Data with Back end Vendor Master Data and also Back End vendor master data is deleted in SRM System. Now I have updated business partner details in SRM System as SRM Local an no SRM Back End Vendor Master Data in SRM System. This step is working fine.
    Step 5: One more time I am executing BBP_UPDATE_PORG Tr code with Add option to have SRM Back End Details (in SRM System) from SRM Local Details (SRM System). Then the system is error message in SM13 Tr code.
    Kind Note: There is no SRM Back End Vendor details in SRM System which I want to have with the help of executing BBP_UPDATE_PORG Tr code with Add option.
    For analysis I went to ST22 (dump Analysis), the SRM gave an error message like:
    Runtime Error          DYNPRO_SEND_IN_BACKGROUND
    Date and Time          09/15/2008 10:56:58
    ShrtText
         Screen output without connection to user.
    What happened?
         Error in ABAP application program.
         The current ABAP program "SAPLBBP_PARTNER_MAINT" had to be terminated because
          one of the
         statements could not be executed.
         This is probably due to an error in the ABAP program.
    Information on where terminated
        The termination occurred in the ABAP program "SAPLBBP_PARTNER_MAINT" in      "BBP_PORG_INSERT".
        The main program was "RSM13000 ".
        The termination occurred in line 59 of the source code of the (Include)      program "LBBP_PARTNER_MAINTU11"
        of the source code of program "LBBP_PARTNER_MAINTU11" (when calling the editor      590).
        The program "SAPLBBP_PARTNER_MAINT" was started in the update system.
       56
       57 * update database
       58   IF NOT LT_FRG0060_NEW[] IS INITIAL.
    >>>>>     INSERT BBPM_BUT_FRG0060 FROM TABLE LT_FRG0060_NEW.
       60   ENDIF.
       61
       62   IF NOT LT_FRG0061_NEW[] IS INITIAL.
       63     INSERT BBPM_BUT_FRG0061 FROM TABLE LT_FRG0061_NEW.
       64   ENDIF.
    Kindly guide me or provide solution.
    We are in SRM 4.0 and ECC 5.0.
    Thanks a lot in advance.
    Regards,
    Sudarsan
    Edited by: KOYYA SUDARSANA NAIDU on Sep 15, 2008 9:09 PM
    Edited by: KOYYA SUDARSANA NAIDU on Sep 17, 2008 8:46 PM

    Hi All,
    I changed the Back end Vendor Master Data - Purchasing View (Example Accounting Number) and run the BBPUPDVD Tr code in SRM. The Business Partner (Vendor) data is updated correctly in SRM System from Back End System.
    We have set of purchasing organisations like one local (SRM) Purchasing Organisation and respective Back end Purchasing Organisation (account number). When ever I run BBPUPDVD, the SRM system updates the backend vendor master data  with back end purchasing organisation into SRM Standard tables. Then I am running BBP_UPDATE_PORG Tr code to have updated data into SRM Local Purchasing Organisation. I am receiving error message.
    Example Scenario:
    step 1: Present values in Vendor Master Vendor Number 100250, Purchaing Organisation : 1010 A/c Number: 100250-1010
    and I changed the account number as 10025o-test for vendor 100250 and pur organisation 1010.
    step 2: I run the BBPUPDVD in SRM System.
    Step 3: I checked the values in BBPMAININT - vendor data (for backend vendor number 100250 and backend pur organisation - 1010). The SRM system replicates the values correct.
    Step 4: I executed BBP_UPDATE_PORG and replaced the local (SRM) business partner (for local vendor number - 100250 and local purchasing organisation) - REPLACE Option. Then SRM replaces the SRM Business Partner (local) Data with Back end Vendor Master Data and also Back End vendor master data is deleted in SRM System. Now I have updated business partner details in SRM System as SRM Local an no SRM Back End Vendor Master Data in SRM System. This step is working fine.
    Step 5: One more time I am executing BBP_UPDATE_PORG Tr code with Add option to have SRM Back End Details (in SRM System) from SRM Local Details (SRM System). Then the system is error message in SM13 Tr code.
    Kind Note: There is no SRM Back End Vendor details in SRM System which I want to have with the help of executing BBP_UPDATE_PORG Tr code with Add option.
    For analysis I went to ST22 (dump Analysis), the SRM gave an error message like:
    Runtime Error          DYNPRO_SEND_IN_BACKGROUND
    Date and Time          09/15/2008 10:56:58
    ShrtText
         Screen output without connection to user.
    What happened?
         Error in ABAP application program.
         The current ABAP program "SAPLBBP_PARTNER_MAINT" had to be terminated because
          one of the
         statements could not be executed.
         This is probably due to an error in the ABAP program.
    Information on where terminated
        The termination occurred in the ABAP program "SAPLBBP_PARTNER_MAINT" in      "BBP_PORG_INSERT".
        The main program was "RSM13000 ".
        The termination occurred in line 59 of the source code of the (Include)      program "LBBP_PARTNER_MAINTU11"
        of the source code of program "LBBP_PARTNER_MAINTU11" (when calling the editor      590).
        The program "SAPLBBP_PARTNER_MAINT" was started in the update system.
       56
       57 * update database
       58   IF NOT LT_FRG0060_NEW[] IS INITIAL.
    >>>>>     INSERT BBPM_BUT_FRG0060 FROM TABLE LT_FRG0060_NEW.
       60   ENDIF.
       61
       62   IF NOT LT_FRG0061_NEW[] IS INITIAL.
       63     INSERT BBPM_BUT_FRG0061 FROM TABLE LT_FRG0061_NEW.
       64   ENDIF.
    Kindly guide me or provide solution.
    We are in SRM 4.0 and ECC 5.0.
    Thanks a lot in advance.
    Regards,
    Sudarsan
    Edited by: KOYYA SUDARSANA NAIDU on Sep 15, 2008 9:09 PM
    Edited by: KOYYA SUDARSANA NAIDU on Sep 17, 2008 8:46 PM

  • Re-Write the Node-DOM code with SQL-XML funtions

    Hi Friends,
    Could you please help in re-writing the below code using SQl-XML functions
    DECLARE
    l_domdoc dbms_xmldom.DOMDocument;
    l_xmltype XMLTYPE;
    l_root_node dbms_xmldom.DOMNode;
    l_departments_node dbms_xmldom.DOMNode;
    l_dept_element dbms_xmldom.DOMElement;
    l_dept_node dbms_xmldom.DOMNode;
    l_name_node dbms_xmldom.DOMNode;
    l_name_textnode dbms_xmldom.DOMNode;
    l_location_node dbms_xmldom.DOMNode;
    l_location_textnode dbms_xmldom.DOMNode;
    l_employees_node dbms_xmldom.DOMNode;
    l_emp_element dbms_xmldom.DOMElement;
    l_emp_node dbms_xmldom.DOMNode;
    l_emp_first_name_node dbms_xmldom.DOMNode;
    l_emp_first_name_textnode dbms_xmldom.DOMNode;
    l_emp_last_name_node dbms_xmldom.DOMNode;
    l_emp_last_name_textnode dbms_xmldom.DOMNode;
    BEGIN
    -- Create an empty XML document
    l_domdoc := dbms_xmldom.newDomDocument;
    -- Create a root node
    l_root_node := dbms_xmldom.makeNode(l_domdoc);
    -- Create a new node Departments and add it to the root node
    l_departments_node := dbms_xmldom.appendChild( l_root_node
    , dbms_xmldom.makeNode(dbms_xmldom.createElement(l_domdoc, 'Deptartments' ))
    FOR r_dept IN (SELECT dept.department_id
    , dept.department_name
    , loc.city
    FROM departments dept
    JOIN locations loc
    ON loc.location_id = dept.location_id
    WHERE dept.department_id IN (10,20)
    LOOP
    -- For each record, create a new Dept element with the Department ID as attribute.
    -- and add this new Dept element to the Departments node
    l_dept_element := dbms_xmldom.createElement(l_domdoc, 'Dept' );
    dbms_xmldom.setAttribute(l_dept_element, 'Deptno', r_dept.Department_Id );
    l_dept_node := dbms_xmldom.appendChild( l_departments_node
    , dbms_xmldom.makeNode(l_dept_element)
    -- Each Dept node will get a Name node which contains the department name as text
    l_name_node := dbms_xmldom.appendChild( l_dept_node
    , dbms_xmldom.makeNode(dbms_xmldom.createElement(l_domdoc, 'Name' ))
    l_name_textnode := dbms_xmldom.appendChild( l_name_node
    , dbms_xmldom.makeNode(dbms_xmldom.createTextNode(l_domdoc, r_dept.department_name ))
    -- Each Dept node will aslo get a Location node which contains the location(city) as text
    l_location_node := dbms_xmldom.appendChild( l_dept_node
    , dbms_xmldom.makeNode(dbms_xmldom.createElement(l_domdoc, 'Location' ))
    l_location_textnode := dbms_xmldom.appendChild( l_location_node
    , dbms_xmldom.makeNode(dbms_xmldom.createTextNode(l_domdoc, r_dept.city ))
    -- For each department, add an Employees node
    l_employees_node := dbms_xmldom.appendChild( l_dept_node
    , dbms_xmldom.makeNode(dbms_xmldom.createElement(l_domdoc, 'Employees' ))
    FOR r_emp IN (SELECT employee_id
    , first_name
    , last_name
    FROM employees
    WHERE department_id = r_dept.department_id
    LOOP
    -- For each record, create a new Emp element with the Employee ID as attribute.
    -- and add this new Emp element to the Employees node
    l_emp_element := dbms_xmldom.createElement(l_domdoc, 'Emp' );
    dbms_xmldom.setAttribute(l_emp_element, 'empid', r_emp.employee_id );
    l_emp_node := dbms_xmldom.appendChild( l_employees_node
    , dbms_xmldom.makeNode(l_emp_element)
    -- Each emp node will get a First name and Last name node which contains the first name and last name as text
    l_emp_first_name_node := dbms_xmldom.appendChild( l_emp_node
    , dbms_xmldom.makeNode(dbms_xmldom.createElement(l_domdoc, 'FirstName' ))
    l_emp_first_name_textnode := dbms_xmldom.appendChild( l_emp_first_name_node
    , dbms_xmldom.makeNode(dbms_xmldom.createTextNode(l_domdoc, r_emp.first_name ))
    l_emp_last_name_node := dbms_xmldom.appendChild( l_emp_node
    , dbms_xmldom.makeNode(dbms_xmldom.createElement(l_domdoc, 'LastName' ))
    l_emp_last_name_textnode := dbms_xmldom.appendChild( l_emp_last_name_node
    , dbms_xmldom.makeNode(dbms_xmldom.createTextNode(l_domdoc, r_emp.last_name ))
    END LOOP;
      END LOOP;
    l_xmltype := dbms_xmldom.getXmlType(l_domdoc);
    dbms_xmldom.freeDocument(l_domdoc);
    dbms_output.put_line(l_xmltype.getClobVal);
    END;
    thanks and regards,
    Arun Thomas T

    It's as easy as this :
    SQL> select xmlserialize(document
      2           xmlelement("Departments"
      3           , xmlagg(
      4               xmlelement("Dept"
      5               , xmlattributes(d.department_id as "Deptno")
      6               , xmlforest(
      7                   d.department_name as "Name"
      8                 , l.city as "Location"
      9                 )
    10               , xmlelement("Employees"
    11                 , (
    12                     select xmlagg(
    13                              xmlelement("Emp"
    14                              , xmlattributes(e.employee_id as "empid")
    15                              , xmlforest(
    16                                  e.first_name as "FirstName"
    17                                , e.last_name as "LastName"
    18                                )
    19                              )
    20                            )
    21                     from hr.employees e
    22                     where e.department_id = d.department_id
    23                   )
    24                 )
    25               )
    26             )
    27           )
    28           indent
    29         )
    30  from hr.departments d
    31       join hr.locations l on l.location_id = d.location_id
    32  where d.department_id in (10,20) ;
    XMLSERIALIZE(DOCUMENTXMLELEMEN
    <Departments>
      <Dept Deptno="10">
        <Name>Administration</Name>
        <Location>Seattle</Location>
        <Employees>
          <Emp empid="200">
            <FirstName>Jennifer</FirstName>
            <LastName>Whalen</LastName>
          </Emp>
        </Employees>
      </Dept>
      <Dept Deptno="20">
        <Name>Marketing</Name>
        <Location>Toronto</Location>
        <Employees>
          <Emp empid="201">
            <FirstName>Michael</FirstName>
            <LastName>Hartstein</LastName>
          </Emp>
          <Emp empid="202">
            <FirstName>Pat</FirstName>
            <LastName>Fay</LastName>
          </Emp>
        </Employees>
      </Dept>
    </Departments>

  • CDC (Change Data Capture) with 2 Tables

    Hello,
    i want to use the change data capture for the typical Data Warehousing progress (bring the new or updatet table from source to the staging area)
    So i have implemented a mapping with to tables. The source table is S_Account, the target or staging table is W_Account_DS.
    I have connected/mapped the tables and in the next step i goes into property inspector of W_ACCOUNT_DS into the Area Change Data Capture --> Change Data Capture Filter and put into the follow expression Builder
    Select *
    from S_Acccount
    where INOUTGRP1.LAST_UPD_DT = CURRENT_DATE (<-- Validation Succesful)
    and the next Step i make Enabeled is true in the Change Data Capture Area. So i think it should ready for one test case.
    I set in SQL Developer with an update statement the LAST_UPD_DT at 28.03.2012 in this case he should not update/insert anything, right? But he insert the full table.
    I set in SQL Developer with an update statement the LAST_UPD_DT by 2 Columms to 28.03.2012 in this case he should update he should update the full table - 2 columns with the date 28.03.2012, right?
    So what make i wrong or have i forgotten anything? (must set keys by the tables? I think not! If yes why?)
    Must i set anything properties else? Why doesnt´work it?
    I look forward for your replies :)

    Setting up CDC is a fairly complex process with different options. Setting just the filter in OWB is only a very small part.
    There is a blog post below on how to use code templates to do CDC which gives some insight;
    http://www.rittmanmead.com/2009/10/changed-data-capture-and-owb11gr2/
    Plus and older one illustrating how to use Oracle logs;
    http://www.rittmanmead.com/2006/04/asynchronous-hotlog-distributed-change-data-capture-and-owb-paris/
    Cheers
    David

  • Need help with nested table

    Hi,
    I am using the following code which is failing with no data found error.
    While if i hardcode the same value the code works.
    create table test(input varchar2(10),result varchar2(10));
    insert into test values('4093163','SUCCESS')
    declare
    TYPE acctid_tab IS table  OF varchar2(40);
        acctid       acctid_tab := acctid_tab ();
    V_RESULT varchar2(20);
    v_input varchar2(40);
    i pls_integer;
    begin
    acctid := acctid_tab('4080402 4093163 64472');
    i := acctid.FIRST;
    WHILE i IS NOT NULL
    LOOP
    v_input :=   trim(substr(acctid(i),instr(acctid(i),' ',1),instr(acctid(i),' ',-1,2)));
    SElect result into v_result from test
    where input = v_input;
          i := acctid.NEXT (i);
       END LOOP;
    END;
    ORA-01403: no data found
    ORA-06512: at line 14
    declare
    TYPE acctid_tab IS table  OF  varchar2(40);
        acctid       acctid_tab := acctid_tab ();
    V_RESULT varchar2(20);
    v_input varchar2(40);
    i pls_integer;
    begin
    acctid := acctid_tab('4080402 4093163 64472');
    i := acctid.FIRST;
    WHILE i IS NOT NULL
    LOOP
    v_input :=   trim(substr(acctid(i),instr(acctid(i),' ',1),instr(acctid(i),' ',-1,2)));
    SElect result into v_result from test
    where input = '4093163';
          i := acctid.NEXT (i);
       END LOOP;
    END;
    PL/SQL procedure successfully completed.Please advise.
    Thanks in advance.

    I guess you can just do
    declare
       v_input varchar2(1000);
    begin
       v_input := '4080402 4093163 64472';
       for i in (select input, result
                   from test
                  where input in (select regexp_substr(v_input, '[^ ]*', 1, level)
                                    from dual
                                  connect by level <= length(v_input) - length(replace(v_input, ' ')) + 1))
       loop
          dbms_output.put_line(i.input || ' ' || i.result);
       end loop;
    end;
    /Or even better
    declare
       v_input varchar2(1000);
    begin
       v_input := '4080402 4093163 64472';
       for i in (select input, result
                   from test
                  where ' ' || v_input || ' ' like '% ' || input || ' %')
       loop
          dbms_output.put_line(i.input || ' ' || i.result);
       end loop;
    end;

Maybe you are looking for

  • How do I find the symbol for the Japanese Yen?

    I'm trying to add the Japanese Yen symbol to a document written in English. I have a US purchased MAC set to English. G5 and Powerbook G4   Mac OS X (10.4.6)  

  • How to add new fields to the system form (Ex.expenses to a/r invoice form)

    hi can any one tell me how to add new fields to the system form (Ex.expenses to a/r invoice form) i want to add expenses field to system a/r invoice form and connect data base also. i used the code of samples\11.system form manipulation(vb.net) but i

  • Why are the CAN drivers so sloooooow?

    In my VC++ application using V1.4 of the drivers, I am communication with a device while I watch the bus with a scope. I have two frames to send to a device, but due to my protocol, I must wait for a response to the first before sending the second. I

  • Using sql Loader to insert from table?

    Hi ,, Can I use the SQL Loader tool to insert data from table to table, I want it to be instead of the following sql script: DELETE FROM TABLE1 WHERE PK IN (SELECT PK FROM TABLE2); INSERT INTO TABLE1 SELECT * FROM TABLE2; COMMIT; the purpose of using

  • Iphone 4 doesn't switch on cellular data after ios 7.1.1 upgrade

    I have noticed couple of issues after upgrading to ios 7.1.1 on my iphone4. 1. Slide option to answer call becomes un-responsive sometimes. 2.Once we enable Cellular data option, its not getting connected to cellular network for browsing, but if we r