Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

Create Outbound proxy interface

Former Member
0 Kudos

Hi Experts,

Business users creates an XML file and store it in AL11 tcode.I have created an XI interface to send a file to file scenario but I need to know how to create an outbound proxy or a program to take the file from AL11 and send it to this XI interface so we can send it to the respective other part of the connection?

Thank you,

1 ACCEPTED SOLUTION

Former Member
0 Kudos

Hi,

I have used the Open data set and the file is read perfectly. But what I need is, I want to update a customized DB table before sending the file through the interface. So, can I write a code in the outbound proxy to update a Ztable with the file data then the interface will send it to the other side of the connection??

Thank you,

6 REPLIES 6

former_member202771
Contributor
0 Kudos

Hi Emam,

use OPEN DATA set to read al11 contents in read mode.

Then send the file as an attachemnt or individual  fields.

check this link for creating and sending attachment+data through outbound proxy.

http://wiki.scn.sap.com/wiki/pages/viewpage.action?pageId=240189709

Thanks,

Anil

Former Member
0 Kudos

Hi,

I have used the Open data set and the file is read perfectly. But what I need is, I want to update a customized DB table before sending the file through the interface. So, can I write a code in the outbound proxy to update a Ztable with the file data then the interface will send it to the other side of the connection??

Thank you,

0 Kudos

Hi Eman,

Yes, you can do that. You can update Z table in this way.

0 Kudos

Yes but how?. as in outbound proxy it doesn't allowing me to do the change?

0 Kudos

Hi Eman,

I hope you have generated the proxy in your client.

For outbound proxies, you need to create a Z report and call the method generated in SPROXY.

In this Z report, you can update your Z table first and then call the method to send the data to XI.

You will get many tutorials on the same.

0 Kudos

Here is the sample code:


DATA:

    l_wa_proxy_invent TYPE zdt_nl_stock_inventories_stock, *---Proxy Structure

    l_wa_output       TYPE zmt_nl_stock_inventories, *---Output Data

    l_i_proxy_invent  TYPE zdt_nl_stock_inventories_s_tab. *---Table to pass to proxy

  FIELD-SYMBOLS:

    <l_fs_final> TYPE ty_final.

  DATA:

    l_o_proxy TYPE REF TO zco_l_nl_ops_proxy_stock_inven. *---Object for proxy class

*-Add Data to Proxy table

  LOOP AT fp_i_final ASSIGNING <l_fs_final>.

    IF <l_fs_final>-stock IS NOT INITIAL.

      l_wa_proxy_invent-maitem = <l_fs_final>-matnr. *-----Material

      l_wa_proxy_invent-maloc  = <l_fs_final>-lgort. *-----Location

      l_wa_proxy_invent-maavail_date  = <l_fs_final>-hsdat. *-----Production date

      l_wa_proxy_invent-maexp_date  = <l_fs_final>-vfdat. *-----Best before date

      l_wa_proxy_invent-maqty  = <l_fs_final>-stock. *-----Stock

      APPEND l_wa_proxy_invent TO l_i_proxy_invent.

    ENDIF.

  ENDLOOP.

  IF NOT l_i_proxy_invent IS INITIAL.

    l_wa_output-mt_nl_stock_inventories-stock_inventories =

                                          l_i_proxy_invent.

    TRY.

*-Create Proxy Object

        CREATE OBJECT l_o_proxy.

        CALL METHOD l_o_proxy->execute_asynchronous

          EXPORTING

            output = l_wa_output.

*Catch exceptions if any.

      CATCH cx_ai_system_fault INTO v_sys_excep.

        RETURN.

      CATCH cx_ai_application_fault INTO v_app_excep.

        RETURN.

    ENDTRY.

    COMMIT WORK.

ENDIF.