cancel
Showing results for 
Search instead for 
Did you mean: 

How to use BAPI in xMII

Former Member
0 Kudos

Is there any documents or tutorial for calling the BAPI from xMII, Please give an idea on how to use?

Accepted Solutions (0)

Answers (3)

Answers (3)

0 Kudos

Selvam,

There is actually a couple of xMII How To Guides which reference using JCO calls to various BAPIs. Follow these steps to set it up:

First we need to setup a JCO Data Server to use....

1) From the xMII Menu Click Data Services -> SAP Server Configuration

- Then Click on the SAP_JCO Name and click the Copy button.

- Enter a name for example "SAPJCO" and enter in the ERP connection information

- Press the Save Button

Next we need to create a Business Logic Transaction

2) From the xMII Menu Click Business Logic Service -> Logic Editor

- Click on the SAP ERP Interface on the left

- Add the SAP JCO Interface action to the sequence

- Right Click on the Action and select Configure

- From the Drop Down select your SAP Server..."SAPJCO"

- For the Search Pattern enter: "BAPI_USER_GETLIST"

- Select the only entry and Press OK

- Say Yes to generate the Request/Response Docs

- Right Click on the Action and select Links this time

- Navigate to the following on the upper right:

- SAPJCOInterface_0.Request{/BAPI_USER_GETLIST/INPUT/MAX_ROWS}

- Expand the Expression editor using the "+" button

- Enter the following value with double quotes: "10" and press the update button

You can now trace out, Logging.Tracer, or save, Web.XMLSaver, the Response XML from the BAPI call which will return the first 10 usernames that it finds. This is a very simple example of a BAPI call and has no error handling. For better examples of JCO calls using xMII navigate to the SDN Downloads section and click on Manufacturing. There you will be able to download the xMII Templates which have various templated examples for interfacing with ERP. Hope this helps.

Regards,

Salvatore Castro

xMII Consulting & Field Enablement

Former Member
0 Kudos

Hi Salvatore,

Can you please tell me what is the SAP JCO to get Production request. How to configure this JCO so that in xMII i can use the JCO action block in the way you described above

Thanks,

Piyush

Former Member
0 Kudos

Hi, Piyush.

Usually, production requests (in the form of LOIPRO IDOCS or PP/PI control recipes) are "pushed" from ERP to xMII instead of "pulled".

Best regards,

Rick Bullotta

Former Member
0 Kudos

Hi Selvam,

Using JCO action block in Transaction Editor. There you can give your SAP server info or select a already existing SAP configured alias and give the BAPI name to select in the textbox. Then it will list all the BAPI with key you gave. Select the required BAPI and press next button. You can give all the BAPI inputs in the link editor once the connection is configured.

Thanks,

Rajesh.

PS : Please award points if answer is useful.

Former Member
0 Kudos

Here is a real simple example. Past this into a text file and save to your transaction directorie (e.g. C:\Lighthammer\Xacute\Transactions\ ) with a .trx extension. You should then be able to open this transaction within the Logic editor. You will have to configure the JCO action block with your SAP systems connection info.

<?xml version="1.0" encoding="UTF-8"?>
<Transaction xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"><TransactionAttributes><ContextItem><Name>Description</Name><Description>Transaction Description</Description><MinRange>0</MinRange><MaxRange>0</MaxRange><Value xsi:type="xsd:string"/><ReadOnly>true</ReadOnly></ContextItem><ContextItem><Name>Comments</Name><Description>User Comments</Description><MinRange>0</MinRange><MaxRange>0</MaxRange><Value xsi:type="xsd:string"/><ReadOnly>true</ReadOnly></ContextItem><ContextItem><Name>CreatedBy</Name><Description>Created By</Description><MinRange>0</MinRange><MaxRange>0</MaxRange><Value xsi:type="xsd:string"/><ReadOnly>true</ReadOnly></ContextItem><ContextItem><Name>CreationDate</Name><Description>Creation Date</Description><MinRange>0</MinRange><MaxRange>0</MaxRange><Value xsi:type="xsd:dateTime">2007-01-09T17:10:50</Value><ReadOnly>true</ReadOnly></ContextItem><ContextItem><Name>Category</Name><Description>Transaction Category</Description><MinRange>0</MinRange><MaxRange>0</MaxRange><Value xsi:type="xsd:string"/><ReadOnly>true</ReadOnly></ContextItem><ContextItem><Name>Status</Name><Description>Deployment Status</Description><MinRange>0</MinRange><MaxRange>0</MaxRange><Value xsi:type="xsd:string">DEVELOPMENT</Value><ReadOnly>true</ReadOnly></ContextItem><ContextItem><Name>LastEditedBy</Name><Description>Last Edited By</Description><MinRange>0</MinRange><MaxRange>0</MaxRange><Value xsi:type="xsd:string"/><ReadOnly>true</ReadOnly></ContextItem><ContextItem><Name>LastEditedDate</Name><Description>Last Edited Date</Description><MinRange>0</MinRange><MaxRange>0</MaxRange><Value xsi:type="xsd:dateTime">2007-01-11T16:22:09</Value><ReadOnly>true</ReadOnly></ContextItem></TransactionAttributes><Name>xDDI_BRIDGE/RFC_READ_TABLE_TEST</Name><Version>11</Version><WriterRoles>Administrators,Developers</WriterRoles><ReaderRoles>Everyone</ReaderRoles><Context/><Local/><Layout><GUILayoutItem><Name>Sequence</Name><X>8</X><Y>8</Y><Width>120</Width><SpacingWidth>120</SpacingWidth><DescendantWidth>120</DescendantWidth><Height>96</Height></GUILayoutItem><GUILayoutItem><Name>SAPJCOInterface_0</Name><X>16</X><Y>24</Y><Width>104</Width><SpacingWidth>0</SpacingWidth><DescendantWidth>0</DescendantWidth><Height>72</Height></GUILayoutItem><GUILayoutItem><Name>Sequence_0</Name><X>8</X><Y>264</Y><Width>120</Width><SpacingWidth>120</SpacingWidth><DescendantWidth>0</DescendantWidth><Height>96</Height></GUILayoutItem><GUILayoutItem><Name>XmlSaver_0</Name><X>16</X><Y>280</Y><Width>104</Width><SpacingWidth>0</SpacingWidth><DescendantWidth>0</DescendantWidth><Height>72</Height></GUILayoutItem><GUILayoutItem><Name>Sequence_1</Name><X>8</X><Y>136</Y><Width>120</Width><SpacingWidth>120</SpacingWidth><DescendantWidth>120</DescendantWidth><Height>96</Height></GUILayoutItem><GUILayoutItem><Name>Tracer_0</Name><X>16</X><Y>152</Y><Width>104</Width><SpacingWidth>0</SpacingWidth><DescendantWidth>0</DescendantWidth><Height>72</Height></GUILayoutItem></Layout><Actions><ContextItem><Name>SAPJCOInterface_0</Name><Description/><MinRange>0</MinRange><MaxRange>0</MaxRange><Value xsi:type="SAPJCOInterface"><Request><ReferenceDocumentSource/><?xml version="1.0" encoding="UTF-8"?>

<RFC_READ_TABLE><INPUT><DELIMITER> </DELIMITER><NO_DATA> </NO_DATA><QUERY_TABLE/><ROWCOUNT>0</ROWCOUNT><ROWSKIPS>0</ROWSKIPS></INPUT><TABLES><DATA><item><WA/></item></DATA><FIELDS><item><FIELDNAME/><OFFSET/><LENGTH/><TYPE/><FIELDTEXT/></item></FIELDS><OPTIONS><item><TEXT/></item></OPTIONS></TABLES></RFC_READ_TABLE></Request><Response><ReferenceDocumentSource/><?xml version="1.0" encoding="UTF-8"?>

<RFC_READ_TABLE><TABLES><DATA><item><WA/></item></DATA><FIELDS><item><FIELDNAME/><OFFSET/><LENGTH/><TYPE/><FIELDTEXT/></item></FIELDS><OPTIONS><item><TEXT/></item></OPTIONS></TABLES></RFC_READ_TABLE></Response><AutoCommit>true</AutoCommit><SAPRFC>RFC_READ_TABLE</SAPRFC><ExecuteFunction>true</ExecuteFunction><Language>EN</Language><SAPSystemAlias/><SAPServerName/><SAPClient/><SAPUserName/><SAPPassword/><SAPSSO2Ticket/><SAPSystemNumber/></Value><ReadOnly>false</ReadOnly></ContextItem><ContextItem><Name>XmlSaver_0</Name><Description/><MinRange>0</MinRange><MaxRange>0</MaxRange><Value xsi:type="XmlSaver"><XmlContent><ReferenceDocumentSource/></XmlContent><Path>c:RFC_READ_TABLE.xml</Path></Value><ReadOnly>false</ReadOnly></ContextItem><ContextItem><Name>Tracer_0</Name><Description/><MinRange>0</MinRange><MaxRange>0</MaxRange><Value xsi:type="Tracer"><Level>INFO</Level><Message/></Value><ReadOnly>false</ReadOnly></ContextItem></Actions><Steps><Step xsi:type="ActionSequence"><Name>Sequence</Name><Description/><Steps><Step xsi:type="ActionSequence"><Name>Sequence_1</Name><Description/><Steps><Step xsi:type="ActionSequence"><Name>Sequence_0</Name><Description/><Steps/><Actions><Action><Name>XmlSaver_0</Name><Description>Xml Saver</Description><IncomingLinks><Assign xsi:type="AssignXml"><Name/><Description/><To>XmlSaver_0.XmlContent</To><From>SAPJCOInterface_0.Response</From></Assign></IncomingLinks><OutgoingLinks/></Action></Actions></Step></Steps><Actions><Action><Name>Tracer_0</Name><Description>Tracer</Description><IncomingLinks><Assign xsi:type="Assign"><Name/><Description/><To>Tracer_0.Message</To><From>"Success?--" & SAPJCOInterface_0.Success</From></Assign></IncomingLinks><OutgoingLinks/></Action></Actions></Step></Steps><Actions><Action><Name>SAPJCOInterface_0</Name><Description>SAP JCO Interface</Description><IncomingLinks><Assign xsi:type="Assign"><Name/><Description/><To>SAPJCOInterface_0.Request{/RFC_READ_TABLE/INPUT/QUERY_TABLE}</To><From>"LTAP"</From></Assign><Assign xsi:type="Assign"><Name/><Description/><To>SAPJCOInterface_0.Request{/RFC_READ_TABLE/INPUT/DELIMITER}</To><From>";"</From></Assign><Assign xsi:type="Assign"><Name/><Description/><To>SAPJCOInterface_0.Request{/RFC_READ_TABLE/TABLES/FIELDS/item/FIELDNAME}</To><From>"TANUM"</From></Assign><Assign xsi:type="Assign"><Name/><Description/><To>SAPJCOInterface_0.Request{/RFC_READ_TABLE/TABLES/OPTIONS/item/TEXT}</To><From>"MANDT = '030'"</From></Assign></IncomingLinks><OutgoingLinks/></Action></Actions></Step></Steps></Transaction>