Application Development and Automation 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: 
Read only

BAPI_ACC_DOCUMENT_POST

kiran_k8
Active Contributor
0 Likes
730

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.

1 ACCEPTED SOLUTION
Read only

kiran_k8
Active Contributor
0 Likes
709

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

7 REPLIES 7
Read only

kiran_k8
Active Contributor
0 Likes
710

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

Read only

Former Member
0 Likes
709

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.

Read only

kiran_k8
Active Contributor
0 Likes
709

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.

Read only

Former Member
0 Likes
709

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.

Read only

kiran_k8
Active Contributor
0 Likes
709

Vania,

It seems we have to give after transaction commit.I was able to download the data into a text file.

Thanks.

K.Kiran.

Read only

Former Member
0 Likes
709

Gr8.

Since its working fine, please mark this question as answered and reward neccessary points.

Thanks.

Read only

kiran_k8
Active Contributor
0 Likes
709

Hi Folks,

Looking forward to SDN Experts replies.

K.Kiran.