‎2010 Jul 02 12:31 PM
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 MEASUREMENTIm 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
‎2010 Jul 02 12:41 PM
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
‎2010 Jul 02 1:06 PM
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 COLORThis 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
‎2010 Jul 02 1:16 PM
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
‎2010 Jul 02 2:00 PM
Delete adjacent duplicates could easily remove the wrong row....
Try
delete gt_final where..... "is blank or is initial or whatever matches your criteria.
‎2010 Jul 06 12:33 PM
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
‎2010 Jul 06 5:22 PM
is it possible to send in table format?
like ====>
a | b | c |
a | b | c |
a | b | c |
-
Srinivas