‎2009 May 25 12:58 PM
Hiii everyone,
I want to select only unique field while displaying an output through internal table.
That is when i want to display Pending GR for payment i want to display only the GR number but while dispalying if i have 4 items against the GR . The GR num is appearing 4 times. Is there any option like ' 'unique' as in sql.
I tried keeping zeile= 1 but i am unable display all the GR some are missing.
can anyone help me out.
with Regards
Radhika
‎2009 May 25 1:43 PM
HI
Between LOOP and ENDLOOP use AT NEW command
(or)
In LOOP and ENDLOOP.
declare varialble V_var.
first time pass the GR value V_var.
second time onwards check the V_var with Internal table GR field.
if both are same, then don't pass the GR valu to your final table
‎2009 May 25 12:59 PM
‎2009 May 25 1:06 PM
but distinct can be used when i am picking data from database table but how can i use it while i am picking data from internal table.
can any one tell me the syntax????
‎2009 May 25 1:11 PM
Dear Radhika,
Then it will be more easier.
just sort your internal table with key field and delete adjacent duplicates from the internal table.
Hope this will solve your problem now. still you have any doubt feel free to ask .
Regards,
Vijay
‎2009 May 25 1:18 PM
Hi Radhika,
Trying using DELETE ADJACENT DUPLICATES FROM <table name> COMPARING <GR No>.
Regards,
Suresh.D
‎2009 May 25 1:02 PM
to add a bit more precision, have a look at the "DISTINCT" addition of the SELECT statement.
‎2009 May 25 1:03 PM
Dear Radhika,
You can use Select Distinct as select query.
e.g. SELECT DISTINCT .....
Hope this solve your problem.
Feel free to ask if you have any doubt.
Regards,
Vijay
‎2009 May 25 1:04 PM
Hi,
U can sort ur internal table for GR number and then use DELETE ADJACENT DUPLICATES.
Hope it will solve ur problem.
‎2009 May 25 1:05 PM
Hi,
Loop at itab into wa_itab.
Data v_gr type gr.
v_gr = itab-gr.
if v_gr EQ itab-gr and v_gr_item NE itab-item.
display.
endif.
endloop.
Thanks ,
SHIVA..
‎2009 May 25 1:09 PM
hi,
you can use delete adjacent duplicate statement ... after this statement is executed the internal table has only unique records...
Regards,
Siddarth
‎2009 May 25 1:14 PM
Hello
Use AT NEW GR number
....items.
ENDAT. when displaying data.
This will make the GR number appear only once and rest of the items under the GR number will not repeat the GR number.
Hope this helps!
Viquar Iqbal
‎2009 May 25 1:43 PM
HI
Between LOOP and ENDLOOP use AT NEW command
(or)
In LOOP and ENDLOOP.
declare varialble V_var.
first time pass the GR value V_var.
second time onwards check the V_var with Internal table GR field.
if both are same, then don't pass the GR valu to your final table