on 12-26-2011 6:18 PM
this my code
RfcDestinationManager.RegisterDestinationConfiguration(new
MyBackendConfig());
RfcDestination prd = RfcDestinationManager.
GetDestination("PRD_000");
RfcRepository repo = prd.Repository;
IRfcFunction myFunction =
repo.CreateFunction
("BBP_RFC_READ_TABLE");
myFunction.SetValue("DELIMITER", " ");
myFunction.SetValue("NO_DATA", " ");
myFunction.SetValue("ROWCOUNT", 10);
myFunction.SetValue("QUERY_TABLE", "ZIPAB_HEADER");
IRfcTable tfields = myFunction.GetTable("FIELDS");
//IRfcTable toptions = myFunction.GetTable("OPTIONS");
tfields.Append();
tfields.SetValue("FIELDNAME", "SCENARIOS");
tfields.SetValue("OFFSET", 3);
tfields.SetValue("LENGTH", 2);
tfields.SetValue("TYPE", "C");
tfields.SetValue("FIELDTEXT", "scénario de gestion");
//tfields.Append();
//tfields.SetValue("FIELDNAME", "REFERENCE");
//tfields.SetValue("OFFSET", 0);
//tfields.SetValue("LENGTH", 10);
//tfields.SetValue("TYPE", "CHAR");
//tfields.SetValue("FIELDTEXT", "REFERENCE");
//tfields.Append();
//tfields.SetValue("FIELDNAME", "TICKET_PESAGE");
//tfields.SetValue("OFFSET", 0);
//tfields.SetValue("LENGTH", 20);
//tfields.SetValue("TYPE", "CHAR");
//tfields.SetValue("FIELDTEXT", "TICKET_PESAGE");
IRfcTable tdata = myFunction.GetTable("DATA");
MessageBox.Show(tdata.RowCount.ToString());
the probleme is that my tdata has no data
tdata.RowCount.ToString() = 0
i know that there is some thing wrong in my code but ...
thanx
HI,
By using this code we can get the emp details based upon empid
RfcDestinationManager.RegisterDestinationConfiguration(new MyBackendConfig());
RfcDestination prd = RfcDestinationManager.GetDestination("SE37");
RfcRepository repo = prd.Repository;
/// ZBAPI_EMP_RECORDS is the BAPI name
IRfcFunction companyBapi1 = repo.CreateFunction("ZBAPI_EMP_RECORDS");
//// EMPID is the column name
companyBapi1.SetValue("EMPID", 5);
/// EMPTAB is the output table
IRfcTable tbl = companyBapi1["EMPTAB"].GetTable();
companyBapi1.Invoke(prd);
// if u want to diplays the total no of rows in a particular table.
int i = tbl.Count;
MessageBox.Show(i.ToString());
// I think u forgot the invoke method for rfcfunction.
NOTE: If u r facing any problem with SAP.Net connector please let me know. By using this connector i was sucessfully run my application.
Best Regards,
Harish.Y
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
95 | |
11 | |
11 | |
10 | |
9 | |
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.