Skip to Content
0
Former Member
Feb 16, 2006 at 10:34 PM

Problem with CSAP_MAT_BOM_MAINTAIN

135 Views

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

Message was edited by: sansanee hanveerawong