cancel
Showing results for 
Search instead for 
Did you mean: 

Avoid duplicates of a coulmn while printing it on form.

Former Member
0 Kudos

Hi,

I have a requirement to print internal table itab data as

-


ItemNO Item Description Sold-To Date

-


10456 xyz ABC 15Aug10

12045 LMN DFG 17Aug10

KMN 19Aug10

PLO 20Aug10

14502 HGT MLN 01Sep10

-


I used ' delete ADJACENT DUPLICATES FROM itab COMPARING ITEMNO' to avoid duplication of ItemNO and its Description.

This inturn also deletes complete 2 dulplicate rows of item # 12045.

Please sugest me how I can delete only duplicates in ItemNo and Item Description columns while printing to form.

Thanks in advance

Accepted Solutions (0)

Answers (3)

Answers (3)

Former Member
0 Kudos

Hi,

Thanks to all, Karthick's logic helped and it sis working.

Best Regards

Former Member
0 Kudos

Hi..

Delete ADJACENT DUPLICATES will always delete completely the duplicate rows.

As per your post I understand that for same item numbers you do not want to print the item no. again, instead it should be like as below..

12045 LMN DFG 17Aug10

KMN 19Aug10

PLO 20Aug10

If I am right, then you need to create a program line inside the main area's cell above the text element (Item Number field) and write logic to check if the item number is repeating or not. Based on this logic set a flag as 'X', whenever it repeats and put a condition on text element (on text element's condition tab) printing Item number as "FLAG NE 'X' ".

In this way it will print item number only if flag is not X, hence when it is not repeating.

Hope this helps.

Regards,

Karthik

Former Member
0 Kudos

Hi,

I like Karthik's logic, but rather than setting a flag (hate flags...), after displaying your item number, just copy the item number to a global variable, ie. GV_LAST_ITEMNO.

Then use this field in the test on your cell so that it only displays when the current item number is different from GV_LAST_ITEMNO.

Regards, Andy

Former Member
0 Kudos

i hope you are aware that the table has to be sorted by the fields for which you want to do the compare when using delete adj.

/edit damn typos...

Former Member
0 Kudos

Hi,

Yes, I am aware of sorting table before I use delete adjacent.