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

Regarding BAPI_ACC_DOCUMENT_POST

Former Member
0 Likes
7,167

Hi All,

I am using BAPI_ACC_DOCUMENT_POST bapi to post the credit memo by using a z transaction. For the field Invoice reference bseg-rebzg, sap is populating the the value "V'. I want the filed to be populated as space. The above value V is populating in BAPI. Do we have any exits or any other method to enhance the value.

Thanks,

Kishore

7 REPLIES 7
Read only

JozsefSzikszai
Active Contributor
0 Likes
4,048

hi Kishore,

you can try through substitution (transaction: GGB1, activation: OBBH), however I am not sure if the substitution runs by BAPI posting.

ec

Read only

Former Member
0 Likes
4,048

Hello,

check exits for tcode F-02...maybe will find how to change that value....

But on this cases is easyer to do it throw batch input....with that FM you can only make the post with NEWBS with standard ones 30 and 40.

Bye

Gabriel

Read only

Former Member
0 Likes
4,048

check the BTE Process: RWBAPI01

T-CODE: FIBF

Check sap note: 487722 to populate extension1.

U can change the value in it.

Read only

Former Member
0 Likes
4,048

Kishore

have you resolved your problem. I, too, am trying to space out REBZG using BDC and it does not work. Any ideas?

Thanks

Jean

Read only

Former Member
0 Likes
4,048

Hi Kishore,

As the invoice reference field BSEG-REBZG is getting populated with a default value 'V' using BAPI 'BAPI_ACC_DOCUMENT_POST' you need to enhance the BAPI. This BAPI contains a table called 'EXTENSION1' through which you can pass an extra field which can not be passes through Export Parameters of BAPI / change a field value.

Here in your case you need to use the EXTENSION1 table to change the invoice reference field value (make it balnk instead of value 'V').

Follow the below steps for your requirement:

Below logic to be implemented in your z proram

A) Declare an internal table and a work area of type bapiacextc

DATA: t_extension TYPE STANDARD TABLE OF bapiacextc,
           wa_extension TYPE bapiacextc. 

    Populate the internal table as below:
     
      CLEAR: wa_extension, t_extension.
      wa_extension-field1 = 'X'.
      APPEND wa_extension TO t_extension.

Pass the internal table 't_extension' to BAPI as below:

CALL FUNCTION 'BAPI_ACC_DOCUMENT_POST'
        EXPORTING
          documentheader    = w_documentheader
        TABLES
          accountgl         = t_accountgl
          accountreceivable = t_accountreceivable
          currencyamount    = t_currencyamount
          criteria          = t_criteria
          extension1        = t_extension            
          return            = t_return.

B)*Follow the below procedure given in the NOTE:487722:

Implementing the Business Transaction Event (BTE, also OPEN FI) RWBAPI01 with enhancement structure EXTENSION1 at BAPI_ACC_DOCUMENT_POST

Go to Transaction FIBF

1. Call the menu path "Settings > Products -> ...of a customer" and create a product that mirrors the function which is to be mapped in the BTE.

2. Create a function module that contains the same interface, such as example module SAMPLE_INTERFACE_RWBAPI01.

Advice: Do not try to copy just create a new one it will be better

3. Call menu path "Settings -> Process function modules > ...of a customer" enter process = RWBAPI01, the function module created and the product.

4. Finally, activate the product you have created in the first step so that the module will run. ( Nothing like activate , just save the newly created Product)

C) Write the Logic as below in the new function module created above:

Put the below logic in the Source code tab.

DATA: wa_accit LIKE accit.

  LOOP AT it_accit INTO wa_accit WHERE rebzg = 'V'
      wa_accit-rebzg = ' '.
      MODIFY it_accit INDEX sy-tabix FROM wa_accit.
  ENDLOOP.

Read only

0 Likes
4,048

Hi veda,

I followed the steps, but in the third step, the process RWBAPI01 already exists... I would do in that case? any idea?

Thanks in advance,

Alex Alcántara.

Read only

0 Likes
4,047

1. go SE18 implement Enhancement for BADI_ACC_DOCUMENT, such as Z_EI_BADI_ACC_DOCUMENT with class ZFI_CL_ACC_DOCUMENT.

2. insert abap code into IF_EX_ACC_DOCUMENT~CHANGE. and then, debug!

  " if sy-tcode <> 'ZFIR001'.
" return.
" endif.
CLEAR LS_ACCIT.
LOOP AT C_ACCIT INTO LS_ACCIT .
IF LS_ACCIT-REBZG = 'V'.
LS_ACCIT-REBZG = ''.
MODIFY C_ACCIT FROM LS_ACCIT.
CLEAR LS_ACCIT.
ENDIF.
ENDLOOP.