Service call and code wizard

Dear All,
I am working on ECC 6.0 with Eph2 and SAP_HR SP27, when i tried to create a service call to function module in the Adapt Context i am not able to view the check box for selection.
Also when i click the Webdynpro Code Wizard it shows only a template gallery with standard screen,from and table only, which is not not displayin the Web dynpro statement structure
What could be the possible reason?
Patch level update or Service activation ?
Could you help me out in the solving this issue?

> when i tried to create a service call to function module in the Adapt Context i am not able to view the check box for selection.
What checkbox can you not see?  I am looking at that step in the Wizard and there isn't any checkbox - just a table control with the node type, name, object type, new name.
>Also when i click the Webdynpro Code Wizard it shows only a template gallery with standard screen,from and table only, which is not not displayin the Web dynpro statement structure
The Web Dynpro Code Wizard from the View-layout tab should only have the Screen, Form, and Table option.  What else where you expecting. If you want the code generation wizard then you are in the wrong place.  Form the method editor choose the Web Dynpro Code Wizard and you will get a completely different set of options than choosing the same option from the view-layout tab.

Similar Messages

  • IDispatchMessageInspector.AfterReceiveRequest - bypass service call and return manually response

    Hi,
    I am using a service behavior class that implements IDispatchMessageInspector.AfterReceiveRequest to handle Health Check Service request that require skipping the actual operation's code and instead manually crafting a response message from "BeforeSendReply".
    I want to skip any processing on the request and instead want to return manual response from "BeforeSendReply".
    It has been pointed out in various forum threads that setting ref request parameter to null will skip the normal message processing and transition directly to BeforeSendReply. I have tracing enabled on my service and observe that underneath it still tries to
    deserialize the message and throws an exception:
    NullReferenceException: Object reference not set to an instance of an object.
    System.ServiceModel.Dispatcher.DispatchOperationRuntime.DeserializeInputs(MessageRpc& rpc)
    System.ServiceModel.Dispatcher.DispatchOperationRuntime.InvokeBegin(MessageRpc& rpc)
    System.ServiceModel.Dispatcher.ImmutableDispatchRuntime.ProcessMessage5(MessageRpc& rpc)
    System.ServiceModel.Dispatcher.ImmutableDispatchRuntime.ProcessMessage31(MessageRpc& rpc)
    System.ServiceModel.Dispatcher.MessageRpc.Process(Boolean isOperationContextSet)
    any idea how can I skip the service call and instead return a manual response back?
       

    This is not correct (setting request to null to bypass the service), unfortunately WCF doesn't have any out-of-the-box way of doing that.
    You can, however, use a few more of the extensibility points in WCF to make this scenario work. You'll need at least an IDispatchMessageFormatter (to prevent the message from being read / deserialized since it's not necessary) and an IOperationInvoker (to
    actually bypass invoking the service method). You can use the operation context to pass information between those extensibility points.
    You can find more information about those three interfaces in my ongoing blog series about WCF extensibility points:
    IDispatchMessageInspector: http://blogs.msdn.com/b/carlosfigueira/archive/2011/04/19/wcf-extensibility-message-inspectors.aspx
    IDispatchMessageFormatter: http://blogs.msdn.com/b/carlosfigueira/archive/2011/05/03/wcf-extensibility-message-formatters.aspx
    IOperationInvoker: http://blogs.msdn.com/b/carlosfigueira/archive/2011/05/17/wcf-extensibility-ioperationinvoker.aspx
    The code which uses those extensions to skip the operation based on a decision made in the message inspector:
    public class Post_55ef7692_25dc_4ece_9dde_9981c417c94a
    [ServiceContract(Name = "ITest", Namespace = "http://tempuri.org/")]
    public interface ITest
    [OperationContract]
    string Echo(string text);
    public class Service : ITest
    public string Echo(string text)
    return text;
    static Binding GetBinding()
    BasicHttpBinding result = new BasicHttpBinding();
    return result;
    public class MyOperationBypasser : IEndpointBehavior, IOperationBehavior
    internal const string SkipServerMessageProperty = "SkipServer";
    public void AddBindingParameters(ServiceEndpoint endpoint, BindingParameterCollection bindingParameters)
    public void ApplyClientBehavior(ServiceEndpoint endpoint, ClientRuntime clientRuntime)
    public void ApplyDispatchBehavior(ServiceEndpoint endpoint, EndpointDispatcher endpointDispatcher)
    endpointDispatcher.DispatchRuntime.MessageInspectors.Add(new MyInspector(endpoint));
    public void Validate(ServiceEndpoint endpoint)
    public void AddBindingParameters(OperationDescription operationDescription, BindingParameterCollection bindingParameters)
    public void ApplyClientBehavior(OperationDescription operationDescription, ClientOperation clientOperation)
    public void ApplyDispatchBehavior(OperationDescription operationDescription, DispatchOperation dispatchOperation)
    dispatchOperation.Formatter = new MyFormatter(dispatchOperation.Formatter);
    dispatchOperation.Invoker = new MyInvoker(dispatchOperation.Invoker);
    public void Validate(OperationDescription operationDescription)
    class MyInspector : IDispatchMessageInspector
    ServiceEndpoint endpoint;
    public MyInspector(ServiceEndpoint endpoint)
    this.endpoint = endpoint;
    public object AfterReceiveRequest(ref Message request, IClientChannel channel, InstanceContext instanceContext)
    Message result = null;
    HttpRequestMessageProperty reqProp = null;
    if (request.Properties.ContainsKey(HttpRequestMessageProperty.Name))
    reqProp = request.Properties[HttpRequestMessageProperty.Name] as HttpRequestMessageProperty;
    if (reqProp != null)
    string bypassServer = reqProp.Headers["X-BypassServer"];
    if (!string.IsNullOrEmpty(bypassServer))
    result = Message.CreateMessage(request.Version, this.FindReplyAction(request.Headers.Action), new OverrideBodyWriter(bypassServer));
    return result;
    public void BeforeSendReply(ref Message reply, object correlationState)
    Message newResult = correlationState as Message;
    if (newResult != null)
    reply = newResult;
    private string FindReplyAction(string requestAction)
    foreach (var operation in this.endpoint.Contract.Operations)
    if (operation.Messages[0].Action == requestAction)
    return operation.Messages[1].Action;
    return null;
    class OverrideBodyWriter : BodyWriter
    string bypassServerHeader;
    public OverrideBodyWriter(string bypassServerHeader)
    : base(true)
    this.bypassServerHeader = bypassServerHeader;
    protected override void OnWriteBodyContents(XmlDictionaryWriter writer)
    writer.WriteStartElement("EchoResponse", "http://tempuri.org/");
    writer.WriteStartElement("EchoResult");
    writer.WriteString(this.bypassServerHeader);
    writer.WriteEndElement();
    writer.WriteEndElement();
    class MyFormatter : IDispatchMessageFormatter
    IDispatchMessageFormatter originalFormatter;
    public MyFormatter(IDispatchMessageFormatter originalFormatter)
    this.originalFormatter = originalFormatter;
    public void DeserializeRequest(Message message, object[] parameters)
    if (message.Properties.ContainsKey(MyOperationBypasser.SkipServerMessageProperty))
    Message returnMessage = message.Properties[MyOperationBypasser.SkipServerMessageProperty] as Message;
    OperationContext.Current.IncomingMessageProperties.Add(MyOperationBypasser.SkipServerMessageProperty, returnMessage);
    OperationContext.Current.OutgoingMessageProperties.Add(MyOperationBypasser.SkipServerMessageProperty, returnMessage);
    else
    this.originalFormatter.DeserializeRequest(message, parameters);
    public Message SerializeReply(MessageVersion messageVersion, object[] parameters, object result)
    if (OperationContext.Current.OutgoingMessageProperties.ContainsKey(MyOperationBypasser.SkipServerMessageProperty))
    return null;
    else
    return this.originalFormatter.SerializeReply(messageVersion, parameters, result);
    class MyInvoker : IOperationInvoker
    IOperationInvoker originalInvoker;
    public MyInvoker(IOperationInvoker originalInvoker)
    if (!originalInvoker.IsSynchronous)
    throw new NotSupportedException("This implementation only supports synchronous invokers");
    this.originalInvoker = originalInvoker;
    public object[] AllocateInputs()
    return this.originalInvoker.AllocateInputs();
    public object Invoke(object instance, object[] inputs, out object[] outputs)
    if (OperationContext.Current.IncomingMessageProperties.ContainsKey(MyOperationBypasser.SkipServerMessageProperty))
    outputs = null;
    return null; // message is stored in the context
    else
    return this.originalInvoker.Invoke(instance, inputs, out outputs);
    public IAsyncResult InvokeBegin(object instance, object[] inputs, AsyncCallback callback, object state)
    throw new NotSupportedException();
    public object InvokeEnd(object instance, out object[] outputs, IAsyncResult result)
    throw new NotSupportedException();
    public bool IsSynchronous
    get { return true; }
    public static void Test()
    string baseAddress = "http://" + Environment.MachineName + ":8000/Service";
    ServiceHost host = new ServiceHost(typeof(Service), new Uri(baseAddress));
    ServiceEndpoint endpoint = host.AddServiceEndpoint(typeof(ITest), GetBinding(), "");
    endpoint.Behaviors.Add(new MyOperationBypasser());
    foreach (var operation in endpoint.Contract.Operations)
    operation.Behaviors.Add(new MyOperationBypasser());
    host.Open();
    Console.WriteLine("Host opened");
    ChannelFactory<ITest> factory = new ChannelFactory<ITest>(GetBinding(), new EndpointAddress(baseAddress));
    ITest proxy = factory.CreateChannel();
    Console.WriteLine(proxy.Echo("Hello"));
    Console.WriteLine("And now with the bypass header");
    using (new OperationContextScope((IContextChannel)proxy))
    HttpRequestMessageProperty httpRequestProp = new HttpRequestMessageProperty();
    httpRequestProp.Headers.Add("X-BypassServer", "This message will not reach the service operation");
    OperationContext.Current.OutgoingMessageProperties.Add(
    HttpRequestMessageProperty.Name,
    httpRequestProp);
    Console.WriteLine(proxy.Echo("Hello"));
    ((IClientChannel)proxy).Close();
    factory.Close();
    Console.Write("Press ENTER to close the host");
    Console.ReadLine();
    host.Close();

  • Join a service call and one serial number?

    In admin web tools
    Can  join a service call and one customer equipment card (serial number) ?

    The company sells machines for industry.
    Every machine and component has a serial number and u201Ccustomer equipment cardu201D in SBO.
    Usually, If the customer has a problem call to company.
    1.-  SBO user get the u201Ccall serveru201D
    2.- SBO user support join the u201Ccall serveru201D and  u201Ccustomer equipment cardu201D
    3.- SBO user go to call server  create a Delivery (works and equipment)
    Unfortunately the technical support, works in customer company and usually canu2019t entry to SBO in several days.
    We like use the u201Cweb toolsu201D, the technical support uses the web and can see the u201Ccall serveru201D, the Customer and marketing documents.
    But canu2019t assign a u201Ccustomer equipment cardu201D to  u201Ccall serveru201D and synchronize to SAP and create a Delivery by WEB
    Can you proposal a new work flow by web?
    Muchas gracias.

  • Link between Service Call and Marketing documents not working

    Hello all,
    I found a field in Marketing Documents - Rows data - that should be the link between a Service Call and the Marketing Documents.
    The field is for example "INV1.isSrvCall" but, even if I create an Invoice from the Service Call, the field will be populated with the value "N".
    Dows anyone knows how to make this field work? Or any workarround to make the connection between a Service Call and the generated documents?
    Thanks in advance,
    Kind Regards

    The problem with SCL4  is that SAP updates it way too late in the process to be meaningful while in the module. You create a service order, then go into the expense document. That is when we need to know the service call id and the internalsn of the equipment being worked on Only when you get out of the service module do SAP post to SCL4.  
    The data (before writing to SCL$) exists as a veriable on the original service form.  But can we access it from the expense document?
    The question is how to access the data (service id) on the original service form from an expense document within the servide module. It is the service form, and that is currently not in focus, so I do not know if you can access it as a varaible, while in the expense document (sales order or invoice) that is in focus.
    Can any one help with this/
    David

  • Why Service Call and why not call Function module Directly in WD ABAP

    Hi,
    I have created a Webdynpro applications and the logic requires calling avrious Function modules.
    Do I need to create Service Call for each Function module or call them directly.
    It would be great if you can suggest me under what cases I need to opt for Service call
    For example, if I use 'RP_CALC_DATE_IN_INTERVAL', do I need to use Service call or call function module directly.
    Note: I have searched forums but could not get the correct answer which I want
    Thanks!

    The Service Call is really meant to be a wizard/time saver.  It has the advantage that it can generate matching context nodes/attributes for the interface of the Function Module you are calling. However everything that the service call does can also be created by hand.
    Personally I'm not a fan of what the service call wizard generates.  Its good as a time saver or for beginners, but I find I prefer to touch up the code it generates anyway. I much prefer to create a nice reusable model class with its own unit test and then consume this model class (with the service call wizard) from WD.  This model class might contain one or more function module calls depending upon what logic I need to access.

  • Script example trigger web service call and populate request from adobe

    Hello,
    I'm trying to make a adobe interactive form that needs to be populated by a web service. I have one field : In the dataconnection that is the input for the web service request and this is bound to the request. I have a button that is connected to my web service. After filling in a new value and pushing the button I want the web service request to be triggered.
    Thus anyone has a coding example or more information about using web services directly from within a Adobe Interactive form ?
    thnx, Jasper

    Hi Jasper,
    You may refer the Adobe ddevelopment center for the docs related to the execute property of the button to trigger a web service.
    <i>Alternatively, if you do not want to create a button to execute a call to a Web Service, you can do it via Script.
    Assuming your Data Connection is named ‘LeasePayment’
    For JavaScript:
    xfa.connectionSet.LeasePayment.execute(0);
    For Form Calc:
    $connectionSet.LeasePayment.execute(0);
    execute(0) indicates no data merging
    execute(1) indicates all the data in the data DOM will be remerged.</i> - Adobe doc.
    hope this will help.
    Thanks andRegards,
    Anto.

  • Service Call and Invoice For That Service Call

    What field relates an invoice created within the service call form under expenses, to the originating service call number. I know it is somewhere but I cannot find it.  The invoice needs to know the originating service calll number.
    Thanks, David

    Yes the field is there SCL4 but the problem is timing. It is posted too late to be meaningful.
    While in an invoice,  I need to capture the service call ID so that I can assign the service call id to a field in the invoice, and also
    import the remarks from the service call to the remarks on the invoice.
    The way B1 words is that SCL4 gets populated way too late in the game. The SCL4 table gets populated only after Updating  the service call itself. This is after the user has created and exited the invoice.
    Any other suggestions for dynamically capturnig the invoice id during invoice creation under a service call?
    Thanks, David

  • Posting to SCL4 -- Link an service call and an invoice --

    Is there any way to post to SCL4 sooner to create the link between a service order and an expense document.
    Currently the link is created after one leaves the service module.  That is too late to be functional. 
    Therefore you cannot grab the service id of the current service order and assign it to the marketing document created while in the service module.
    SCL4 creates a strong link between the serivce order and the expense document, it is just too late.
    The link is made on exit of the service call.  
    It would be great if the link was created when the user "Adds" the expense document (sales order or invoice) to B1 while in the service module.
    Thanks, David

    Yes the field is there SCL4 but the problem is timing. It is posted too late to be meaningful.
    While in an invoice,  I need to capture the service call ID so that I can assign the service call id to a field in the invoice, and also
    import the remarks from the service call to the remarks on the invoice.
    The way B1 words is that SCL4 gets populated way too late in the game. The SCL4 table gets populated only after Updating  the service call itself. This is after the user has created and exited the invoice.
    Any other suggestions for dynamically capturnig the invoice id during invoice creation under a service call?
    Thanks, David

  • ColdFusion Remote Service Calls and Dates

    Hi all, I'm hoping someone can help me out with my confusion.  I’m sending an object including datetime data from ColdFusion to a Flash application.  The datetime in the ColdFusion object include milliseconds, however, if I use the getTime() function on the Date object in the Flex application, the milliseconds have been zeroed out.  Is there any way to retain the milliseconds when the data is passed through the flexgateway?
    Thanks,
    Christine

    Hi Balaji,
    I have attached a demo of my proxy webservice called pxTest.cfc.  pxTest.cfc contains two functions, testDate and pushBackTestDate.  I also attached a simple Flex App called testDate.mxml.  And a Test file called test.cfm.
    Save pxTest.cfc to your CFC folder.  Create a new project called TestDate.  Go to the data/services tab, click "Connect to Data/Service" and select Data Service ColdFusion.  Browse to PxTest.cfc and select it for the CFC location.  Click Next, then click Finish.  Configure ReturnType as Date for both pushBackTestDate and testDate.  Paste the code from TestDate.mxml into the blank TestDate.mxml file that was created when you created the project TestDate.  Run the TestDate.mxml application.
    On load of the application a date was requested and received from pxTest.cfc.  Click Confirm Test Date and note the date returned, and the milliseconds value for that date.  Next click Push User Data back, this will call the method pushBackTestDate sending the date from the Flex app back into CF.  All pushBackTestDate does is set the value returned into session and return it back to the Flex app again.
    Click the button Show Pushed Data Result to see the date that was returned.  In my tests this date no longer has a value for milliseconds.  As long as pxTest.cfc and test.cfm run in the same session you will be able to see the dates sent and returned by running test.cfm.  The dump of that session variable and time formatted versions of that variables are displayed below:
    RETURNED
    {ts '2009-09-17 12:57:50'}
    SEND
    {ts '2009-09-17 12:57:50'}
    TimeFormat Send 12:57:50 13
    TimeFormat Returned 12:57:50 0
    Note the date sent contains milliseconds, the date returned does not have milliseconds.  Hopefully this demo will work for you and demonstrate the issue.  Please let me know if you need more information.
    Thanks,
    Christine

  • Web service call and page fowarding

    I just started with HTML DB. I have a customer that requires the use of HTML DB for there standard look and feel, since they are using it for other applications.
    I need to use HTML DB to create a front end that is backed by either EJBs or Web services that front the EBJs, to create a single application. I can not go directly to the DB since there is to much business logic contained in the EJBs that I would be circumventing. I dont think this is a good use of tech. from either side (J2EE or HTML DB) but I did not make the decision.
    I have not seen integration with EJBs addressed (if you know of any please speak up), so I was happy to see that web services are supported.
    So....
    I have been able to call a webservice and get a result. I need to be able to format the result and create buttons based on the results returned by the web services. These buttons will call other pages that may or may not call additional webservices. In addition, I need to pass values in the web services response to pages called by the buttons generated. Any and all help would be appreciated.
    Also does the syntax for #somethine# and &someone get evaluated if used in the XSL that renders the webservice response?

    Please disregard my "additional information" post to this
    item. I posted it here by mistake!

  • Service call and context

    Hi expert,
    Thanks,
    Edited by: Salahuddin Lughmani on Jun 13, 2008 11:02 PM

    Hi,
    You can use service group for changing the destination at run time.
    Regards
    Narendra

  • Web Service call - XI - SAP  and  SAP - XI  - Web Service response ???

    Hi ALL,
    Need some  guidance on the following Scenario :
    A Legacy system  would  transfer some data to SAP thoruhg a Web Service call and  would expect a response from SAP by way of a response to the same Web service call
    A synchronous Interface , inbound to sap via a Web service call and back  to the legacy system through the response to the same Web Service .
    Need to provide WSDL to the Legacy system
    Any help on how to do the above mentioned will be apreciated
    thanks in advance

    SD,
    Check this weblog for step by step procedure:
    /people/siva.maranani/blog/2005/09/03/invoke-webservices-using-sapxi
    Here instead of deploying in XI you will deploy your webservice in the legacy system.
    If you want to test this webservice then check this weblog:
    /people/siva.maranani/blog/2005/09/03/invoke-webservices-using-sapxi
    ---Satish

  • Horrible customer service, dropped calls and faulty products

    Does Verizon offer partial credits to accounts due to defective equipment and inability to use their services? I received a new set top box that would not download my existing HBO and SHOWTIME accounts. After numerous calls on hold, dropped service calls and misdirected (on purpose) calls to billing in customer service to increase my services...I finally waited over one hour for technical assistance tonight to be told my new set top box was faulty and a new one would be sent in the mail. I asked about a partial refund because I could not use it during the least two weeks. I was told by the tech he would send a new box and put me in touch with customer service after explaining to them the circumstances and that supervisor would need that info for a partial credit to my account. A horrible customer service rep {edited for privacy} bluntly stated no partial credits and tech should not have said a partial credit was possible. By this time I was on the phone over one our and not a very happy customer. I asked to speak to a superior to which {edited for privacy} said they were too busy and a partial credit would not be possible for my two week period with faulty equipment. I demanded to speak with a supervisor and was put on hold for an additional 70 minutes. I am STILL ON HOLD!!!! This is no way to treat customers! I am disconnecting my call and BEG THAT A VERSION REP get back in touch with me to resolve this. Under what circumstances does verizon provide partial credit for a customer who has not been able to use it because the equipment is DEFECTIVE??? Hopefully new set top box is enroute..HOPE IT IS NOT DEFECTIVE!!!!!!

    Your issue has been escalated to a Verizon agent. Before the agent can begin assisting you, they will need to collect further information from you.Please go to your profile page for the forum, and look in the middle, right at the top where you will find an area titled "My Support Cases". You can reach your profile page by clicking on your name beside your post, or at the top left of this page underneath the title of the board.
    Under “My Support Cases” you will find a link to the private board where you and the agent may exchange information. This should be checked on a frequent basis as the agent may be waiting for information from you before they can proceed with any actions. To ensure you know when they have responded to you, at the top of your support case there is a drop down menu for support case options. Open that and choose "subscribe".
    Please keep all correspondence regarding your issue in the private support portal.

  • Need Information regarding Service Call creation in SAP R/3

    Hello,
      I need the Transaction code or BAPI to create a service call in sap. Please provide the database table name for the service calls.
    We want to develop  service call management in our server.So please send me the Business data model for service call management in SAP.(All related objects to the service call and their data models.)
    Regards,
    Kiran.

    Hi
    Invoice list is basically SD configuration.
    <b>Invoice List</b>
    <b>Purpose</b>
    The invoice list lets you create, at specified time intervals or on specific dates, a list of billing documents (invoices, credit and debit memos) to send to a particular payer.
    The billing documents in the invoice list can be single or collective documents (collective invoices combine items from more than one delivery).
    The standard version of the SAP R/3 System includes two types of invoice lists:
    1.for invoices and debit memos
    2.for credit memos
    If you wish, you can process invoices, debit memos, and credit memos at the same time. The system automatically creates a separate invoice list for credit memos.
    A payer may be the head office of a buying group, which pays all the invoices for goods that are shipped to individual members. The group payer takes responsibility for paying the invoice lists and then collecting payment from the individual members. In return for these services, the group payer usually earns a factoring or del credere discount.
    Depending on the tax structure of the payer's country, the payer may be liable to pay taxes on factoring discounts that he earns. In Germany, for example, factoring discounts are taxed at the standard rate of 15%. During invoice list processing, you can reimburse the payer in advance for this tax liability by creating special condition records
    Regards
    Ramakrishna

  • URGENT: Service Call Activity Issue

    Hi guys, I have a seriously irritating issue concerning the linking of an activity to service call.
    As of Service Pack 01, Patch 36 (at least as far as I know) I get the following error when attempting to create and link an activity to a service call:
    Error Code: -5002
    Error Description: A service call activity does not exist
    I use the folliwing code;
    If oServ.GetByKey(MRI) Then
                    If DocType = "QT" Then
                        oAct = oComp.GetBusinessObject(SAPbobsCOM.BoObjectTypes.oContacts)
                        oAct.Activity = SAPbobsCOM.BoActivities.cn_Task
                        oAct.CardCode = oServ.CustomerCode
                        oAct.DocEntry = DocID
                        oAct.DocType = 23
                        oDoc = oComp.GetBusinessObject(SAPbobsCOM.BoObjectTypes.oQuotations)
                        If oDoc.GetByKey(DocID) Then
                            oAct.Notes = "Sales Quote: " & oDoc.Comments
                        End If
                        oAct.Details = "Sales Quote " & DocID & " auto created by MRI " & MRI & ""
                        If oAct.Add <> 0 Then
                            oApp.SetStatusBarMessage("Error adding Linked Document Activity for Sales Quote " & DocID & " : " & oComp.GetLastErrorDescription)
                            oLog.WriteLog("Error adding Linked Document Activity for Sales Quote " & DocID & " : " & oComp.GetLastErrorCode & oComp.GetLastErrorDescription, EventLogEntryType.Error)
                        Else
                            oServ.Activities.Add()
                            oServ.Activities.ActivityCode = oComp.GetNewObjectKey
                            oServ.Activities.SetCurrentLine(oServ.Activities.Count() - 1)
                        End If
    If oServ.Update <> 0 Then
                        oApp.SetStatusBarMessage("Error linking Expense Document " & DocID & ":" & oComp.GetLastErrorDescription)
                        oLog.WriteLog("Error linking Expense Document " & DocID & ":" & oComp.GetLastErrorCode & "-" & oComp.GetLastErrorDescription, EventLogEntryType.Error)
                    End If
    the Activity is added without any problem, but the error comes when linking it to the Service Call (oServ.Update)
    Can you please help, I'm going insane with this problem.

    this is how i got it to work:
    ServiceCalls sc = null;
    sc = (ServiceCalls)company.GetBusinessObject(BoObjectTypes.oServiceCalls);
    if (!sc.GetByKey(callId))
          throw new Exception("Failed to add service call activity! Service call does not exist!");
    if (sc.Activities.Count == 1)
             sc.Activities.SetCurrentLine(sc.Activities.Count - 1);
             string temp = sc.Activities.ActivityCode.ToString();
             if (!string.IsNullOrEmpty(temp) && !temp.Equals("0"))
                     sc.Activities.Add();
    else
             sc.Activities.Add();
    sc.Activities.SetCurrentLine(sc.Activities.Count - 1);
    sc.Activities.ActivityCode = int.Parse(lastAcctivity);
    if (sc.Update() != 0)
             company.GetLastError(out errorCode, out errorMsg);
              if (null != sc)
                      System.Runtime.InteropServices.Marshal.ReleaseComObject(sc);
                      sc = null;
    throw new Exception(errorCode + " -> " + errorMsg);
    You could either use that piece of code or make an insert in SCL5.

Maybe you are looking for