Omit Duplicate value in D/N report
Dear Expert,
I have a report based on outbound Delivery.
Data showing in my report with duplicate value.
Delivery Item Condition value
3600000016 90001 2,169,180.00
3600000016 90002 2,169,180.00
3600000016 90003 2,169,180.00
But I need to my report report like:
3600000016 90001 2,169,180.00
3600000016 90002
3600000016 90003
Thanks & B.Rgds
Hi,
Apply the below logic.
data: wa like itab,
v_count type i.
loop at itab.
if v_count > 0.
if itab-deliveryitem = wa-deliveryitem and
itab-condition = wa-condition and
itab-value = wa-value.
clear: itab-condition, itab-value.
modify itab.
else.
wa-deliveryitem = itab-deliveryitem.
wa-condition = itab-condition.
wa-value = itab-value.
endif.
else.
wa-deliveryitem = itab-deliveryitem.
wa-condition = itab-condition.
wa-value = itab-value.
endif.
v_count = v_count + 1.
endloop.
Similar Messages
-
Duplicate value in Command extract report
Hi Experts
I am getting a duplicate record when extracting the BOM which is so called Material Extract in my words
when running the report I am getting the duplicate value for the cost estimate. near the form extract_bom_details under select queries
Can anyone help me why I am getting so by seeing the coding please.
TYPES:
BEGIN OF ty_bom,
matnr(12) TYPE c, " Material #
werks(4) TYPE c, " Plant
stprs(10) TYPE c, " Quantity
meins(3) TYPE c, " Unit of Measure
END OF ty_bom,
it_ty_bom TYPE ty_bom OCCURS 0,
*Start of block of changes for JPC20061107
BEGIN OF ty_bom_sapfmt,
matnr TYPE MARC-MATNR, " Material #
werks TYPE MARC-WERKS, " Plant
stprs TYPE MBEW-STPRS, " Quantity
meins TYPE MARA-MEINS, " Unit of Measure
END OF ty_bom_sapfmt.
Report COMMAND_EXTRACT_D *
REPORT command_extract_d .
*CLASS cl_gui_control DEFINITION LOAD.
*CLASS cl_gui_frontend_services DEFINITION LOAD.
Tables
TABLES:
kna1,
knb1,
knvv,
mara,
mast, "JPC20061107
marc,
makt,mbew,
sscrfields.
CONSTANTS: BEGIN OF gc_status,
acc TYPE zcrstat1 VALUE ' ACC',
hol TYPE zcrstat1 VALUE ' HOL',
sto TYPE zcrstat1 VALUE ' STO',
ok TYPE zcrstat1 VALUE ' OK',
hold TYPE zcrstat1 VALUE 'HOLD',
END OF gc_status.
CONSTANTS: BEGIN OF gc_reason,
000 TYPE zreason VALUE '000',
001 TYPE zreason VALUE '001',
002 TYPE zreason VALUE '002',
003 TYPE zreason VALUE '003',
004 TYPE zreason VALUE '004',
005 TYPE zreason VALUE '005',
006 TYPE zreason VALUE '006',
007 TYPE zreason VALUE '007',
008 TYPE zreason VALUE '008',
010 TYPE zreason VALUE '010',
011 TYPE zreason VALUE '011',
021 TYPE zreason VALUE '021',
022 TYPE zreason VALUE '022',
023 TYPE zreason VALUE '023',
024 TYPE zreason VALUE '024',
025 TYPE zreason VALUE '025',
026 TYPE zreason VALUE '026',
999 TYPE zreason VALUE '999',
END OF gc_reason.
TYPES: BEGIN OF ty_kna1_fields,
kunnr TYPE kna1-kunnr,
sperr TYPE kna1-sperr,
aufsd TYPE kna1-aufsd,
lifsd TYPE kna1-lifsd,
faksd TYPE kna1-faksd,
loevm TYPE kna1-loevm,
END OF ty_kna1_fields.
TYPES: BEGIN OF ty_knb1_fields,
kunnr TYPE knb1-kunnr,
bukrs TYPE knb1-bukrs,
sperr TYPE knb1-sperr,
loevm TYPE knb1-loevm,
END OF ty_knb1_fields.
TYPES: BEGIN OF ty_knvv_fields,
kunnr TYPE knvv-kunnr,
vkorg TYPE knvv-vkorg,
vtweg TYPE knvv-vtweg,
spart TYPE knvv-spart,
aufsd TYPE knvv-aufsd,
lifsd TYPE knvv-lifsd,
faksd TYPE knvv-faksd,
END OF ty_knvv_fields.
TYPES: BEGIN OF ty_knkk_fields,
kunnr TYPE knkk-kunnr,
kkber TYPE knkk-kkber,
ctlpc TYPE knkk-ctlpc,
crblb TYPE knkk-crblb,
knkli TYPE knkk-knkli,
klimk TYPE knkk-klimk,
skfor TYPE knkk-skfor,
ssobl TYPE knkk-ssobl,
END OF ty_knkk_fields.
TYPES: BEGIN OF ty_cust_stat_output,
kunnr(10) TYPE c, "Customer #
stat(4) TYPE c, "Customer status
END OF ty_cust_stat_output.
TYPES:
BEGIN OF ty_customers,
kunnr(10) TYPE c, " Customer #
div1(1) TYPE c, " Pipe delimiter
name1(32) TYPE c, " Customer name
div2(1) TYPE c, " Pipe delimiter
altkn(8) TYPE c, " Old Customer #
div3(1) TYPE c, " Pipe delimiter
stras(30) TYPE c, " Street
div4(1) TYPE c, " Pipe delimiter
ort01(20) TYPE c, " City
div5(1) TYPE c, " Pipe delimiter
regio(3) TYPE c, " State
div6(1) TYPE c, " Pipe delimiter
pstlz(4) TYPE c, " Postcode
div7(1) TYPE c, " Pipe delimiter
telf1(14) TYPE c, " Phone 1
div8(1) TYPE c, " Pipe delimiter
telf2(14) TYPE c, " Phone 2
div9(1) TYPE c, " Pipe delimiter
erdat(10) TYPE c, " date
div10(1) TYPE c, " Pipe delimiter
splant(2) TYPE c, " plant
div11(1) TYPE c, " Pipe delimiter
END OF ty_customers,
it_ty_customers TYPE ty_customers OCCURS 0,
BEGIN OF ty_custstat,
kunnr(11) TYPE c, " Customer #
company(2) TYPE c, " #
status(3) TYPE c, " acc,cod,hol,
END OF ty_custstat,
it_ty_custstat TYPE ty_custstat OCCURS 0.
TYPES:
BEGIN OF ty_materialm,
matnr(12) TYPE c, " Material #
maktx2(40) TYPE c, " Command sales desc.
maktx(16) TYPE c, " Basic description
extwg(6) TYPE c, " External Material Group
flag1(1) TYPE c, "
flag2(1) TYPE c, "
flag3(1) TYPE c, "
flag4(1) TYPE c, "
END OF ty_materialm,
it_ty_materialm TYPE ty_materialm OCCURS 0,
BEGIN OF ty_materialp,
matnr(12) TYPE c, " Material #
werks(4) TYPE c, " plant
batch(1) TYPE c, " download to batch
END OF ty_materialp,
it_ty_materialp TYPE ty_materialp OCCURS 0.
TYPES:
BEGIN OF ty_bom,
matnr(12) TYPE c, " Material #
werks(4) TYPE c, " Plant
stprs(10) TYPE c, " Quantity
meins(3) TYPE c, " Unit of Measure
END OF ty_bom,
it_ty_bom TYPE ty_bom OCCURS 0,
*Start of block of changes for JPC20061107
BEGIN OF ty_bom_sapfmt,
matnr TYPE MARC-MATNR, " Material #
werks TYPE MARC-WERKS, " Plant
stprs TYPE MBEW-STPRS, " Quantity
meins TYPE MARA-MEINS, " Unit of Measure
END OF ty_bom_sapfmt.
Selection screen definition
SELECTION-SCREEN: BEGIN OF BLOCK bom WITH FRAME TITLE text-004.
PARAMETERS:
p_dbom LIKE filepath-pathintern DEFAULT 'Z_COMMAND_BOM_EXTRACT',
p_fbom LIKE rlgrap-filename.
SELECT-OPTIONS:
s_bmatnr FOR MARA-MATNR, "JPC20061107
s_bwerks FOR MAST-WERKS no-extension no intervals, "JPC20061107
s_bextwg FOR mara-extwg.
SELECTION-SCREEN: END OF BLOCK bom.
SELECT-OPTIONS:
s_kunnr FOR kna1-kunnr.
SELECTION-SCREEN: END OF BLOCK ccst.
DATA: clsdir TYPE REF TO cl_gui_frontend_services.
DATA: strfolder TYPE string.
DATA: folderln TYPE i.
DATA: gva_error(1) TYPE c VALUE ' '.
Initial procedure on START ***************
INITIALIZATION.
p_fcust = 'CUST.prn'.
p_fmatm = 'MATM.prn'.
p_fmatp = 'MATP.prn'.
p_fbom = 'BOM.prn'.
p_fccst = 'CCSTAT.prn'.
p_fccst2 = 'CCSTATC.prn'.
p_fccstl = 'CCSTATL.prn'.
s_dextwg-option = 'BT'.
s_dextwg-low = '1'.
s_dextwg-high = '8'.
APPEND s_dextwg.
s_bextwg-option = 'BT'.
s_bextwg-low = '1'.
s_bextwg-high = '1'.
APPEND s_bextwg.
AT SELECTION-SCREEN.
IF p_ccust EQ 'X' AND ( p_fcust IS INITIAL OR p_dcust IS INITIAL ).
MESSAGE s000(zppu)
WITH 'You must specify the file details for the customer data'.
gva_error = 'X'.
ENDIF.
IF p_cmatm EQ 'X' AND ( p_fmatm IS INITIAL OR
p_fmatp IS INITIAL OR
p_dmatm IS INITIAL ).
MESSAGE s001(zppu)
WITH 'You must specify the file details for the material data'.
gva_error = 'X'.
ENDIF.
IF p_cbom EQ 'X' AND ( p_fbom IS INITIAL OR p_dbom IS INITIAL ).
MESSAGE s002(zppu)
WITH 'You must specify the file details for the BOM data'.
gva_error = 'X'.
ENDIF.
IF p_cbom EQ 'X'.
IF s_bwerks-low is initial.
MESSAGE s002(zppu)
WITH 'You must specify a plant to run BOM extract for'.
gva_error = 'X'.
ENDIF.
IF LINES( s_bwerks ) > 1.
MESSAGE s002(zppu)
WITH 'You can only specify 1 plant for BOM extract'.
gva_error = 'X'.
ENDIF.
ENDIF.
IF p_ccst EQ 'X' AND ( p_fccst IS INITIAL OR
p_fccst2 IS INITIAL OR
p_fccstl IS INITIAL OR
p_dccst IS INITIAL ).
MESSAGE s002(zppu)
WITH 'You must specify the file details for the customer'
'status data'.
gva_error = 'X'.
ENDIF.
AT SELECTION-SCREEN OUTPUT.
PERFORM user_command.
AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_fcust.
PERFORM get_gui_filename USING p_dcust p_fcust.
AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_fmatm.
PERFORM get_gui_filename USING p_dmatm p_fmatm.
AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_fmatp.
PERFORM get_gui_filename USING p_dmatm p_fmatp.
AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_fbom.
PERFORM get_gui_filename USING p_dbom p_fbom.
AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_fccst.
PERFORM get_gui_filename USING p_dccst p_fccst.
AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_fccst2.
PERFORM get_gui_filename USING p_dccst p_fccst2.
AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_fccstl.
PERFORM get_gui_filename USING p_dccst p_fccstl.
END-OF-SELECTION.
Data selection execution.
DATA: lwa_kna1 TYPE kna1,
lwa_knb1 TYPE knb1,
lwa_knvv TYPE knvv.
DATA: lwa_marc TYPE marc,
lwa_mara TYPE marav,
lwa_makt TYPE makt.
DATA: lit_marav TYPE marav OCCURS 0.
DATA: lit_customers TYPE it_ty_customers,
lwa_customers TYPE ty_customers.
DATA: lit_custstat TYPE it_ty_custstat,
lwa_custstat TYPE ty_custstat.
DATA: lit_materialm TYPE it_ty_materialm,
lwa_materialm TYPE ty_materialm.
DATA: lit_materialp TYPE it_ty_materialp,
lwa_materialp TYPE ty_materialp.
*(del)DATA: lwa_bomlist TYPE ty_bomlist, "JPC20061107
*(del) lit_bomlist TYPE it_ty_bomlist. "JPC20061107
DATA: lwa_bom TYPE ty_bom_sapfmt,
lit_bom TYPE it_ty_bom WITH HEADER LINE. "JPC20061107
lit_bom TYPE it_ty_bom. "JPC20061107
DATA: output_file TYPE string.
DATA: lock_file TYPE string.
DATA: lva_mssage TYPE string.
DATA: lva_matnr(18) TYPE n.
DATA: lva_date TYPE datum.
DATA: txtper(3) TYPE c.
DATA: custper TYPE i.
DATA: custcount TYPE i.
DATA: itemnum TYPE i.
CHECK gva_error <> 'X'.
IF p_ccust EQ 'X'. " Do the customer file extract
PERFORM extract_customer_details.
ENDIF.
IF p_cmatm EQ 'X'. " Do the Material file extract
PERFORM extract_material_details.
ENDIF.
IF p_cbom EQ 'X'. " Do the BOM file extract
PERFORM extract_bom_details.
ENDIF.
IF p_ccst EQ 'X'. " Do the customer credit status file extract
PERFORM extract_credit_status_details.
ENDIF.
*& Form extract_customer_details
text
--> p1 text
<-- p2 text
FORM extract_customer_details.
SELECT * FROM knb1
INTO lwa_knb1
WHERE bukrs = p_dcomp.
MOVE-CORRESPONDING lwa_knb1 TO lwa_customers.
MOVE-CORRESPONDING lwa_knb1 TO lwa_custstat.
MOVE '#' TO lwa_custstat-company.
MOVE p_dwerk TO lwa_customers-splant.
--WG1K903075: Start Delete-
move: '|' to lwa_customers-div1,
'|' to lwa_customers-div2,
'|' to lwa_customers-div3,
'|' to lwa_customers-div4,
'|' to lwa_customers-div5,
'|' to lwa_customers-div6,
'|' to lwa_customers-div7,
'|' to lwa_customers-div8,
'|' to lwa_customers-div9,
'|' to lwa_customers-div10,
'|' to lwa_customers-div11.
--WG1K903075: End Delete---
--WG1K903075: Start Insert-
MOVE: ' ' TO lwa_customers-div1,
' ' TO lwa_customers-div2,
' ' TO lwa_customers-div3,
' ' TO lwa_customers-div4,
' ' TO lwa_customers-div5,
' ' TO lwa_customers-div6,
' ' TO lwa_customers-div7,
' ' TO lwa_customers-div8,
' ' TO lwa_customers-div9,
' ' TO lwa_customers-div10,
' ' TO lwa_customers-div11.
--WG1K903075: End Insert---
APPEND lwa_customers TO lit_customers.
APPEND lwa_custstat TO lit_custstat.
ENDSELECT.
DESCRIBE TABLE lit_customers LINES custcount.
LOOP AT lit_customers INTO lwa_customers.
txtper = 100 * sy-tabix / custcount.
custper = txtper.
SELECT SINGLE * FROM kna1
INTO lwa_kna1
WHERE kunnr = lwa_customers-kunnr.
MOVE-CORRESPONDING lwa_kna1 TO lwa_customers.
lva_date = lwa_customers-erdat.
CALL FUNCTION 'CONVERT_DATE_TO_EXTERNAL'
EXPORTING
date_internal = lva_date
IMPORTING
date_external = lwa_customers-erdat
EXCEPTIONS
date_internal_is_invalid = 1
OTHERS = 2.
REPLACE ALL OCCURRENCES OF '.'
IN lwa_customers-erdat WITH '/'.
CALL FUNCTION 'CONVERSION_EXIT_ALPHA_OUTPUT'
EXPORTING
input = lwa_customers-kunnr
IMPORTING
output = lwa_customers-kunnr.
WRITE: lwa_customers-kunnr RIGHT-JUSTIFIED TO lwa_customers-kunnr.
MODIFY lit_customers FROM lwa_customers.
Percentage indicator display
lva_mssage = 'Extracting customers'.
CALL FUNCTION 'SAPGUI_PROGRESS_INDICATOR'
EXPORTING
percentage = custper
text = lva_mssage.
ENDLOOP.
IF p_gui IS INITIAL.
PERFORM get_file_path USING p_dcust p_fcust output_file.
OPEN DATASET output_file FOR OUTPUT IN TEXT MODE ENCODING DEFAULT.
IF sy-subrc EQ 0.
LOOP AT lit_customers INTO lwa_customers.
TRANSFER lwa_customers TO output_file.
ENDLOOP.
CLOSE DATASET output_file.
ELSE.
MESSAGE s002(zppu)
WITH 'Dataset' output_file 'cannot be opened on the server'.
ENDIF.
ELSE.
MOVE p_fcust TO output_file.
CALL FUNCTION 'GUI_DOWNLOAD'
EXPORTING
filename = output_file
filetype = 'ASC'
TABLES
data_tab = lit_customers
EXCEPTIONS
OTHERS = 11.
ENDIF.
output_file = custcount.
CONCATENATE
output_file
' Customers extracted'
INTO
lva_mssage.
message lva_mssage type 'I'.
ENDFORM. " extract_customer_details
*& Form extract_bom_details
text
--> p1 text
<-- p2 text
FORM extract_bom_details.
select MARAMATNR MBEWBWKEY MBEWSTPRS MARAMEINS "JPC20061220
into lwa_bom
from ( MARAV AS MARA
inner join MARC
ON MARAMATNR = MARCMATNR
INNER join MBEW
ON MARCMATNR = MBEWMATNR
AND MARCWERKS = MBEWBWKEY
where MARA~MATNR in s_bmatnr
and MBEW~BWKEY in s_bwerks
and MARA~EXTWG in s_bextwg.
clear lit_bom.
WRITE lwa_bom-matnr TO lit_bom-matnr.
MOVE lwa_bom-werks TO lit_bom-werks.
MOVE: lwa_bom-stprs TO lit_bom-stprs,
lwa_bom-meins TO lit_bom-meins.
APPEND lit_bom.
ENDSELECT.
SORT lit_bom ascending.
Ending for lines inserted for change 20061107
IF p_gui IS INITIAL. "write to server
PERFORM get_file_path USING p_dbom p_fbom output_file.
OPEN DATASET output_file FOR OUTPUT IN TEXT MODE ENCODING DEFAULT.
IF sy-subrc EQ 0.
custcount = lines( lit_bom ).
LOOP AT lit_bom.
txtper = 100 * sy-tabix / custcount.
custper = txtper.
lva_mssage = 'Extracting material B.O.Ms'.
CALL FUNCTION 'SAPGUI_PROGRESS_INDICATOR'
EXPORTING percentage = custper
text = lva_mssage.
TRANSFER lit_bom TO output_file.
ENDLOOP.
CLOSE DATASET output_file.
ELSE.
MESSAGE s002(zppu)
WITH 'Dataset' output_file 'cannot be opened on the server'.
ENDIF.
ELSE.
MOVE p_fbom TO output_file.
CALL FUNCTION 'GUI_DOWNLOAD'
EXPORTING
filename = output_file
filetype = 'ASC'
write_field_separator = ' '
TABLES
data_tab = lit_bom
EXCEPTIONS
OTHERS = 11.
ENDIF.
ENDFORM. " extract_bom_details
output with duplicate values
MARA BWKEY STPRS MEINS
10004989 BN01 28.00 TO
10004989 BN01 28.00 TO
10005010 BN01 19.00 EA
10005010 BN01 19.00 EA
10005018 BN01 800.00 BAG
10005018 BN01 800.00 BAG
10005115 BN01 82.74 TO
10005115 BN01 82.74 TO
10005117 BN01 137.30 TO
10005117 BN01 137.30 TO
Regards
PirozHi,
Use this statement then duplicate entries removed.
DELETE ADJACENT DUPLICATES FROM table-field.
regards,
Lakshminarayana -
Showing only the duplicate values in a webi report.
Hi, I have a unique identifier in my table which is not unique as we are not correctly maitaining the data, I am looking for a way in Webi to list out only the duplicate numbers in the table for that unique object as an audit report so I can make sure it remains clean with no duplicates. Any suggestions on an easy way to do this?
Create a Row Count Measure, as the value being 1, in your Universe for the report. Add that Row Count into the query for the report, re-execute the query, highlight the entire report and then set a filter for that by dragging and dropping the Row Count Measure and filtering where the value > 1.
Edited by: Dennis Scoville on Jul 27, 2009 11:29 AM -
Bringing Duplicate values in OBIEE Answers report
Hi Experts
Need you advise on the below:
I need to bring the duplicate rows in obiee11g report. I have a seq. generator which makes the complete row unique.
But the problem is Business User doesn't want to bring that column in report and then hide it.
I also unchecked "DISTINCT SUPPORTED" plus few more parameters in teh DB properties but no help.
Pls. guide how to achieve it on rpd level so that user doesn't have to drag the column to get duplicate rows.
Appreciat any guidance.Hi
I tried the solution but it didn't work .
These 9 records come when I don't bring the unique identifier in the report request
2013 November FirstNameA LastNameA 1851
2013 November FirstNameB LastNameB V594
2013 November FirstNameC LastNameC 1851
2013 November FirstNameD LastNameD V594
2013 November FirstNameE LastNameE V594
2013 November FirstNameG LastNameG 1851
2013 November FirstNameH LastNameH 1851
2013 November Samuel Ian 1775
2013 November Sandra David 1775
These 10 records come when I bring the unique identifier in the report request . See for - FirstNameE LastNameE
The user wants to see both the rows without actually dragging the unique identifier.
2013 November 16 Sandra David 1775
2013 November 17 FirstNameA LastNameA 1851
2013 November 18 FirstNameB LastNameB V594
2013 November 19 FirstNameC LastNameC 1851
2013 November 20 FirstNameD LastNameD V594
2013 November 21 FirstNameE LastNameE V594
2013 November 22 FirstNameE LastNameE V594
2013 November 23 FirstNameG LastNameG 1851
2013 November 24 FirstNameH LastNameH 1851
2013 November 25 Samuel Ian 1775 -
How to delete duplicate value in movement type 541 & 542(alv report)
hi experts,
i have some problem in alv report,
input we can give some movement type for ex(101,102,541,542, etc)
how to delete duplicate value in 541 and 542.
regards
gunasekaran.Try:
Delete adjacent duplicates from ITAB comparing FIELD1, FIELD2.
to do this the ITAB must be Sorted first.! -
Unable to Enforce Unique Values, Duplicate Values Exist
I have list in SP 2010, it contains roughly 1000 items. I would like to enforce unique values on the title field. I started by cleaning up the list, ensuring that all items already had a unique value. To help with this, I used the export
to excel action, then highlight duplicates within Excel. So as far as I can tell, there are no duplicates within that list column.
However, when I try to enable the option to Enforce Unique Values, I receive the error that duplicate values exist within the field and must be removed.
Steps I've taken so far to identify / resolve duplicate values:
- Multiple exports to Excel from an unfiltered list view, then using highlight duplicates feature > no duplicates found
- deleted ALL versions of every item from the list (except current), ensured they were completely removed by deleting from both site and site collection recycle bins
- Using the SP Powershell console, grabbed all list items and exported all of the "Title" type fields (Item object Title, LinkTitle, LinkTitleNoMenu, etc) to a csv and ran that through excel duplicate checking as well.
Unless there's some rediculous hidden field value that MS expects anyone capable of attempting to enforce unique values on a list (which is simple enough for anyone to figure out - if it doesn't throw an error), then I've exhausted anything I can think
of that might cause the list to report duplicate values for that field.
While I wait to see if someone else has an idea, I'm also going to see what happens if I wipe the Crawl Index and start it from scratch.
- JonFirst, I create index for a column in list settings, it works fine no matter duplicate value exists or not;
then I set enforce unique values in the field, after click OK, I get duplicate values error message.
With SQL Server profiler, I find the call to proc_CheckIfExistingFieldHasDuplicateValues and the parameters. After reviewing this stored procedure in content database,
I create the following script in SQL Server management studio:
declare @siteid
uniqueidentifier
declare @webid
uniqueidentifier
declare @listid
uniqueidentifier
declare @fieldid
uniqueidentifier
set @siteid='F7C40DC9-E5D3-42D7-BE60-09B94FD67BEF'
set @webid='17F02240-CE04-4487-B961-0482B30DDA84'
set @listid='B349AF8D-7238-419D-B6C4-D88194A57EA7'
set @fieldid='195A78AC-FC52-4212-A72B-D03144DC1E24'
SELECT
* FROM TVF_UserData_List(@ListId)
AS U1 INNER
MERGE JOIN
NameValuePair_Latin1_General_CI_AS
AS NVP1 WITH (INDEX=NameValuePair_Latin1_General_CI_AS_MatchUserData)
ON NVP1.ListId
= @ListId AND NVP1.ItemId
= U1.tp_Id
AND ((NVP1.Level
= 1 AND U1.tp_DraftOwnerId
IS NULL)
OR NVP1.Level
= 2)
AND NOT((DATALENGTH(ISNULL(NVP1.Value,
= 0)) AND U1.tp_Level
= NVP1.Level
AND U1.tp_IsCurrentVersion
= CONVERT(bit, 1)
AND U1.tp_CalculatedVersion
= 0 AND U1.tp_RowOrdinal
= 0 INNER
MERGE JOIN
NameValuePair_Latin1_General_CI_AS
AS NVP2 WITH (INDEX=NameValuePair_Latin1_General_CI_AS_CI)
ON NVP2.SiteId
= @SiteId AND NVP2.ListId
= @ListId AND NVP2.FieldId
= @FieldId AND NVP2.Value
= NVP1.Value
AND NVP2.ItemId <> NVP1.ItemId
CROSS APPLY TVF_UserData_ListItemLevelRow(NVP2.ListId, NVP2.ItemId,
NVP2.Level, 0)
AS U2 WHERE ((NVP2.Level
= 1 AND U2.tp_DraftOwnerId
IS NULL)
OR NVP2.Level
= 2)
AND NOT((DATALENGTH(ISNULL(NVP2.Value,
= 0))
I can find the duplicate list items based on the result returned by the query above.
Note that you need to change the parameter values accordingly, and change the name of NameValuePair_Latin1_General1_CI_AS table based on the last parameter of the
proc_CheckIfExistingFieldHasDuplicateValues stored procedure. You can review the code of this stored procedure by yourself.
Note that direct operation on the content database in production environment is not supported, please do all these in test environment. -
Query produces duplicate values in successive rows. Can I null them out?
I've had very good success (Thanks Andy) in getting detailed responses to my posted questions, and I'm wondering whether there is a way in a report region join query that produces successive rows with duplicate values that I can suppress(replace) the print of the duplicate values in those rows. In case I've managed to twist the question into an unintelligible mess (One of my specialties), let me provide an example:
We're trying to list the undergraduate institutions that an applicant has attended, and display information about dates of attendence, gpa, and major(s)/minor(s) taken. The rub is that there can be multiple major(s)/minor(s) for a given undergraduate institution, so the following is produced by the query:
University of Hard Knox 01/02 01/06 4.00 Knitting
University of Hard Knox 01/02 01/06 4.00 Cloth Repair
Advanced University 02/06 01/08 3.75 Clothing Design
Really Advanced U 02/08 01/09 4.00 Sports Clothing
Really Advanced U 02/08 01/09 4.00 Tennis Shoe Burlap
I want it to look like this:
University of Hard Knox 01/02 01/06 4.00 Knitting
Cloth Repair
Advanced University 02/06 01/08 3.75 Clothing Design
Really Advanced U 02/08 01/09 4.00 Sports Clothing
Tennis Shoe Burlap
* (edit) Please note that the cloth repair and tennis shoe repair rows would be correctly positioned in a table, but unfortunately got space suppresed here for some reason. *
Under Andy's tuteage, I'd say the answer is probably javascript looping through the DOM looking for the innerHTML of specific TDs in the table, but I'd like to confirm that, or, does Apex provide a checkbox that I can check that will produce the same results? Thanks in advance guys, and sorry for all the questions. We've been tasked to use Apex for our next project and to learn it by using it, since the training budget is non-existant this year. I love unfunded mandates ;)
Phil
Edited by: Phil McDermott on Aug 13, 2009 9:34 AMHi Phil,
Javascript is useful, as is the column break functionality within Report Attributes (which would be my first choice if poss).
If you need to go past 3 columns, I would suggest doing something in the SQL statement itself. This will mean that the sorting would probably having to be controlled, but it is doable.
Here's a fairly old thread on the subject: Re: Grouping on reports (not interactive) - with an example here: [http://htmldb.oracle.com/pls/otn/f?p=33642:112] (I've even used a custom template for the report, but you don't need to go that far!)
This uses the LAG functionality within SQL to compare the values on one row to the values on the preceeding row - being able to compare these values allows you to determine which ones to display or hide.
Andy -
Greetings Everyone,
I am getting the follow up errors: "This field contains duplicate values. Remove all duplicate values and try the operation again."
when I tried to make the field "Claim Number" from the list in site collection library. See the screen below:
1- I selected on the "List" and I clicked on the list name
"Claim Tracking Report"
2- After I clicked on the list name then I went to the ribbon and selected list setting to choose Enforce Unique for the Field Column
"Claim Number"
3- Then I went down and selected
"Yes" to Enforced the Unique for the Field Column "Claim Number".
4- Then after I clicked "Yes" I got the error
"Sorry, something went wrong. This field contains duplicate values. Remove all duplicate values and try the operation again." But I don't have any duplicates values Items, because I had them removed before I tried
to Enforce the field column values to Unique. Can someone help or provide me a suggestions on how I can solve this issue please. Thank you
FYI: I am using a Nintex WorkflowHope this is a list, how many total items are there?
Please try to open this list as access(link in IE) and run this query in access
SELECT Claim.[Claim Number], Count(*) AS Expr1
FROM Claim
GROUP BY Claim.[Claim Number]
HAVING (((Count(*))>1));
Hope it will show something! if this does not show you dups then better to create a separate list and migrate items after configuring unique column.
Please 'propose as answer' if it helped you, also 'vote helpful' if you like this reply. -
Duplicate Values in an Internal Table
Hi,
Is it possible to delete records having Duplicate Values in a field, in an Internal Table, but in the situation when the Internal Table is NOT sorted on that field ?
Regards,
Pankaj.Hi Pankaj,
i think you have to create a copy of your itab and collect.
try this:
REPORT ZGRO_TEST.
DATA: BEGIN OF ITAB OCCURS 0,
MATNR LIKE MARA-MATNR,
VBELN LIKE VBAK-VBELN,
END OF ITAB.
DATA: BEGIN OF ITAB1 OCCURS 0,
MATNR LIKE MARA-MATNR,
VBELN LIKE VBAK-VBELN,
END OF ITAB1.
START-OF-SELECTION.
itab-matnr = '000000000000000111'. itab-vbeln = '0000000011'. append itab.
itab-matnr = '000000000000000113'. itab-vbeln = '0000000013'. append itab.
itab-matnr = '000000000000000111'. itab-vbeln = '0000000011'. append itab.
itab-matnr = '000000000000000112'. itab-vbeln = '0000000012'. append itab.
itab-matnr = '000000000000000111'. itab-vbeln = '0000000011'. append itab.
itab-matnr = '000000000000000112'. itab-vbeln = '0000000012'. append itab.
itab-matnr = '000000000000000113'. itab-vbeln = '0000000013'. append itab.
loop at itab.
itab1 = itab.
collect itab1.
endloop.
loop at itab.
write: / itab-matnr, itab-vbeln.
endloop.
write: / sy-uline.
loop at itab1.
write: / itab1-matnr, itab1-vbeln.
endloop.
END-OF-SELECTION.
if you whant it back in itab. refrash itab and copy itab1 to itab.
Hope it helps.
Regards, Dieter -
How to pass value from the Z Report to the selection screen of the std rep
Dear Experts,
i have developed a report and the values are maintained only in internal table based on some condition. When I execute the report, for example MM60, there is a material number field for multiple selection.
the report should call the standard transaction and pass the values from the internal table to the multiple selection- material number of the standard transaction.
the standard transaction should never get executed automatically. Only the value should get passed from internal table to the standard t code. Please help.
regards,
ShankarHai
Go through the following Documents
SUBMIT rep.
Additions
1. ... LINE-SIZE col
2. ... LINE-COUNT lin
3. ... TO SAP-SPOOL
4. ... VIA SELECTION-SCREEN
5. ... AND RETURN
6. ... EXPORTING LIST TO MEMORY
7. ... USER user VIA JOB job NUMBER n
8. ... Various additions for parameter transfer to rep
9. ... USING SELECTION-SETS OF PROGRAM prog
Effect
Calls the report rep . Leaves the active program and starts the new report rep .
Addition 1
... LINE-SIZE col
Effect
Prints the report with the line width col .
Addition 2
... LINE-COUNT lin
Effect
Prints the report with lin lines (per page).
Addition 4
... VIA SELECTION-SCREEN
Effect
Displays the selection screen for the user. In this case, the selection screen is redisplayed after return from the report list display - the user's entries are retained.
Addition 5
... AND RETURN
Effect
Returns to the calling transaction or program after the called program has been executed. SUBMIT ... AND RETURN creates a new internal mode .
Addition 6
... EXPORTING LIST TO MEMORY
Effect
Does not display the output list of the called report, but saves it in SAP memory and leaves the called report immediately. Since the calling program can read the list from memory and process it further, you need to use the addition ... AND RETURN . Also, since the called report cannot be requested for printing, the addition ... TO SAP-SPOOL is not allowed here. You can read the saved list from SAP memory with the function module 'LIST_FROM_MEMORY' and then (for example) store it in the database with EXPORT . You can process this list further with the function modules 'WRITE_LIST' , 'DISPLAY_LIST' ... of the function group "SLST" .
Addition 7
... USER user VIA JOB job NUMBER n
Effect
Schedules the specified report in the job specified by the job name job and the job number n . The job runs under the user name user and you can omit the addition USER user . The assignment of the job number occurs via the function module JOB_OPEN (see also the documentation for the function modules JOB_CLOSE and JOB_SUBMIT . This addition can only be used with the addition ...AND RETURN .
Note
When scheduling a report with the SUBMIT ... VIA JOB job NUMBER n statement, you should always use the addition ...TO SAP-SPOOL to pass print and/or archive parameters. Otherwise, default values are used to generate the list and this disturbs operations in a production environment.
Addition 9
... USING SELECTION-SETS OF PROGRAM prog
Effect
Uses variants of the program prog when executing the program rep .
Note
Important
The programs prog and rep must have the same SELECT-OPTIONS and PARAMETER s. Otherwise, variants of the program prog may be destroyed.
Note
When using this addition, the specified variant vari of the program prog is taken in USING SELECTION-SET vari . On the other hand, all variant-related actions on the selection screen of rep (Get , Save as variant , Display , Delete ) refer to the variants of prog .
Example
SUBMIT REPORT01
VIA SELECTION-SCREEN
USING SELECTION-SET 'VARIANT1'
USING SELECTION-SETS OF PROGRAM 'REPORT00'
AND RETURN.
Effect
Executes the program REPORT01 with the variant VARIANT1 of the program REPORT00 .
Note
Runtime errors
LOAD_PROGRAM_NOT_FOUND : The specified program was not found.
SUBMIT_WRONG_TYPE : The specified program is not a report.
SUBMIT_IMPORT_ONLY_PARAMETER : Only one value passed to a report parameter.
SUBMIT_WRONG_SIGN : Invalid value passed to a selection with the addition SIGN .
SUBMIT_IN_ITAB_ILL_STRUCTURE : Table passed to a selection with WITH sel IN itab had an unexpected structure.
Try with this Example
Data: listobject like abaplist occurs 1 with header line.
CALL FUNCTION 'LIST_FROM_MEMORY'
TABLES
listobject = listobject
EXCEPTIONS
OTHERS = 1 .
IF sy-subrc <> 0.
message ID '61' TYPE 'E' NUMBER '731'
with 'LIST_FROM_MEMORY'.
ENDIF.
Thanks & regards
Sreenivasulu P -
Duplicate value in export file
Hi,
I have a sql report where I have implemented download to excel using the print attribute. When I export the report into Excel, there are few columns whose values getting duplicated in the spreadsheet where as those column values are blank in the report.
for example.
Query:
select col1 col2 col3 col4 from table1;
The report displays the correct value for col1 col2 col3 col4 but in the export file value for col1, col2, col3 are correct but col4 is picking up the value of col3.
Any help? Thanks.
--ManishHi Scott,
Could you please have a look at it.
http://apex.oracle.com/pls/otn/f?p=47427:12
When you will click download_excel at the bottom of the page, the export file will show you the duplicate values for the column [G-L].
Thanks again for your help.
--Manish
Message was edited by:
Manish Jha -
hi,
i want to print distinct value
example data is given below :
Jv.No hl.no col1 col2 col3 col4 col5
1 a12 xx yy zz 11 21
b23 xx yy zz 11 21
actuallly i m not printig the hl.no in his report , for u r reference i will show to u
col1 to col 5 values printing based on the serial
jval , jserial two columns
i am writing the code in formula column
if jserial=1 then
print jval ( for that serial wat value is stored in the table that should return)
like upto serial 5 should print
col1 to col5 all the values are same only it should print distinct value
like this
Jv.No col1 col2 col3 col4 col5
1 xx yy zz 11 21
otherwise any one value is varrying as usaualawahtever is there that only print
Jv.No col1 col2 col3 col4 col5
1 xx yy zz 11 21
xx yy zz 154 21
need o/p like this :
Jv.No col1 col2 col3 col4 col5
1 xx yy zz 11 21
xx yy zz 154 21hi,
job no mblno carrier vsl voy lport dport
111 2000 misc hanjin 12E sl UK
misc hanjin 12E sl UK
job no & mbol no is one group
remainings values another group.
carrier , vsl , voy , lport,dport these values fetches from the column of JOB_DESC
data's strored in the table like this:
jobparent Job desc jobserial
1 misc 1
1 hanjin 2
1 12E 3
1 sl 4
1 UK 5
2 misc 1
2 hanjin 2
2 12E 3
2 sl 4
2 UK 5
i am writing the formula column in the datamodel of second group.
if jobserial = 1 then print the value of Misc in carrier , job_serial=2 then print the value of Hanjin into vsl column.
i need to avoid the duplicate value :
job no mblno carrier vsl voy lport dport
111 2000 misc hanjin 12E sl UK
misc hanjin 12E sl UK -- This line not required
suppose carrier,voy or any one value is different then i need to print all the data
job no mblno carrier vsl voy lport dport
111 2000 misc hanjin 12E sl UK
ABCc hanjin 34D sl UK -
Hi all
In one of my report I have duplicate values for Measure 2 = Measure1(2008+2009+2010)
Year-------Meausre1------Measure2
2008------ 10--------------60
2009------ 20--------------60
2010------ 30--------------60
Is it possible to only display 60 for 2008??
RegardsHi.
It's not clear enough to understand what's your criteria to suppress measure2.
So, I tried the similar, in Answers.
Group by:
TIMES.CALENDAR_MONTH_DESC
Measure1:
SALES.QUANTITY_SOLD
Measure2: Quantity sold calculated on year level
SUM(SALES.QUANTITY_SOLD by TIMES.CALENDAR_YEAR)
Measure2 suppressed: Quantity sold calculated on year level shown only in the first month of each year
CASE
WHEN RCOUNT(SALES.QUANTITY_SOLD BY TIMES.CALENDAR_YEAR)=1 THEN SUM(SALES.QUANTITY_SOLD BY TIMES.CALENDAR_YEAR)
ELSE NULL
END
So I would expect results:
Month Quantity sold Quantity sold year Quantity sold year (suppressed)
1999-01 10081747.00 10991779.00 *10991779.00*
1999-02 96488.00 10991779.00
1999-03 78508.00 10991779.00
1999-04 68016.00 10991779.00
1999-05 76852.00 10991779.00
2000-01 88540.00 930584.00 *930584.00*
2000-02 82436.00 930584.00
2000-03 77812.00 930584.00
2000-04 69924.00 930584.00
2000-05 80184.00 930584.00
Maybe this helps.
Regards,
Goran
http://108obiee.blogspot.com -
Hello,
is it possible to supress duplicate values in Oracle Report? like in sqlplus
BREAK ON DEPARTMENT_ID; would hide all duplicate values like mentioned in this doc
http://download.oracle.com/docs/cd/B19306_01/server.102/b14357/ch6.htm#sthref1249
Any such capability in Oracle Reports?
ThanksCreate a group with the fields you want to break on. In the datamodel, drag that column from the rectangular group-box onto the line which connects the rounded query box and the rectangle group-box.
-
Hash value and duplicate value
Hi,
1. I get hash value in my report for the fields which has zero value. So how can show zero value instead of hash value.
2. Then i do have duplicate values for few fields and for this duplicate value report is showing no value. And i want to display value of the fields even if there is dupliacte values.
How is this two options possible.
Regards,
RohiniHi Bhanu & Anil,
This BEx has taken away my peace from last few days. But iam enjoying with it.
Anyways.. here is the example
Shopping Cart no|Creation date|end date|start time|endtime
1000574 | 06/12/2005 | 06/14/2005 | 09:19:02 | 15:39:03
| 06/15/2005 | 06/21/2005 | 17:34:06 | 18:00:00
| | | 18:01:00 | 18:15:00
1000678 | # | # | # | #
Here u can see third record of SC 1000574 has same start date and end date thus that fileds remain blank.
And SC 1000678 is an example when fileds value is blank and it gives hash vaue
Regards,
Rohini
Maybe you are looking for
-
Folio download file size in Folio Producer possible to view?
Is there a way to see how large in MBs a folio is inside of Folio Producer without or before you actually download it to the iPad? Thanks.
-
How to add coordinate system SVY21(SRID: 3414) to Oracle Spatial 11g/12c
Can any one please help me for "How to add coordinate system SVY21(SRID: 3414, for Singapore) to Oracle Spatial 11g/12c'?
-
Import IP Prefix from Global Table into a VRF Table
Hello, Is it possible to import IP Prefix from Global Table into a VRF Table on ASR9001 with Version 4.3.0? Thanks. Regards, Eric
-
Calculate Pending Qty in Inventory?
Hi Experts, We are on R12 (12.1.3) DB 11gR1 Am not a Techical guy - need a help from you guyz .. Am trying to create a report using BI Publishera with below info:- Shipment Number, Purchase Order Number, Recieved Date, GRN NO (Reciept) , Location (Su
-
Validate license at Pre-chrome error
I downloaded the Photoshop CS5 trial and after the 30 days decided to buy it. I entered my software key just fine and the program would not open. So, I unistalled it and installed it again, and it still will not open. I downloaded the Adobe Support