‎2007 Jul 16 5:19 PM
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
‎2007 Jul 16 5:25 PM
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
‎2007 Jul 16 5:52 PM
Ravi,
I am new to bapi's can u post the sample code if u have any related to my requirement.....
SRI
‎2007 Jul 16 5:29 PM
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.
‎2007 Jul 16 5:33 PM
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
‎2007 Jul 16 5:38 PM
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).
‎2007 Jul 16 5:41 PM
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
‎2007 Jul 16 5:45 PM
Agreed... I was not getting your point.
Ravi's pseudo-code above is exactly what you are looking for then.