Application Development 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: 

SELECT too lower

Former Member
0 Kudos
83

Hi all,

I try to make a SELECT on ODS with this following code.

Prodorder ID is contained in data_package, but ODS (MYODS) have this key : COMP_CODE, PRODORDER, OPERATION and WORKCENTER.

Consequently, PRODORDER is not the key of MYODS and the execution of SELECT is too lower.

How can I customize my SELECT ?

itb_tmp_dp[] = DATA_PACKAGE[].

SORT itb_tmp_dp BY PRODORDER.

DELETE ADJACENT DUPLICATES FROM itb_tmp_dp

COMPARING PRODORDER.

SELECT

PRODORDER

/BIC/LREDKZ

SCHEDSTART

SCHEDFINDT

ACTRELDATE

/BIC/LCHANTIER

/BIC/LADRNRA

FROM /BIC/AMYSODS00

UP TO 1 ROWS

INTO TABLE itb_1

FOR ALL ENTRIES IN itb_tmp_dp

WHERE PRODORDER = itb_tmp_dp-PRODORDER.

SORT itb_1 BY PRODORDER.

DELETE ADJACENT DUPLICATES FROM itb_1

COMPARING PRODORDER.

Thanks,

Rgds

Sébastien Bourg

2 REPLIES 2

Former Member
0 Kudos
34

HI,

Use the Funcation module to get the data rather than select statement.

Here is the code for your reference.

YPES:

BEGIN OF ET_LINE,

ZOCACTGRP(6) TYPE C,

ZOCTDLINX(8) TYPE C,

0FISCYEAR(4) TYPE N,

END OF ET_LINE,

ET_DATA TYPE ET_LINE.

DATA: TAB_ET TYPE STANDARD TABLE OF ET_LINE

WITH DEFAULT KEY INITIAL SIZE 10.

DATA: TAB_SFC TYPE rsdri_th_sfc.

DATA: REC_SFC TYPE rsdri_s_sfc.

*wHER YOU DEFINE WHAT CHARACT YOU WANT RETURNED.

REC_SFC-CHANM = 'ZOCACTGRP'.

INSERT REC_SFC INTO TABLE TAB_SFC.

REC_SFC-CHANM = 'ZOCTDLINX'.

INSERT REC_SFC INTO TABLE TAB_SFC.

REC_SFC-CHANM = '0FISCYEAR'.

INSERT REC_SFC INTO TABLE TAB_SFC.

  • WHAT KEY FIGURES YOU WANT RETURNED

DATA: TAB_SFK TYPE rsdri_th_sfK.

DATA: REC_SFK TYPE rsdri_s_sfK.

  • WHERE YOU SET THE PARAMETERS/FILTERS.

DATA: REC_RANGE TYPE rsdri_s_range.

DATA: TAB_RANGE TYPE rsdri_t_range.

CLEAR REC_RANGE.

REC_RANGE-chanm = 'ZOCACTGRP'.

REC_RANGE-sign = 'I'.

REC_RANGE-compop = 'EQ'.

REC_RANGE-low = '336001'.

APPEND REC_RANGE TO TAB_RANGE.

CLEAR REC_RANGE.

REC_RANGE-chanm = 'ZOCTDLINX'.

REC_RANGE-sign = 'I'.

REC_RANGE-compop = 'EQ'.

REC_RANGE-low = '0707992'.

APPEND REC_RANGE TO TAB_RANGE.

CLEAR REC_RANGE.

REC_RANGE-chanm = '0FISCYEAR'.

REC_RANGE-sign = 'I'.

REC_RANGE-compop = 'EQ'.

REC_RANGE-low = '2007'.

APPEND REC_RANGE TO TAB_RANGE.

DATA: LIN_COUNT TYPE I.

DATA: FIRST_CALL TYPE RS_BOOL.

FIRST_CALL = 'X'.

CALL FUNCTION 'RSDRI_INFOPROV_READ'

EXPORTING

I_INFOPROV = 'ZCBACTGRP'

I_TH_SFC = TAB_SFC

I_TH_SFK = TAB_SFK

I_T_RANGE = TAB_RANGE

  • I_TH_TABLESEL =

  • I_T_RTIME =

  • I_REFERENCE_DATE = SY-DATUM

  • I_ROLLUP_ONLY = RS_C_TRUE

  • I_T_REQUID =

  • I_SAVE_IN_TABLE = ' '

  • I_TABLENAME =

  • I_SAVE_IN_FILE = ' '

  • I_FILENAME =

  • I_PACKAGESIZE = 1000

  • I_MAXROWS = 0

  • I_AUTHORITY_CHECK = RSDRC_C_AUTHCHK-READ

  • I_CURRENCY_CONVERSION = 'X'

  • I_USE_DB_AGGREGATION = RS_C_TRUE

  • I_USE_AGGREGATES = RS_C_TRUE

  • I_READ_ODS_DELTA = RS_C_FALSE

  • I_CALLER = RSDRS_C_CALLER-RSDRI

  • I_DEBUG = RS_C_FALSE

  • I_CLEAR = RS_C_FALSE

IMPORTING

E_T_DATA = TAB_ET

  • E_END_OF_DATA =

  • E_AGGREGATE =

  • E_SPLIT_OCCURRED =

  • E_T_MSG =

CHANGING

C_FIRST_CALL = FIRST_CALL

  • EXCEPTIONS

  • ILLEGAL_INPUT = 1

  • ILLEGAL_INPUT_SFC = 2

  • ILLEGAL_INPUT_SFK = 3

  • ILLEGAL_INPUT_RANGE = 4

  • ILLEGAL_INPUT_TABLESEL = 5

  • NO_AUTHORIZATION = 6

  • ILLEGAL_DOWNLOAD = 7

  • ILLEGAL_TABLENAME = 8

  • TRANS_NO_WRITE_MODE = 9

  • INHERITED_ERROR = 10

  • X_MESSAGE = 11

  • OTHERS = 12

.

IF SY-SUBRC <> 0.

  • MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO

  • WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.

ENDIF.

Cheer's

Mahesh

Former Member
0 Kudos
34

Hi,

this FM is used to read infoprovider such as Cube or MultiCube. I don't want to use it, in order to read an ODS. FM result is same that my SQL query result and for each PRODORDER, this FM will select many lines in MYODS whereas I want just 1 line for each PRODORDER.

I try to change my SQL request with adding GROUP BY, or DISTINCT or UP TO 1 ROWS, in order to optimize request and obtain just 1 result line for each PRODORDER. But any solution speed up the execution of this SQL request.

Is there other SQL option in order to increase execution ?

Rgds,