Skip to Content
avatar image
Former Member

Infopackage selection option

Hi BW practioners,

I am looking for practical experience with special records selection in infopackages to solve 2 issues.

1- How to use other var type to get dynamic record selection on a specific criterias.

ie: have all records with File-AEDAT >= (todays'date - 365 days).

Should we use var type 5=free temporal selection, 6=ABAP routine or 7=OLAP Variable ?? What are the difference ?

2- Can we have an OR condition between to different selection criterias in an infopackage ?

By default an AND is assumed between different variables and a OR within the same variable (when having multiple lines.

I know i can simulate it in 2 runs but because our extractor enhancements is heavy, we would like to have the following selection in a single infopackage:

ie: File-AEDAT >= 2003-10-01 OR

File-ERDAT >= 2003-10-01

Any documentation on advanced feature in infopackages selection options is welcome or samples.

Regards

Marc

Add comment
10|10000 characters needed characters exceeded

  • Follow
  • Get RSS Feed

1 Answer

  • Jul 21, 2004 at 08:12 PM

    You can use a ABAP routine to derive te FROM and TO value. Wehn you select the type = 6 it will allow you to write the ABAP code.

    following is the code which I have written..

    data: l_idx like sy-tabix.

    *Calculating current and previous period for the Current Month cube.

    data Y. "Used only for debugging

    data: X like sy-datum.

    data : CURR_BUPER like T009B-POPER,

    CURR_GJHAR like T009B-BDATJ,

    CURR_PERIOD(10),

    PREV_BUPER like T009B-POPER,

    PREV_GJHAR like T009B-BDATJ,

    PREV_PERIOD(10) .

    X = SY-DATUM.

    CALL FUNCTION 'DATE_TO_PERIOD_CONVERT'

    EXPORTING

    I_DATE = X

    • I_MONMIT = 00

    I_PERIV = 'Z1'

    IMPORTING

    E_BUPER = CURR_BUPER

    E_GJAHR = CURR_GJHAR

    EXCEPTIONS

    INPUT_FALSE = 1

    T009_NOTFOUND = 2

    T009B_NOTFOUND = 3

    OTHERS = 4.

    Y = 1.

    *The following is used for debugging only. Use SM50 for debugging.

    • While Y = 1.

    • endwhile.

    IF SY-SUBRC <> 0.

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

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

    ENDIF.

    if CURR_BUPER = '001'."Includes 12/PY, 13/PY,14/PY,00/CY,01/CY

    PREV_BUPER = '012'.

    PREV_GJHAR = CURR_GJHAR - 1 .

    else.

    PREV_BUPER = CURR_BUPER - 1.

    PREV_GJHAR = CURR_GJHAR.

    endif.

    concatenate CURR_GJHAR CURR_BUPER into CURR_PERIOD .

    concatenate PREV_GJHAR PREV_BUPER into PREV_PERIOD .

    read table l_t_range with key

    fieldname = 'FISCPER'.

    l_idx = sy-tabix.

    *....

    l_t_range-low = PREV_PERIOD .

    l_t_range-high = CURR_PERIOD .

    l_t_range-sign = 'I'.

    l_t_range-option = 'BT'.

    modify l_t_range index l_idx.

    p_subrc = 0.

    $$ end of routine - insert your code only before this line -

    endform.

    Add comment
    10|10000 characters needed characters exceeded