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

Extension in BAPI_ACC_DOCUMENT_POST

Former Member
0 Likes
962

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

2 REPLIES 2
Read only

Former Member
0 Likes
638

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

Read only

0 Likes
638

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