Purpose
This page created to clarify the application logic and customizing behind Field Selection in Contract and in Scheduling Agreement.
Overview
Field Selection determines whether a field should be editable/disabled, visible/hidden, mandatory/optional, when users display, edit or create the Contract or Scheduling Agreement.
The Field Selection Customizing can be found in the following OLME paths:
- General: Contract (or Scheduling Agreement) -> Define Screen Layout at Document Level,
- Account Assignment related: Account Assignment -> Maintain Account Assignment Categories.
The general customizing contains many different field selections and it is not always easy to determine, which one is used in different cases. Moreover, there are also different logic, which can overwrite the customizing dynamically.
By following the Debugging Guide, you can determine, which Field Selection is used and why the field is displayed as system displays it. The guide is prepared for the most common screens such as header details, item details, item additional data, item overview table and account assignment.
Initial steps
Before starting the debugging, press F1 on the relevant field that you would like to debug and click button Technical Information (hammer icon). Here copy the table and field name such as [table name]-[field name]. If this is an accounting field, the field name is enough.
In case of field Validity end, this will look like as EKKO-KDATE.
On the same screen, you can also find the screen you are on.
In this example, we are on the header screen (0201).
Now click on the link that contains the screen you are on (page will jump to the clicked section):
- Header details (0201), item details (0211), item additional data (0212),
- Item overview (0220),
- Account Assignment (0511).
Header details (0201), item details (0211), item additional data (0212)
Start debugging in FM MEX_MODIFY_FELDAUSWAHL. To avoid irrelevant stops, set the breakpoint right before you navigate to the relevant screen. Depending on the navigation, it can be that the FM is called more than once.
- When you would like to debug the header details (0201), make sure that the PBO SCREEN is 0201 in call stack.
- When you would like to debug the item details (0211), make sure that the PBO SCREEN is 0211 in call stack.
- When you would like to debug the item additional data (0212), make sure that the PBO SCREEN is 0212 in call stack.
In FM MEX_MODIFY_FELDAUSWAHL system loops at the screen elements and changes the field selection based on customizing that can be found in structure I_ENDMASKE. In this structure each character represents the customizing for each field. This is the static field selection, which changes the fields based on static customizing.
SCREEN is not an internal table that you can display and search for the index of the relevant entry. Therefore, to debug only the relevant field, at the beginning of the LOOP, set a Watchpoint for field SCREEN-NAME based on the previously copied table and field name (e.g.: EKKO-KDATE).
After the watchpoint was created, press F8. System will go into the relevant LOOP step. In this LOOP step on line "CASE <AUSW>." check the value of variable <AUSW>. Below you can find the meaning of the value:
- . = Optional
- + = Required
- * = Display
- - = Hidden
If the value is not expected, it means that the issue occurs due to incorrect customizing. To find the used Field Selection keys press F7 and display variables AUSWAHL0, AUSWAHL1, AUSWAHL2, AUSWAHL3, AUSWAHL4, AUSWAHL5, AUSWAHL6.
In the example below four field selection keys are used.
Then go into OLME path Contract (or Scheduling Agreement) -> Define Screen Layout at Document Level and verify the previously found field selection keys.
If the value is correct until this point, it means that the customizing is correct. Press F7 to return into Include MM06EO0M_MODIFY_SCREEN.
Here system loops at the screen elements again and overwrites the SCREEN parameters based on document values, follow-on documents, switches etc. This is the dynamic field selection.
You can debug the relevant field with the same Watchpoint method mentioned previously. Check where system sets the SCREEN parameters unexpectedly:
- SCREEN-INPUT: 0 – read only, 1 - editable,
- SCREEN-REQUIRED: 0 – not mandatory, 1 - mandatory,
- SCREEN-INVISIBLE: 0 – visible, 1 – not visible.
Item overview (0220)
Start debugging in MEX_MODIFY_LOOP.
This is called as many times as many lines exist in over overview table (including blank lines).
In FM MEX_MODIFY_LOOP system loops at the screen elements and changes the field selection based on customizing that can be found in structure I_ENDMASKE. In this structure each character represents the customizing for each field. This is the static field selection, which changes the fields based on static customizing.
SCREEN is not an internal table that you can display and search for the index of the relevant entry. Therefore, to debug only the relevant field, at the beginning of the LOOP, set a Watchpoint for field SCREEN-NAME based on the previously copied table and field name (e.g.: EKPO-MENGE).
After the Watchpoint was created, press F8. System will go into the relevant LOOP step. In this LOOP step on line "CASE <AUSW>." check the value of variable <AUSW>. Below you can find the meaning of the value:
- . = Optional,
- + = Required,
- * = Display,
- - = Hidden.
If the value is not expected, it means that the issue occurs due to incorrect customizing. To find the used Field Selection keys press F7 and display variables AUSWAHL0, AUSWAHL1, AUSWAHL2, AUSWAHL3, AUSWAHL4, AUSWAHL5, AUSWAHL6.
In the example below four field selection keys are used.
Then go into OLME path Contract (or Scheduling Agreement) -> Define Screen Layout at Document Level and verify the previous found field selection keys.
If the value is correct until this point, it means that the customizing is correct.
By pressing F7 you will reach MM06EO0M_MODIFY_LOOP and MM06EO0M_MODIFY_LOOP_4 (MODULE MODIFY_1) where you can find product and info record specific logic to change field selection. Check, whether system calls the logic at all and if yes, verify if the SCREEN parameters are changed using the same Watchpoint method described previously.
Continue pressing F7 until you reach Include MM06EO0M_MODIFY_LOOP_4 Module MODIFY_LOOP_4.
Go into MODIFY_LOOP_4, because this is where the general dynamic logic occurs. Here system loops at the screen elements again and overwrites the SCREEN parameters based on document values, follow-on documents, switches etc. This is the dynamic field selection.
You can debug the relevant field with the same Watchpoint method mentioned previously. Check where system sets the SCREEN parameters unexpectedly:
- SCREEN-INPUT: 0 – read only, 1 - editable,
- SCREEN-REQUIRED: 0 – not mandatory, 1 - mandatory,
- SCREEN-INVISIBLE: 0 – visible, 1 – not visible.
Account Assignment (0511)
Set breakpoint in:
- FM ME_COBLF_FUELLEN,
- FM COBL_EX_SEND_PBO.
When the accounting screen is opened, the breakpoint will stop in FM ME_COBLF_FUELLEN.
First, system fetches the relevant customizing.
After this step, check if table I_TCOBM[] contains the relevant field. If not, check whether the field is available in SPRO path Financial Accounting (New) -> Financial Accounting Global Settings (New) -> Ledgers -> Fields -> Customer Fields -> Edit Coding Block.
In a DO cycle, system loops at the account assignment fields of table I_TCOBM[] and sets them based on field selection customizing. There are other fields, which have separate logic and are processed after the loop cycles.
To debug only the relevant field, at the beginning of the DO cycle, set a Watchpoint for field FNAME based on the previously copied field name (section Initial steps).
After the watchpoint was created, press F8. System will stop in the first line where the processing of the desired field starts.
First, check if the customizing is correct. You can find the customizing value in variable L1:
- . = Optional
- + = Required
- * = Display
- - = Hidden
If the customizing is not correct, copy the value of field KNTTP of structure T162K (this shows the used account assignment category) and open OLME path Account Assignment -> Maintain Account Assignment Categories. Double-click the previously copied value and change the customizing as desired.
If the customizing is correct, follow the program into FORM COBLF_FUELLEN_*.
In that FORM, system sets the REQUIRED and INPUT attributes of the field based on the customizing.
The meaning of values of field REQUIRED and INPUT:
- ICOBLF-INPUT: 0 – read only, 1 - editable
- ICOBLF-REQUIRED: 0 – not mandatory, 1 – mandatory
Press F7 to return Include MM06EFKN_KNT_INT_COBLF_FUELLEN.
Here system checks if flag Acct.assg.changable is set in transaction OME9 for the Account Assignment category and if yes, system disables the account assignment fields, if GR or Invoice were already created for the Agreement. In case GR non-valuated flag is set, system only does this, if Invoice was already created.
Press F8. The breakpoint in FM COBL_EX_SEND_PBO will stop.
Here system deletes fields based on switch activation status.
Finally, system fills the set field selection values into buffer table GT_COBLF.
Related Content
Related Documents
Community Wiki - Field Selection in Purchase Requisition - Debugging Guide
Community Wiki - Field Selection in Purchase Order - Debugging Guide