F4 on GuiXT field
I  want to customize the selection box that appears when F4 is invoked on a GuiXT created field, viz

inputfield (9,2) "-nolabel" "name=g_material_1" "size=12"
"techname=RESBD-MATNR"

So when the selection box for the material comes up, I always need to go to a particular tab and stop there. I can do that with F4 on standard SAP screen, but on a GuiXT created field, when the popup appears, the screen element window does not show the screen elements for that popup. What can I do?

The F4 help presumably comes up as a control (each user can select between control and standard list display), and the tabs in the control are not known to GuiXT.

I suggest the following as a possible solution:
The standard search help "MAT1" is defined as a collection of different matchcodes MAT1A, MAT1B, .... You can directly name the value help that you want displayed. So, for example you can use

inputfield (9,2) "-nolabel" "name=g_material_1" "size=12" "searchhelp=MAT1E"