cancel
Showing results for 
Search instead for 
Did you mean: 

Trying to get a employee with DI SERVER

Former Member
0 Kudos

Hi experts,

I'm using the DI Server and I need update a employee, for that, I need to get a specific employee and then modify him, but when I use the GetByKey method, it always returns "no record found". My code is the next one:


SBODI_Server.Node DISnode = new SBODI_Server.Node();

string sSOAPans = null;

XmlDocument xmlDoc = new XmlDocument();

string sCmd = <?xml version=""1.0"" encoding=""UTF-16""?><env:Envelope xmlns:env=""http://schemas.xmlsoap.org/soap/envelope/"">

+ "<env:Header><SessionID>" + SessionID + "</SessionID></env:Header>"

+ @"<env:Body><dis:GetByKey xmlns:dis=""http://www.sap.com/SBO/DIS"">"

+ "<Object>oEmployeesInfo</Object><EmployeeID>" + empID + "</EmployeeID></dis:GetByKey></env:Body></env:Envelope>";

sSOAPans = DISnode.Interact(sCmd);

xmlDoc.LoadXml(sSOAPans);

I just have one employee in the data base, with empID = 1. I tried to view all employees with the next code:


string sCmd = <?xml version=""1.0"" encoding=""UTF-16""?><env:Envelope xmlns:env=""http://schemas.xmlsoap.org/soap/envelope/"">

+ "<env:Header><SessionID>" + SessionID + "</SessionID></env:Header>"

+ @"<env:Body><dis:GetObjectKeyBySingleValue xmlns:dis=""http://www.sap.com/SBO/DIS"">"

+ "<ObjNum>oEmployeesInfo</ObjNum><PropName>Religion</PropName><Value>--</Value><Condition>bqc_NotEqual</Condition>"

+ "</dis:GetObjectKeyBySingleValue></env:Body></env:Envelope>";

And the EmployeeID 1 appears.

What am I doing wrong?

Regards,

Pedro

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Ok, it's a SAP error in PL10. I've installed SBO9 PL11 and I can get the employee data.

regards,

Pedro

Answers (1)

Answers (1)

maik_delly
Active Contributor
0 Kudos

Hi Pedro,

your SOAP command is correct - i get the data for the employee with empID = 1.

Is it possible that your variable empID holds wrong data ?

Can you (again) verify that OHEM contains a record with empID 1.

works:

<?xml version=""1.0"" encoding=""UTF-16""?><env:Envelope xmlns:env=""http://schemas.xmlsoap.org/soap/envelope/"">

<env:Header><SessionID>" + SessionID + "</SessionID></env:Header> 

<env:Body><dis:GetByKey xmlns:dis=""http://www.sap.com/SBO/DIS""> 

<Object>oEmployeesInfo</Object><EmployeeID>1</EmployeeID></dis:GetByKey></env:Body></env:Envelope>

regards,

Maik

Former Member
0 Kudos

Hi Maik,

I tried your code


<?xml version=""1.0"" encoding=""UTF-16""?><env:Envelope xmlns:env=""http://schemas.xmlsoap.org/soap/envelope/"">

<env:Header><SessionID>" + SessionID + "</SessionID></env:Header>

<env:Body><dis:GetByKey xmlns:dis=""http://www.sap.com/SBO/DIS"">

<Object>oEmployeesInfo</Object><EmployeeID>1</EmployeeID></dis:GetByKey></env:Body></env:Envelope>

But  I have the same response:

<?xml version="1.0" ?>

<env:Envelope xmlns:env="http://www.w3.org/2003/05/soap-envelope">

     <env:Body>
          <env:Fault>
               <env:Code>
                    <env:Value>env:Receiver</env:Value>
                    <env:Subcode>
                         <env:Value>-2052</env:Value>

                    </env:Subcode>

               </env:Code>

               <env:Reason>
                    <env:Text xml:lang="en">No record found</env:Text>

               </env:Reason>

               <env:Detail>
                    <EmployeeID>1</EmployeeID>
                    <Object>171</Object>
                    <Command>GetByKey</Command>
                     <SessionID>6B3C6A86-2F4B-4810-99DC-C0CCAAEECAC9</SessionID>

               </env:Detail>

           </env:Fault>

     </env:Body>

</env:Envelope>

The second message of original post returns this list:


<?xml version="1.0" ?>

<env:Envelope xmlns:env="http://www.w3.org/2003/05/soap-envelope">

     <env:Body>

          <GetObjectKeyBySingleValueResponse xmlns="http://www.sap.com/SBO/DIS">

               <BOM>

                    <BO>

                         <AdmInfo>

                              <Object>oRecordset</Object>

                         </AdmInfo>

                         <EmployeesInfo>

                              <row>

                                   <EmployeeID>1</EmployeeID>

                              </row>

                         </EmployeesInfo>

                    </BO>

               </BOM>

          </GetObjectKeyBySingleValueResponse>

     </env:Body>

</env:Envelope>


I'm using SAPBO 9 PL10 HF1.

Regards,

Pedro


maik_delly
Active Contributor
0 Kudos

Hi Pedro,

this is indeed very strange.

Can you have a look in OHEM to see if there is really an employee with empID=1 in database level?

In SQL Profiler I could see that HEM1-7 and CUFD are also queried - do they contain strange data ?

regards,

Maik

Former Member
0 Kudos

Hi Maik,

I looked the database and there are an employee with empID=1.

The employee has not another data, so HEM1-7 tables are empty and I don't see strange data in CUFD.

I tried the same code in other machine, with SAP BO 9 PL 9 HF1, with the same database, and returns the employee correctly. For that, I think that the issue is a bug in PL10.

I will update to PL11 the next week and then I'll try again. I hope it finally works

Thanks for respond