Home > Default > How to get called from R3 on a Sales Order creation

How to get called from R3 on a Sales Order creation

October 11Hits:0
Advertisement
Hi,
I'm completely new on SAP NetWeaver technology.
My domain is SAP Business One SDK development and .NET Technologies.
What I'm trying to do is some kind of integration between B1 and R3 and for that I need to get called in my .NET application by an event or something similar coming from and R3 system everytime a new Sales Order is created.
Could some of you as NetWeaver experts give me a hint on how to do it? Right now I'm looking at ALE and IDocs but I cannot find a concrete sample of a .NET application. Do you have some useful links to .NET samples?
Thanks,
Trinidad.

Answers

Use ERP Connect.
Apart from the client functionality that allows function modules or BAPIs to be accessed in
the SAP system, ERP Connect also offers the possibility of easily developing a server
function.
For example, if you have a .net application which adds 2 numbers sent by R/3, you can call that .NET function using ABAP code like this one:
REPORT z_add_test .
DATA result TYPE i.
CALL FUNCTION 'Z_ADD' DESTINATION 'YAHOO'
  EXPORTING
    number1 = 13
    number2 = 31
  IMPORTING
    res = result.
WRITE result.
Looks simple, right?
But don't forget that you still have to do something from the .net realm.
Code something like this:
using ERPConnect;
static void Main(string[] args)
  RFCServer s = new RFCServer();
  s.GatewayHost = "ides";
  s.GatewayService = "sapgw13";
  s.ProgramID = "YAHOO";
  s.IncomingCall  += new ERPConnect.RFCServer.OnIncomingCall(s_IncomingCall);
  RFCServerFunction f = s.RegisteredFunctions.Add("Z_ADD");
  f.Imports.Add("NUMBER1",RFCTYPE.INT);
  f.Imports.Add("NUMBER2",RFCTYPE.INT);
  f.Exports.Add("RES",RFCTYPE.INT);
  s.Start();
  Console.Write("Service is ready.");
  Console.ReadLine();
private static void s_IncomingCall(RFCServer Sender, RFCServerFunction CalledFunction)
  if (CalledFunction.FunctionName=="Z_ADD")
    Int32 i1 = (Int32)CalledFunction.Imports["NUMBER1"].ParamValue;
    Int32 i2 = (Int32)CalledFunction.Imports["NUMBER2"].ParamValue;
    Int32 erg = i1 + i2;
    CalledFunction.Exports["RES"].ParamValue = erg;
    Console.WriteLine("SAP did a call at " + DateTime.Now.ToString());
  else
    throw new Exception("Something bad happened!!!");
That... should be working
Reward points when you find usefull.

Read other 12 answers

Tags:

Related Articles

  • New DVR Issues (First Run, Channel Switching, etc.)October 11

    I've spent the last 30 minutes trying to find answers through the search with no luck, so sorry if I missed something. I recently switched to FIOS from RCN cable in New York.  I've gone through trying to setup my DVR and am running into issues and wa

  • Delete File From Mounted VolumeOctober 11

    Hey, I am trying to delete the "Calendar Cache" files on both my laptop PowerBook G4 and the Mac Pro Quad that I sync my calendars with. I am using ChronoSync and the individual calendars sync fine, but there is a little house keeping needed wit

  • Mixing memory modules on WestmereOctober 11

    Dear Hardware gurus, I have a 12-Cores Westmere. Do you know is it possible to mix different memory modules on it, namely: 6x1 Gb 1330Mhz + 2x4 Gb 1066Mhz and if yes, in which configuration? Thanks a lot for any comment!Kappy, thanks for the note. I

  • Null And " "October 11

    What is the difference between these two lines of codes? String currentFile = null; String currentFile = ""; Edited by: AMARSHI on Jul 10, 2008 7:07 AMThe reference variable itself, takes up the same amount of space, of course, as all references

  • Query HelpOctober 11

    Table1: ou store point LS LIB1 50 LS LIB1 200 LS LIB1 100 LS LIB1 79 I have to insert table1 to table2 by splitting into every 143point and assing serial number for every 143 from parameter. in aboce example we can split 3 time 143 like below table2

  • Eclipse Community ForumsOctober 11

    Hi, I have a problem using Xtext generated ecore files in both Eclipse and standalone Java. In a nutshell, Xtext generates relative ecore references which work fine in Eclipse for platform:/resource URIs which make it seem like all projects are sibli

  • Logical filename in broadcastingOctober 11

    Hi everyone, We want to use the bursting functionality to broadcast a report to the portal. We'll split the result to profit center so each profit center gets a seperate pdf document. Now a few hundred pdf files get created but it's unclear which fil

  • Fields in Creation of free goods VBN1October 11

    hi everybody, Can somebody expalin in detail the fields in creation of free goods(T-vbn1) like free goods quantity,additional quantity,documnet quantity and calculation rule.... <b>Please dont copy paste anything form SAP help....I read that one....

  • Safari doesn't open and comes up with this error report.October 11

    Please help. Process:         Safari [474] Path:            /Applications/Safari.app/Contents/MacOS/Safari Identifier:      com.apple.Safari Version:         7.0.4 (9537.76.4) Build Info:      WebBrowser-7537076004000000~3 Code Type:       X86-64 (Na

  • Open PO Analysis - BW report issueOctober 11

    Hello Friends I constructed a query in BW in order to show Open Purchase Orders. We have custom DSO populated with standard datasource 2lis_02_itm (Purcahse Order Item). In this DSO we mapped the field ELIKZ to the infoobject 0COMP_DEL (Delivery comp

Copyright (C) 2017 wisumpire.com, All Rights Reserved. webmaster#wisumpire.com 15 q. 0.203 s.