cancel
Showing results for 
Search instead for 
Did you mean: 

Synchronous ABAP proxy development

ross_goodman
Participant
0 Kudos

Hi Folks,

What is the process to develop a synchronous abap proxy? I have an inbound interface (going to SAP) in PI that is defined as synchronous but when I look in SPROXY although I have an inbound mesage interface for that message there appears to be no matching outbound message interface to send the response back to PI.

Ross

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hello Ross,

There's no need for a second "outbound" interface. Your synchronous inbound interface should contain already

a request message (going to your SAP system) and a response message (the answer from your SAP system back).

If you generate the proxy you ll see these 2 structures as in and output parameters of the proxy method

(execute_synchronous in older releases or your operation name in newer releases)

Best regards

Sebastian

ross_goodman
Participant
0 Kudos

So far some good then The abap proxy was generated by the original developer and has I see the execute_synchronous method as you say. This simply appears to get the database data and fill the outbound structure. The last few lines of the method are shown below

loop at lt_out_log_tbl into ls_out_log.

move-corresponding ls_out_log to ls_log .

append ls_log to lt_log_tab .

endloop.

append lines of lt_log_tab to lwa_output-mt_sales_order_check_response-sales_order_message-item.

output = lwa_output.

clear: lwa_input,

lwa_output,

lt_log_tab,

lv_so_num.

refresh: lt_bapiret2.

endmethod.

Once the method ends what is the mechanism that sends the output structure to PI or can I simply assume that is handled by the proxy runtime? I ask as no reponse meesage is arriving in PI at this point in time.

Cheers,

Ross

Former Member
0 Kudos

Hi Ross,

The response it will send back automatically from proxy, you no need to do anything.

Since you didn't receive any response in PI, you can also test the proxy interface from SPROXY.

Click the service interface and press F8 test. You can see whether your proxy working fine or not.

Regards

Fernand.

stefan_grube
Active Contributor
0 Kudos

Are you sure that:

lt_out_log_tbl

has entries?

> I ask as no reponse meesage is arriving in PI at this point in time.

Do you mean, you see no response payload in the message which is sent to SAP system?

Or you see a payload, but it has no data?

ross_goodman
Participant
0 Kudos

Working through tsting the proxy there were heaps of errors with data such that the proxy was never running cleanly. So thanks for the assistance in testing the proxy as I now have a clean proxy run from testing in the development environment.

When you test the proxy this way am I right in assuming it will not send a message to PI as it needs the inbound message detail to respond to, and I now have to perform the test from end to end to see what arrives in PI?

Ross

Former Member
0 Kudos

Hello Ross,

Yes, right. If you test your proxy execution happens only locally (for an inbound proxy).

To test end 2 end you ll have to send the message through PI.

With best regards

Sebastian

ross_goodman
Participant
0 Kudos

Testing through PI and through soapui I am now getting the message into SAP arriving but this does not seem to be firing the inbound proxy!! I have logged in as the SAP user defined for the communication channel and set a break point in the execute_sunchronous method. This does not produce a debug. I have set an htttp breakpoint and a local breakpoint at different times and neither took me into the code. Which is why I believe the proxy is not getting called.

Whilst looking to see what the cause of this might be I had a look at the message history from SXMB_MONI and noticed that the meesage type is "Asynchronous Message" whilst I know the interface is defined in the repository as synchronous.

So two things......

1] How do I debug the proxy when called from PI?

2] Why does message history denote the message type as Asynchronous when the definition definitely says synchronous?

Must be getting closer surely

Ross

Former Member
0 Kudos

Hello Ross,

Concerning:

1.) As far as i know that's not possible in "live mode", however you can copy your PI payload from sxmb_moni and simulate the call in debug mode with the Proxy Test option. Take a look at this blog of Stefan that describes debugging with the test option:

/people/stefan.grube/blog/2006/07/28/xi-debug-your-inbound-abap-proxy-implementation

2.) When you see that the message runs in asynchronous mode, there might be something wrong already in PI (e.g. you haven't turned on the quality of Service to "Best Effort" in your sending adapter). Make shure the processing mode in PI is best effort.

How do you send the message through PI?

With best regards

Sebastian

stefan_grube
Active Contributor
0 Kudos

> 2] Why does message history denote the message type as Asynchronous when the definition definitely says synchronous?

You look always into your ABAP proxy. But the issue is the sender system.

Check the communication channel of the sender. Here you have to set Quality of service to "Best-Effort".

Maybe you sgould consider if your scenario can be performed synchronously. This does not make sense, when the sender is:

IDoc, File, JMS, JDBC.

Answers (0)