2021 Mar 15 9:16 AM
Hi,
I have two fields on my module pool dialog box screen. When I enter the value of the field 1, the description of the field should auto-populate into the value of the field 2. I cannot use PAI user-command as the screen itself is a dialog box and will consists of only two commands 'ENTER' and 'EXIT'. The field 1 is an I/O field and cannot be assigned a fcode as well.
if i enter <field 1 > = '123' then <field 2> should automatically get the value 'ABC' without having to click on any user command.
How do I achieve this requirement in module pool dialog box programming?
2021 Mar 15 9:27 AM
Hello manu.dasa
I see two options for this:
1. You create a search help which will return two fields (value and description). When user selects a value from the search help one field will be populated with the value and the other with the description.
2. User enters a value in the first field and presses enter, then, in PAI, you read the description and populate the second field.
There is no other way. ABAP does not have Windows-like events.
Kind regards,2021 Mar 15 1:49 PM
With a search help, using "type-ahead search" could also help, that would make the field 2 irrelevant because it would be shown automatically below field 1 as the user types the value.
2021 Mar 15 12:46 PM
Basically you cannot.
Nevertheless you could use a logic such as comparing in PAI the current displayed value of field2 (the dependant field) with the value expected for the current value of field1, if they are identical, manage ENTER as a validation, else change value of field2 and trigger a new PBO (e.g. clear OK_CODE) and of course the EXIT must be defined as an Exit function code and handled at start of PAI logic.
NB: Other solutions could be converting field1/field2 into a single field with dropdown list selection or similar screen element that allow function code or force link between the 2 fields.