Selection conditions in a Query

Hi All,
I have two selections on my selection screen of the query like, Document Type and Debit/Credit Ind.
I we select Doc Ty = 'AB' then D/C Ind should be Debit and for all the other Doc types this should be credit or blank.
Can anyone please advise if this is doable. I was trying to get this using Custom exit variable but in vain.
Thank you

Hi PVK,
You are right the conditions are for Key figures, as teh conditions allow you to filter data based on values in the form of Top N, bottom N, greater than, less than and so on.
You cannot do these operations on Characteristic values.
If you want to use characteristic values in the conditions, I would suggest creating a Restricted Key figure(RKF) based on a characteristic value and then using the RKF in the condition.
Hope it helps.
Cheers
Anurag
Create a condition

Similar Messages

  • Adhoc Query : Error during selection; check the selection conditions

    Hi
    We have a report set-up and which we want to run using our adhoc query report tcode S_PH0_48000513
    The report, has a few different selection criteria in it to look at all action IT screen data in the system for ee's in specific personnel areas. There is also a criteria to allow us to paste in specific employee numbers we are interested in. The issue I am facing is that over about 3000 ids, the system automatically returns me a message when I click on the Output button to run the report which states:
    Error during selection; check the selection conditions
    Message no. PAIS206
    I am not sure why this is happening. The selection criteria are fine and the other day I ran the report and I experienced no issues. The report ran successfully. Now though, if I try and paste in all the ids I am interested in (about 8000) I get this message straightaway.
    Can anything be done to overcome this issue?
    Any advice would be much appreciated.
    Nicola

    Hi
    The message in full is:
    Error during selection; check the selection conditions
    Message no. PAIS206
    Diagnosis
    A runtime error occurred during dynamic selection.
    System response
    The runtime error will be caught; no short dump will be created. This error should not occur as a rule. However, very large select statements may trigger the runtime error SAPSQL_STMNT_TOO_LARGE or DBIF_RSQL_INVALID_RSQL. There is no way to prevent this happening. In this case, the error can only be caught.
    Procedure
    Check the selection conditions to see whether the error was caused because the option "Import from text file" included too many objects in the "Multiple selection" dialog. If this is so, you must limit the number of individual values.

  • I need use conditions in the select fields of a query.

    Hello,
    Is possible, that I can have conditions in the select fields of a query? In a invoice when the type is cancellation I want to put *-1 to price and if is other type the price is normally.
    If VBRK.FKART = 'S1' THEN KWERT*-1 else KWERT .
    Thank you very much.

    you can do two things:
    1. select the data into internal table and loop through the internal table and do the necessary changes
    SELECT fkart kwert
    FROM vbrk
    INTO TABLE itab
    WHERE ...
    LOOP AT itab.
    IF itab-fkart EQ 'S1'.
    itab-kwert = itab-kwert * -1 .
    MODIFY itab.
    ENDIF.
    ENDLOOP.
    2. use select-endselect and change the data acc. to your needs inbetween and append the internal table.
    SELECT fkart kwert
    FROM vbrk
    INTO wa
    WHERE ...
    IF wa-fkart EQ 'S1'.
    wa-kwert = wa-kwert * -1 .
    ENDIF.
    APPEND wa TO itab.
    ENDSELECT.
    (The first approach is probably faster.)

  • How to transfer Query selection conditions to Virtualprovider?

    Hi,
    I am using a virtualProvider with DTP for a query. The virtualprovider data comes from an infocube. I want to manipulate some fields based on the selection conditions given as user entry during the query execution as I have to read a few master data infoobjects.
    How and where do i get the user input given in query in the virtualprovider transformation routines?
    Regards,
    Sujai

    Hi Eric,
    Exporting to memory is a method i thought of, but i am assuming there should be a method other than that to do it. I found this doc in the forum:
    [http://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/f05d0b81-076a-2c10-44ab-f00b0b90ce38?quicklink=index&overridelayout=true]
    It explains how the issue could be resolved using the Expert routine. But now i am having a different problem.
    The calculations are done at the record level based on some criteria, I would like to know how to get the internal table which stores the selected records from the source on which i could do my calculations in the virtual provider.
    Regards,
    Sujai

  • Query on resource selection condition

    Hi All
    I have a process order with a operation having a resource selection condition.In the classification of the master recipe i have entered the resource name(as characteristic value) as X whereas the name of the resource where the operation is to take place is A and in the classification of the resource A i have enter the characteristic value as "A".
    Now is it possible to release the process order without getting the error message :"Resource in operation does not satisfy resource selection condition".
    please advice.

    Hy,
    Kindly go through below link it might be give some inputs if some data is missing in your condition.
    [http://help.sap.com/erp2005_ehp_03/helpdata/EN/89/a42678461e11d182b50000e829fbfe/frameset.htm]
    Regards,
    Dhaval

  • Options in Assignment of Condition in BEX Query Designer

    Hi Experts,
      I am trying to define a condition in BEX Query Designer.
    I defined my condition and bit confused with Characterstic Assignment
    What Happens if is select 9What is the difference)
    1) All Characterstic in the Drilldown Independtly
    2)Most Detailed  Characterstic Along the Rows
    3)Most Detailed Characterstic Along Columns and
    4)Individual Chars and Chars.Combinations
    Thanks

    hi,
    chk the link
    Query creation
    http://help.sap.com/saphelp_nw70/helpdata/EN/f1/0a5625e09411d2acb90000e829fbfe/content.htm
    http://help.sap.com/saphelp_nw70/helpdata/EN/42/d21c1f46076bb2e10000000a1553f6/content.htm
    Ramesh

  • Problem with Conditions in a Query

    Hello All,
                 I have the following Condition in My Query.
    Applied Amount Equals to 0.   When I run the Query I receive a message 'No Records Exists with the given conditions'.   But when I remove the condition and place 'Applied Amount' in the Columns Section I see there are numerous records that Have 'Applied Amount' as 0.   What might be the problem?
    Thanks

    Hi,
    Check out the zero suppression in your BEx analyser and also make sure that when you have defined conditions then you have to select only Applied Amount Charecteristic rather than all the charecteristics.
    Hope tis helps...
    Assign points if it helps..
    Thanks,
    Gattu.

  • How to add join conditions in ABAP Query.

    Hi,
    I need a help on "ABAP Query".
    How to add join conditions in ABAP Query.
    Thanks in advance.
    Thanks & Regards,
    Ramana

    Hi,
    See below code,
    *& Report  ZRNP_ALV_SO
    REPORT  zrnp_alv_so MESSAGE-ID z7rnp .
    INCLUDE zrnp_include .
    *SELECTION SCREEN                                                      *
    SELECTION-SCREEN BEGIN OF BLOCK blk1 WITH FRAME TITLE text-004 .
    SELECT-OPTIONS: s_vbeln FOR vbak-vbeln ,
                    s_auart FOR v_auart ,
                    s_vkorg FOR v_vkorg ,
                    s_spart FOR v_spart ,
                    s_kunnr FOR v_kunnr ,
                    s_matnr FOR v_matnr .
    SELECTION-SCREEN END OF BLOCK blk1 .
    *AT SELECTION SCREEN                                                   *
    AT SELECTION-SCREEN.
      SELECT SINGLE vbeln
                     FROM vbak INTO vbak-vbeln
                     WHERE vbeln IN s_vbeln.
      IF sy-subrc <> 0.
        MESSAGE e202.
      ENDIF.
    *START OF SELECTION                                                    *
    START-OF-SELECTION .
      PERFORM data_select.
      PERFORM t_sort USING i_sort .
      PERFORM event_cat USING i_event .
      PERFORM fld_cat USING i_fldcat[] .
      PERFORM t_layout USING i_layout .
      PERFORM fld_cat2 USING i_fldcat2[] .
      PERFORM call_alv.
    * DATA SELECT                                                          *
    *&      Form  DATA_SELECT
    *       text
    *  -->  p1        text
    *  <--  p2        text
    FORM data_select .
      REFRESH: it_vbfa, it_so1, it_del_ful ,it_del1 .
      BREAK-POINT.
      *SELECT*
            *a~vbeln*
            *a~auart*
            *a~vkorg*
            *a~spart*
            *a~kunnr*
            *b~posnr*
            *b~matnr*
            *c~maktx*
            *b~kwmeng*
            *b~vrkme*
            *INTO TABLE it_so1 FROM vbak AS a*
                  *INNER JOIN vbap AS b ON b~vbeln = a~vbeln*
                  *INNER JOIN makt AS c ON c~matnr = b~matnr*
                  *AND c~spras = sy-langu*
                  *WHERE a~vbeln IN s_vbeln .*
      IF sy-subrc = 0.
        SORT it_so1 BY vbeln.
        DELETE ADJACENT DUPLICATES FROM it_so1.
      ENDIF.
    * COLURING DISPLAY                                                     *
      DATA: ld_color(1) TYPE  c .
    *  LOOP AT it_so1 INTO wa_so.
    * Populate color variable with colour properties
    * Char 1 = C (This is a color property)
    * Char 2 = 3 (Color codes: 1 - 7)
    * Char 3 = Intensified on/off ( 1 or 0 )
    * Char 4 = Inverse display on/off ( 1 or 0 )
    *           i.e. wa_ekko-line_color = 'C410'
    *    ld_color = ld_color + 1.
    * Only 7 colours so need to reset color value
    *    IF ld_color = 8.
    *      ld_color = 1.
    *    ENDIF.
    *    CONCATENATE 'C' ld_color '10' INTO wa_so-line_color.
    **  wa_ekko-line_color = 'C410'.
    *    MODIFY it_so1 FROM wa_so.
    *  ENDLOOP .
    *  IF sy-subrc = 0.
      IF NOT it_so1[] IS INITIAL.
        SELECT vbelv
               posnv
               vbeln
               posnn
               vbtyp_n
               INTO TABLE it_vbfa
               FROM vbfa
               FOR ALL ENTRIES IN it_so1
               WHERE vbelv = it_so1-vbeln
               AND   posnn = it_so1-posnr
               AND vbtyp_n ='J' .
        IF sy-subrc = 0.
          SELECT vbeln
                 posnr
                 matnr
                 werks
                 lgort
                 charg
                 lfimg
                 vrkme
                 FROM lips INTO TABLE it_del_ful
                 FOR ALL ENTRIES IN it_vbfa
                 WHERE vbeln = it_vbfa-vbeln
                 AND   posnr = it_vbfa-posnn.
        ENDIF.
      ENDIF.
    ENDFORM.                    " DATA_SELECT
    **************** EVENT CATALOG ****************************************
    *&      Form  EVENT_CAT
    *       text
    *      -->P_I_EVENT  text
    FORM event_cat  USING    p_i_event TYPE slis_t_event .
      REFRESH p_i_event .
      CALL FUNCTION 'REUSE_ALV_EVENTS_GET'
    * EXPORTING
    *   I_LIST_TYPE           = 0
       IMPORTING
          et_events             = p_i_event
    * EXCEPTIONS
    *   LIST_TYPE_WRONG       = 1
    *   OTHERS                = 2
    *  IF sy-subrc <> 0.
    ** MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
    **         WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    *  ENDIF.
      READ TABLE p_i_event WITH KEY name = slis_ev_top_of_page INTO t_event.
      IF sy-subrc = 0.
        MOVE 'TOP_OF_PAGE' TO t_event-form.
        MODIFY p_i_event FROM t_event INDEX sy-tabix TRANSPORTING form.
      ENDIF.
      CLEAR t_event .
    ENDFORM.                    " EVENT_CAT
    **********FORM FOR EVENT TOP_OF_PAGE**********************************
    FORM top_of_page .
      REFRESH i_listheader.
      DATA: t_header TYPE slis_listheader.
      DATA: v_text(50).
      WRITE sy-datum TO v_text.
      CLEAR t_header.
      t_header-typ = 'S'.
      t_header-key = "Date".
      t_header-info = v_text.
      APPEND t_header TO i_listheader.
      CLEAR t_header.
      CLEAR v_text.
      WRITE:  'SALES ORDER & DELIVERY DETAILS REPORT  ' TO v_text .
      t_header-typ = 'S'.
      t_header-key = 'TITLE'.
      t_header-info = v_text.
      APPEND t_header TO i_listheader.
      CALL FUNCTION 'REUSE_ALV_COMMENTARY_WRITE'
        EXPORTING
          it_list_commentary = i_listheader.
    *      I_LOGO             = 'ALV_BACKGROUND'.
    *   I_END_OF_LIST_GRID       =
    ENDFORM.                    "TOP_OF_PAGE
    ********  FIRST ALV GRID DISPLAY ***************************************
    FORM call_alv .
    * FORM TO MAKE THE CELL CONTENTS INVISIBLE.
    * PERFORM INVISIBLE_CELL_CONTENTS. *
    *EXCLUDE-DECLARATION.
      CLEAR wa_exclude.
      wa_exclude-fcode = '&VEXCEL'.
      APPEND wa_exclude TO i_exclude.
    *&      Form  CALL_ALV
    *       text
    *  -->  p1        text
    *  <--  p2        text
      CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
       EXPORTING
         i_callback_program                = sy-repid
    *    I_CALLBACK_PF_STATUS_SET          = 'SET_PF_STATUS'
         i_callback_user_command           = 'USER_COMMAND1'
         i_callback_top_of_page            = 'TOP_OF_PAGE'
         i_background_id                   = 'ALV_BACKGROUND'
         is_layout                         = i_layout
         it_fieldcat                       = i_fldcat[]
         it_excluding                      = i_exclude
         it_sort                           = i_sort
         it_events                         = i_event
        TABLES
         t_outtab                          = it_so1
    *  IF sy-subrc <> 0.
    ** MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
    **         WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    *  ENDIF.
    ENDFORM.                    " CALL_ALV
    ************** FIRST FIELDCATALOG *************************************
    *&      Form  FLD_CAT
    *       text
    *      -->P_I_FLDCAT[]  text
    FORM fld_cat  USING    p_i_fldcat TYPE slis_t_fieldcat_alv.
      CLEAR i_fldcat.
      i_fldcat-fieldname   = 'VBELN'. "FIELD FOR WHICH CATALOG ID FILLED
      i_fldcat-tabname     = 'IT_SO1'."TABLE NAME
      i_fldcat-seltext_m   = 'SALES ORDER NO.'.
      i_fldcat-col_pos     = 1.        " POSITION OF THE COLUMN.
      i_fldcat-outputlen   = 20.       " SET THE OUTPUT LENGTH.
      i_fldcat-emphasize   = 'X'.      " COLOR OF THIS COLUMN.
      i_fldcat-key         = 'X'.      " SO THAT THIS FIELD IS NOT
      "SCROLLABLE AND HIDDABLE.
      i_fldcat-hotspot     = 'X'.
      i_fldcat-just(1)     = 'C'.
      APPEND i_fldcat.
      CLEAR i_fldcat.
      i_fldcat-fieldname   = 'AUART'. "FIELD FOR WHICH CATALOG ID FILLED
      i_fldcat-tabname     = 'IT_SO1'."TABLE NAME
      i_fldcat-seltext_m   = 'SALES DOC. TYPE'.
      i_fldcat-col_pos     = 2.        " POSITION OF THE COLUMN.
      i_fldcat-outputlen   = 15.       " SET THE OUTPUT LENGTH.
      i_fldcat-emphasize   = 'X'.      " COLOR OF THIS COLUMN.
      i_fldcat-key         = 'X'.      " SO THAT THIS FIELD IS NOT
      "SCROLLABLE AND HIDDABLE.
      i_fldcat-just(1)     = 'C'.
      APPEND i_fldcat.
      CLEAR i_fldcat.
      i_fldcat-fieldname   = 'VKORG'. "FIELD FOR WHICH CATALOG ID FILLED
      i_fldcat-tabname     = 'IT_SO1'.
      i_fldcat-seltext_m   = 'SALES ORG.'.
      i_fldcat-col_pos     = 3.        " POSITION OF THE COLUMN.
      i_fldcat-outputlen   = 12.       " SET THE OUTPUT LENGTH.
      i_fldcat-emphasize   = 'X'.      " COLOR OF THIS COLUMN.
      i_fldcat-key         = 'X'.      " SO THAT THIS FIELD IS NOT
      "SCROLLABLE AND HIDDABLE.
      i_fldcat-just(1)     = 'C'.
      APPEND i_fldcat.
      CLEAR i_fldcat.
      i_fldcat-fieldname   = 'SPART'. "FIELD FOR WHICH CATALOG ID FILLED
      i_fldcat-tabname     = 'IT_SO1'.
      i_fldcat-seltext_m   = 'DIVISION'.
      i_fldcat-col_pos     = 4.        " POSITION OF THE COLUMN.
      i_fldcat-outputlen   = 10.       " SET THE OUTPUT LENGTH.
      i_fldcat-emphasize   = 'X'.      " COLOR OF THIS COLUMN.
      i_fldcat-key         = 'X'.      " SO THAT THIS FIELD IS NOT
      "SCROLLABLE AND HIDDABLE.
      i_fldcat-just(1)     = 'C'.
      APPEND i_fldcat.
      CLEAR i_fldcat.
      i_fldcat-fieldname   = 'KUNNR'. "FIELD FOR WHICH CATALOG ID FILLED
      i_fldcat-tabname     = 'IT_SO1'.
      i_fldcat-seltext_m   = 'SOLD TO PARTY'.
      i_fldcat-col_pos     = 5.        " POSITION OF THE COLUMN.
      i_fldcat-outputlen   = 15.       " SET THE OUTPUT LENGTH.
      i_fldcat-emphasize   = 'X'.      " COLOR OF THIS COLUMN.
      i_fldcat-key         = 'X'.      " SO THAT THIS FIELD IS NOT
      "SCROLLABLE AND HIDDABLE.
      i_fldcat-just(1)     = 'C'.
      APPEND i_fldcat.
      CLEAR i_fldcat.
      i_fldcat-fieldname   = 'POSNR'. "FIELD FOR WHICH CATALOG ID FILLED
      i_fldcat-tabname     = 'IT_SO1'.
      i_fldcat-seltext_m   = 'SALES DOC. ITEM'.
      i_fldcat-col_pos     = 6.        " POSITION OF THE COLUMN.
      i_fldcat-outputlen   = 17.       " SET THE OUTPUT LENGTH.
      i_fldcat-emphasize   = 'X'.      " COLOR OF THIS COLUMN.
      i_fldcat-key         = 'X'.      " SO THAT THIS FIELD IS NOT
      "SCROLLABLE AND HIDDABLE.
      i_fldcat-just(1)     = 'C'.
      APPEND i_fldcat.
      CLEAR i_fldcat.
      i_fldcat-fieldname   = 'MATNR'. "FIELD FOR WHICH CATALOG ID FILLED
      i_fldcat-tabname     = 'IT_SO1'.
      i_fldcat-seltext_m   = 'MATERIAL NO.'.
      i_fldcat-col_pos     = 7.        " POSITION OF THE COLUMN.
      i_fldcat-outputlen   = 20.       " SET THE OUTPUT LENGTH.
      i_fldcat-emphasize   = 'X'.      " COLOR OF THIS COLUMN.
      i_fldcat-key         = 'X'.      " SO THAT THIS FIELD IS NOT
      "SCROLLABLE AND HIDDABLE.
      i_fldcat-just(1)     = 'C'.
      APPEND i_fldcat.
      CLEAR i_fldcat.
      i_fldcat-fieldname   = 'MAKTX'. "FIELD FOR WHICH CATALOG ID FILLED
      i_fldcat-tabname     = 'IT_SO1'.
      i_fldcat-seltext_m   = 'DESCRIPTION'.
      i_fldcat-col_pos     = 8.        " POSITION OF THE COLUMN.
      i_fldcat-outputlen   = 20.       " SET THE OUTPUT LENGTH.
      i_fldcat-emphasize   = 'X'.      " COLOR OF THIS COLUMN.
      i_fldcat-key         = 'X'.      " SO THAT THIS FIELD IS NOT
      "SCROLLABLE AND HIDDABLE.
      i_fldcat-just(1)     = 'C'.
      APPEND i_fldcat.
      CLEAR i_fldcat.
      i_fldcat-fieldname   = 'KWMENG'. "FIELD FOR WHICH CATALOG ID FILLED
      i_fldcat-tabname     = 'IT_SO1'.
      i_fldcat-seltext_m   = 'QUANTITY'.
      i_fldcat-col_pos     = 9.        " POSITION OF THE COLUMN.
      i_fldcat-outputlen   = 15.       " SET THE OUTPUT LENGTH.
      i_fldcat-emphasize   = 'X'.      " COLOR OF THIS COLUMN.
      i_fldcat-key         = 'X'.      " SO THAT THIS FIELD IS NOT
      "SCROLLABLE AND HIDDABLE.
      i_fldcat-do_sum    = 'X'.        " For doing "SUM"
      i_fldcat-just(1)     = 'C'.
      APPEND i_fldcat.
      CLEAR i_fldcat.
      i_fldcat-fieldname   = 'VRKME'. "FIELD FOR WHICH CATALOG ID FILLED
      i_fldcat-tabname     = 'IT_SO1'.
      i_fldcat-seltext_m   = 'SALES UNIT'.
      i_fldcat-col_pos     = 10.       " POSITION OF THE COLUMN.
      i_fldcat-outputlen   = 10.       " SET THE OUTPUT LENGTH.
      i_fldcat-emphasize   = 'X'.      " COLOR OF THIS COLUMN.
      i_fldcat-key         = 'X'.      " SO THAT THIS FIELD IS NOT
      "SCROLLABLE AND HIDDABLE.
      i_fldcat-just(1)     = 'C'.
      APPEND i_fldcat.
    ENDFORM.                    " FLD_CAT
    ****************** ALV SORTING  ***************************************
    *&      Form  SORT
    *       text
    *      -->P_I_SORT  text
    FORM t_sort  USING    p_i_sort TYPE slis_t_sortinfo_alv .
      DATA: i_sort TYPE slis_sortinfo_alv .
      REFRESH p_i_sort .
      CLEAR i_sort.
      i_sort-spos = 1.
      i_sort-tabname = 'IT_SO1'.
      i_sort-fieldname = 'VBELN'.
      i_sort-up = 'X'.
      i_sort-subtot = 'X'.
      i_sort-group = '*'.
      APPEND i_sort TO p_i_sort.
    ENDFORM.                    " SORT
    *FORM SET_PF_STATUS USING rt_extab TYPE slis_t_extab.
    *  SET PF-STATUS 'ZSTANDARD'.
    *ENDFORM. "Set_pf_status
    ***********FORM FOR EVENT USER_COMMAND1********************************
    FORM user_command1 USING r_ucomm LIKE sy-ucomm
                             rs_selfield TYPE slis_selfield.
    *CASE R_UCOMM .
    *    WHEN '&IC1' .
    *    IF rs_selfield-FIELDNAME = 'VBELN' .
    *    ENDIF .
    * WHEN OTHERS .
    * ENDCASE .
      CLEAR wa_so.
      REFRESH: it_del1 .
      IF r_ucomm = '&IC1' AND rs_selfield-fieldname = 'VBELN' AND
      rs_selfield-value IS NOT INITIAL.
        READ TABLE it_so1 INTO wa_so INDEX rs_selfield-tabindex.
        IF sy-subrc = 0.
          LOOP AT it_vbfa INTO wa_vbfa WHERE vbelv = wa_so-vbeln
                                       AND   posnv = wa_so-posnr.
            READ TABLE it_del_ful INTO wa_it_del_ful
                 WITH KEY vbeln = wa_vbfa-vbelv
                          posnr = wa_vbfa-posnn.
            IF sy-subrc = 0.
              CLEAR wa_del.
              MOVE wa_it_del_ful TO wa_del.
              APPEND wa_del TO it_del1.
            ENDIF.
          ENDLOOP.
        ENDIF.
      ENDIF.
    ********* SECOND ALV GRID DISPLAY ***********************************
      CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
       EXPORTING
        i_callback_program                = sy-repid
    *   I_CALLBACK_PF_STATUS_SET          = 'SET_PF_STATUS'
        i_callback_user_command           = 'USER_COMMAND2'
        i_callback_top_of_page            = 'TOP_OF_PAGE'
        i_background_id                   = 'ALV_BACKGROUND'
        it_fieldcat                       = i_fldcat2[]
        it_sort                           = i_sort
        TABLES
        t_outtab                          = it_del_ful
    *  IF sy-subrc <> 0.
    ** MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
    **         WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    *  ENDIF.
    ENDFORM .                    "USER_COMMAND1
    ********** FORM FOR EVENT USER_COMMAND 2 ******************************
    FORM user_command2 USING r_ucomm LIKE sy-ucomm
                             rs_selfield TYPE slis_selfield.
      CLEAR wa_so.
      REFRESH: it_del1 .
      IF r_ucomm = '&IC1' AND rs_selfield-fieldname = 'VBELN' AND
      rs_selfield-value IS NOT INITIAL.
        READ TABLE it_so1 INTO wa_so INDEX rs_selfield-tabindex.
    *    IF SY-SUBRC = 0.
    *       LOOP AT it_vbfa INTO wa_vbfa WHERE vbelv = WA_SO-vbeln
    *                                    AND   posnv = WA_SO-posnr.
        READ TABLE it_del_ful INTO wa_it_del_ful
             WITH KEY vbeln = rs_selfield-value
                     " vbeln = wa_vbfa-vbeln
                      posnr = wa_vbfa-posnn.
        IF rs_selfield-fieldname = 'VBELN'.
          SET PARAMETER ID 'VL' FIELD wa_vbfa-vbeln .
          CALL TRANSACTION 'VL03' AND SKIP FIRST SCREEN.
        ENDIF .
    *       ENDLOOP.
    *    ENDIF.
      ENDIF.
    ENDFORM .                    "USER_COMMAND2
    ********* SECOND FIELDCATALOG ******************************************
    *&      Form  FLD_CAT2
    *       text
    *      -->P_I_FLDCAT2[]  text
    FORM fld_cat2  USING    p_i_fldcat2 TYPE slis_t_fieldcat_alv .
      CLEAR i_fldcat2.
      i_fldcat2-fieldname   = 'VBELN'. "FIELD FOR WHICH CATALOG ID FILLED
      i_fldcat2-tabname     = 'IT_DEL_FUL'."TABLE NAME
      i_fldcat2-seltext_m   = 'DELIVERY NO.'.
      i_fldcat2-col_pos     = 1.        " POSITION OF THE COLUMN.
      i_fldcat2-outputlen   = 20.       " SET THE OUTPUT LENGTH.
      i_fldcat2-emphasize   = 'X'.      " COLOR OF THIS COLUMN.
      i_fldcat2-key         = 'X'.      " SO THAT THIS FIELD IS NOT
      "SCROLLABLE AND HIDDABLE.
      i_fldcat2-hotspot     = 'X'.
      i_fldcat2-just(1)     = 'C'.
      APPEND i_fldcat2.
      CLEAR i_fldcat2.
      i_fldcat2-fieldname   = 'POSNR'. "FIELD FOR WHICH CATALOG ID FILLED
      i_fldcat2-seltext_m   = 'DELIVERY ITEM'.
      i_fldcat2-col_pos     = 2.        " POSITION OF THE COLUMN.
      i_fldcat2-outputlen   = 20.       " SET THE OUTPUT LENGTH.
      i_fldcat2-emphasize   = 'X'.      " COLOR OF THIS COLUMN.
      i_fldcat2-key         = 'X'.      " SO THAT THIS FIELD IS NOT
      "SCROLLABLE AND HIDDABLE.
      i_fldcat2-just(1)     = 'C'.
      APPEND i_fldcat2.
      CLEAR i_fldcat2.
      i_fldcat2-fieldname   = 'MATNR'. "FIELD FOR WHICH CATALOG ID FILLED
      i_fldcat2-seltext_m   = 'MATERIAL NO.'.
      i_fldcat2-col_pos     = 3.        " POSITION OF THE COLUMN.
      i_fldcat2-outputlen   = 20.       " SET THE OUTPUT LENGTH.
      i_fldcat2-emphasize   = 'X'.      " COLOR OF THIS COLUMN.
      i_fldcat2-key         = 'X'.      " SO THAT THIS FIELD IS NOT
      "SCROLLABLE AND HIDDABLE.
      i_fldcat2-just(1)     = 'C'.
      APPEND i_fldcat2.
      CLEAR i_fldcat2.
      i_fldcat2-fieldname   = 'WERKS'. "FIELD FOR WHICH CATALOG ID FILLED
      i_fldcat2-seltext_m   = 'PLANT.'.
      i_fldcat2-col_pos     = 4.        " POSITION OF THE COLUMN.
      i_fldcat2-outputlen   = 20.       " SET THE OUTPUT LENGTH.
      i_fldcat2-emphasize   = 'X'.      " COLOR OF THIS COLUMN.
      i_fldcat2-key         = 'X'.      " SO THAT THIS FIELD IS NOT
      "SCROLLABLE AND HIDDABLE.
      i_fldcat2-just(1)     = 'C'.
      APPEND i_fldcat2.
      CLEAR i_fldcat2.
      i_fldcat2-fieldname   = 'LGORT'. "FIELD FOR WHICH CATALOG ID FILLED
      i_fldcat2-seltext_m   = 'ST. LOCATION'.
      i_fldcat2-col_pos     = 5.        " POSITION OF THE COLUMN.
      i_fldcat2-outputlen   = 20.       " SET THE OUTPUT LENGTH.
      i_fldcat2-emphasize   = 'X'.      " COLOR OF THIS COLUMN.
      i_fldcat2-key         = 'X'.      " SO THAT THIS FIELD IS NOT
      "SCROLLABLE AND HIDDABLE.
      i_fldcat2-just(1)     = 'C'.
      APPEND i_fldcat2.
      CLEAR i_fldcat2.
      i_fldcat2-fieldname   = 'CHARG'. "FIELD FOR WHICH CATALOG ID FILLED
      i_fldcat2-seltext_m   = 'BATCH NO.'.
      i_fldcat2-col_pos     = 6.        " POSITION OF THE COLUMN.
      i_fldcat2-outputlen   = 20.       " SET THE OUTPUT LENGTH.
      i_fldcat2-emphasize   = 'X'.      " COLOR OF THIS COLUMN.
      i_fldcat2-key         = 'X'.      " SO THAT THIS FIELD IS NOT
      "SCROLLABLE AND HIDDABLE.
      i_fldcat2-just(1)     = 'C'.
      APPEND i_fldcat2.
      CLEAR i_fldcat2.
      i_fldcat2-fieldname   = 'LFIMG'. "FIELD FOR WHICH CATALOG ID FILLED
      i_fldcat2-seltext_m   = 'ACT. DEL. QTY.'.
      i_fldcat2-col_pos     = 7.        " POSITION OF THE COLUMN.
      i_fldcat2-outputlen   = 20.       " SET THE OUTPUT LENGTH.
      i_fldcat2-emphasize   = 'X'.      " COLOR OF THIS COLUMN.
      i_fldcat2-key         = 'X'.      " SO THAT THIS FIELD IS NOT
      "SCROLLABLE AND HIDDABLE.
      i_fldcat2-just(1)     = 'C'.
      APPEND i_fldcat2.
      CLEAR i_fldcat2.
      i_fldcat2-fieldname   = 'VRKME'. "FIELD FOR WHICH CATALOG ID FILLED
      i_fldcat2-seltext_m   = 'SALES UNIT.'.
      i_fldcat2-col_pos     = 8.        " POSITION OF THE COLUMN.
      i_fldcat2-outputlen   = 20.       " SET THE OUTPUT LENGTH.
      i_fldcat2-emphasize   = 'X'.      " COLOR OF THIS COLUMN.
      i_fldcat2-key         = 'X'.      " SO THAT THIS FIELD IS NOT
      "SCROLLABLE AND HIDDABLE.
      i_fldcat2-just(1)     = 'C'.
      APPEND i_fldcat2.
    ENDFORM.                                                    " FLD_CAT2
    ***************** ALV LAYOUT *******************************************
    *&      Form  LAYOUT
    *       text
    *      -->P_I_LAYOUT  text
    FORM t_layout  USING    p_i_layout TYPE slis_layout_alv .
      p_i_layout-zebra  = 'X'.
      p_i_layout-totals_text = 'GRAND TOTAL ='.
    *  p_i_layout-CONFIRMATION_PROMPT = 'X'.
    *  p_i_layout-DEF_STATUS  = ' '.
      p_i_layout-info_fieldname = 'LINE_COLOR'.
    ENDFORM.                    " LAYOUT

  • How to insert 2 conditions in a Query

    Hi ,
    How can i apply 2 conditions to a query
    First i need to apply a condition X to query and then i need to apply condition Y to the  results which are based on condition X
    How can i acheve this

    Hi
    We can create multiple condition in one query
    When ever u select condition on tab it shows two options Chenge condition and new condition
    If we have 2 comndition in one query it works with AND function .
    If we have all applicable condition in one condition then it works with OR functionality.
    Assign points

  • Conditions on a query

    Hello,
    I am working on BW3.5.
    Problem: When I create conditions on a query.I am not able see the check boxes for selecting the characteristics.
    Regards,
    Siva

    Hi,
    It could be anything your GUI version (upgrade that) or authorizations. Try on some other machine or some other user id and you should be able to figure it out.
    Regards
    Vikash

  • IU Elim. "No data found for processing using current selection conditions""

    Dear Experts,
    While Executing task of Interunit elimination  in Consolidation Montior  I am getting Message "No data found for processing using current selection conditions"
    Ex. is
    A)
    In Unit X
    GL (399999) Account     Dr. 65000 (Customer Recon. Ac.)   (with Trading Parter X)
    GL (499999) Rev.A/c           65000 (with Trading Parter X)
    In Unit Y
    GL (199999) Exp. A/c     Dr. 65000   (with Trading Parter Y)
    GL (299999).Account           65000 (Vendor Recon. Ac.) (with Trading Parter Y)
    B) GLs in info cube in 0FIGL_C01 are :-
    GL Account---CCode--Trading PartnerDebit--
    Credit
    199999--YY65000-----00000
    299999--YY00000-----65000
    399999--XX65000-----00000
    499999--XX00000-----65000
    In COnsolidation WorkBench
    1) I have created Document Type
    2) Method-
      In  General Tab
       a) Two SIded Selection
        b) Per Transaction Currency Selected
    In Selection Tab
    1St Selection
    GL Account = 299999 (Customer Recon. Account)
    Company    = X
    Trading Partner = X
    1St Selection
    GL Account = 399999 (Vendor Recon. Account)
    Company    = Y
    Trading Partner = Y
    Difference Tab
    a) Post Diff to "Unit from Selection 1"
    b) Key Figure "Period Value GC
    c) Check Limit Per Difference Row
    Other Differnce
    GL Account = 100099 (Other GL)
    Currencyce Diff
    GL Account = 100510 (Other GL)
    Question :-
    1) Is the posting is appropriate and does it attracts IU Elimination?
    2) The Infocube Details are correct?
    3) Any Config issue
    May any one suggest, Why Am I not able to get the data?
    Thanks
    Rakesh Shrivastav

    Dear Sir,
    Following are the View at my end in context to your suggestion
    1. check the BCS totals data to ensure trading partner is included.
    THis is the view of Source Info Cube 0FIGL_C01
    GL Account---CCode--Trading PartnerDebit--
    Credit
    199999--YY65000-----00000
    299999--YY00000-----65000
    399999--XX65000-----00000
    499999--XX00000-----65000
    2. Execute the task for the cons group that includes both cons units X and Y
    The COns Group Is XYZ
    X- Cons Unit
    Y- Cons Unit
    In Cons Monitor I am executing Test run at XYZ level
    3. Although the trading partner for cons unit X should be Y and vice versa, the elimination should still occur with the cons unit X and trading partner X records.
    Same as the query description
    4. make sure that the items 199999, 299999, 399999 and 499999 are included in the elimination method for either selection 1 or selection 2.
    The Method Selection Tab View is
    1St Selection
    GL Account = 299999,199999
    Company = Y
    TP = Y
    2Nd Selection
    GL Account = 399999,499999
    Company = X
    TP = X
    What is your View On That?

  • Selective (Conditional) export failing with ORA-00936: missing expression

    HI Experts,
    I was doing selective (Conditional) export of one table. But the export is failing with the following error.
    ORA-00936: missing expression
    I have been trying for the past 2 hours on this to resolve. But not.
    Could anybody please how can i export the data..
    Oracle Version : 10.2.0.5
    OS : SOLARIS 10 SPARC
    exp E3DAIUSR/E3DAIUSR@ORCL statistics=none file=exp_TABLE.dmp log=exp_Conditional.log TABLES=PGTB_IFDATA query=\'where CRE_DT=\''20120513\'
    The error is as follows
    ==============
    About to export specified tables via Conventional Path ...
    . . exporting table PGTB_IFDATA
    EXP-00056: ORACLE error 936 encountered
    ORA-00936: missing expression
    Export terminated successfully with warnings.
    Please help me on this..

    Hi ,
    Now i am using the query like below. But still getting the error.
    exp E3DAIUSR/E3DAIUSR@ORCL statistics=none file=exp_TD17870_1_TABLE.dmp log=exp_TD17870_1_TABLE_Conditional.log TABLES=PGTB_IFDATA query=\"where CRE_DT=\'20120513\'"
    Error
    ====
    LRM-00111: no closing quote for value 'where CRE_'
    EXP-00019: failed to process parameters, type 'EXP HELP=Y' for help
    EXP-00000: Export terminated unsuccessfully
    This is Solaris OS
    Please provide me correct query if possible

  • Update or select in a single query

    Hi , I want to select or update from a single query. Can I do that ?
    I tried Merge into, but it is for Update or Insert.
    Can anyone help me please. I do not want to use stored Proc/function.

    userPrasad wrote:
    I want to fire a update or merge statement inside a select SQL. Is there any way to do that ?Just to clarify:
    It is possible to UPDATE based on a SELECT condition within SQL, i.e.,
    UPDATE table1 t1
       SET col1 = new_val
    WHERE col2 IN (
        SELECT col2
           FROM table2 t2
          WHERE t1.col1 = t2.col1
              AND col1 = old_val);or to MERGE:
    MERGE into table1 t1
    USING (SELECT * FROM table2) t2
      ON (t1.col1 = t2.col1)
    WHEN MATCHED...
    WHEN NOT MATCHED...Both of those will use a SELECT, and MERGE can UPDATE, INSERT, both or either one, or none.
    Is that what you had in mind?

  • Can some selection conditions as PL/SQL procedure input parameters

    Dear All,
    I need to write a PL/SQL procedure so as to compute the different query only by changing the input parameters. But those input parameters need to be like a PL/SQL table selection conditions. Like:
    one of the query I need two conditions:
    customers.zip = 60606
    customers.zip = employees.zipMy procedure can compute the query like:
    select customers.cno, cname, employees.eno, ename
    from customers, orders, employees
    where customers.cno = orders.cno and
          employees.eno = orders.eno and
          C; 
    where C is the conjunction of the conditions in the input parameter.
    Please help and thanks in advance!

    Well, it's easy enough to do what you want....
    SQL> conn scott/tiger
    Connected.
    SQL> CREATE OR REPLACE FUNCTION flexi_q (pn_deptno IN NUMBER, pv_string IN VARCHAR2 := NULL)
      2  RETURN sys_refcursor AS
      3    return_value sys_refcursor;
      4  BEGIN
      5    IF pv_string IS NULL THEN
      6          OPEN return_value FOR SELECT * FROM emp WHERE deptno = pn_deptno;
      7    ELSE
      8          OPEN return_value FOR 'SELECT * FROM emp WHERE deptno = :1 AND '
      9          ||pv_string USING pn_deptno; 
    10    END IF;
    11    RETURN return_value;
    12  END;
    13  /
    Function created.
    SQL> var rc refcursor
    SQL> exec :rc := flexi_q(30)
    PL/SQL procedure successfully completed.
    SQL> print rc
         EMPNO ENAME      JOB              MGR HIREDATE         SAL       COMM
        DEPTNO
          7499 ALLEN      SALESMAN        7698 20-FEB-81       1600        300
            30
          7698 BLAKE      MANAGER         7839 01-MAY-81       2850
            30
          7900 JAMES      CLERK           7698 03-DEC-81        950
            30
          7654 MARTIN     SALESMAN        7698 28-SEP-81       1250       1400
            30
          7844 TURNER     SALESMAN        7698 08-SEP-81       1500          0
            30
          7521 WARD       SALESMAN        7698 22-FEB-81       1250        500
            30
    6 rows selected.
    SQL> exec :rc := flexi_q(30, 'SAL > 1400')
    PL/SQL procedure successfully completed.
    SQL> print rc
         EMPNO ENAME      JOB              MGR HIREDATE         SAL       COMM
        DEPTNO
          7499 ALLEN      SALESMAN        7698 20-FEB-81       1600        300
            30
          7698 BLAKE      MANAGER         7839 01-MAY-81       2850
            30
          7844 TURNER     SALESMAN        7698 08-SEP-81       1500          0
            30
    SQL> The real question is: do you really want to do this? Fundamentally you are handing over control of your app to any nimrod who thinks they know how to write SQL. It's just about allowable for them to add simple restrictions but they could add in anything - correlated sub-queries, extravagant sorts, etc. Even if they don't deliberately exploit this hole you still have a fundamentally untunable part of your app.
    It would be much better to have some additional parameters that allows the users to choose from several off-the-peg queries. If you have a user demanding the ability to write "any report I need" I recommend talking to them. The chances are they simply have a pet query, probably embodied in an Excel spreadsheet, they run once every month. Give them a view to meet that need and they'll be happy.
    Cheers, APC

  • View with selection conditions with system fields.

    Hi Experts,
    I have a view. Now i want to control the data that is selected using 'Selection Conditions'.
    here i want to use system field SY-DATUM.
    My requirement is  i want to control the output like
    Valid_From_Date GE SY-DATUM and
    Valid_To_Date     LE  SY-DATUM
    which means that i would be showing only active users in this view.
    How can i go about this? System is not allowing system fields in comparision value.
    Any help on this is highly appreciated. Thanks.
    regards,
    Simha

    Hi,
    I am getting a warning first 'enter constant as comparision value'
    when i trying to activate the view i am getting the below error.
    A join condition on a field of the system table SY (or SYST) was defined.
    This is not permitted for database views because the system table is not known to the database
    Have tried to activate the view you created?
    How to go about this?
    Regards,
    Simha

Maybe you are looking for

  • Parametric roles in Oracle BPM 11g

    Hi all!, For all of us that was asking how to do the parametric roles in Oracle BPM 11g, here´s how to do it, hope it helps. Regards!! Z3uV4k https://docs.google.com/file/d/0B7YrnfO7h717M2U1MTlmMmEtZjI3Mi00ZTNhLWFhNTQtYzkyZjc5OGI5Y2I4/edit?pli=1

  • Create New Cost centers in HR Module

    Dear friends, i wan't to create new cost centers in SAP we have different Profiles in our company like GSM,WLN,CDMA,WLNGSM,CDMAWLN,GSM+WLN etc and that in differernt locations i wan't to create cost centers so that any new employee created should fal

  • Unknown host exception when weblogic is a https client to another server

    Hi, I have weblogic 6.1 sp2. My program connects as a client using https protocol. For this the classes provided by wls are used . The key , cert and ca files are of weblogic available in wlserver6.1\config\mydomain demokey.pem, democert.pem and ca.p

  • Problems with a corrupt block  (ORA-00227)+(ORA-00202)

    Hi..i'm having this problem on my oracle installation (10g r2 on win2000sp4, italian language) im having trouble to recovery that control file 'CONTROL.DBF', i'm on my first experiences as dba, and i'm trying to startup db,after shutdowning it.. here

  • IPhoto Migration : Mixed Reference and Manged

    I just purchased a new mac to replace an old one,  in iPhoto I have one library and copied the library library across to new,  most photo's work fine however I have found some are only thumbnail. After doing a bit of research it would seem iPhoto lib