cancel
Showing results for 
Search instead for 
Did you mean: 

Metadata not available before invoke

Former Member
0 Kudos

Hi,

I had been testing out NCO 3.0 and was excited about the new metadata methods.

My test environment is as follow:

1. Visual Studio 2010

2. NCO 3.0 64-bit

3. NetFramework 4.0

4. SAP ECC 7.02

My sample .Net VB code to create RFC function is as follow:

Dim rfcGetProdOrder As IRfcFunction = ECC_Destination.Repository.CreateFunction("BAPI_PRODORD_GET_DETAIL")

Immediately, I try to obtain the metadata for TABLE

dim myTable as IRFCTable = rfcGetProdOrder.GetTable("Operation")

Dim myElementMetadata As RfcElementMetadata

myElementMetadata = myTable.GetElementMetadata(0) ' Get the first metadata from the table, supposed to be for first field of table.

It will return null or error .

However, if I first invoke the RFC, then I will get the metadata for table OPERATION.

There is no issue with metadata for structure.

Any idea where I had done wrong, or, is it possible to obtain the metadata for table without invoking the RFC?

Thanks!

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi , in order to query table structure you can read metadata from table without invoking .

  1. Dim myElementMetadata As RfcStructureMetadata
  2. myElementMetadata = myTable.Metadata.LineType

at this point you'll have structure metadata and you can query it or even create new line by using method "CreateStructure".

Yarden Jacobson.

Former Member
0 Kudos

Thanks for that. Had tried it out and it has the data I needed.

The next problem I face is the name of table.

In SE37, the TABLE tab has something like this:

RETURNCODE              LIKE          BAPI_RETURNCODE

The metadata.linetype.name returns "BAPI_RETURNCODE".

I want to obtain "RETURNCODE" instead. Been combing all metadata but don't seem to locate it.

Appreciate if you can help on this.

Thanks!

MarkusTolksdorf
Product and Topic Expert
Product and Topic Expert
0 Kudos

Hello Ronald,

the name RETURNCODE is only associated with the table within your function module. For the type itself, the table metadata does not really have a name for an instance of the table type BAPI_RETURNCODE. Only when using it for an instance of the table a name will be associated. In your function module the name is RETURNCODE, in some other function module it might be RETCODE. Hence, you need to get the name for a table from the enclosing RfcFunctionMetadata, which is referring to the table metadata.

Best regards,

Markus

Answers (1)

Answers (1)

former_member236869
Participant
0 Kudos

Hi to everybody,

I followed the posts to do the same things of Ronald and the code works well.

Now I need to get the value from a field into the RfcStructureMetadata table, but I don't know how.

I'm able getting all the name fields, but their values I don't know how.

Is there anybody who can help me pls?


thank's

Best regards.

Celeghin Denis

MarkusTolksdorf
Product and Topic Expert
Product and Topic Expert
0 Kudos

Hello Celeghin,

strange you are called Romano. The question you ask is not really clear - perhaps you provide an example what you want to achieve. Furthermore, you should open a new question - you could refer to this thread, but what you want to know should be described as a new question.

Best regards,

Markus