on 2022 Nov 04 2:07 PM
We have a Master data template (MDT) based on the BPartner category. When using this template in EC70, we would like to make the contract account category (VKTYP) a virtual attribute. The function module to determine this value requires either the premise or the installation keys associated with the Move-in. How can I configure our MDT to contain this information so that it is accessible during the execution of my virtual attribute function module?
Request clarification before answering.
Hello Corey,
We had the same requirement and here is the way we implemented it:
- Create a custom implementation of the Badi ISU_CSBTIO_PRDOC
- In method IF_EX_ISU_CSBTIO_PRDOC~MDG_CONTAINER_MODIFY, provide the Parked Document ID as a new container element:
IF i_mdg_template_category EQ 'BPARTNER'.
CALL FUNCTION 'SWC_ELEMENT_SET'
EXPORTING
element = 'ZZPRDOC'
field = i_ecamiopr-prdoc
TABLES
container = ct_container
EXCEPTIONS
OTHERS = 1.
ENDIF.- Then in your custom virtual attribute function module, you can use this code to retrieve the Parked Document ID and get the related Premise
IF typeid EQ 'CONTRACT_ACCOUNT'.
READ TABLE lt_container ASSIGNING FIELD-SYMBOL(<ls_container>)
WITH KEY element = 'ZZPRDOC'.
IF sy-subrc IS INITIAL.
lv_parkeddoc = <ls_container>-value.
ENDIF.
* Get the premise
SELECT SINGLE premise FROM ecamioprmdkey
INTO lv_premise
WHERE prdoc EQ lv_parkeddoc
AND moveinout EQ 'I'.
ENDIF.Kind Regards,
Fabian
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.