none
Please help.... import/export parameters. RRS feed

  • Question

  •  

    When we see the BAPI/RFC inside SAP, it has list of import and export parameters, when a proxy is generated programmatically, how to know set for import/export parameter while generating proxy?

    Please help...

    Taruna

    Thursday, March 27, 2008 5:32 AM

Answers

  • Hi Mahadevan,

    I've already tried this reflection, all the parameters in and out come "false" always. I had seen the proxy generated by VS has comments before RFC parameters, when i generate i dont get the comments, also in/out r always false. But my wsdl has comments for in/out parameter, how can even write those comments inside proxy and also is there anything to do with proxy while generating to set in/put params flag.

    Tuesday, April 1, 2008 2:11 PM
  • Hi!

    If the parameter type ends with "&", it is a ref (in + out) parameter.

    As for putting the comments in the proxy, the ASDK takes the CodeCompileUnit object, takes the WSDL, and does a

    CodeTypeMember.Comments.Add(CodeCommentStatement)

    //CodeTypeMember and CodeCommentStatement are .NET classes.

    You should refer to the MSDN documentation for these classes, it will become clearer then.
    Sunday, April 20, 2008 5:28 AM

All replies

  • I am assuming you are talking about the BizTalk Adapter Pack SAP adapter. The IMPORT parameters are the in parameters in the proxy method and the EXPORT parameters are out parameters in the proxy method.

     

    Friday, March 28, 2008 8:57 AM
  • Hi Mahadevan,

    I use BizTalk Adapter Pack SAP adapter. Here I've generated dynamic proxy then I've created assemby to read the proxy and call the method dynamically, everything is fine, since I know by experience which are the in/out params, now from the reflection i would like to know which mandatory in, and out params. Since I don't know the parameters for all the BAPI/RFC, i've to login to SAP to check it, how can I see The IMPORT parameters are the in parameters in the proxy method and the EXPORT parameters are out parameters in the proxy method.

    Can you please give me a sample code?

    Thanks

     

    Saturday, March 29, 2008 6:28 AM
  • You can use the MethodInfo and ParameterInfo classes to find the the parameters in methods and their direction (isIn, isOut).

     

    using System;
    using System.Reflection;

    public class MainClass
    {
        public event MyDelegate ev;

        public static void Main()
        {
            Type delegateType = typeof(MainClass).GetEvent("ev").EventHandlerType;
            MethodInfo invoke = delegateType.GetMethod("Invoke");
            ParameterInfo[] pars = invoke.GetParameters();
            foreach (ParameterInfo p in pars)
            {
                Console.WriteLine(p.IsIn);

                Console.WriteLine(p.IsOut);
            }
        }
    }

     

    Otherwise if you directly want to accesss the metadata of the RFC, you may use SAP's internal RFCs(RFC_GET_FUNCTION_INTERFACE). Note that they could be unreleased (unsupported).

     

    Tuesday, April 1, 2008 2:57 AM
  • Hi Mahadevan,

    I've already tried this reflection, all the parameters in and out come "false" always. I had seen the proxy generated by VS has comments before RFC parameters, when i generate i dont get the comments, also in/out r always false. But my wsdl has comments for in/out parameter, how can even write those comments inside proxy and also is there anything to do with proxy while generating to set in/put params flag.

    Tuesday, April 1, 2008 2:11 PM
  • Hi!

    If the parameter type ends with "&", it is a ref (in + out) parameter.

    As for putting the comments in the proxy, the ASDK takes the CodeCompileUnit object, takes the WSDL, and does a

    CodeTypeMember.Comments.Add(CodeCommentStatement)

    //CodeTypeMember and CodeCommentStatement are .NET classes.

    You should refer to the MSDN documentation for these classes, it will become clearer then.
    Sunday, April 20, 2008 5:28 AM