Skip to Content
0
Former Member
Nov 28, 2008 at 08:49 AM

ADDING FIELDS

17 Views

hi all.

my final internal table is outrec.

and wiant to add 8 fields of kunnr.

if the flag = X

then addition of the fields and then displaying the result.

i am doing as below.but there is warning coming in the wa_outrec that it cannot be converted into number(as there are many alphabetical fields along with the numerical fields in the table)

IF P_CON = ' '.

SORT OUTREC BY BUKRS.

ELSEIF P_CON = 'X'.

SORT OUTREC BY KUNNR.

endif.

LOOP AT OUTREC.

WA_OUTREC1 = WA_OUTREC.

WA_OUTREC-RAST1 = WA_OUTREC1_1.

WA_OUTREC-RAST2 = WA_OUTREC1_2.

WA_OUTREC-RAST3 = WA_OUTREC1_3.

WA_OUTREC-RAST4 = WA_OUTREC1_4.

WA_OUTREC-RAST5 = WA_OUTREC1_5.

WA_OUTREC-RAST6 = WA_OUTREC1_6.

WA_OUTREC-RAST7 = WA_OUTREC1_7.

WA_OUTREC-SUM1 = WA_OUTREC1_8.

AT END of KUNNR.

P_CON = ' '.

ENDAT.

IF P_CON = 'X'.

WA_OUTREC1_1 = WA_OUTREC1_1 + WA_OUTREC.

WA_OUTREC1_2 = WA_OUTREC1_2 + WA_OUTREC.

WA_OUTREC1_3 = WA_OUTREC1_3 + WA_OUTREC.

WA_OUTREC1_4 = WA_OUTREC1_4 + WA_OUTREC.

WA_OUTREC1_5 = WA_OUTREC1_5 + WA_OUTREC.

WA_OUTREC1_6 = WA_OUTREC1_6 + WA_OUTREC.

WA_OUTREC1_7 = WA_OUTREC1_7 + WA_OUTREC.

WA_OUTREC1_8 = WA_OUTREC1_8 + WA_OUTREC.

endif.

ENDLOOP.

CLEAR:WA_OUTREC,P_CON.

refresh outrec.

wa_outrec1_1 = wa_outrec.

append wa_outrec to outrec.

please explain me the mistake as it is not working.

kindly reply