on 02-16-2006 10:35 PM
Hi,
I am trying to update Material BOM using CSAP_MAT_BOM_MAINTAIN, but I got the RfcAbapException when the CSAP_MAT_BOM_MAINTAIN is invoked. I would appreciate if anyone can help point me out what I have done wrong or if anyone can post the ABAP code for CSAP_MAT_BGOM_MAINTAIN. Below is my code in C#:
public static void UpdateBOM(SAP.Connector.Connection conn){
try{
SAPProxy p = new SAPProxy();
p.Connection = conn;
//Items
STPO_API03Table tStpo = new STPO_API03Table();
STPO_API03 item = new STPO_API03();
item.Item_No = "0010";
item.Comp_Qty = "5";
tStpo.Add(item);
//Assignment of the rest
STKO_API01 iStko = new STKO_API01();
CSDEP_DATTable tDepData = new CSDEP_DATTable();
CSDEP_DESCTable tDepDescr = new CSDEP_DESCTable();
CSDEP_DOCTable tDepDoc = new CSDEP_DOCTable();
CSDEP_ORDTable tDepOrder = new CSDEP_ORDTable();
CSDEP_SORCTable tDepSource = new CSDEP_SORCTable();
CSDMU_TMXTable tDmuTmx = new CSDMU_TMXTable();
CSDOC_LINKTable tDocLink = new CSDOC_LINKTable();
CSLTX_LINETable tLtxLine = new CSLTX_LINETable();
STPU_API01Table tStpu = new STPU_API01Table();
STKO_API02 oStko = new STKO_API02();
string material = "100-100";
string plant = "1000";
string validFrom = "19950728";
string bomUsage = "1";
string warning = string.Empty;
p.Csap_Mat_Bom_Maintain(string.Empty,bomUsage,
string.Empty, string.Empty, string.Empty, string.Empty,
string.Empty,string.Empty,string.Empty,string.Empty,
string.Empty,iStko, material, plant, string.Empty, validFrom,
out warning, out oStko, ref tDepData, ref tDepDescr,ref tDepDoc,
ref tDepOrder, ref tDepSource, ref tDmuTmx, ref tDocLink,
ref tLtxLine, ref tStpo, ref tStpu);
p.CommitWork();
}
catch (Exception e){
Console.WriteLine(e.Source + ": "+e.Message);
}
}
Thanks in advance,
Sunny
RfcAbapException is allways related to a "short dump" in ABAP. Therefore you either check the dump or "ABAP debug" into the function module and find out where and why it dumps: Just install SAPGUI on you machine and specify the ABAP_DEBUG parameter in connection string. Note that ABAP debugging doesn't work in ASP.NET apps. You may need to isolate the code and bring it into a Windows Forms or Console application.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
84 | |
25 | |
12 | |
9 | |
6 | |
6 | |
5 | |
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.