Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

Regarding select option

Former Member
0 Likes
1,366

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

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
1,328

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

11 REPLIES 11
Read only

Sm1tje
Active Contributor
0 Likes
1,328

What about DISTINCT?

Read only

Former Member
0 Likes
1,328

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????

Read only

Former Member
0 Likes
1,328

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

Read only

Former Member
0 Likes
1,328

Hi Radhika,

Trying using DELETE ADJACENT DUPLICATES FROM <table name> COMPARING <GR No>.

Regards,

Suresh.D

Read only

Former Member
0 Likes
1,328

to add a bit more precision, have a look at the "DISTINCT" addition of the SELECT statement.

Read only

Former Member
0 Likes
1,328

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

Read only

Former Member
0 Likes
1,328

Hi,

U can sort ur internal table for GR number and then use DELETE ADJACENT DUPLICATES.

Hope it will solve ur problem.

Read only

Former Member
0 Likes
1,328

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..

Read only

Former Member
0 Likes
1,328

hi,

you can use delete adjacent duplicate statement ... after this statement is executed the internal table has only unique records...

Regards,

Siddarth

Read only

viquar_iqbal
Active Contributor
0 Likes
1,328

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

Read only

Former Member
0 Likes
1,329

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