You can make the connection by using the name of Global variables. A Global variable can be defined by using this code:
DATA matnr TYPE MATNR-> to create a global variable matnr. You can define DDIC structure or table like Tables: MARA
In Screen Painter, you can reference of fields of table/structure MARA. Note that one of the useful features of the screen painter is choosing dictionary/program fields and this can be done by pressing “F6”.