How does your touch screen store data into the DM[1] and DM[2]? I imagine it is via Modbus? If so, then the number that you enter as Hex in your touch screen is sent to the PLC DM[1] and DM[2] as an integer number. A number is always a binary number inside the CPU. Whether we look at it as decimal or hexadecimal is only for our own convenience since a number that is represented by 0 and 1 only is not easily readable by human.
You can understand what I mean by going online monitoring and then view the number as decimal or as hex by pressing the H or D key while in the "View variable" screen. The screen will show the number in either format. But that does not change the number itself.
When you need to format the number as a hexadecimal string, you can simply use the function HEX$(DM[1],4) to convert it into 4 digit hexadecimal number.