make use of Field-symbols.
field-symbols : <n> type x.
field-symbols : <pn> type c.
field-symbols : <dn1> type x.
data : rn type i.
data : rn1(4) type c.
data : n type c.
describe field P_I_UPLOAD type _c.
if _c eq 'u'.
_l = strlen( P_I_UPLOAD ).
_i = _l div 2.
do _l times.
a = sy-index - 1.
a1 = P_I_UPLOAD+a(1).
assign a1 to <n> casting.
move <n> to rn.
if rn = 32.
continue.
endif.
*For Prod rn1 should be 3(1) and for QAS rn1 Shld be 0(1)
*rn = rn - key.
*rn = rn - 12 .
rn = rn - ( P_DATE+4(2) + P_DATE+6(2) ).
assign rn to <pn> casting.
move <pn> to rn1.
*if rn1+0(1) EQ '#'.
n = rn1+3(1).
*a1 = n.
*ELSE.
*N = RN1+0(1).
A1 = n.
*ENDIF."PRABHU ON 4.1.2005
*REPLACE ALL OCCURRENCES OF '#' IN rn1 WITH ' '.
P_I_UPLOAD+a(1) = A1.
enddo.
endif.<