‎2011 Nov 11 8:53 AM
Hi Experts!
I created a table maintenance generator for a customized table. The requirement is to fill FIELD3, based on the input from FIELD2. The search help of FIELD2 should be filtered based on the input in FIELD1. I created a PROCESS ON VALUE-REQUEST block in the screen Flow Logic as shown below.
PROCESS ON VALUE-REQUEST.
FIELD ztable-FIELD2 MODULE set_search_help.
The issue is, in set_search_help module, I cannot find any global variable to get the value of FIELD1 to use as a basis for the search help values of FIELD2.
Any idea?
Thanks!
‎2011 Nov 11 9:37 AM
Hi,
Do you mean that the Field2 is not available in the POV module that you have coded or do you mean that the value that you populate on the screen for Field 2is available at the program level in the POV.
Field2 should be available and is normally Tablename-Field2.
And if it is not populated with the value that you have passed in the screen, then use the Function Module DYNP_VALUES_READ to read the value from the screen.
The parameters that need to be passed are : DYNAME , DYNUMB and the table DYNPFIELDS will return the values from the screen and you can read it for FIELD 2.
Let me know if this is what you are asking for or whether my understanding of your issue is not right.
Regards,
Arun
‎2011 Nov 11 9:37 AM
Hi,
Do you mean that the Field2 is not available in the POV module that you have coded or do you mean that the value that you populate on the screen for Field 2is available at the program level in the POV.
Field2 should be available and is normally Tablename-Field2.
And if it is not populated with the value that you have passed in the screen, then use the Function Module DYNP_VALUES_READ to read the value from the screen.
The parameters that need to be passed are : DYNAME , DYNUMB and the table DYNPFIELDS will return the values from the screen and you can read it for FIELD 2.
Let me know if this is what you are asking for or whether my understanding of your issue is not right.
Regards,
Arun
‎2011 Nov 11 9:48 AM
FIELD1 is the field I need to check because I need this to filter the search help for FIELD2. I tried using DYNP_VALUES_READ but the table returned is empty. When I checked ZTABLE in debug mode, it has no contents.
‎2011 Nov 11 10:40 AM
Hi ,
Apologies for the slight misunderstanding. So field1 is what you want at the POV event .right?
THe code should be something like this ,
PROCESS ON VALUE-REQUEST.
FIELD ztable-FIELD2 MODULE set_search_help.
and in the module set_search_help, write the following code :
data: it_dynpfields type standard table of DYNPREAD,
wa_dynpfields type dynpread.
wa_dynpfields-fieldname = 'ZTABLE-FIELD1'.
wa_dynpfields-stepl = 1. - Important
append wa_dynpfields to it_dynpfields.
The above piece of code is what you probably missed out on.
CALL FUNCTION 'DYNP_VALUES_READ'
EXPORTING
dyname = sy-repid
dynumb = '9000' - whatever screen number you have specified.
tables
dynpfields = it_dynpfields
IF sy-subrc <> 0.
ENDIF.
After the function module is called, read the it_dynpfield table, you are sure to find the value.
Regards,
Arun
‎2011 Nov 11 1:52 PM
Hi,
In Module pool, if you have entered some value for Field1 and without pressing Enter, you click on the f4 help for Field2, there is no way in which you can read the value of field1 in the module under process on value request.
This is because when a user enters a value on the screen and then clicks on the F4 help for a field on the same screen, the 'Process on value request' is triggered first followed by PAI. Since the PAI is triggered after POV, the value of field1 id not read.
The only way to solve this is:-
1) Enter the value for Field1 - Press Enter. - By this way the PAI event is triggered and the value of field 1 is recorded
2) Now click on the F4 help for Field2 = This will trigger the POV. Since Field1 value has been recorded, you can use it to populate the F4 help.
The difference lies in the way we are testing.
Check the code should work.
‎2011 Nov 11 2:17 PM
Hi,
It is to bypass this exact problem that i suggested the function module 'DYNP_VALUES_READ'. We very well know that if enter is not pressed then the data does not flow from the screen to the module pool program PAI event.
I think before making sweeping statements like ' it is not possible to get the value ' , some research should be done to explore all the possibilities. This is to ensure that people who post queries are not misguided.
Just a suggestion from my side with no animosity directed against anyone
Regards,
Arun
‎2011 Nov 21 2:42 AM
Hi Arun,
Thanks! That solved my problem. In addition, I used the FM below to get the current index in the table:
CALL FUNCTION 'DYNP_GET_STEPL'
IMPORTING
povstepl = lv_stepl
EXCEPTIONS
stepl_not_found = 1
OTHERS = 2.
Regards,
abapGenin
‎2022 Feb 10 7:25 AM