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: 

Upload the data from application server with bapi

Former Member
0 Kudos

hi,

can anyone paste some sample code to upload the data from a file which is in applicaiton server with the use of a BAPI

Please its bit urgent....

Thanks a lot for your anticipation.....

SRI

7 REPLIES 7

former_member181962
Active Contributor
0 Kudos

Your requirement is two fold.

1) Get the file from the Application server into an internal table.

2) Populate the BAPI's interface parameters and call the BAPI FM.

1)

open dataset <file> for input in text mode encoding default.

do.

read dataset <file> into wa.

if sy-subrc = 0.

append wa to itab.

else.

exit.

endif.

enddo.

close dataset.

2) fill bapi interface parameters and call the bapi using the call function statement

loop at itab.

x_exp1-field1 = itab-field1.

x_exp1-field2 = itab-field2.

call function 'BAPI_XXXXXXXXXXXXXXXX'

exporting

exp1 = x_exp1

tables

table1 = t_itab1

return = t_return.

endloop.

REgards,

Ravi

0 Kudos

Ravi,

I am new to bapi's can u post the sample code if u have any related to my requirement.....

SRI

Former Member
0 Kudos

Sri,

There is no BAPI specifically for this purpose. Why is a BAPI required?

Look to FM -ARCHIVFILE_SERVER_TO_TABLE. You could make a custom BAPI of it - if you TRULY need a BAPI. No real reason that I can thought of, though.

Points.... don't forget those points.

0 Kudos

John,

I am not specifically asking anything....

Just I need some sample program to upload the data which is in the application server with the use of a BAPI.

let us take one case i will get the AR line item data into applicaiton server. I have to upload the data into sap system with the use of a bapi.......

Can u help me plzzzzzzzzzz

SRI

0 Kudos

There is no BAPI specifically for this purpose in SAP.

BAPI are Business Objects that relate to business activities - creating a sales order, for example.

You will need to use a Func Mod (like the one cited above).

0 Kudos

John,

you are not catching my point

let us take one bapi BAPI_ACC_BILLING_POST... this is used to upload the open AR items and G/L items. So i will take the file from applicaiton server read that data into one int. table n will do the validations and call that above bapi.....

so i need some sample program like this if u have any......

SRI

0 Kudos

Agreed... I was not getting your point.

Ravi's pseudo-code above is exactly what you are looking for then.