‎2008 Jun 02 5:27 AM
Hi Gurus,
I have an internal table i_final2 with values Country, brand, pack and curr pri. I need to extract only the first value for any country and put iti n another internal table i_final2. I used AT NEW statment and wrote the following code.
loop AT i_temp INTO w_temp.
MOVE w_temp-country TO w_final1-country.
MOVE w_temp-brand TO w_final1-brand.
MOVE w_temp-pack TO w_final1-pack.
MOVE w_temp-curr_pri TO w_final1-curr_pri.
APPEND w_final1 TO i_final1.
endloop.
IF i_final1 IS NOT INITIAL.
Loop AT i_final1 INTO w_final1.
AT NEW country.
APPEND w_final1 TO i_final2.
CLEAR w_final1.
ENDAT.
endloop.
ENDIF.But in the output i get the country code properly , where as the other values appear as astericks like *****, *******, etc. Can anyone help me in the regard?
Thanks & Regards.
‎2008 Jun 02 5:33 AM
Hi,
Between Control Block statement,all the fields next to the field used in control break statement will be like * only .
So you just move the value of the remaining fiedls just above the AT new statemnt.
data:w_final2 like w_final1.
Loop AT i_final1 INTO w_final1.
w_final2 = w_final1.
AT NEW country.
APPEND w_final2 TO i_final2.
CLEAR w_final2.
ENDAT.
Endloop.
Edited by: Vigneswaran S on Jun 2, 2008 6:33 AM
‎2008 Jun 02 5:29 AM
hi,
jus read the internal table after AT NEW.
SORT I_FINAL1 BY COUNTRY.
Loop AT i_final1 INTO w_final1.
AT NEW country.
READ TABLE I_FINAL1...now u'll get the values right! Sort the internal table before using control break statements.
regards,
madhu
‎2008 Jun 02 5:33 AM
Hi,
Between Control Block statement,all the fields next to the field used in control break statement will be like * only .
So you just move the value of the remaining fiedls just above the AT new statemnt.
data:w_final2 like w_final1.
Loop AT i_final1 INTO w_final1.
w_final2 = w_final1.
AT NEW country.
APPEND w_final2 TO i_final2.
CLEAR w_final2.
ENDAT.
Endloop.
Edited by: Vigneswaran S on Jun 2, 2008 6:33 AM
‎2008 Jun 02 5:42 AM