cancel
Showing results for 
Search instead for 
Did you mean: 

Use of EXTENSIONIN parameter in .NET call

michael_bennett
Explorer
0 Kudos

Hi,

Not being an .NET expert but an ABAP based developer I hope to explain this problem clearly.

We are using the .NET connector to generate proxies and call a BAPI from an external application. The BAPI is a custom extension of the the business object BUS1001006 and method savedata, thus the standard BAPI is BAPI_MATERIAL_SAVEDATA. For all intensive purpose our customer extension uses the same interface but does some extra work as well. All this is ok and we have been using this routine for some time.

Recently we needed to expand the interface to start using the EXTENSIONIN parameters of BAPI_MATERIAL_SAVEDATA as we have added some customer fields to the material master.

As the string you pass to EXTENSIONIN-VALUEPART1 is in essence a structure (i.e. structured according to the name you put in EXTENSIONIN-STRUCTURE e.g. BAPI_TE_MARC) but not part of the BAPI interface is it possible to generate a .NET "object" structure with it's named fields in the proxy class? or is it easier to build a string of fixed positions and simply put this into EXTENSIONIN-VALUEPART1 given that we know the layout of the structure from a SAP point of view.

As an example using BAPI OCX you can code

Set oExtensionIn = oBAPICtrl.DimAs(boMaterial, "SaveData", "ExtensionIn")

but can you "set" soemthing that is not directly part of the interface? (i.e. just an R/3 based DDIC structure)

Thanks,

Michael

Accepted Solutions (1)

Accepted Solutions (1)

reiner_hille-doering
Active Contributor
0 Kudos

NCo design time creates proxies for all DDIC types that are references directly or indirectly from the BAPIs you use - based on the DDIC where you create the proxy from.

When you extend some DDIC structures and then create a proxy of it, they should contain the extensions.

michael_bennett
Explorer
0 Kudos

Hi Reiner,

Thanks for your response. You might have answered my question without me knowing it but I will persist to make sure we are on the same page. I don't think that Nco could now we are going to pass the structured record of BAPI_TE_MARC to the BAPI. This structure BAPI_TE_MARC is not part of the interface as far as I can tell directly or indirectly. From what I can see of the EXTENSION concept for BAPI's the structure to be passed is really dependant upon the implementation of the BAPI. In the case of the SAP BAPI BAPI_MATERIAL_SAVEDATA are you saying that it will create enough defintion in the proxy so that I have a structured BAPI_TE_MARC record to pass to EXTENSIONIN-VALUEPART1 ?

Regards,

Michael

reiner_hille-doering
Active Contributor
0 Kudos

Hi Michael,

unfortunately I don't know enough about the extension concept of BAPIPAREX. When I understand it correctly from

http://help.sap.com/saphelp_46c/helpdata/de/c3/40999d8b8911d396b70004ac96334b/content.htm

it seems that a structure is simply in the VALUEPART fields.

To make it usable from NCo, you need two things:

1. A .NET proxy for the underlying structure

2. An encoding function to BAPIPAREX.

For 1. you could either create a .NET class by hand. Or you force NCo design time to create a proxy for you. At the moment you can not drag structures on there on from server explorer. But you can create a small helper ABAP in SE37 that has your structure as input or output. Ignore the function, but just use the generated structure proxy.

The encoding (2.) could be done straight-forward using reflection or some structure-specific code.

michael_bennett
Explorer
0 Kudos

Hi Reiner,

Thanks very much for your suggestion.

We had thought that we could call an RFC to get the definition of the structure from DDIC and therefore build the content to be passed to VALUEPART based on field offset and length. I was just wondering if there was a more standard way.

I like the 2nd part of your suggestion so I think we will do that.

Just wanted to say thanks for your input.

Regards

Michael

p.s. trying to award the points but it doesn't seem to work at the moment. not sure if this is because you are a SAP person. will check the help on rewarding points and will reward if I can.

Message was edited by: Michael Bennett

Answers (0)