3.4.10 How Do I Place Variables in the PIC18 Device’s External Program Memory?

If all you mean to do is place read-only variables in program memory, qualify them as const (see 5.4.3 Objects in Program Space). If you intend the variables to be located in the external program memory then use the __far qualifier (see 5.3.9.3 Far Type Qualifier) and specify the memory using the -mram option (see 4.6.1.17 Ram Option). The compiler will allow __far-qualified variables to be modified. Note that the time to access these variables will be longer than for variables in the internal data memory. The access mode to external memory can be specified with an option (see 4.6.1.9 Emi Option).