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: 

How to get the XML request using the BAPI testcase

former_member899300
Discoverer
0 Kudos
480

Hi I am a Functional consultant and need to get the xml request from bapi after creating the test case how to get this XML file or request to map into middleware

4 REPLIES 4

moshenaveh
Community Manager
Community Manager
0 Kudos
415

Welcome to the SAP Community. Thank you for visiting us to get answers to your questions.

Since you're asking a question here for the first time, I'd like to offer some friendly advice on how to get the most out of your community membership and experience.

First, please see https://community.sap.com/resources/questions-and-answers, as this resource page provides tips for preparing questions that draw responses from our members. Second, feel free to take our Q&A tutorial at https://developers.sap.com/tutorials/community-qa.html, as that will help you when submitting questions to the community.

I also recommend that you include a profile picture. By personalizing your profile, you encourage readers to respond: https://developers.sap.com/tutorials/community-profile.html.

Now for some specific suggestions on how you might improve your question:

* Outline what steps you took to find answers (and why they weren't helpful) -- so members don't make suggestions that you've already tried.

* Share screenshots of what you've seen/done (if possible), as images always helps our members better understand your problem.

* Make sure you've applied the appropriate tags -- because if you don't apply the correct tags, the right experts won't see your question to answer it.

Should you wish, you can revise your question by selecting Actions, then Edit.

The more details you provide (in questions tagged correctly), the more likely it is that members will be able to respond.

I hope you find this advice useful, and we're happy to have you as part of SAP Community!

Ulrich_Schmidt
Product and Topic Expert
Product and Topic Expert
0 Kudos
415

A good and easy to use middleware for converting between XML documents and BAPI requests would be the SAP Business Connector.

Download: https://support.sap.com/sbc-download
(Vallid S-User and one-time registration is required, but otherwise it's free.)

Documentation: https://support.sap.com/en/product/connectors/bc/details.html

For an overview of the topic "BAPIs and XML", see the chapter "Functional Highlights" in the SAPAdapterGuide.pdf, in particular "Routing IDocs, RFCs and BAPIs", "Support for IDoc- and RFC-XML" and "Support for BizTalk XML envelopes for BAPI calls".But of course, in addition to the build-in XML formats for BAPIs (RFC-XML, bXML, BizTalk), the SAP BC can also be used to define your own hand-tailored XML formats, depending on what your sender/receiver application needs.

Sandra_Rossi
Active Contributor
0 Kudos
415

What kind of "BAPI XML request" are you talking about? Could you show the XML format that you expect?

former_member899300
Discoverer
0 Kudos
415

For example below is for BAPI_CUSTOMER_GETDETAIL if RFC xml format is used i.e compliance with namespace "urn:sap-com:document:sap:rfc:functions"

<?xml version="1.0" encoding="UTF-8"?>

- <BAPI_CUSTOMER_GETDETAIL xmlns="urn:sap-com:document:sap:rfc:functions">

<CUSTOMERNO xmlns="">0000000001</CUSTOMERNO>

<PI_DISTR_CHAN xmlns="">01</PI_DISTR_CHAN>

<PI_DIVISION xmlns="">01</PI_DIVISION>

<PI_SALESORG xmlns="">001</PI_SALESORG>

</BAPI_CUSTOMER_GETDETAIL>

and same bapi xml if BAPI xml format is used i.e in compliance with namespace "urn:sap-com:document:sap:business"

<?xml version="1.0" encoding="UTF-8"?>

- <Customer.GetDetail CustomerNo="0000000001" xmlns="urn:sap-com:document:sap:business">

<PiSalesorg xmlns="">001</PiSalesorg>