Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

Problem with CSAP_MAT_BOM_MAINTAIN

Former Member
0 Kudos

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

2 REPLIES 2

Former Member
0 Kudos

Hi,

Could you post the RFC exception you have got it?.

Thank you.

Regards, Karun M

0 Kudos

Karun,

I got RfcAbapException. What I guess is that I need to assign some value to STKO_API01 but the previous STKO_API01 is populated by calling CSAP_MAT_BOM_MAINTAIN.

Sunny