‎2008 Jun 21 9:31 AM
hi,
i have this codes below,
SORT i_employee1 BY carrid.
CLEAR wa_employee1.
LOOP AT i_employee1 INTO wa_employee1.
AT NEW carrid.
WRITE: / wa_employee1-carrid,
wa_employee1-connid,
wa_employee1-countryfr.
ENDAT.
endloop.
only carrid display... the rest are asterisks(*)...
why is that so considering that i already put the entry into work area...
thanks!
‎2008 Jun 21 9:51 AM
As these are control break statements and these will perform the aggregation on the fields, so asterik(*) is appearing for the character & numeric fields.
Put the carrid at the last or.
Before using the control break statement, transfer the entire data into temp internal table and use that table like
SORT i_employee1 BY carrid.
i_employee_temp[] = i_employee1.
CLEAR wa_employee1.
LOOP AT i_employee1 INTO wa_employee1.
AT NEW carrid.
read table i_employee_temp into wa_employee_temp with key carrid = wa_employee1-carrid.
if sy-subrc eq 0.
WRITE: / wa_employee_temp-carrid,
wa_employee_temp-connid,
wa_employee_temp-countryfr.
endif.
ENDAT.
clear:wa_employee_temp.
endloop.
Regards
Kannaiah
‎2008 Jun 21 9:34 AM
‎2008 Jun 21 9:48 AM
i hope .. at new should be like this...then it is possible
at new wa_employee1-carrid.
‎2008 Jun 21 9:51 AM
As these are control break statements and these will perform the aggregation on the fields, so asterik(*) is appearing for the character & numeric fields.
Put the carrid at the last or.
Before using the control break statement, transfer the entire data into temp internal table and use that table like
SORT i_employee1 BY carrid.
i_employee_temp[] = i_employee1.
CLEAR wa_employee1.
LOOP AT i_employee1 INTO wa_employee1.
AT NEW carrid.
read table i_employee_temp into wa_employee_temp with key carrid = wa_employee1-carrid.
if sy-subrc eq 0.
WRITE: / wa_employee_temp-carrid,
wa_employee_temp-connid,
wa_employee_temp-countryfr.
endif.
ENDAT.
clear:wa_employee_temp.
endloop.
Regards
Kannaiah
‎2008 Jun 21 9:59 AM
Kannaiah's explanation is spot on.
Slightly different way :
SORT i_employee1 BY carrid.
CLEAR wa_employee1.
LOOP AT i_employee1 INTO wa_employee1.
AT NEW carrid.
read table i_employee1 into wa_employee1 index sy-tabix.
if sy-subrc = 0.
WRITE: / wa_employee1-carrid,
wa_employee1-connid,
wa_employee1-countryfr.
endif.
ENDAT.
endloop.
‎2008 Jun 21 10:01 AM
HI
Just make sure that field carrid is first field of the internal table i_employee1.
At statment works with only the first field of an internal table.
This will solve your problem.
Reward points if helful.
Regards
Bikas