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: 

BAPI to upload data from internal table to BAPI input parameters

Former Member
0 Kudos

Hi Experts

Is there any FM or BAPI to take data from internal table to input parameters of a BAPI?

Thanks & regards,

Akriti

1 ACCEPTED SOLUTION

Former Member
0 Kudos

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

24 REPLIES 24

Former Member
0 Kudos

Hi Akriti,

What do you need to accomplish? Can you please explain a little bit more?

Thanks

raymond_giuseppi
Active Contributor
0 Kudos

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

Former Member
0 Kudos

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

0 Kudos

Have you tried this FM - DMEE_GET_XML_DATA_ABA?

Regards,

Ernesto

Former Member
0 Kudos

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

0 Kudos

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"

Former Member
0 Kudos

Thanks Ernesto

No , I havent used this BAPI.

CAn you please tell how to pass XML file to this BAPI.?

Thanks

Akriti

0 Kudos

Yes, please check SAP SCN thread 96971.

Hope this helps.

Former Member
0 Kudos

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

0 Kudos

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

Former Member
0 Kudos

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

Former Member
0 Kudos

Sorry for asking this Ernest

But could you please tell from where to open the thread?

0 Kudos

Hi, the thread is

Regards,

E

Former Member
0 Kudos

Thanku so much Ernest

Former Member
0 Kudos

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

0 Kudos

It is not for a special BAPI.

You need to parse XML structure and fill your BAPI structures accordingly.

Former Member
0 Kudos

Thanks for the quick response.

Sorry i didnt get it ?

How to do this.

Regards,

Akriti

0 Kudos

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

Former Member
0 Kudos

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.

0 Kudos

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

0 Kudos

Sure no problem. Add me as your connection for me to send you my email.

0 Kudos

This message was moderated.

Former Member
0 Kudos

This message was moderated.

Former Member
0 Kudos

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