cancel
Showing results for 
Search instead for 
Did you mean: 

.NET & SAP: Problems about exporting a table from .NET to SAP

Former Member
0 Kudos

Hi!

I'm coding a .NET WebService which passes a table (with values) to a FM in SAP. The problem is that I don't know exactly which class in C# (in spite of the C# programming is very easy and better than in VB) I could use to pass a table to this function:

Here's my code in C# (sorry for all these hardcodes).The internal table I wanna pass is T_DETALLE

-


--------------------------------------before these lines I am already connected to SAP :D
                /*Posiciones de Pedido*/
               //Calling the tables from SAP Function ifunction
                SAPTableFactoryCtrl.Tables tablesFnc = (SAPTableFactoryCtrl.Tables)ifunction.Tables;
                SAPTableFactoryCtrl.Table myTable = (SAPTableFactoryCtrl.Table)tablesFnc.get_Item("IT_ZLOGMETA4");
                myTable.FreeTable();
                //SAPFunctionsOCX.IStructure gclientt = (SAPFunctionsOCX.IStructure)ifunction.get_Exports("IT_DETALLE");
                for (int fil = 0; fil < 10; fil++)
                {
// The names in "" represents the name of the columns of IT_DETALLE, my internal table
                    myTable.set_ColumnName(1,"TIPOIMPT"); 
                    myTable.set_Value(fil, "TIPOIMPT", "F");
                    myTable.set_Value(fil, "TEXTPOS", "I'M YOUR DADDY");
                    myTable.set_Value(fil, "SOLICIT", "QWQEQWE");
                    myTable.set_Value(fil, "FECHENTREGA", "20101012");
                    myTable.set_Value(fil, "CUENTMAYOR", "2Q14321321");
                    myTable.set_Value(fil, "CENTCOSTO", "110203");
                    myTable.set_Value(fil, "ORDINVER", "201112002");
                    myTable.set_Value(fil, "SOCIEDAD", "LAP");
                    myTable.set_Value(fil, "TIPPOS", "S");
                    myTable.set_Value(fil, "CENTRO", "LAP");
                    myTable.set_Value(fil, "TEXTLINEA", "32432FDSFDSFDSFDSFDSF");
                    myTable.set_Value(fil, "CANTIDAD", "45");
                    myTable.set_Value(fil, "UNIDAD", "KG");
                    myTable.set_Value(fil, "COSTUNI", "0343434333");
                }

my SAPFunction.Call();"Calling the MM RFC(FM that calls to BAPI PO_CREATE (ME21N)
(... next lines are not really important)

-


Thanks in advance for all the answers.

Atte.

Raul Romero

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi Raul,

As I understand your code is not deal with sap.net connector, am i right?

To get a comprehensive help about connection to SAP from Visual Studio with SAP.NET Connector, you can examine my articles:

http://www.huseyinakturk.net/2008/12/a-complete-sample-connection-to-sap-from-visual-studio-net-2003...

http://www.huseyinakturk.net/2009/01/a-comprehensive-example-for-connection-to-sap-with-visual-studi...

Regards,

Huseyin Akturk

http://www.huseyinakturk.net

Former Member
0 Kudos

Hi!

Thanks for your answer.

Your clear explanation in those example you've sent is really interesting.

But the point is that you are using the SAP Connector in order to establish the communication with SAP.

As you mentioned in your pages:

We are assuming that you have SAP .NET Connector 2.0 add on program and installed. If you donu2019t have, contact to your system administrator and so you can download it from SAP Marketplace.

But in my code, and of course, in our project currently we are not using any connectors. Only we want to establish the C# logic as a Web Service to call via RFC the FM and the rest of procedures in SAP.

Apart from that, I checked all the FM in order to configurate the parameters IMPORT, EXPORT and TABLES according with your document.

-


This problem sounds really critic, because in the Internet I didn't find clearinformation according to solve this issue (including chinese & korean forums).

Looking forward to hearing from you.

Raul Romero

Former Member
0 Kudos

Hi again,

Firstful you should know which technology you are using current. As I understand you are using DCOM. If so, you can get information via here : http://msdn.microsoft.com/en-us/library/ms809358.aspx

Regards,

Huseyin Akturk

http://www.huseyinakturk.net

Answers (0)