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

Parking GL Documents using BAPI_ACC_GL_POSTING_POST and EXTENSION1

JoseMG
Explorer
0 Likes
3,080

Hi All,

I am trying to PARK a GL document using BAPI_ACC_GL_POSTING_POST. I have successfully posted documents using this BAPI but my requirement is for only park documents.

I have read some threads that mentioned that is possible to park documents by using the EXTENSION1 parameter (tables) to trigger a user exit that must be activated.

In other thread says to use the BADI ACC_DOCUMENT to pass the value '2' to C_ACCHD-STATUS_NEW ( C_ACCHD-STATUS_NEW = '2') which should park documents.

Does anyone is familiar with this? If so, could you

please send me a sample?

Please advice,

Regards,

Jose

Hi All,

I am trying to PARK a GL document using BAPI_ACC_GL_POSTING_POST. I have successfully posted documents using this BAPI but my requirement is for only park documents.

I have read some threads that mentioned that is possible to park documents by using the EXTENSION1 parameter (tables) to trigger a user exit that must be activated.

In other thread says to use the BADI ACC_DOCUMENT to pass the value '2' to C_ACCHD-STATUS_NEW ( C_ACCHD-STATUS_NEW = '2') which should park documents.

Does anyone is familiar with this? If so, could you

please send me a sample?

Please advice,

Regards,

Jose

6 REPLIES 6
Read only

Former Member
0 Likes
1,315

i do some work follow your ideas, but it doesn't work.

in user_exit EXIT_SAPLACC4_001 changing parameter

T_ACCHD-STATUS_NEW = '2' , well, the bapi BAPI_ACC_GL_POSTING_POST returns success message and documents number, but i can't see it in fb03.

while i change it to '4' it also success,and i will see it in fbv3,but the message says it's not parked document.

what shall i do ?

Read only

0 Likes
1,315

I have exactly the same problem. The BAPI_ACC_GL_POSTING_POST returns success message and documents number, but I am unable to open the document in FB03. It says "Document does not exists".

Hopefully an expert can advice to us...

Read only

Former Member
0 Likes
1,315

Hi,

concerning your 'document does not exist' issue:

try calling FM 'BAPI_TRANSACTION_COMMIT' right after calling FM 'BAPI_ACC_GL_POSTING_POST'.

Please search this forum for more examples on how to use 'BAPI_TRANSACTION_COMMIT'.

You can also test this in SE37 by creating a test sequence ( Function module --> Test --> Test sequences and then fill in the two BAPI names BAPI_ACC_GL_POSTING_POST and BAPI_TRANSACTION_COMMIT' )

Hope this helps.

Read only

Former Member
0 Likes
1,315

Hi,

I have a similar requirement. I tried to find a BAPI to park a GL Doc but could not find any. I already search the whole SDN and many SAP related sites.

Thus, I ended up park the GL Doc using BDC for transaction code F-65. The performance is good as the screens has not many fields.

Pls let me know if you found any BAPI that can do that.

Pls reward points if solve your problem.

Read only

0 Likes
1,315

Hi Andrew Tan ,

This is shanmukesh from Hyderabad(India),I need some information regarding to park the document,Can u please send me the BDC code to park the document.I am sending my mail-id can you please help me.

Mail-id :[email protected]

Thanks & Regards,

Shanmukesh.P

Read only

former_member69765
Contributor
0 Likes
1,315

Hi All...

I had this same requirement long back...

I was not able to Park using this FM .. However since some of u have successfully called this FM to pass .. but are not able to see the Parked Doc in FB03 .. I would advice you to do a BAPI_COMMIT after that... in case u have not done.

At that time.. I had written a BDC to park the Docs... So I would just post the BDC..

you may use it for ur reference.

Note : I had to deal with some jurisdiction codes also.. so i have coded that also.. u will have to modify the BDC accordingly ..

In any cas u can always refer the BDC part.

************************

&----


*& Form sub_park_document

&----


  • text

----


  • --> p1 text

  • <-- p2 text

----


FORM sub_park_document .

DATA : l_amount(13) TYPE c,

l_error_flag TYPE c,

l_date(10) TYPE c,

l_rc TYPE sy-subrc,

it_return TYPE STANDARD TABLE OF bapiret2 INITIAL SIZE 0 WITH HEADER LINE,

l_key_cr TYPE bseg-bschl,

l_key_db TYPE bseg-bschl.

WRITE sy-datum TO l_date.

  • Populate Header Data.

PERFORM sub_put_field TABLES bdcdata

USING : c_on 'SAPLF040' '0100',

c_off 'BKPF-BLDAT' l_date,

c_off 'BKPF-BLART' p_doc,

c_off 'BKPF-BUKRS' p_bukrs,

c_off 'BKPF-BUDAT' l_date,

c_off 'BKPF-WAERS' 'USD',

c_off 'VBKPF-XBWAE' 'X'.

LOOP AT it_cc_amount_final INTO fl_cc_amount.

IF fl_cc_amount-db_amount GE 0.

l_key_cr = '40'.

l_key_db = '50'.

WRITE fl_cc_amount-db_amount TO l_amount.

ELSE.

l_key_cr = '50'.

l_key_db = '40'.

WRITE fl_cc_amount-cr_amount TO l_amount.

ENDIF.

IF sy-tabix EQ 1.

PERFORM sub_put_field TABLES bdcdata

USING : c_off 'RF05V-NEWBS' l_key_cr,

c_off 'RF05V-NEWKO' p_acc_cr,

c_off 'BDC_OKCODE' '/00'.

ENDIF.

  • Get Tax jurisdiction code.

READ TABLE it_cost_centre INTO fl_cost_centre WITH KEY cost_centre = fl_cc_amount-cost_centre.

  • Populate Line Item Entry with Credit Amount.

PERFORM sub_put_field TABLES bdcdata

USING : c_on 'SAPLF040' '0300',

c_off 'BSEG-WRBTR' l_amount,

c_off 'BSEG-MWSKZ' p_tax_cd,

c_off 'BSEG-TXJCD' fl_cost_centre-tax_code.

  • Populate Line Item Entry with Debit Amount.

PERFORM sub_put_field TABLES bdcdata

USING : c_off 'RF05V-NEWBS' l_key_db,

c_off 'RF05V-NEWKO' p_acc_db,

c_off 'BDC_OKCODE' '/00',

c_on 'SAPLKACB' '0002',

c_off 'BDC_OKCODE' '=ENTE',

c_on 'SAPLF040' '0300',

c_off 'BSEG-WRBTR' l_amount,

c_off 'RF05V-NEWBS' l_key_cr,

c_off 'RF05V-NEWKO' p_acc_cr,

c_off 'BDC_OKCODE' '/00',

c_on 'SAPLKACB' '0002',

c_off 'COBL-KOSTL' fl_cc_amount-cost_centre,

c_off 'BDC_OKCODE' '=ENTE'.

ENDLOOP.

  • Park The Document.

PERFORM sub_put_field TABLES bdcdata

USING : c_on 'SAPLF040' '0300',

c_off 'BDC_OKCODE' '=BP',

c_on 'SAPLKACB' '0002',

c_off 'BDC_OKCODE' '=ENTE'.

  • Submit your transaction using Call Transaction method.

PERFORM sub_submit_transaction TABLES bdcdata t_ct_messages

USING 'FBV1' l_rc.

  • Populate the Return table.

PERFORM sub_build_bdc_return_table TABLES t_ct_messages it_return.

  • Check for Errors.

READ TABLE it_return WITH KEY type = 'E'.

IF sy-subrc EQ 0.

l_error_flag = 'X'.

ENDIF.

  • Error Handling.

LOOP AT it_return.

PERFORM sub_interface_message USING it_return-type it_return-message.

ENDLOOP.

IF l_error_flag NE 'X'.

ENDIF.

ENDFORM. " sub_park_document

**************************

Hope this will help u all...