Example For Filling The ExtensionIn Parameter

You might also like

Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 3

Hi,

Finally i got a solution and finally worked !!!!!!


See the below solution :
********************************************************************************
******
Write this code in the program which is using the Bapi.
DATA : I_EXT2 TYPE STANDARD TABLE OF bapiparex WITH HEADER LINE.
I_EXT2-STRUCTURE = 'CONTRACT_10'.
I_EXT2-VALUEPART1 = 'A'.
I_EXT2-VALUEPART2 = ITAB_XS010-COD_REF.
APPEND I_EXT2.
CLEAR I_EXT2.
I_EXT2-STRUCTURE = 'CONTRACT_20'.
I_EXT2-VALUEPART1 = 'A'.
I_EXT2-VALUEPART2 = ITAB_XS010-COD_REF.
APPEND I_EXT2.
CLEAR I_EXT2.
CALL FUNCTION 'BAPI_ACC_DOCUMENT_POST'
EXPORTING
DOCUMENTHEADER = ITAB_DOCUMENTHEADER
 CONTRACTHEADER = ITAB_CONTRACTS
IMPORTING
OBJ_TYPE = OBJ_TYPE
OBJ_KEY = OBJ_KEY
OBJ_SYS = OBJ_SYS
TABLES ACCOUNTGL = ITAB_GLACCOUNT
ACCOUNTRECEIVABLE = ITAB_CUSTOMER
CURRENCYAMOUNT = ITAB_CURRENCY
RETURN = ITAB_RETURN
EXTENSION2 = I_EXT2.
********************************************************************************
*****
Enhance the BADI ACC_Document - Method - Change
method IF_EX_ACC_DOCUMENT~CHANGE.
DATA: wa_extension TYPE bapiparex,
wa_accit TYPE accit.
LOOP AT c_extension2 INTO wa_extension.
IF wa_extension-structure = 'CONTRACT_10'.
CLEAR wa_accit.
READ TABLE c_accit INTO wa_accit WITH KEY posnr = 10.
IF sy-subrc = 0.
wa_accit-VERTT = wa_extension-valuepart1.
wa_accit-VERTN = wa_extension-valuepart2.
MODIFY c_accit FROM wa_accit INDEX sy-tabix TRANSPORTING VERTT VERTN.
ENDIF.
ENDIF.
IF wa_extension-structure = 'CONTRACT_20'.
CLEAR wa_accit.
READ TABLE c_accit INTO wa_accit WITH KEY posnr = 20.
IF sy-subrc = 0.
wa_accit-VERTT = wa_extension-valuepart1.
wa_accit-VERTN = wa_extension-valuepart2.
MODIFY c_accit FROM wa_accit INDEX sy-tabix TRANSPORTING VERTT VERTN.
ENDIF.
ENDIF.
ENDLOOP.
endmethod.
//////////////////////////////////////////////////////////////////////////////////////////////////////////////

Constraints
 The following infotypes are not included in the enhancement concept:
o Actions (infotype 0000)
o Additional Actions (infotype 0302)
o Time Management infotypes (2nnn)
o Leave Entitlement (infotype 0005)
o Maternity Protection/Parental Leave (infotype 0080)
o Military Service (infotype 0081)
o Leave Entitlement Compensation (infotype 0083)
o Time Quota Compensation (infotype 0416)
o Applicant Actions (infotype 4000)
 The length of the data field structure PSnnnn together with the CI include must not exceed 1500 bytes.
 If you include additional fields in the Organizational Assignment infotype (0001), you cannot use them as
selection fields.
https://answers.sap.com/questions/10696849/bapi-extension-structures.html

https://blogs.sap.com/2014/01/24/tips-to-solve-the-extensioncustomer-fields-problem-in-bapi-even-though-the-
extension-structures-are-maintained/
https://help.sap.com/doc/saphelp_nw73/7.3.16/en-US/4c/fed58d0b2a3d8ee10000000a42189e/content.htm?
no_cache=true

You might also like