cancel
Showing results for 
Search instead for 
Did you mean: 

How to insert ABAP PROXY in customized ABAP program

former_member852447
Active Participant
0 Kudos

Hello experts,

I am a ABAP developer and I am developing a program to send XML strings to a legacy system using an ABAP PROXY but I have run into a roadblock as follows:

My PI colleagues who know PI but not ABAP have created a ABAP PROXY data type with the structure that I need to be populated from my program but cannot tell me how to get the data into this structure. They have directed me to SERVICE INTERFACES where there is a class and method EXECUTE_ASYNCHRONOUS but this is where we all have a road block. I am not sure whether I have to just use this class and method in my program to populate the data type proxy previously created or whether a completely new proxy has to be created under service interfaces.

Any help would be appreciated.

regards

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi David,

My user defined structures have indeed moved across but the method EXECUTE_ASYNCHRONOUS executes a deep structure and my user defined structure is deeply buried at the bottom of the layer....is there a way to send data to a deep structure. The proxy is an SAP defined proxy which is the reason there is a deep structure.

---> Since you are using EXECUTE_ASYNCHRONOUS, means using ABAP server proxy..We have handled the data upto 4 level deep . We didn't find any issue in using ABAP code for this. Directly access the data through root node message type , at the run time Proxy will hand over all the data to you in one shot . So use accordingly !!

A substitute, At the mapping time you can convert hierarchical structure into flat one using PI's available standard node functions .

that is the beauty of SAP's solution...use whatever you prefer.

Regards,

Answers (10)

Answers (10)

former_member852447
Active Participant
0 Kudos

Thanks Santosh, I have given you the points.

regards

Former Member
0 Kudos

Hi David ,

Please advise what you mean by 'root node message type' and 'PI using standard node functions'.

-


> by root node message type I mean to say to refer the top most hierarchy , which will act as message type and will contain the the data at run time . this will be similar in functionality to any internal table if containing multiple records or a structure if containing single record .

-


> Node functions are available in PI for taking care of hierarchical structure . basically nodes are created when ever a context change happens . So using node functions and Java made UDF's we can convert the hierarchical structure into flat structure.

For better clarity, Please check !!!

/people/sundararamaprasad.subbaraman/blog/2006/02/21/real-example-for-formatbyexample

/people/stefan.grube/blog/2005/12/29/new-functions-in-the-graphical-mapping-tool-xi-30-sp13

/people/sravya.talanki2/blog/2005/12/08/message-mapping-simplified-150-part-ii

http://help.sap.com/saphelp_erp2004/helpdata/en/43/c4cdfc334824478090739c04c4a249/content.htm

Regards,

former_member852447
Active Participant
0 Kudos

Hello Santosh,

Solved problem and got into deep structure. Please advise what you mean by 'root node message type' and 'PI using standard node functions'.

Thank you

former_member852447
Active Participant
0 Kudos

Hello Satish/Neetesh,

My user defined structures have indeed moved across but the method EXECUTE_ASYNCHRONOUS executes a deep structure and my user defined structure is deeply buried at the bottom of the layer....is there a way to send data to a deep structure. The proxy is an SAP defined proxy which is the reason there is a deep structure.

Thanks

former_member852447
Active Participant
0 Kudos

Thank you satish and others, this is beginning to come together. Apparently I do not need to create a service interface proxy as SAP delivers one. I have the following methods. This standard interface also contains the user defined structure that I need to populate

IF_PROXY_BASIS_INTERNAL~CREATE_FRAMEWORK

IF_PROXY_BASIS~GET_PROTOCOL

IF_PROXY_BASIS~GET_TRANSPORT_BINDING

IF_PROXY_CLIENT~EXECUTE

CONSTRUCTOR

EXECUTE_ASYNCHRONOUS

From reading previous correspondence I believe that I need to call EXECUTE_ASYNCHRONOUS in my ABAP program. When I call the above method how do I ensure that the user defined structure in the method is populated.

regards

Former Member
0 Kudos

Hi David,

Once you activate the proxy, the Data structure from the PI will move into the R3 and will automatically get linked to your data structure, if you have used move-corresponding.

In case the field names are different in PI and your proxy definition, then you will have to manually map the fields in R3.

Once you activate the proxy, you can see the DT under the ExternalView tab.

Regards,

Neetesh

Former Member
0 Kudos

Hi David,

You debug from your end when you execute the report. If you think the data is populated and if you want to confirm then in sap go to the transaction sxmb_moni and then click on monitor for processed xml messages --> then press F8 --> then you should see a messages --> double click on the last message --> then on the left side click on inbound message --> Payloads --> double click on Main Document --> then in the right bottom screen you can see the payload what you are sending from your proxy. The same payload is going as input to PI. Then you work is done and the same can be seen in PI also. From here your PI developers should take care.

You can do this only when you have permissions for transaction sxmb_moni. If you dont have then you can ask the PI developers to do the same steps in PI and confirm you.

Regards,

---Satish

former_member852447
Active Participant
0 Kudos

Thanks Neetesh, I have done all that and created a proxy with the desired fields to populate....do you know what method I would call going forward to fill that proxy created.

regards

Former Member
0 Kudos

David, your method will be created same as the name of your Message Interface. So, you have to use that.

Also, the Class name itself is the method name which you need to call in report.

Hope this is helpful in moving ahead.

Regards,

Neetesh

Former Member
0 Kudos

Hi David,

You need to call your service interface method. Please check this thread for some additonal help:

Regards,

---Satish

former_member852447
Active Participant
0 Kudos

Hello Satish,

We are running PI7.1. is it asking too much if you could give me a point by point instruction as to how to implement the contents of the blog as the blog assumes that you are already an expert in this area. I can see EXECUTE_ASYNCHRONOUS on the service interface but the blog says that you cannot use it. I have already created a proxy under datatypes and this can be seen on the structure of the parameter OUTPUT on method EXECUTE_ASYNCHRONOUS so just when I thought that I was getting somewhere along comes this blog telling me I cannot use EXECUTE_ASYNCHRONOUS

Thanks

Former Member
0 Kudos

Hi David,

I thought you are using 7.0 ... sorry for the confusion.

Here are the steps that you can follow for proxy generation for SAP PI 7.1:-

TCode - SPROXY

1. The interface objects are ordered according to software component version, namespace and object type.

If no connection to the Integration Repository exists, the system only displays interface objects in the tree structure for which a proxy exists in the system.

2. Choose an interface object for which no proxy already exists. To create a proxy for this interface object, double click the context menu Create Proxy.

3. In the dialog box, specify the name of the package where you want to create the proxy objects. You can also specify a prefix for the names of all objects to be created to avoid naming conflicts with names that already exist in the system.

Result

To generate proxies, the WSDL description of the message interface is read using HTTP.

If no naming conflicts occur during the conversion, you can call the hierarchy of the generated objects from the tab page "Structure". The objects are only then saved in the system once you choose Activate.

If the description is changed in the Integration Repository, you must regenerate the proxy objects

Hope this is helpful.

Regards,

Neetesh

Former Member
0 Kudos

David,

Please check this thread and code accordingly:

Regards,

---Satish

former_member852447
Active Participant
0 Kudos

Hello Neetesh,

Thank you for your reply and I will certainly award you the points but one further question which may sound like very basic but I am really new to this OO stuff so please excuse me .....in the following code METHOD Z**i_<MessageInterface>~execute_asynchronous is the Z**i_<MessageInterface> is that a method which I have to create and link to the class of 'execute_assynchronous' or is it just an ABAP definition with no class links.

regards

Former Member
0 Kudos

Hi David,

Please follow the below mentioned steps :-

1. TCode -> SPROXY

2. Go to the SWCv -> Namespace -> Service Interface

3. In Service Interface, you will find your Message Interface

4. Generate this by doing a right click

5. Once done, the proxy will be generated

6. Double click on the proxy name, you will find the Method EXECUTE_ASYNCHRONOUS, which is created automatically

7. Go inside of EXECUTE_ASYNCHRONOUS, it will be all blank. Put your INCLUDE over there.

8. This INCLUDE will have your actual implementation code

9. Once done, activate the proxy

10. Done ...

Let me know if you have more queries.

Regards,

Neetesh

Edited by: Neetesh Raj on Aug 20, 2009 12:57 PM

Former Member
0 Kudos

David,

Please see this blog and the code written by Ravi in abap proxy. He is sending constant values, but you will write your logic and will populate accordingly.

/people/ravikumar.allampallam/blog/2005/03/14/abap-proxies-in-xiclient-proxy

But check with your PI guys, which version of PI they are using. If they are using XI 3.0 or PI 7.0 then you need to approach like said above.

But if they have PI 7.1 version then you need to write your code as per this blog:

/people/michal.krawczyk2/blog/2009/06/20/pixi-abap-proxies-say-goodbye-to-executeasynchronous-method

Regards,

---Satish

Former Member
0 Kudos

Hello David,

Yes you have to use the method EXECUTE_ASYNCHRONOUS.

Here you will do the implementation.

METHOD Z***i_<MessageInterface>~execute_asynchronous.

      • **** INSERT IMPLEMENTATION HERE **** ***

INCLUDE Z**GL***.

ENDMETHOD.

Inside of the INCLUDE, will be your actual implementation.

Hope this helps.

Regards,

Neetesh

Edited by: Neetesh Raj on Aug 20, 2009 11:41 AM

Former Member
0 Kudos

Hi David,

PI guys would have created the datatype and message types. Message type is actually holding your payload in XI.

Write the program in SE38 and once your programming is done you need to use the class which they have created and populate the data into that class. After sending data to that class then if you want you display an output for your report, you can do that also. Also if your program brings no data then you can use not initial so that it dont send null payload. Hope this gives you some idea.

Regards,

---Satish