12-02-2014 11:38 AM
Hi Experts
Is there any FM or BAPI to take data from internal table to input parameters of a BAPI?
Thanks & regards,
Akriti
12-10-2014 3:35 PM
Hi Akriti,
Attached you'll find program that calls BAPI_FLIGHT_GETDETAIL from an XML file. It is a combination of 3 programs I found on SCN. Basically it parses XML file, then reads BAPI Interface structure from BAPI name and then builds call to BAPI dynamically. In this case we are reading data out of SAP. You'll have to adjust it to update data, if that is what you want.
Hope this helps.
Regards,
Ernesto
12-04-2014 2:15 PM
Hi Akriti,
What do you need to accomplish? Can you please explain a little bit more?
Thanks
12-04-2014 2:24 PM
There are FMs to map structure from internal format (database) to BAPI format, is this your question ?
Usuallty those FM have names starting with either MAP2E or MAP2I and are in the same function group than the BAPI.
You can also generate such FM for your own requirement using transaction BDBS.
(Ref: BAPI Programming Guide Reference (CA-BFA) : Tools for Developing BAPIs, Converting Between Int. and Ext. Data Formats and Structures)
Regards,
Raymond
12-04-2014 2:27 PM
Yes Ernesto ...
Suppose i have an XML file for a BAPI.
I want to read input from this XML file and then fill these inputs in the respective input parameters of the BAPI in SAP.
In this i will not have to manually write the data in BAPI.
Please let me know if you need any other input from my side.
Thanks & Regards,
Akriti
12-04-2014 2:38 PM
12-04-2014 2:32 PM
Hi Raymond
Thanks for the input
But i dont want to map from database to BAPI.
I want to map from XML file to BAPI Inputs.
Thanks
Akriti
12-04-2014 2:52 PM
So you need to define some rules for a CALL TRANSFORMATION to get xml data into Abap and then to BAPI ?
Regards,
Raymond
PS: You may also change the title of the thread, as "internal table" hardly suggests "xml data"
12-04-2014 2:46 PM
Thanks Ernesto
No , I havent used this BAPI.
CAn you please tell how to pass XML file to this BAPI.?
Thanks
Akriti
12-04-2014 2:50 PM
12-04-2014 3:07 PM
Hi Ernest ,
My XML file is in my PC.
I want to take this file from computer and then read this XML data and pass to the FM DMEE_GET_XML_DATA_ABA.
Please help me to get this.
Thanks
Akriti
12-04-2014 3:27 PM
Hi Akriti,
The thread I mentioned is a report which has a parameter (XML file). You can enter the file path and execute.
Regards,
Ernesto
12-04-2014 3:08 PM
Hi Raymond.. Thanks for the inputs
yes u are right.
But i was thinking of first reading XML into the internal table and then paas data to BAPI.
BUt it would be great if i am able to diectly map XML to BAPI.
Regards,
Akriti
12-04-2014 3:36 PM
Sorry for asking this Ernest
But could you please tell from where to open the thread?
12-04-2014 3:42 PM
12-04-2014 3:46 PM
12-04-2014 4:36 PM
Hi Ernest.
The report is running good.
But In FM DMEE_GET_XML_DATA_ABA what should i paas in input T_XMLTABLE?
How to specify for which BAPI this input is used?
Please help
Regards
Akriti
12-04-2014 4:37 PM
It is not for a special BAPI.
You need to parse XML structure and fill your BAPI structures accordingly.
12-04-2014 4:40 PM
Thanks for the quick response.
Sorry i didnt get it ?
How to do this.
Regards,
Akriti
12-04-2014 4:52 PM
This program is not designed for a certain BAPI.
Basically what it does is it parses an XML file to get xml values and then with this values you can call the BAPI you need to call.
For example you need to create a Sales Order using BAPI_SALESORDER_CREATEFROMDAT1 and the data you need is contained on a XML file.
With the program you read the XML values and then you fill the BAPI structures with the exctracted XML values.
Hope this helps
12-04-2014 4:55 PM
Thanks Ernesto..:)
But my report should be dynamic.
The report should read data from XML .. Then i have to specify the name of BAPI in which i have to paas the input.
And this XML data shoul pass into the fields of BAPI.
12-04-2014 5:05 PM
Akriti,
The XML file will contain other fields than those of the BAPI. You will have to do some coding to match the XML fields to those of the BAPI.
Regards,
Ernesto
Message was edited by: Ernesto Caballero
12-04-2014 5:30 PM
Sure no problem. Add me as your connection for me to send you my email.
12-04-2014 5:34 PM
12-04-2014 5:10 PM
12-10-2014 3:35 PM
Hi Akriti,
Attached you'll find program that calls BAPI_FLIGHT_GETDETAIL from an XML file. It is a combination of 3 programs I found on SCN. Basically it parses XML file, then reads BAPI Interface structure from BAPI name and then builds call to BAPI dynamically. In this case we are reading data out of SAP. You'll have to adjust it to update data, if that is what you want.
Hope this helps.
Regards,
Ernesto