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

User exit for BAPI_ACC_DOCUMENT_POST..?

Former Member
0 Likes
7,726

Hi,

Is there any user exit for BAPI_ACC_DOCUMENT_POST...

Please suggest...

Thanks

Cheers: Sam

1 ACCEPTED SOLUTION
Read only

former_member194669
Active Contributor
0 Likes
3,846

Hi,

In this fm BTE is available for customer exit EXTENSION1 and not for EXTENSION2.

if you check documentation it clearly says that you need to use BADI for custom field extension.

Here is documentation

Description

This enhancement structure can be used to transfer additional fields.

There are four fields available for each data record (VALUEPART1 - 4), which each contain 240 characters. A defined ABAP dictionary structure can be transferred in the field STRUCTURE, on the basis of which the field contents are read.

The accounting document can be supplemented and changed in an implemented BAdI ( ACC_DOCUMENT) before the active accounting component is called.

Default

The class CL_EXM_IM_ACC_DOCUMENT is available as example implementation. Here, for each data record of the parameter that is transferred the ABAP dictionary structure is checked and the content of the fields VALUEPART1 to -4 is set in the structure. If the structure that is transferred contains a field POSNR, the associated lines of the accounting document are updated using the contents of the enhancement.

aRs

10 REPLIES 10
Read only

former_member194669
Active Contributor
0 Likes
3,846

Hi,

You can use Business Add-in IF_EX_ACC_DOCUMENT and can use method CHANGE

aRs

Read only

0 Likes
3,846

Hi,

Thanks for the reply...

How can i enhance this BAPI to include custom fields..I mean using the EXTENSION parameter...Can we do it through BTE...

Please help its really URGENT..

Thanks

Read only

former_member194669
Active Contributor
0 Likes
3,847

Hi,

In this fm BTE is available for customer exit EXTENSION1 and not for EXTENSION2.

if you check documentation it clearly says that you need to use BADI for custom field extension.

Here is documentation

Description

This enhancement structure can be used to transfer additional fields.

There are four fields available for each data record (VALUEPART1 - 4), which each contain 240 characters. A defined ABAP dictionary structure can be transferred in the field STRUCTURE, on the basis of which the field contents are read.

The accounting document can be supplemented and changed in an implemented BAdI ( ACC_DOCUMENT) before the active accounting component is called.

Default

The class CL_EXM_IM_ACC_DOCUMENT is available as example implementation. Here, for each data record of the parameter that is transferred the ABAP dictionary structure is checked and the content of the fields VALUEPART1 to -4 is set in the structure. If the structure that is transferred contains a field POSNR, the associated lines of the accounting document are updated using the contents of the enhancement.

aRs

Read only

0 Likes
3,846

Ok Buddy...

How shud i implement it then...can u please provide me the detail steps...i have no idea about BADI or BTE...

Please help....My manager wants something immediately...

Thanks

Read only

0 Likes
3,846

Hi,

Check these threads

How to implement BADI

/people/thomas.weiss/blog/2006/04/03/how-to-define-a-new-badi-within-the-enhancement-framework--part-3-of-the-series

Related BADI implementation thread

and here sample code i have done to how to populate EXTENSION2.


DATA : HelpExt TYPE ZACCIT.
REFRESH INTBL_EXTENSION2. REFRESH INTBL_EXTENSION2.
CLEAR WA_EXTENSION2. CLEAR WA_EXTENSION2.
CLEAR HelpExt. CLEAR HelpExt.
HelpExt-posnr = '0000000002'. HelpExt-posnr ='0000000002 '.
IF NOT P_AVANS IS INITIAL. IF NOT P_AVANS IS INITIAL. "" индикатор авансовый платеж "" indicator down payment
*аванс * advance
HelpExt-BSCHL = '29'. HelpExt-BSCHL ='29 '.
ELSE. ELSE.
*неаванс * neavans
HelpExt-BSCHL = '25'. HelpExt-BSCHL ='25 '.
ENDIF. ENDIF.
HelpExt-UMSKZ = P_SP_GL. HelpExt-UMSKZ = P_SP_GL.
CLEAR WA_EXTENSION2. CLEAR WA_EXTENSION2.
WA_EXTENSION2-STRUCTURE = 'ZACCIT'. WA_EXTENSION2-STRUCTURE = 'ZACCIT'.
WA_EXTENSION2-VALUEPART1+0(10) = HelpExt-posnr. WA_EXTENSION2-VALUEPART1 0 (10) = HelpExt-posnr.
WA_EXTENSION2-VALUEPART1+10(1) = HelpExt-UMSKZ. WA_EXTENSION2-VALUEPART1 10 (1) = HelpExt-UMSKZ.
WA_EXTENSION2-VALUEPART1+11(2) = HelpExt-BSCHL. WA_EXTENSION2-VALUEPART1 11 (2) = HelpExt-BSCHL.
APPEND WA_EXTENSION2 TO INTBL_EXTENSION2. APPEND WA_EXTENSION2 TO INTBL_EXTENSION2. 

aRs

Read only

0 Likes
3,846

Thanks...

But What steps shoud i follow....

I have to do it right now and submit...

if i double click on change method it doesnt let me edit it...

What shud i do

Read only

0 Likes
3,846

Hi,

You can use the transaction SE18 to define a new BAdI definition which may be implemented by other developers later. It is not so challenging. Here is the roadmap:

A. BAdI Definition

1. SE18

2. Enter the name for the BAdI to be created in customer namespace and press "Create".

3. Enter a definition for your BAdI and on the interface tab enter a name for the BAdI interface. SAP proposes a name and it is pretty good. Meanwhile a BAdI class is also created which is not in our concern.

e.g for "ZTEST", SAP proposes "ZIF_EX_TEST" for the interface and "ZCL_EX_TEST" for the class.

4. Save your BAdI.

5. Double-click on the interface name. It will pass to a Class Builder session to make you implement your interface. If you are not familiar to the Class Builder; it's a bit like Function Builder and it will be easy to discover its procedure.

6. Save and activate your interface.

B. Calling your BAdI from an application program

1. Declare a reference variable with reference to the Business Add-In interface.

e.g. DATA exit_ref TYPE REF TO zif_ex_test.

2. Call the static method GET_INSTANCE of the service class CL_EXITHANDLER. This returns an instance of the required object.

e.g.

CALL METHOD CL_EXITHANDLER=>GET_INSTANCE

CHANGING instance = exit_ref .

3. After those two steps, you can now call all of the methods of the BAdI where it is required in your program. Make sure you specify the method interfaces correctly.

C. BAdI Implementations

1. SE19

2. Enter the name for the BAdI implementation to be created in customer namespace and press "Create".

3. It will request the BAdI definition name to which this implementation will be tied.

4. Enter a definition for your implementation and on the interface tab enter a name for the implementing class. Again SAP proposes a name and it is pretty good.

e.g for "ZIMPTEST", SAP proposes "ZCL_IM_IMPTEST".

5. Save your implementation.

6. To implement a method, just double-click on the method name and you will be taken to the Class Builder to write the code for it. Here you redefine the BAdI interface methods.

7. You must activate your implementation to make it executable. You can only activate or deactivate an implementation in its original system without modification. The activation or deactivation must be transported into subsequent systems

I think this one will help you to implement BADI

<u>

I am not near to my system, so i could not able give you the code

</u>

aRs

Read only

0 Likes
3,846

HI,

Thanks for the reply...but still i am strugling here...

In BAPI_ACC_DOCUMENT_POST there is PERFORM call_badi TABLES extension2.

once i double click on this it takes me to

CALL METHOD g_exit->change

EXPORTING

flt_val = gs_aw-awtyp

CHANGING

c_acchd = ls_acchd

c_accit = it_accit

c_acccr = it_acccr

c_accwt = it_accwt

c_acctx = it_acctx

c_extension2 = p_extension[]

c_return = lt_return.

Once i double click on change it shows a window with two radio buttons definition and implementation....if i choose implementation it takes me to piece of code which is like

method IF_EX_ACC_DOCUMENT~CHANGE....

i cannot change the code here...SAP doesnt allow me....

Please help...

Also how can i link this

CALL METHOD g_exit->change to my own class...so that once i double click on this it takes to my custom class in which i am writing code...

Thnaks

Message was edited by:

Sam williams

Read only

Former Member
0 Likes
3,846

Check these user exits out

Exit Name Description

F050S001 FIDCMT, FIDCC1, FIDCC2: Edit user-defined IDoc segment

F050S002 FIDCC1: Change IDoc/do not send

F050S003 FIDCC2: Change IDoc/do not send

F050S004 FIDCMT, FIDCC1, FIDCC2: Change outbound IDoc/do not send

F050S005 FIDCMT, FIDCC1, FIDCC2 Inbound IDoc: Change FI document

F050S006 FI Outgoing IDoc: Reset Clearing in FI Document

F050S007 FIDCCH Outbound: Influence on IDoc for Document Change

F180A001 Balance Sheet Adjustment

FARC0002 Additional Checks for Archiving MM Vendor Master Data

RFAVIS01 Customer Exit for Changing Payment Advice Segment Text

RFEPOS00 Line item display: Checking of selection conditions

RFKORIEX Automatic correspondence

SAPLF051 Workflow for FI (pre-capture, release for payment)

FEDI0001 Function exits for EDI in FI

Read only

Former Member
0 Likes
3,846

Thanks..