on 04-21-2016 10:08 AM
It was very simple:
First SORT the table by keys of internal table for what deleting duplicates would be going.
SORT lt_tables BY country company.
Then Loop on this table with assigning for checking initial field(and not initial). And loop in the loop with WHERE , here we filter by country and company.
LOOP AT lt_tables ASSIGNING <ls_tables>.
IF <ls_tables>-table04 IS INITIAL.
LOOP AT lt_tables INTO ls_tables WHERE country = <ls_tables>-country AND
company = <ls_tables>-company AND
table04 IS NOT INITIAL.
and after that simple data copy (assign) for field from filtered by company and country.
<ls_tables>-table04 = ls_tables-table04.
and delete duplicates in table by my sorted keys.
DELETE ADJACENT DUPLICATES FROM lt_tables COMPARING country company.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Michal,
Is the data in 1 row where you are reading it from ?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Where is your data coming from, can't you process that after db selection, before you display ALV?
M.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
It is not ALV Simple table.
I make Select with assigning, and after that loop, where with If i choosing color for cells and set date in columns. My code example:
SELECT * FROM zbw... INTO CORRESPONDING FIELDS OF TABLE lt_zgm...
LOOP AT lt_zgm.. ASSIGNING <ls_zgm...> .
IF <ls_zgm_...>-tabname = 'ZGM_M...'.
ls_tables-country = <ls_zgm_mmv_status>-country.
....
IF ls_tables-country IS NOT INITIAL.
ls_tables-celldesign = cl_wd_table_column=>e_cell_design-calendar_blue.
ENDIF.
The same for others tab.
And in the end: append into table and bind it
Then you could consider lt_zgm as intermediary table with key Company and Country,
So in your final table you do READ lt_final WITH KEy country = .. company = ..
if found -> update
if not found -> insert,
and bind that lt_final to your uielement.
This way you only have one entry per Company/Country.
User | Count |
---|---|
93 | |
10 | |
10 | |
9 | |
9 | |
7 | |
6 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.