on 06-05-2006 4:53 PM
i am trying to send an idoc(see below) with idocsender in an asp.net application
ABC.txt is where the idoc is
i make the connection to my sap okay
string dataFile = "ABC.txt" ;
string txtIdocContents;
string filePath = (Server.MapPath(dataFile));
StreamReader str = File.OpenText(filePath);
txtIdocContents = str.ReadToEnd();
TextReader t = str;
RfcTID myTid = RfcTID.NewTID();
try
{
proxy.Connection = SAP.Connector.SAPLoginProvider.GetSAPConnection(this);
sapiDocSender2.SubmitIDoc(t,myTid);
proxy.ConfirmTID(myTid);
HttpContext.Current.Response.Write ("Idoc was submitted to SAPlook at transaction WE02 in SAP");
}
catch (Exception ex)
{
HttpContext.Current.Response.Write ("Problem submitting IDOC to SAP\n" + ex.ToString()
)
-
i get the following error
txtProblem submitting IDOC to SAP System.ArgumentException: iDoc Parameter name: Invalid IDoc. at SAP.Connector.SAPIDocSender.ParseIDocStream(TextReader iDoc) at SAP.Connector.SAPIDocSender.SubmitIDoc(TextReader iDoc, RfcTID tid) at sap6.WebForm1.Button1_Click(Object sender, EventArgs e) in
psbeh18\wwwroot$\sap6\default.aspx.cs:line 137
EDI_DC40 0000000000000037249620 3012 EXCHANGE_RATE01 EXCHANGE_RATE EXCHANRBFILEPORTLS BTS2000 EXCHANSAPMBS LS BTS2000 20021014113506
E2EXCHANGE_RATE000 000000000000003724900000100000001 X
E2BP1093_0001 000000000000003724900000200000102M AED JPY 200210101.02 1 1 1.02 1 1
please help
very new to this
any ideas or direction to help info would be greatly appreciated
Please use the other overload, i.e.
SubmitIDoc(string iDocPath, RfcTID tid);
This means, instead of
sapiDocSender2.SubmitIDoc(t,myTid)
, try using
sapiDocSender2.SubmitIDoc(filePath,myTid);
2. Make sure the file has correct permissions.
3. Good luck with RFC/IDocs!!
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
thank you thank you for the help
i am now getting a different error
any ideas?
I now use
sapiDocSender2.SubmitIDoc((Server.MapPath(dataFile)),myTid);
and I get the following error
txtProblem submitting IDOC to SAP SAP.Connector.RfcException: Invalid connection. at SAP.Connector.SAPClient.tRfcInvoke(String method, Object[] methodParamsIn, RfcTID tid) at SAP.Connector.SAPIDocSender.TRfcIDocInBoundAsynchronous(EDI_DC40_BLOCKList iDocControlRec40, EDI_DD40_BLOCKList iDocDataRec40, RfcTID tid) at SAP.Connector.SAPIDocSender.SubmitIDoc(TextReader iDoc, RfcTID tid) at SAP.Connector.SAPIDocSender.SubmitIDoc(String iDocPath, RfcTID tid) at sap6.WebForm1.Button1_Click(Object sender, EventArgs e) in
psbeh18\wwwroot$\sap6\default.aspx.cs:line 137
1. Congratulation on you successful resolution of first problem -- please indicate it in "Reward Points".
2. Now that your IDoc is attempting to enter into SAP database, integrity checks are being carried out and the IDoc contents are not being accepted.
You may be having problem with acceptance of you control record EDI_DC40. Things mentioned in it must be valid on your SAP database.
Using the "Inbound IDoc Processing -- WE16" from SAP GUI, first manually import it into SAP to confirm if it is not corrupted. Make sure you have the trading partner/port referred in this IDoc properly setup. Do all the trouble shooting of IDoc contents using SAP GUI before attempting its import via connector.
thank you thank you thank you again
i have my idoc in a file c:
ABC.txt. this idoc is from an example i am using.
I created a port called INTERNAL.
when i try to run WE16 putting in c:
ABC.txt and port INTERNAL is says
error opening file 'c:
ABC.txt'.
Is this because it cannot find the file. Does it need to be in a special directory or something?
any ideas would be greatly appreciated
SAP cannot access you C: drive. Create a share at SAP server. If your SAP server's name is SAPSERVER, and you share its C: drive as CDRIVE, the UNC name of that share would be
SAPSERVER\CDRIVE
copy ABC.txt into
SAPSERVER\CDRIVE and define it in the port definition of "INTERNAL".
Now try WE16. It should work
User | Count |
---|---|
98 | |
11 | |
11 | |
10 | |
10 | |
8 | |
6 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.