Skip to Content
author's profile photo Former Member
Former Member

Extension in BAPI_ACC_DOCUMENT_POST

Hi All,

I want to extend BAPI_ACC_DOCUMENT_POST to post profit center for my AP account. But somehow in BADI ACC_DOCUMENT, the profit center's value 'ZBSMBL' is not read into the valuepart1 field.

Here's the code for my extension table:

clear: ls_zzz, i_gt_extension2.

ls_zzz-prctr = 'ZBSMBL'.

append ls_zzz.

MOVE ls_zzz TO i_gt_extension2-valuepart1.

MOVE 'ACCIT' to i_gt_extension2-structure.

APPEND i_gt_extension2.

code for BADI:

DATA:

ls_zzz TYPE accit,

wa_extension type bapiparex,

wa_accit TYPE accit.

LOOP AT c_extension2 INTO wa_extension.

ls_zzz = wa_extension-valuepart1.

READ TABLE c_accit WITH KEY prctr = ls_zzz-prctr

INTO wa_accit.

IF sy-subrc IS INITIAL.

wa_accit-prctr = ls_zzz-prctr.

MODIFY c_accit FROM wa_accit INDEX sy-tabix.

ENDIF.

ENDLOOP.

in here ls_zzz-prctr always return empty , pls advice

Add comment
10|10000 characters needed characters exceeded

1 Answer

  • author's profile photo Former Member
    Former Member
    Posted on Aug 02, 2006 at 10:27 AM

    Have you looked at the option of substitution and validation for populating the field?

    Add comment
    10|10000 characters needed characters exceeded

    • Former Member

      Hi Abhijit,

      I read other thread regarding extension2 and I just copied out the coding , how can I know on which substitution/fields I am supposed to use