Hi dear experts,

You can find the logic in the following link: SAP PI Scenario | ABAP Proxy to Multimapping to divided flows without ccBPM | following 4 blog posts

This is the first part of the following 2 posts (in few days, i will post the “logic” as a 4th post):

Multimapping in SAP PI (Graphical / Java: Simple, DOM, SAX / XSLT, ABAP) – for dummies part 2 of 3

Execute your SAP PI scenario from ABAP Proxy to PI (multimapping) to 2 receiver systems – for dummies part 3 of 3

Now i share the first part of a whole interface from ECC (ABAP Proxy) to SAP PI (multimapping) to other 2 system receivers, all for dummies.

  • Idea: i was in a situation where i needed to implement an abap proxy and im not an abap programmer, i just have a great experience programming in other languages; so looking for information in the web i didn’t find step by step information of how to implement it…
  • Objective: i share an step by step where you will find the logic in how implement it in “this first post of 3”, in order to let you add your great experience as abap programmer, or if you dont have a lot experience you can follow it, too.
  • Apologize: if you see errors in my logic, sorry but im not an expert in abap(but to implement this in 2 days i learned a lot about abap LOL), so you can suggest or tune this proposal, from one dummy for dummies experience shared… Thank you!!…

STEPS:

1.- SAP PI SIDE: implement your data type in your enterprise service repository(netweaver/java side); with the following structure and then your service interface outbound, as you know how to do it:

2.- ECC side – SE11 Transaction: implement the next Ztable

3.- ECC side – SPROXY Transaction: Look for your methods / objects names that you will need to adapt the abap code, where i added the numbers that you see in the images, so just change it or if is the same, just use it as same:

4.- ECC side – SE38 to program your proxy call: NOW COPY – PASTE and ADAPT


*&---------------------------------------------------------------------*
 *& Report  ZPROXYPI
 *&BY: AZAEL NAVARRO JIMENEZ
 *&DATE: 13/05/2015
 *&OBJECTIVE: SHARE THE MAIN AND COMPLETE LOGIC TO SEND INFO USING ABAP PROXY
 *&----------IN AN EASY WAY, WHERE YOU USE IT TO IMPLEMENT YOUR FIRS ABAP PROXY
 *&----------BUT WITHOUT BEEN AND EXPERT IN ABAP, BEACAUSE IS A CODE FOR DUMMIES
 *&----------WRITTEN BY A DUMMY IN ABAP AND WITHOUT ASSUMING THAT YOU ARE
 *&----------AND EXPERT IN ABAP... GOOD LUCK!
 *&---------------------------------------------------------------------*
 *&A. PROGRAM TO VISUALIZE INFORMATION AND TO SEND ROWS TO SAP WITH ABAP PROXY
 *&---------------------------------------------------------------------*

 REPORT ZPROXYPI.
 *================1.- Our main table that must be created================*
 TABLES: ZTABLATESTPI.
 *================2.- Variables to control the information from the Selection Screen================*
 data WA_ZTABLATESTPI like ZTABLATESTPI.
 data VAR_PIID like ZTABLATESTPI.


 *&---------------------------------------------------------------------*
 *&
 *&B. INITIAL WINDOW TO FILTER THE ROW THAT IS GOING TO BE SENT:
 *&---------------------------------------------------------------------*
 *================3.- Our Graphical selection screen================*
 parameters PA_PIID like ZTABLATESTPI-ID_EMPLOYEE.
 *================4.- Call the first subroutin that is JUST INFORMATIVE SECTION and you can eliminate================*
 PERFORM SELECTINFO.

 *&---------------------------------------------------------------------*
 *& C. CHOOSE INFORMATION NEEDED FROM TABLE AND CALL PROXY:
 *& This form is not neccesary, is just to let you reference the ID
 *& requested in graphical window in order to filter the information in
 *& your query using a variable in a graphic way you can eliminate it
 *& or you can use sofisticated code
 *&---------------------------------------------------------------------*
 FORM SELECTINFO.
   " PA_PIID = 1.
 *================5.- Get the information from the table just to visualize it================*
   VAR_PIID = PA_PIID.
   SELECT CLIENT ID_EMPLOYEE NOMBRE EDAD TELEFONO FROM ZTABLATESTPI
     INTO CORRESPONDING FIELDS OF WA_ZTABLATESTPI
     WHERE ID_EMPLOYEE = VAR_PIID.
   ENDSELECT.

 *================6.- We can see the information that is in the table and should be sent================*
   write:/ WA_ZTABLATESTPI-ID_EMPLOYEE color col_key,
   WA_ZTABLATESTPI-NOMBRE,
   WA_ZTABLATESTPI-EDAD,
   WA_ZTABLATESTPI-TELEFONO.
 *================7.- THE IMPORTANT SUBROUTIN: we call the code that is going to get the information and the will be sent================*
   PERFORM SENT_INFO_TO_PROXY.
 ENDFORM.
 *&---------------------------------------------------------------------*
 *& D. EXECUTE ABAP PROXY AND SEND INFORMATION TO SAP PI:
 *& This is the important code where you can just add your new table name,
 *& your new structure names and the is going to get the information from your table
 *& and after that is going to deliver the information to SAP PI executing the
 *& ABAP Proxy Method
 *&---------------------------------------------------------------------*
 FORM SENT_INFO_TO_PROXY.
 *================8.- Just to Control the error status================*
   DATA: lv_error(1) TYPE c.

 *================9.- SAP PI Proxy metadata reference: REFER TO IMAGES IN THE POST================*
   DATA :
     IT_ZTEST_PROXY_OUT LIKE TABLE OF ZTABLATESTPI WITH HEADER LINE,"1.- CHANGE THE NAME OF YOUR TABLE: ZTABLATESTPI
     IT_OUTPUT TYPE ZMT_TEST, "2.- CHANGE THE NAME OF YOUR MESSAGE TYPE: ZMT_TEST
     IT_PROXY_RESULT TYPE ZDT_TEST_ROW, "3.- CHANGE THE NAME OF YOUR DATATYPE: ZDT_TEST_ROW
     T_PROXY_RESULT TYPE ZDT_TEST_ROW_TAB. "4.- CHANGE THE NAME OF YOUR METADATA FROM MESSAGE TYPE VIEW: ZDT_TEST_ROW_TAB

   DATA: CL_PROXY_CLIENT  TYPE REF TO ZCO_SI_OA_TEST. "5-. CHANGE THE NAME OF YOUR ABAP CLASS: ZCO_SI_OA_TEST

 *================10.- Get the information from your table================*
   SELECT * FROM ZTABLATESTPI INTO CORRESPONDING FIELDS OF TABLE  IT_ZTEST_PROXY_OUT
   WHERE ID_EMPLOYEE = PA_PIID.

 *================11.- Upload the information from the table to the internal table in abap side================*
   LOOP AT IT_ZTEST_PROXY_OUT.
     IT_PROXY_RESULT-ITEM1 = IT_ZTEST_PROXY_OUT-NOMBRE.
     IT_PROXY_RESULT-ITEM2 = IT_ZTEST_PROXY_OUT-EDAD.

     APPEND IT_PROXY_RESULT TO T_PROXY_RESULT.

   ENDLOOP.

 *================12.- If there is information will be sent to Proxy================*
   IF T_PROXY_RESULT[] IS INITIAL.
     WRITE 'There is no information'.
   ELSE.
     IT_OUTPUT-MT_TEST-ROW = T_PROXY_RESULT. "6.- CHANGE THE PATH OF YOUR NODES IN MESSAGE TYPE
     TRY.
         CREATE OBJECT CL_PROXY_CLIENT.
         CALL METHOD CL_PROXY_CLIENT->SI_OA_TEST "7.- CHANGE THE NAME OF YOUR SERVICE INTERFACE: SI_OA_TEST
           EXPORTING
             OUTPUT = IT_OUTPUT.
         COMMIT WORK.
       CATCH cx_ai_system_fault .
         MESSAGE 'System error' TYPE 'I'.
       CATCH cx_ai_application_fault.
         MESSAGE 'Application error' TYPE 'I'.
     ENDTRY.
   ENDIF.
 COMMIT WORK.

 *================STATUS OF THE INFORMATION DELIVERED OR NOT DELIVERED================*
   IF sy-subrc IS INITIAL.
     WRITE: 'Successful'.
   ELSE.
     WRITE: 'NO Successful'.
   ENDIF.
   IF lv_error IS INITIAL.
     MESSAGE i088(ms) WITH 'Information sent succesfully!'.
   ENDIF.
 ENDFORM.

4.1. Execute your code and test it:


5.- ECC side – SXI_MONITOR transaction to monitor your results:

Thanks for your time, i hope you enjoy it!…

References: obviously: 1) i reused source code from other (a lot posts), 2) i asked few things to other abap consultants, but not was copied, it was a reutilization of logics, code, etc… to achieve this result.. So i say thanks to all those ways (people and posts)…

To report this post you need to login first.

3 Comments

You must be Logged on to comment or reply to a post.

Leave a Reply