Hello All ,
I came through this scenario while answering one of the query in SCN and after debugging for a while I came with this solution.
So , I would like to share the same with you all.
Scenario :
There are more than one fields in a module pool selection screen and you have implement POV event for one of the fields and requirement is such that on selecting any value from the HITLIST popped it must populate with related values to other fields along with the field for which POV has been coded.
As an example consider the below screen.
Here I have coded POV for Customer ID ( Variable VAR_CUSTID ) which will pop up with the below shown options on clicking
Now on selecting any of the HITLIST value it will populate the field Customer ID ( VAR_CUSTID ) with the value of F0001 from the clicked line.
Now the requirement is such that while selecting any value for Customer ID it should also populate the Display fields DISP_NAME1 & DISP_NAME2 ( Just below Customer ID ) with values from F002 and F003 respectively.
Below is the code POV which takes care of field Customer ID ( VAR_CUSTID )
Now for populating DISP_NAME1 and DISP_NAME2 with corresponding F0002 and F0003 values respectively I am going to Implicitly enhance Program LSDSDF01 ( which is an INCLUDE Program inside SAPLSDSD ).
This is the program which actually comes into action when we select any of the line from the hit list popped up based on POV.
Create and Implicit Enhancement at this below point.
Here Internal Table dynpfields is an internal table which consists of four fields :
FIELDNAME = which consists of the field for which POV has been coded , here it is VAR_CUSTID which we provided in FM F4IF_INT_TABLE_VALUE_REQUEST as Exporting parameter DYNPROFIELD
FIELDVALUE = which consists of the value based on user click from the hitlist popped.
STEPL = not relevant for this discussion
FIELDINP = not relevant for this discussion.
Now we will write the below code to accomplish the task.
Now whenever we will select any value from the hit list for Customer ID the below two fields will also be populated with NAME1 and NAME2 respectively
as shown below.
Hope this was a useful stuff.