on 02-04-2014 1:57 PM
Hi everyone,
Good day.
We need to dynamically disable (not editable) and enable (editable) Account Assignment Category in SRM 7.
We have already set the customizing in SPRO via the link below:
SAP Supplier Relationship Management -> SRM Server -> Cross-Application Basic Settings -> Extensions and Field Control (Personalization) -> Configure Field Control -> Configure Control for Fields of Substructures -> Metadata for Fields of Substructures and Table-Like Enhancements
Below is the customizing details:
Bus. Object Set Type 31 Account assignment
Structure Field Name ACC_CAT Account Assignment Category in SRM
Bus. Object Type BUS2203 Confirmation of Goods/Services
Set Level ITEM Item Level
Set Subtype
Dyn. Customer Class ZCLASS
Dyn. Customer Method ZMETHOD
In our Z Class, a Z Method was created with the below parameters:
IV_FIELD_NAME | Importing | Type | /SAPSRM/PDO_META_FIELD_NAME |
IS_HEADER | Importing | Type | DATA |
IS_ITEM | Importing | Type | DATA |
IS_SET | Importing | Type | DATA |
IS_ADD_DATA | Importing | Type | /SAPSRM/S_PDO_META_FLD_ADD_DAT |
CS_METADATA | Changing | Type | /SAPSRM/S_PDO_FIELD_METADATA |
However, upon testing to testing to check if it will pass thru my Z Method. The error below appears:
Formal parameter not found during dynamic method call.
Method: /SAPSRM/IF_PDO_META_CONF_BO~GET_BO_SET_FIELD_METADATA of program /SAPSRM/CL_PDO_META_CONF_PROV=CP
Method: /SAPSRM/IF_PDO_META_CONSUMER~GET_FIELD_METADATA of program /SAPSRM/CL_PDO_META_BO_CONF===CP
Method: /SAPSRM/IF_PDO_META_CONSUMER~GET_FIELD_METADATA of program /SAPSRM/CL_PDO_META_BOCONF_ADVCP
Method: /SAPSRM/IF_PDO_META_CONSUMER~GET_FIELD_METADATA of program /SAPSRM/CL_PDO_META_HANDLER===CP
Method: UPDATE_META_DATA_ELEMENT of program /SAPSRM/CL_CH_WD_MAP_META_HDLRCP
Method: UPDATE_META_DATA of program /SAPSRM/CL_CH_WD_MAP_META_HDLRCP
Method: BIND_ACC_DATA_OVERVIEW of program /SAPSRM/CL_CH_WD_DODM_ACC=====CP
Method: /SAPSRM/IF_CLL_MAPPER~REFRESH of program /SAPSRM/CL_CH_WD_DODM_ACC=====CP
Method: WDDOMODIFYVIEW of program /1BCWDY/1360VCXTW2LDEKBANMKV==CP
Method: IF_WDR_VIEW_DELEGATE~WD_DO_MODIFY_VIEW of program /1BCWDY/1360VCXTW2LDEKBANMKV==CP
Can you please provide the detailed approach on how to dynamically disable (not editable) and enable (editable) Account Assignment Category in SRM 7? Can you kindly provide example code (if any)? Thanks in advance.
Best regards,
Brando
Hi Brando,
check you have iv_object_type
Regards
Konstantin
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
What Konstantin is hinting at: did you copy the interface parameters from a Substructure method?
The complete set (taken from class /SAPSRM/CL_PDO_DYN_MDF_SB_ACC method ACCT_ASSGN_GL_ACCT):
IS_HEADER Importing Type BBP_PDS_PO_HEADER_D
IS_ITEM Importing Type BBP_PDS_PO_ITEM_D
IV_OBJECT_TYPE Importing Type BBP_BUS_OBJECT_TYPE
IV_FIELD_NAME Importing Type NAME_KOMP
IS_ADD_DATA Importing Type /SAPSRM/S_PDO_META_FLD_ADD_DAT
IS_SET Importing Type BBP_PDS_ACC
CS_METADATA Changing Type /SAPSRM/S_PDO_FIELD_METADATA
Regards,
Robin
Hi Konstantin/all,
I have added IV_OBJECT_TYPE and I'm still getting same error.
Also, per SAP's documentation it seems that IV_OBJECT_TYPE is not included. So, maybe it's correct that it should not be included?
The parameters of the dynamic control methods are described below:
- IV_FIELD_NAME
At runtime, the system fills the importing parameter IV_FIELD_NAME with the field name for the metadata that has to be determined.
- IS_HEADER
At runtime, the system fills the importing parameter IS_HEADER with the BO type-dependent header structure containing the header data of the current business object. If you use your dynamic control method only for one business object type, for example, shopping cart or purchase order, you can specify the parameter IS_HEADER with the structure entered in Dynamic control structure of view Metadata Configuration Struct. per Set Type and/or BO Type (/SAPSRM/V_MDFSTR) with set type '05' (header). This makes programming easier, as you can access the fields of the header structure directly without the dynamic ASSIGN or MOVE-CORRESPONDING comands.
- IS_ITEM
At runtime, the system fills the importing parameter IS_ITEM with the BO type-dependent item structure containing the item data of the item to which the set belongs. If the set or substructure is assigned to the header, IS_ITEM is left empty. If you use your dynamic control method only for one business object type, for example, shopping cart or purchase order, you can specify parameter IS_ITEM with the structure entered in Dynamic control structure of view Meta data Configuration Struct. per Set Type and/or BO Type (/SAPSRM/V_MDFSTR) with set type '06' (item). This makes programming easier, as you can access the fields of the item structure directly without the dynamic ASSIGN or MOVE-CORRESPONDINGs command.
- IS_SET
At runtime, the system fills the importing parameter IS_SET with the set type-dependent structure containing the data of the set line to which the field belongs. To determine default metadata, the same structure is used but it contains only default data.
You can specify parameter IS_SET with the structure specified in Dynamic control structure of view Meta data Configuration Struct. per Set Type and/or BO Type (/SAPSRM/V_MDFSTR) with the set type for which you want to provide metadata. This makes programming easier, as you can access the fields of the set structure directly without the dynamic ASSIGN or MOVE-CORRESPONDING commands.
- IS_ADD_DATA
Contains a component called POSSIBLE_META DATA, which has the same structure as CS_META DATA (fields Visible, Enabled, and Required) and contains the metadata attribute values that are still allowed after evaluating static and dynamic system metadata, and static customer metadata.
- CS_META DATA
Contains the checkboxes Visible, Enabled, and Required for the meta data attributes Field visible, Field enabled, and Field required. When the dynamic control method is called, the parameter CS_META DATA contains the metadata provided as static meta data in the corresponding entry. If the metadata is changed in the method, the system compares it with the static metadata from the table entry and the most restrictive value from the static and dynamic determination is used for each attribute.
Do you happen to know other possible reason for the error and possible solution? Thank you.
Best regards,
Brando
Hi Robin / Konstantin / all,
Below are parameters of my Z Method under Z class. IS_ADD_DATA optional checkbox is ticked.
IS_HEADER | Importing | Type | BBP_PDS_PO_HEADER_D |
IS_ITEM | Importing | Type | BBP_PDS_PO_ITEM_D |
IV_OBJECT_TYPE | Importing | Type | BBP_BUS_OBJECT_TYPE |
IV_FIELD_NAME | Importing | Type | NAME_KOMP |
IS_ADD_DATA | Importing | Type | /SAPSRM/S_PDO_META_FLD_ADD_DAT |
IS_SET | Importing | Type | BBP_PDS_ACC |
CS_METADATA | Changing | Type | /SAPSRM/S_PDO_FIELD_METADATA |
However, I'm still getting the same error. Do you happen to know other possible reason for the error and possible solution? Thank you.
Best regards,
Brando
Hi Robin, Konstantin,
Thanks for your help. The error is gone. Below are the parameters that I have used:
IS_HEADER | Importing | Type | ANY |
IS_ITEM | Importing | Type | ANY |
IV_OBJECT_TYPE | Importing | Type | BBP_BUS_OBJECT_TYPE |
IV_FIELD_NAME | Importing | Type | NAME_KOMP |
IS_ADD_DATA | Importing | Type | /SAPSRM/S_PDO_META_FLD_ADD_DAT |
IS_SET | Importing | Type | ANY |
CS_METADATA | Changing | Type | /SAPSRM/S_PDO_FIELD_METADATA |
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.