‎2008 Dec 02 9:51 AM
Hi,
I want to display some values in a list box( drop down) in a particular field of table control.
These values are not fixed....these values will be determined based on some other value entered by user on the same screen.
I have written code using FM 'VRM_SET_VALUES' at 'PROCESS ON VALUE REQUEST'.
But this code is being trigged before the screen is getting displayed.....
Problem is I want some way by which I can populate the values after user enters the values of plant and clicks on the drop down of second field.
I can do this using F4 help but I want list box .. so that user can not enter any values other than those in list box......
Thanks
‎2008 Dec 02 9:56 AM
Hi Preethi,
Please use your code in PBO not in POV
here you can use IF conditions also
regards
Ramchander Rao.K
Edited by: ramchander krishnamraju on Dec 2, 2008 10:58 AM
‎2008 Dec 02 10:05 AM
Hi Ramchander
Thanks fo replying.
But as I said I can not determine the values which needs to be displyed in listbox at the time of PBO because this will depend on another field on 'Plant' on the same screen. So only after user enters 'Plant' I will be able to get corret values...
‎2008 Dec 02 10:25 AM
Hi Preethi,
you can use DYNP_READ_VALUES Fm
to get the screen field value before user interacts with the screen
use an IF condition to query the user values
Hope this would sove the problem
Regards
Ramchander Rao.K
‎2008 Dec 02 11:24 AM
Hi..
Let me explain the problem more clearly..
I have a screen 1001
Fist field here is plant
sencond field is in table control where I want to display this list box whose values will be determined by value of 'Plant'.
So now when this screen 1001 is displayed for the first time 'Plant' is null because user has not entered any value yet.
Now if the user enters some value in 'Plant' and clicks on the list box button (without pressing enter).. value should be displayed according to 'Plant'....... but there is not event which trigges on list box button click.
‎2008 Dec 02 12:02 PM
Hi Preeti,
You can assign a function code for the list box of type EXIT in the screen painter
which can recognize what the user has entered.
try assigning the function code for the lilst box
regards
Ramchander Rao.K
‎2008 Dec 02 12:11 PM
Fucntion code can be assigned to list box ... but plant is a normal input output field........not possible to asign any fcode...
second field is list box......where I m not able to display dynamic values...
Even if I dtermine the value of first field 'Plant'.....where shopuld i write the code to populate list box...??
bcause " process on value request" gets executed before the screen is displayed ......and plant is entered later on
‎2008 Dec 02 12:19 PM
Preeti,
Who said PROCESS ON VALUE REQUEST executed before the screen is displayed
dont worry assign the function code to the LIST BOX
To my imagination your plant field is above the table control, am right
enter the plant there and select the dropdown list which triggers PAI and also PBO as you assigned the FCode type EXIT
try it out
initially maintain some dummy values in list box using FM then once the user enters the value just refresh these values in the VALUES parameters and use your own
even it tried it out just now.
here is the code
type-pools vrm
data : ID type VRM_ID,
VALUES type VRM_VALUES with header line.
ID = 'ERDAT'.
VALUES-KEY = '12.10.2008'. this is a dummy value it helps only to trigger the PAI as we used the EXIT TYPE FCODE
append VALUES.
clear VALUES.
this FM gives you DUMMY values in the LIst box
call function 'VRM_SET_VALUES'
exporting
ID = ID
VALUES = VALUES[]
exceptions
ID_ILLEGAL_NAME = 1.
if not CARRID is initial.
here you check the Plant
refresh VALUES.(refreshing the VALUES TABLE )
ID = 'ERDAT'.
VALUES-KEY = '12.10.2008'.
append VALUES.
clear VALUES.
VALUES-KEY = '12.11.2008'.
append VALUES.
clear VALUES.
VALUES-KEY = '12.12.2008'.
append VALUES.
call function 'VRM_SET_VALUES'
exporting
ID = ID
VALUES = VALUES[]
exceptions
ID_ILLEGAL_NAME = 1.
endif.
Regards
Ramchander Rao.K
Edited by: ramchander krishnamraju on Dec 2, 2008 1:28 PM
‎2008 Dec 08 11:11 AM
Hi Preethi,
If you got a solution can you please close this thread
Regards
Ramchander Rao.K
‎2012 Feb 08 9:48 AM
Hi,
I have the same problem. i want to trigger listbox upon click then populate the values.
POV also get trigger from the start.
Even if I put exit code on the list box is still cannot be triggered.
i do however change the pf-status. but i already placed the exit code there.
is there anything i am missing here?
Thank you.