Step By Step guide for Creating a Transaction in …...SAP xApp Manufacturing Integration and Intelligence (SAP xMII 11.5.1 build 63) and SAP 6.00 Summary This Paper tells about calling
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Step By Step guide for Creating a Transaction in xMII to call an RFC Module
Step By Step guide for Creating a Transaction in xMII to call an RFC Module
Applies to:
SAP xApp Manufacturing Integration and Intelligence (SAP xMII 11.5.1 build 63) and SAP 6.00
Summary This Paper tells about calling an RFC (BAPI_SERVICE_GET_LIST) from xMII Business Logic Editor using a transaction? Data fetched from SAP can be used for different purposes in xMII. Author: Musarrat Husain Company: Wipro Technologies Created on: 8 October 2007
Author Bio Musarrat Husain is working in Wipro Technologies as a SAP consultant since October 2006 and doing application development and support for various projects in ABAP. Since the launch of xMII team in Wipro technologies, he has become a part of competency and is contributing in development of composite applications in xMII.
Step By Step guide for Creating a Transaction in xMII to call an RFC Module
Table of Contents Create a Table of Contents in Microsoft Word. To change, right-click on the TOC and select Update Field. Applies to: ........................................................................................................................................ 1 Summary.......................................................................................................................................... 1 Author Bio ........................................................................................................................................ 1 Declaring Variables.......................................................................................................................... 2 Adding and configuring JCO Action Block....................................................................................... 2 Adding an Illuminator Document ..................................................................................................... 3 Error Handling.................................................................................................................................. 4
Error handling at Connection Phase ............................................................................................ 5 Checking the Error Return Type .................................................................................................. 8
Populating Data in Illuminator Document ........................................................................................ 9 Configuring Repeater ................................................................................................................... 9 Configuring Illuminator Rows ..................................................................................................... 10
Linking of Fields...................................................................................................................... 11 Assigment ...................................................................................................................................... 12 Related Content............................................................................................................................. 15 Disclaimer and Liability Notice....................................................................................................... 16
Declaring Variables Variable declaration can be done at any stage, but I’m doing it just for the sake of clarity. Go to Transaction->properties and create following output parameter of type XML.
• Output
• Request
• Response
Adding and configuring JCO Action Block JCO Action Blocks are used to call an RFC from SAP server. Insert SAP JCO interface action block (from SAP ERP interface tab) in first sequence and right click->configure. In the configuration window, choose SAP Server Name and give search pattern and SAP RFC name as BAPI_SERVICE_GET_LIST . After that, click ok and hit choose generate sample XML.
Step By Step guide for Creating a Transaction in xMII to call an RFC Module
Adding an Illuminator Document Illuminator document is used to hold multiple XML rows during the course of transaction and it also converts the XML format to xMII understandable form. The structure of Illuminator document should be same as the output required by you. Here, I’m taking the service no., short text and serv from the BAPI output (internal table SERVICELIST).
Step By Step guide for Creating a Transaction in xMII to call an RFC Module
Error Handling In order to trap and handle errors occurred during the SAP RFC call, we need to check RFC status at various stages. I’m quoting the instances of connection and error return type. Error handling comprises of three steps:
1. Checking for the error using condition Block 2. If error occurs, then storing the error in XML Illuminator document using fatal error action block
Step By Step guide for Creating a Transaction in xMII to call an RFC Module
3. Terminating the transaction with an error message using termination transaction block
Here we are focusing on two stages of BAPI call.
• Connection
• Return type
Error handling at Connection Phase Add a sequence to the transaction and add a condition block (Logic tab). Map the “success” property of BAPI to the input of the condition block.
Step By Step guide for Creating a Transaction in xMII to call an RFC Module
Now add two sequences to the condition block. The green one will be executed if the condition is true otherwise red one will be executed.
Now add an “illuminator fatal error” action block to the sequence. And configure it illuminator document. In the “incoming” tabs, Map the BAPI’s LastErrorMessage to the message property.
Step By Step guide for Creating a Transaction in xMII to call an RFC Module
In the outgoing tabs, map the illuminator document’s output property to transaction’s output.
Now add a sequence to the fatal error action block. And add a terminate transaction action block and map the termination message to RFC’s last error message.
Step By Step guide for Creating a Transaction in xMII to call an RFC Module
After finishing with error handling, the screen should look something like this.
Populating Data in Illuminator Document Since the data is in the form of table and comprises of more than one record, so we have to use loop the RFC output line by line.
So for this we will be using repeater (from logic) and illuminator row
(from xMII XML output)
Configuring Repeater In the true sequence of second condition check, add the repeater action block and configure it to item level of output from BAPI.(Here, we’ll be sticking to internal table SERVICELIST)
Step By Step guide for Creating a Transaction in xMII to call an RFC Module
Configuring Illuminator Rows Add a sequence to the repeater and add an illuminator row action block to it. Configure it to the output of illuminator document.
Step By Step guide for Creating a Transaction in xMII to call an RFC Module
Assignment The “Assignment” action block is used for explicitly assigning some value to some variable. Here, we’ll be using it to assign the illuminator documents output to the output of the transaction.
Step By Step guide for Creating a Transaction in xMII to call an RFC Module
Disclaimer and Liability Notice This document may discuss sample coding or other information that does not include SAP official interfaces and therefore is not supported by SAP. Changes made based on this information are not supported and can be overwritten during an upgrade. SAP will not be held liable for any damages caused by using or misusing the information, code or methods suggested in this document, and anyone using these methods does so at his/her own risk. SAP offers no guarantees and assumes no responsibility or liability of any type with respect to the content of this technical article or code sample, including any liability resulting from incompatibility between the content within this document and the materials and services offered by SAP. You agree that you will not hold, or seek to hold, SAP responsible or liable with respect to the content of this document.