Hello Experts, kindly help..
Requirement:
To have a custom field on MIRO header at Basic data tab. Values in this field should get populated in BKPF table (which will be further used in reporting).
Our Approach:
We've added a custom field on Basic Data Tab in MIRO. For this we implemented BADI_FDCB_SUBBAS05. We've updated following Structures and Tables with this custom field.
1) INVFO - Screen field
2) RBKP_V - To pass values to RBKP
2) RBKP - Once the MM document gets posted the custom field is populated here.
3) ACCHD/ ACCTHD - To pass values to BKPF
3) BKPF - Finally value should get updated here once FI document created.
Step1)
This custom field is getting populated in RBKP successfully once we implement BADI_FDCB_SUBBAS05 and add field to INVFO, RBKP_V, RBKP.
Step2)
To populate this custom field in BKPF- we are first passing this field to ACCHD for this we've implemented BADI AC_DOCUMENT. In method if_ex_ac_document~change_after_check we're updating ACCHD using field symbols as follows:
DATA: lv_zzref_hd TYPE bkpf-zzref,
lv_rbkpv_zzref_hd TYPE char21 VALUE '(SAPLMR1M)RBKPV-ZZREF',
lv_xacchd_zzref TYPE char18 VALUE '(SAPLMRMP)xacchd[]'.
FIELD-SYMBOLS: <fv_zzref> TYPE any,
<fv_zzref_hd> TYPE any,
<ft_xacchd> TYPE acchd_t,
<fs_xacchd> TYPE acchd.
ASSIGN (lv_xacchd_zzref) TO <ft_xacchd>.
CHECK sy-subrc EQ 0.
ASSIGN (lv_rbkpv_zzref_hd) TO <fv_zzref_hd>.
CHECK sy-subrc EQ 0.
LOOP AT <ft_xacchd> ASSIGNING <fs_xacchd>.
lv_zzref_hd = <fv_zzref_hd>.
<fs_xacchd>-zzref = lv_zzref_hd.
ENDLOOP
But still this custom field is not getting updated in BKPF. Kindly suggest!!
Thank you so much in advance..
Regards,
Vishal