‎2010 Jan 12 9:50 AM
hi friends,
i want to create the abap proxy. in xi side, they created the interface. now i want to create the outbound interface in t code sproxy . can anyone explain clearly? i studied the documents.my doubt is when i select the outbound interface and click create, after that do i want to create the class name for proxy or autimacally is it create the class name, and message interface name ? can anyone expalin clearly ?
regards,
Varadarajan.R
‎2010 Jan 12 10:35 AM
Hi,
1. In transaction SPROXY, right click on message interface. Select u2018createu2019. This will ask the package and prefix.
2. Give the prefix, that will create a class which will have prefix given by you
3. Now the class is ready. Double click on the class, youu2019ll see the methods generated. Apply your business logic in that method EXECUTE*.
4. In case of outbound asynchronous, you will call this method in your program at the end to pass the data to XI box.
Regards,
Tanaya
‎2010 Jan 12 9:56 AM
Hi,
when u select the outbound interface and click create, after that it wil ask for prefix u can enter application area as prefix then it create the class name for proxy , and message interface name also same ,then activate that it wil ask package and TR number.
‎2010 Jan 12 10:05 AM
hi ,Upender Verma.
Thanks for ur answer. after getting the class name, we will use this class name in se38 program using call method and catch .is it right ?
Regards,
Varadarajan.R
‎2010 Jan 12 10:12 AM
Hi,
Yes. If it's an outbound interface, you can populate your proxy structure using a Report Program.
‎2010 Jan 12 10:18 AM
Hi Varadarajan,
The proxy works in this way.
There are 3 types of proxies,1. Inbound 2. Outbound and synchronous proxy.
1. Inbound proxy means the data comes from other system we need to collect the data and process it at ECC side. For this kind of interfaces we go to SPROXY and generate the proxy. Inside the proxy we generated we can start writing our code.
Here the data coming from the external system needs to be collected and pass the data to the internal tables and start the processing
2. For the outbound proxy we need not to generate the proxy, instead the XI or PI team will give us the proxy name.In outbound proxy in general we will do our normal programing, the only one change that we find is after all the processing is done at ABAP we need to pass the data to the external system through the XI by calling the proxy and passing the table which should match the outbound proxy table.
If you go the T-code SPROXY and select the correpsonding proxy.
Now double click on the proxy name this will show us the class name and method name.
The External view button gives the type of method, table that you need to consider in your program
SXMB_MONI is used to check the message that is going in/out of SAP.
Regards
Navy
‎2010 Jan 12 10:35 AM
Hi,
1. In transaction SPROXY, right click on message interface. Select u2018createu2019. This will ask the package and prefix.
2. Give the prefix, that will create a class which will have prefix given by you
3. Now the class is ready. Double click on the class, youu2019ll see the methods generated. Apply your business logic in that method EXECUTE*.
4. In case of outbound asynchronous, you will call this method in your program at the end to pass the data to XI box.
Regards,
Tanaya
‎2010 Jan 12 11:42 AM
hi,
what is the business logic ? bec i am the new guy for class and method. can u give some sample code for that one ? in my object, i am moving the product datas. i developed the code in se38. can u explain clearly ?
Regards,
varadarajan.R.
‎2010 Jan 12 12:09 PM
Hi varadarajan,
In case of outbound proxy, we need to create report. This report will contain logic in which we will use class created using tcode Sproxy. And also, we will populate data in the structure and using metthod 'Execute_asynchronous' or 'Execute_synchronous', we will send data to XI.
We create proxy using tcode Sproxy, which will also create class, message type and data type.
XI team creates a structure with fields, it is with the format in which they want to receive data.
So, when we create proxy via Sproxy, it maps the structure created in XI and creates same message type.
Also, it generates method Execute_asynchronous/Execute_synchronous. You can use any of these methods depending on your requirement.
Please let me know if you need any more clarification.
Thanks,
Archana
‎2010 Jan 12 12:18 PM
Hi Archana,
in that class, do i have write any code or business logic in sproxy ? in my report, i fetched the dats from database, the vales are available in the internal table ? before days , i am not using class and methods . can u explain clearly?
Regards,
Varadarajan.
‎2010 Jan 13 3:33 AM
Hi Varadarajan,
When you create proxy in sproxy you don't need to write any business logic in that in case of outboud proxy. Method is already generated here. So, you just need to use class, message type, metod in your report.
Below is the sample code for that.
DATA:
l_wa_proxy_invent TYPE zdt_nl_stock_inventories_stock, *---Proxy Structure (data type in Sproxy)
l_wa_output TYPE zmt_nl_stock_inventories, *---Output Data (message type in Sproxy)
l_i_proxy_invent TYPE zdt_nl_stock_inventories_s_tab. *---Table to pass to proxy (data type in Sproxy)
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 (class in Sproxy)
*-Add Data to Proxy table (Loop at your final internal 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.
‎2010 Jan 13 11:00 AM
‎2010 Jan 15 9:08 AM
Hi archana,
I have developed the report using the class. how can i check my program is working or not ?
can u explain the steps please ?
Regards,
Varadarajan.R
‎2010 Jan 15 10:02 AM
Hi,
You cen execute your program using any of the three transaction.
1.> SPROXY-->press execute button.
2.> SE80-->Select yor Proxy-->execute
3.> SE24-->Enter your class name-->execute.Thanks
Nitesh