cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

Call BAPIs (Table, Structure, and other) Parameters with NCo 3.0

Former Member
0 Kudos
869

Hi @ all,

i would like to use the new sap nco 3.0 to call bapis from a .net enviroment.

i used the tutorials, which are provided by sap, but there are not all posibilities covered, like call a bapi with parameters within a table.

i want to call for eg. BAPI_FUNCLOC_GETLIST with table parameters like FUNCLOC_RA -> SIGN: I, OPTION: BT, LOW: 1, HIGH: 5000 and i expect based on this call with the parameters to get the Structure FUNCLOC_LIST where i will get the desired function locations.

So i don't know how to pass the parameters. I didn't find anything suitable for me ether on SDN,SCN or elsewhere.

Hopefully i can get some help here.

Thank you in advance

Best regards

R. Henschel

Accepted Solutions (0)

Answers (4)

Answers (4)

Former Member
0 Kudos

... i got it, at least for this case ..

gunter_vandamme
Discoverer
0 Kudos

Code example for FUNCTION: BAPI_ALM_ORDERHEAD_GET_LIST

Dim API As IRfcFunction = ecc.Repository.CreateFunction("BAPIALM_ORDERHEAD_GET_LIST")

'

Dim myStructure As IRfcStructure = ecc.Repository.GetStructureMetadata("BAPIALM_ORDER_LISTHEAD_RANGES").CreateStructure

myStructure.SetValue("FIELD_NAME", "OPTIONS_FOR_DOC_TYPE")

myStructure.SetValue("OPTION", "EQ")

myStructure.SetValue("LOW_VALUE", "ZM01")

'

Dim myTable As IRfcTable = API.GetTable("IT_RANGES")

myTable.Append(myStructure)

API.SetValue("IT_RANGES", myTable)

API.Invoke(_ecc)

Hope this helps.

Former Member
0 Kudos

Thanks for your input, but i found a solution by my self already.

but thanks anyway.

BR

R.H.

Former Member
0 Kudos

. . .
IRfcFunction FuncLocBAPI_GETLIST = repo.CreateFunction("BAPI_FUNCLOC_GETLIST");

FuncLocBAPI_GETLIST.Invoke(prd);

IRfcStructure returnStructure = FuncLocBAPI_GETLIST.GetStructure("RETURN");
string returnCode = returnStructure.GetString("TYPE");
if (returnCode.Equals("E") || returnCode.Equals("A"))
{
     throw new Exception(returnStructure.GetString("MESSAGE"));
}
 

The result of this code is a message with the content: "Specify at least one selection condition".

Do somebody know how can i pass some parameters to the BAPI Call to get the right results, in this case a Tabel with the List of Functional Locations.

Thanks everyone in advance for oyur help.

BR

Rudolf

Edited by: Rudolf Henschel on Feb 25, 2011 2:09 PM

Edited by: Rudolf Henschel on Feb 25, 2011 2:11 PM

Former Member
0 Kudos

.. i tried almost everything, but without success. i don't know how to pass parameters to get the Table FUNCLOC_RA (pre)filled so that i can get the result table FUNCLOC_LIST.

Former Member
0 Kudos

.. is there nobody who could provide some ideas?