07-26-2010 4:33 PM
Hello,
I have implemenated BADI ME_PROCESS_PO_CUST to process a particular field in a PO during creation in ME21N or ME59N, it is all working fine. However, I also want to change the field properties using this BADI, I hope someone can give some advice.
Essentially, when field EKPO-BEDNR is populated by the BADI using PROCESS_ITEM, I want the field to change to display only. I a assuming method IF_EX_ME_PROCESS_PO_CUST~FIELDSELECTION_ITEM can be used for this, but I cannot find any documentation on it.
Any advice on how to change the field properties is greatly appreciated.
Note: I have tried to use SAP standard field selection in customizing but this is not possible to achieve what is required, the only route is through the BADI.
Thanks.
Jake Smith.
07-27-2010 10:10 AM
Hi Jacob Smith,
method IF_EX_ME_PROCESS_PO_CUST~FIELDSELECTION_ITEM can be used for this
I think you are in the correct track.
Please find the documentation of this method.Here it is saying you have to make changes in table CH_FIELDSELECTION .
Functionality
The FIELDSELECTION_ITEM method enables you to influence the field selection properties for a field.
Parameters
The following parameters are available:
IM_HEADER - Document header
The interface reference is of the type IF_PURCHASE_ORDER_MM.
IM_ITEM - Document item
The interface reference is of the type IF_PURCHASE_ORDER_ITEM_MM.
CH_FIELDSELECTION - Fiele selection table
By making changes to this table, you can influence the display properties of a field.
This table consists of value pairs <METAFIELD|FIELDSTATUS>.
The Metafield represents a business content (e.g. the PO quantity). Thus, for example, the database field EKPO-MENGE is linked to a certain metafield value just like the field MEPO1211-MENGE on the item overview screen in the purchase order.
Through this abstraction, reference can be made to business contents on a uniform basis.
Standard metafields are defined in the type group MMMFD.
The field selection status has four possible instances:
'-' Field is suppressed
'' Field is purely a display field*
'.' Input field
'+' Mandatory field
Notes
Under no circumstances make any changes to the database within this method. On no account use Commits.
Hope this will help you to a certain extent.
Regards,
Antony Thomas
07-27-2010 6:19 AM
Hi Jacob,
Please check in debugger, whether it is stopping in the corresponding method before the screen comes. ( PBO ).
If it is not stopping, then you have to find another BADI, just to make it in DISAPLY mode.
Regards,
Nikhil
07-27-2010 10:10 AM
Hi Jacob Smith,
method IF_EX_ME_PROCESS_PO_CUST~FIELDSELECTION_ITEM can be used for this
I think you are in the correct track.
Please find the documentation of this method.Here it is saying you have to make changes in table CH_FIELDSELECTION .
Functionality
The FIELDSELECTION_ITEM method enables you to influence the field selection properties for a field.
Parameters
The following parameters are available:
IM_HEADER - Document header
The interface reference is of the type IF_PURCHASE_ORDER_MM.
IM_ITEM - Document item
The interface reference is of the type IF_PURCHASE_ORDER_ITEM_MM.
CH_FIELDSELECTION - Fiele selection table
By making changes to this table, you can influence the display properties of a field.
This table consists of value pairs <METAFIELD|FIELDSTATUS>.
The Metafield represents a business content (e.g. the PO quantity). Thus, for example, the database field EKPO-MENGE is linked to a certain metafield value just like the field MEPO1211-MENGE on the item overview screen in the purchase order.
Through this abstraction, reference can be made to business contents on a uniform basis.
Standard metafields are defined in the type group MMMFD.
The field selection status has four possible instances:
'-' Field is suppressed
'' Field is purely a display field*
'.' Input field
'+' Mandatory field
Notes
Under no circumstances make any changes to the database within this method. On no account use Commits.
Hope this will help you to a certain extent.
Regards,
Antony Thomas
07-27-2010 10:26 AM
Hello,
Thanks for the reply, appreciate it.
Just about there now with it, although when I check table CH_FIELDSELECTION "is not active in the Dictionary". Am I missing something on this?
Thanks,.
Jake.
07-27-2010 10:50 AM
Hello Jacob,
Here CH_FIELDSELECTION is a interface table parameter of method FIELDSELECTION_ITEM only
Method parameters FIELDSELECTION_ITEM
Parameter Type Associated Type Description
CH_FIELDSELECTION Changing TTYP_FIELDSELECT Field selection
So you can pass your values through the interface of this method via table parameter CH_FIELDSELECTION which is of type TTYP_FIELDSELECT.
hope your issue is clear now.
with best regards,
Antony Thomas
07-27-2010 4:38 PM
hi Jacob,
just to clarify
does creating a z transaction/screen variant not suffice your requirement?
i mean if u want to have a field to be only in display y not use a variant rather than going into the code for it.
until unless u have validation on which the property should change.
regards,
Johnson George