VA05, VA25 vs. Raporlara Ek Alan Eklenmesi - S4HANA
S4HANA`da VA05, VA25 gibi standart raporlara ek alan eklemek için BADI_SDOC_WRAPPER Badisi implement edilmelidir.
*IF_BADI_SDOC_WRAPPER~ADAPT_RESULT_COMP Adapt result components
*IF_BADI_SDOC_WRAPPER~POST_PROCESSING Adapt result line
METHOD if_badi_sdoc_wrapper~adapt_result_comp.
IF iv_application_id(4) EQ `VA05`.
INSERT VALUE #( table = `VBAK`
field = `VDATU`
name = `VBAK_VDATU` ) INTO TABLE ct_result_comp.
ENDIF.
IF iv_application_id(4) EQ `VA25`.
INSERT VALUE #( table = `VBKD`
field = `KONDA`
name = `VBKD_KONDA` ) INTO TABLE ct_result_comp.
ENDIF.
ENDMETHOD.
METHOD if_badi_sdoc_wrapper~post_processing.
IF iv_application_id(4) EQ `VA25`.
TRY.
ASSIGN COMPONENT `VBELN` OF STRUCTURE cs_result TO FIELD-SYMBOL(<lfs_vbeln>).
ASSIGN COMPONENT `VBKD_KONDA` OF STRUCTURE cs_result TO FIELD-SYMBOL(<lfs_konda>).
ASSIGN COMPONENT `VBKD_PLTYP` OF STRUCTURE cs_result TO FIELD-SYMBOL(<lfs_pltyp>).
IF <lfs_vbeln> IS ASSIGNED AND <lfs_vbeln> IS NOT INITIAL AND
<lfs_konda> IS ASSIGNED AND <lfs_pltyp> IS ASSIGNED.
SELECT SINGLE konda pltyp FROM vbkd INTO (<lfs_konda>,<lfs_pltyp>)
WHERE vbeln EQ <lfs_vbeln>.
ENDIF.
UNASSIGN: <lfs_vbeln>, <lfs_konda>, <lfs_pltyp>.
CATCH cx_root.
ENDTRY.
ENDIF.
ENDMETHOD.