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: 

BAPI to replace batch input of tx. FB08

mayra_cobo
Explorer
0 Kudos

Hi,

I need to reversal FI documents. I have found BAPI's: BAPI_ACC_GL_POSTING_REV_POST and BAPI_ACC_DOCUMENT_REV_POST, but I can't make to work correctly, instead I get the following messages:

"Error in document: BKPFF $ QAS300

Document BKPFF 000400002020002010 QAS300 cannot be reversed

Reversal in component Financial Accounting not possible

Reversal not possible, accounting document for the ref. does not exist"

Any suggestions? Is there other BAPI or functions module?... Am I passing wrong parameters?

Thanks in advance...

Best regards,

Mayra.

7 REPLIES 7

mvoros
Active Contributor
0 Kudos

Hi,

it's really hard to say if you are passing wrong parameters or not without seeing you code. But you should be able to reverse document using BAPI BAPI_ACC_DOCUMENT_REV_POST. Have you checked documentation for this BAPI in SE37? It tells you which fields are mandatory.

Cheers

Former Member
0 Kudos
Reversal not possible, accounting document for the ref. does not exist"

Based on above statement, looks like some thing wrong with accounting doc number. Check your data.

Thanks

Satyasuresh Donepudi

Former Member
0 Kudos

Hi,

First try to post reversal manually through the standard transaction. Observe what are all the mandatory parameters need to be passed.

Then proceed with the similar way by passing all the parameters to the BAPI.

Hope this helps you to find out the missing/ incorrect parameters !!!

Regards,

Ganga

Former Member
0 Kudos

hi ALL,

i am currently doing a program using this BAPI as well. Unfortunately, it generates an error 'Required field OBJ_KEY_R was not transferred in parameter REVERSAL'. This field is suppose to be the reversing document number. This doc number is generated only after the BAPI execution. I want to ask your help why this is as required field in the inmporting parameter of the BAPI. If this reversal BAPI fails, my PLAN B is BDC processing.

Has anyone processed this BAPI successfully before? Any information will be highly appreciated.

Thanks a lot!

-Rhea

mayra_cobo
Explorer
0 Kudos

Hi,

I have some progress but still have not accounted the reversal document.

I'm testing by "Test Sequences" in transaction SE37 these BAPIs:

1. BAPI_ACC_DOCUMENT_REV_POST

2. BAPI: BAPI_TRANSACTION_COMMIT

For the first one, the import parameter data is:

REVERSAL-OBJ_TYPE BKPF

REVERSAL-OBJ_KEY 000400000720002010

REVERSAL-OBJ_SYS QAS300

REVERSAL-OBJ_KEY_R 000400000720002010

BUS_ACT RFBU

And the export parameters and RETURN table, it shows:

OBJ_TYPE BKPF

OBJ_KEY 000400000720002010

OBJ_SYS QAS300

RETURN-TYPE S

RETURN-ID RW

RETURN-NUMBER 605

RETURN-MESSAGE Document posted successfully: BKPF 000400000720002010 QAS300

RETURN-LOG_NO

RETURN-LOG_MSG_NO 000000

RETURN-MESSAGE_V1 BKPF

RETURN-MESSAGE_V2 000400000720002010

RETURN-MESSAGE_V3 QAS300

RETURN-MESSAGE_V4

RETURN-PARAMETER

RETURN-ROW 0

RETURN-FIELD

RETURN-SYSTEM QAS300

For the second one, the import parameter data is:

WAIT X

And the RETURN table it shows:

RETURN-TYPE E

RETURN-ID S&

RETURN-NUMBER 150

RETURN-MESSAGE Updating could not be completed

RETURN-LOG_NO

RETURN-LOG_MSG_NO 000000

RETURN-MESSAGE_V1

RETURN-MESSAGE_V2

RETURN-MESSAGE_V3

RETURN-MESSAGE_V4

RETURN-PARAMETER

RETURN-ROW 0

RETURN-FIELD

RETURN-SYSTEM QAS300

Why?

Thanks a lot to all (even to the ironic)

Best regards,

Mayra.

0 Kudos

Hi All,

I've solved my problem. I'm using BAPI: BAPI_ACC_DOCUMENT_REV_POST, but to test it, you have to do your own program, because by SE37 it doesn't work as expected.

This code show the parameters.

REPORT zbc_experimento_153.

DATA : t_reversal LIKE bapiacrev.

DATA : e_otype LIKE bapiacrev-obj_type,

e_obkey LIKE bapiacrev-obj_key,

e_obsys LIKE bapiacrev-obj_sys.

DATA : t_retur LIKE bapiret2 OCCURS 0.

PARAMETERS: p_awkey LIKE bkpf-awkey. "document to reversed

t_reversal-obj_type = 'BKPF'.

t_reversal-obj_key = p_awkey.

t_reversal-obj_sys = 'QAS300'.

t_reversal-obj_key_r = p_awkey.

t_reversal-reason_rev = '01'.

CALL FUNCTION 'BAPI_ACC_DOCUMENT_REV_POST'

EXPORTING

reversal = t_reversal

bus_act = 'RFBU'

IMPORTING

obj_type = e_otype

obj_key = e_obkey

obj_sys = e_obsys

TABLES

return = t_retur.

IF sy-subrc EQ 0.

COMMIT WORK AND WAIT.

ENDIF.

Thanks all and best regards,

Mayra.

0 Kudos

Hi. When using BAPI in se37, you need to execute the FM BAPI_COMMIT_WORK in

sequence of the first bapi.

If you dont do that, The first Function does not change DB.

In se80, in the group of function you want do execute, right click in the tree ( context menu ) you will

have the option for execute multiple functions in sequence.

Att.