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

problem in processing internal table

Former Member
0 Likes
804

Hi All,

I have an internal table populated with following data:

gt_final:has following two fields Material Desc and value

*Material Desc*                                                            *value*         
SUPPL. CONCENTRATION
POT. TITR. NITRITE TITRATION
TAMPED VOLUME METHOD DIN
VISUAL TEST                                                            Inspect value
LIQUID CHROMATOGRAPHY       
SOLUBILITY TEST 60/30 °C
WASHING-OFF TEST FOR NOVACRON C DYES                                      wash
WASHING-OFF TEST FOR NOVACRON C DYES                                      wash
LIQUID CHROMATOGRAPHY                                                       22c
LIQUID CHROMATOGRAPHY             
VISUAL TEST                                                            inspect value        
TRANSMISSION MEASUREMENT

Im printing this in smartform.

Requirement to print:

Material desc down

value

If the "material desc" & "value" are same then it has to print only one material descripton

example:

Visual test

inspect value

Problem is, if you see the internal table, there are 3 records with LIQUID CHROMATOGRAPHY.

For two of them there are no values. and one has the value 22c.

Now it has to display like this.

LIQUID CHROMATOGRAPHY

2Spaces(here it has to print value but as it is having spaces no value would be printed. Thats ok).

LIQUID CHROMATOGRAPHY(again mat desc has to print as it has having different value)

now,22c has to print.

Hope you understood the requirement.

Pls help me if anyone have clue to achieve the above requriement.

Your helpful anwer would greatly appreciated.

Rgs,

Priya

6 REPLIES 6
Read only

Former Member
0 Likes
770

Hey,

I understood the requirement ,

what you need to do is :

Firts sort the internal table on description and value.

Then write

delete ADJACENT DUPLICATES FROM itab.

It will solve your problem.

Hop ethis is helpful.

Regards,

Uma Dave

Read only

0 Likes
770

Hi Umadave,

Thanks for the reply.

Actually there is another field need to consider in the internal table. Forgot to say you about that.

Here it is:

*Material Desc*                                                            *value*                                             IC_desc
SUPPL. CONCENTRATION                                                                                CONTENT
POT. TITR. NITRITE TITRATION                                                                                CONTENT
TAMPED VOLUME METHOD DIN                                                                                ACTIVE SUBSTANCE
VISUAL TEST                                                            Inspect value                                APPEARANCE
LIQUID CHROMATOGRAPHY                                                                                REACTIVE DYE CONTENT
SOLUBILITY TEST 60/30 °C                                                                                SOLUBILITY TEST FILTER METHOD
WASHING-OFF TEST FOR NOVACRON C DYES                                      wash                                          STAINING CO
WASHING-OFF TEST FOR NOVACRON C DYES                                      wash                                          STAINING PA
LIQUID CHROMATOGRAPHY                                                       22c                                             CONTENT
LIQUID CHROMATOGRAPHY                                                                                SUM OF ZONE 2,3
VISUAL TEST                                                            inspect value                                  COLOR

This is how it has to display.

Material desc

value

ic_desc

Example:1(material desc 2VISUAL TEST/ 2 values inspect value are same. hence appearce and color displyd below i)

visual test

inspect value

appearence

color

Example2: (material desc 3 LIQUID CHROMATOGRAPHY/ 2 values space and 1 value 22c / ic_desc are different for all)

Desired output:

LIQUID CHROMATOGRAPHY

"2spaces"

SUM OF ZONE 2,3

REACITVE DYE CONTENT

LIQUID CHROMATOGRAPHY

22c

content

Pls help me with your valuable suggestins.

Rgs,

Priya

Read only

0 Likes
770

Hi..

Just try using the following statement:

DELETE ADJACENT DUPLICATES FROM itab COMPARING field1 field2 field3.

As a result any duplicate entries based on the fields will be deleted.

Regards,

Karthik

Read only

0 Likes
770

Delete adjacent duplicates could easily remove the wrong row....

Try

delete gt_final where.....  "is blank or is initial or whatever matches your criteria.

Read only

0 Likes
770

Hi Everyone,

Thanks for your valuable suggestions.

The internal table doesnt contain any duplicate entries.

So, no use of "Delete adjacent" i hop.

Just I need to process it in the user desired format.(as mentioned in prev message)

Pls guide me .

Regards,

Priya

Read only

0 Likes
770

is it possible to send in table format?

like ====>

a

b

c


a

b

c


a

b

c

-


Srinivas