‎2007 Sep 10 6:35 AM
Hi Folks,
BAPI_ACC_DOCUMENT_POST
Is it the possible to get the data that the above said BAPI is transferring,into a flat file.
Thanks,
K.Kiran.
‎2007 Sep 10 7:18 AM
Hi Folks,
To be more precise,
CALL FUNCTION 'BAPI_ACC_DOCUMENT_POST'
EXPORTING
documentheader = header
CUSTOMERCPD =
CONTRACTHEADER =
IMPORTING
obj_type = obj_type
obj_key = obj_key
obj_sys = obj_sys
<b>TABLES
accountgl = accountgl
ACCOUNTRECEIVABLE =
accountpayable = accountpayable
ACCOUNTTAX = accounttax
currencyamount = currencyamount</b>
CRITERIA =
VALUEFIELD =
EXTENSION1 =
return = return
PAYMENTCARD =
CONTRACTITEM =
EXTENSION2 =
REALESTATE =
.
I want the data in accountgl,accountpayable,and currencyamount into a flat file.
All these tables are declared as follows in the program.
accountpayable LIKE bapiacap09 OCCURS 0 WITH HEADER LINE,
accountgl LIKE bapiacgl09 OCCURS 0 WITH HEADER LINE,
currencyamount LIKE bapiaccr09 OCCURS 0 WITH HEADER LINE.
Looking forward to SDN experts replies.
Thanks,
K.Kiran.
Message was edited by:
Kiran K
Message was edited by:
Kiran K
‎2007 Sep 10 7:18 AM
Hi Folks,
To be more precise,
CALL FUNCTION 'BAPI_ACC_DOCUMENT_POST'
EXPORTING
documentheader = header
CUSTOMERCPD =
CONTRACTHEADER =
IMPORTING
obj_type = obj_type
obj_key = obj_key
obj_sys = obj_sys
<b>TABLES
accountgl = accountgl
ACCOUNTRECEIVABLE =
accountpayable = accountpayable
ACCOUNTTAX = accounttax
currencyamount = currencyamount</b>
CRITERIA =
VALUEFIELD =
EXTENSION1 =
return = return
PAYMENTCARD =
CONTRACTITEM =
EXTENSION2 =
REALESTATE =
.
I want the data in accountgl,accountpayable,and currencyamount into a flat file.
All these tables are declared as follows in the program.
accountpayable LIKE bapiacap09 OCCURS 0 WITH HEADER LINE,
accountgl LIKE bapiacgl09 OCCURS 0 WITH HEADER LINE,
currencyamount LIKE bapiaccr09 OCCURS 0 WITH HEADER LINE.
Looking forward to SDN experts replies.
Thanks,
K.Kiran.
Message was edited by:
Kiran K
Message was edited by:
Kiran K
‎2007 Sep 10 11:49 AM
Hi
You can download the tables by simply using the function module "GUI_DOWNLOAD".
Once the BAPI returns the internal tables filled with data, call the above mentioned FM each time you want to download a file.
Example:
CALL "GUI_DOWNLOAD"
EXPORTING
filename = 'C:\accountpayable.txt'
filetype = 'ASC'
TABLES
data_tab = accountpayable.
repeat this for all table you want download as a flat file by changing the data_tab parameter.
PS: Reward points if this solves your query.
‎2007 Sep 11 5:19 AM
Vania,
Do I have to use this after BAPI_transaction_commit?I had given gui_download after bapi_acc_document_post but it is not dowloading the table into text file.
Kindly let me know.
Thanks,
K.Kiran.
‎2007 Sep 11 6:53 AM
Hi Kiran,
It is irrelevant that you use this after CALL FUNCTION 'BAPI_TRANSACTION_COMMIT' since all you are doing is downloading data from your internal table to a text file on your desktop.
The previous code mite not have worked since it was a pseudo code.
Am attaching a sample code below from which you can replace neccessary variables to suit your requirement.
DATA: it_scarr TYPE TABLE OF scarr.
DATA: g_length TYPE i.
SELECT * FROM scarr INTO TABLE it_scarr.
CALL FUNCTION 'GUI_DOWNLOAD'
EXPORTING
filename ='C:\test.txt'
filetype = 'ASC'
IMPORTING
filelength = g_length
TABLES
data_tab = it_scarr.
IF sy-subrc = 0.
WRITE: g_length.
ENDIF.
Let me know if your problem still persist else points
Regards.
‎2007 Sep 11 7:33 AM
Vania,
It seems we have to give after transaction commit.I was able to download the data into a text file.
Thanks.
K.Kiran.
‎2007 Sep 11 7:46 AM
Gr8.
Since its working fine, please mark this question as answered and reward neccessary points.
Thanks.
‎2007 Sep 10 10:06 AM