0% found this document useful (0 votes)
1K views

BAPI Extension For BAPI

This document discusses extending the BAPI_ACC_GL_POSTING_POST function module to post general ledger documents via custom fields added to the BSEG table. It describes building a BAPI extension structure to pass the custom field values, filling the extension table with the custom field data, and calling the BAPI function while passing the extension table.

Uploaded by

parthasc
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
1K views

BAPI Extension For BAPI

This document discusses extending the BAPI_ACC_GL_POSTING_POST function module to post general ledger documents via custom fields added to the BSEG table. It describes building a BAPI extension structure to pass the custom field values, filling the extension table with the custom field data, and calling the BAPI function while passing the extension table.

Uploaded by

parthasc
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 4

BAPI Extension for BAPI_ACC_GL_POSTING_POST

By Alka Khambra, Hitachi

Had a requirement to post GL documents via BAP I function module: BAPI_ACC_GL_POSTING_POST,


using the 5 custom fields which are added to BSEG table

Custom field in the Tcode FB01 are Project ID, Channel, State, Reinsurer Code and Product as:

Custom fields in BSEG table are highlighted below:


In BAPI "BAPI_ACC_GL_POSTING_POST" need to add EXTENSION1 for BAPI extension.

Building structure BAPIEXTC, BAPIEXT, BAPIEXTA which will act as the container for the 5 custom fields
Can use the following code for filling the values in the EXTENSION1 :

DATA : it_extension TYPE TABLE OF bapiextc,


wa_extension TYPE bapiextc.

Filling extension table


wa_extension-field1(03) = lw_item-itemno_acc+7(3).
wa_extension-field1+03(04) = w_post-zzproj.
wa_extension-field1+07(04) = w_post-zzstate.
wa_extension-field1+11(06) = w_post-zzrecode.
wa_extension-field1+17(04) = w_post-zzprod.
wa_extension-field1+21(04) = w_post-zzchennel.
wa_extension-field1+25(04) = w_post-ldgrp.
APPEND wa_extension TO it_extension.
CLEAR: lw_item,wa_extension.

Calling the BAPI 'BAPI_ACC_GL_POSTING_POST' and passing it_extension to extension1.

CALL FUNCTION 'BAPI_ACC_GL_POSTING_POST'


EXPORTING
documentheader = wa_head
IMPORTING
obj_type = obj_type
obj_key = obj_key
obj_sys = obj_sys
TABLES
accountgl = i_item
currencyamount = i_amnt
return = i_return
extension1 = it_extension.

CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'.

You might also like