How to FORM USER_COMMAND in ALV without using PERFORM.

plz let me know all the steps as soon as possible.

Hi Aarif,
An Interactive ALV Report
*& Report  ZZ_22038_22098_002                                          *
*& This is an Interactive ALV report, where on line slection we can see
*&  the secondry list
REPORT  ZZ_22038_22098_002 NO STANDARD PAGE HEADING LINE-SIZE 650
MESSAGE-ID ZZ_9838                      .
TYPE-POOLS: SLIS.
*type declaration for values from ekko
TYPES: BEGIN OF I_EKKO,
       EBELN LIKE EKKO-EBELN,
       AEDAT LIKE EKKO-AEDAT,
       BUKRS LIKE EKKO-BUKRS,
       BSART LIKE EKKO-BSART,
       LIFNR LIKE EKKO-LIFNR,
       END OF I_EKKO.
DATA: IT_EKKO TYPE STANDARD TABLE OF I_EKKO INITIAL SIZE 0,
      WA_EKKO TYPE I_EKKO.
*type declaration for values from ekpo
TYPES: BEGIN OF I_EKPO,
       EBELN LIKE EKPO-EBELN,
       EBELP LIKE EKPO-EBELP,
       MATNR LIKE EKPO-MATNR,
       MENGE LIKE EKPO-MENGE,
       MEINS LIKE EKPO-MEINS,
       NETPR LIKE EKPO-NETPR,
       END OF I_EKPO.
DATA: IT_EKPO TYPE STANDARD TABLE OF I_EKPO INITIAL SIZE 0,
      WA_EKPO TYPE I_EKPO .
*variable for Report ID
DATA: V_REPID LIKE SY-REPID .
*declaration for fieldcatalog
DATA: I_FIELDCAT TYPE SLIS_T_FIELDCAT_ALV,
      WA_FIELDCAT TYPE SLIS_FIELDCAT_ALV.
DATA: IT_LISTHEADER TYPE SLIS_T_LISTHEADER.
declaration for events table where user comand or set PF status will
be defined
DATA: V_EVENTS TYPE SLIS_T_EVENT,
      WA_EVENT TYPE SLIS_ALV_EVENT.
declartion for layout
DATA: ALV_LAYOUT TYPE SLIS_LAYOUT_ALV.
declaration for variant(type of display we want)
DATA: I_VARIANT TYPE DISVARIANT,
      I_VARIANT1 TYPE DISVARIANT,
      I_SAVE(1) TYPE C.
*PARAMETERS : p_var TYPE disvariant-variant.
*Title displayed when the alv list is displayed
DATA:  I_TITLE_EKKO TYPE LVC_TITLE VALUE 'FIRST LIST DISPLAYED'.
DATA:  I_TITLE_EKPO TYPE LVC_TITLE VALUE 'SECONDRY LIST DISPLAYED'.
INITIALIZATION.
  V_REPID = SY-REPID.
  PERFORM BUILD_FIELDCATLOG.
  PERFORM EVENT_CALL.
  PERFORM POPULATE_EVENT.
START-OF-SELECTION.
  PERFORM DATA_RETRIEVAL.
  PERFORM BUILD_LISTHEADER USING IT_LISTHEADER.
  PERFORM DISPLAY_ALV_REPORT.
*&      Form  BUILD_FIELDCATLOG
      Fieldcatalog has all the field details from ekko
FORM BUILD_FIELDCATLOG.
  WA_FIELDCAT-TABNAME = 'IT_EKKO'.
  WA_FIELDCAT-FIELDNAME = 'EBELN'.
  WA_FIELDCAT-SELTEXT_M = 'PO NO.'.
  APPEND WA_FIELDCAT TO I_FIELDCAT.
  CLEAR WA_FIELDCAT.
  WA_FIELDCAT-TABNAME = 'IT_EKKO'.
  WA_FIELDCAT-FIELDNAME = 'AEDAT'.
  WA_FIELDCAT-SELTEXT_M = 'DATE.'.
  APPEND WA_FIELDCAT TO I_FIELDCAT.
  CLEAR WA_FIELDCAT.
  WA_FIELDCAT-TABNAME = 'IT_EKKO'.
  WA_FIELDCAT-FIELDNAME = 'BUKRS'.
  WA_FIELDCAT-SELTEXT_M = 'COMPANY CODE'.
  APPEND WA_FIELDCAT TO I_FIELDCAT.
  CLEAR WA_FIELDCAT.
WA_FIELDCAT-TABNAME = 'IT_EKKO'.
  WA_FIELDCAT-FIELDNAME = 'BUKRS'.
  WA_FIELDCAT-SELTEXT_M = 'DOCMENT TYPE'.
  APPEND WA_FIELDCAT TO I_FIELDCAT.
  CLEAR WA_FIELDCAT.
WA_FIELDCAT-TABNAME = 'IT_EKKO'.
  WA_FIELDCAT-FIELDNAME = 'LIFNR'.
  WA_FIELDCAT-NO_OUT    = 'X'.
  WA_FIELDCAT-SELTEXT_M = 'VENDOR CODE'.
  APPEND WA_FIELDCAT TO I_FIELDCAT.
  CLEAR WA_FIELDCAT.
ENDFORM.                    "BUILD_FIELDCATLOG
*&      Form  EVENT_CALL
  we get all events - TOP OF PAGE or USER COMMAND in table v_events
FORM EVENT_CALL.
  CALL FUNCTION 'REUSE_ALV_EVENTS_GET'
   EXPORTING
     I_LIST_TYPE           = 0
   IMPORTING
     ET_EVENTS             = V_EVENTS
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.
ENDFORM.                    "EVENT_CALL
*&      Form  POPULATE_EVENT
     Events populated for TOP OF PAGE & USER COMAND
FORM POPULATE_EVENT.
  READ TABLE V_EVENTS INTO WA_EVENT WITH KEY NAME = 'TOP_OF_PAGE'.
  IF SY-SUBRC EQ 0.
    WA_EVENT-FORM = 'TOP_OF_PAGE'.
    MODIFY V_EVENTS FROM WA_EVENT TRANSPORTING FORM WHERE NAME =
WA_EVENT-FORM.
  ENDIF.
  READ TABLE V_EVENTS INTO WA_EVENT WITH KEY NAME = 'USER_COMMAND'.
  IF SY-SUBRC EQ 0.
    WA_EVENT-FORM = 'USER_COMMAND'.
    MODIFY V_EVENTS FROM WA_EVENT TRANSPORTING FORM WHERE NAME =
WA_EVENT-NAME.
  ENDIF.
ENDFORM.                    "POPULATE_EVENT
*&      Form  data_retrieval
  retreiving values from the database table ekko
FORM DATA_RETRIEVAL.
  SELECT EBELN AEDAT BUKRS BSART LIFNR FROM EKKO INTO TABLE IT_EKKO.
ENDFORM.                    "data_retrieval
*&      Form  bUild_listheader
      text
     -->I_LISTHEADEtext
FORM BUILD_LISTHEADER USING I_LISTHEADER TYPE SLIS_T_LISTHEADER.
  DATA HLINE TYPE SLIS_LISTHEADER.
  HLINE-INFO = 'this is my first alv pgm'.
  HLINE-TYP = 'H'.
ENDFORM.                    "build_listheader
*&      Form  display_alv_report
      text
FORM DISPLAY_ALV_REPORT.
  V_REPID = SY-REPID.
  CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
   EXPORTING
     I_CALLBACK_PROGRAM                = V_REPID
  I_CALLBACK_PF_STATUS_SET          = ' '
     I_CALLBACK_USER_COMMAND           = 'USER_COMMAND'
     I_CALLBACK_TOP_OF_PAGE            = 'TOP_OF_PAGE'
     I_GRID_TITLE                      = I_TITLE_EKKO
  I_GRID_SETTINGS                   =
  IS_LAYOUT                         = ALV_LAYOUT
     IT_FIELDCAT                       = I_FIELDCAT[]
  IT_EXCLUDING                      =
  IT_SPECIAL_GROUPS                 =
  IT_SORT                           =
  IT_FILTER                         =
  IS_SEL_HIDE                       =
    i_default                         = 'ZLAY1'
     I_SAVE                            = 'A'
    is_variant                        = i_variant
     IT_EVENTS                         = V_EVENTS
    TABLES
      T_OUTTAB                          = IT_EKKO
EXCEPTIONS
  PROGRAM_ERROR                     = 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.
ENDFORM.                    "display_alv_report
*&      Form  TOP_OF_PAGE
      text
FORM TOP_OF_PAGE.
  CALL FUNCTION 'REUSE_ALV_COMMENTARY_WRITE'
    EXPORTING
      IT_LIST_COMMENTARY       = IT_LISTHEADER
   i_logo                   =
   I_END_OF_LIST_GRID       =
ENDFORM.                    "TOP_OF_PAGE
*&      Form  USER_COMMAND
      text
     -->R_UCOMM    text
     -->,          text
     -->RS_SLEFIELDtext
FORM USER_COMMAND USING R_UCOMM LIKE SY-UCOMM
RS_SELFIELD TYPE SLIS_SELFIELD.
  CASE R_UCOMM.
    WHEN '&IC1'.
      READ TABLE IT_EKKO INTO WA_EKKO INDEX RS_SELFIELD-TABINDEX.
      PERFORM BUILD_FIELDCATLOG_EKPO.
      PERFORM EVENT_CALL_EKPO.
      PERFORM POPULATE_EVENT_EKPO.
      PERFORM DATA_RETRIEVAL_EKPO.
      PERFORM BUILD_LISTHEADER_EKPO USING IT_LISTHEADER.
      PERFORM DISPLAY_ALV_EKPO.
  ENDCASE.
ENDFORM.                    "user_command
*&      Form  BUILD_FIELDCATLOG_EKPO
      text
FORM BUILD_FIELDCATLOG_EKPO.
  WA_FIELDCAT-TABNAME = 'IT_EKPO'.
  WA_FIELDCAT-FIELDNAME = 'EBELN'.
  WA_FIELDCAT-SELTEXT_M = 'PO NO.'.
  APPEND WA_FIELDCAT TO I_FIELDCAT.
  CLEAR WA_FIELDCAT.
  WA_FIELDCAT-TABNAME = 'IT_EKPO'.
  WA_FIELDCAT-FIELDNAME = 'EBELP'.
  WA_FIELDCAT-SELTEXT_M = 'LINE NO'.
  APPEND WA_FIELDCAT TO I_FIELDCAT.
  CLEAR WA_FIELDCAT.
  WA_FIELDCAT-TABNAME = 'I_EKPO'.
  WA_FIELDCAT-FIELDNAME = 'MATNR'.
  WA_FIELDCAT-SELTEXT_M = 'MATERIAL NO.'.
  APPEND WA_FIELDCAT TO I_FIELDCAT.
  CLEAR WA_FIELDCAT.
WA_FIELDCAT-TABNAME = 'I_EKPO'.
  WA_FIELDCAT-FIELDNAME = 'MENGE'.
  WA_FIELDCAT-SELTEXT_M = 'QUANTITY'.
  APPEND WA_FIELDCAT TO I_FIELDCAT.
  CLEAR WA_FIELDCAT.
WA_FIELDCAT-TABNAME = 'I_EKPO'.
  WA_FIELDCAT-FIELDNAME = 'MEINS'.
  WA_FIELDCAT-SELTEXT_M = 'UOM'.
  APPEND WA_FIELDCAT TO I_FIELDCAT.
  CLEAR WA_FIELDCAT.
WA_FIELDCAT-TABNAME = 'I_EKPO'.
  WA_FIELDCAT-FIELDNAME = 'NETPR'.
  WA_FIELDCAT-SELTEXT_M = 'PRICE'.
  APPEND WA_FIELDCAT TO I_FIELDCAT.
  CLEAR WA_FIELDCAT.
ENDFORM.                    "BUILD_FIELDCATLOG_EKPO
*&      Form  event_call_ekpo
  we get all events - TOP OF PAGE or USER COMMAND in table v_events
FORM EVENT_CALL_EKPO.
  CALL FUNCTION 'REUSE_ALV_EVENTS_GET'
   EXPORTING
     I_LIST_TYPE           = 0
   IMPORTING
     ET_EVENTS             = V_EVENTS
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.
ENDFORM.                    "event_call_ekpo
*&      Form  POPULATE_EVENT
       Events populated for TOP OF PAGE & USER COMAND
FORM POPULATE_EVENT_EKPO.
  READ TABLE V_EVENTS INTO WA_EVENT WITH KEY NAME = 'TOP_OF_PAGE'.
  IF SY-SUBRC EQ 0.
    WA_EVENT-FORM = 'TOP_OF_PAGE'.
    MODIFY V_EVENTS FROM WA_EVENT TRANSPORTING FORM WHERE NAME =
WA_EVENT-FORM.
  ENDIF.
  ENDFORM.                    "POPULATE_EVENT
*&      Form  TOP_OF_PAGE
      text
FORM F_TOP_OF_PAGE.
  CALL FUNCTION 'REUSE_ALV_COMMENTARY_WRITE'
    EXPORTING
      IT_LIST_COMMENTARY       = IT_LISTHEADER
   i_logo                   =
   I_END_OF_LIST_GRID       =
ENDFORM.                    "TOP_OF_PAGE
*&      Form  USER_COMMAND
      text
     -->R_UCOMM    text
     -->,          text
     -->RS_SLEFIELDtext
*retreiving values from the database table ekko
FORM DATA_RETRIEVAL_EKPO.
SELECT EBELN EBELP MATNR MENGE MEINS NETPR FROM EKPO INTO TABLE IT_EKPO.
ENDFORM.
FORM BUILD_LISTHEADER_EKPO USING I_LISTHEADER TYPE SLIS_T_LISTHEADER.
DATA: HLINE1 TYPE SLIS_LISTHEADER.
HLINE1-TYP = 'H'.
HLINE1-INFO = 'CHECKING PGM'.
ENDFORM.
FORM DISPLAY_ALV_EKPO.
CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
EXPORTING
  I_INTERFACE_CHECK                 = ' '
  I_BYPASSING_BUFFER                = ' '
  I_BUFFER_ACTIVE                   = ' '
   I_CALLBACK_PROGRAM                = V_REPID
  I_CALLBACK_PF_STATUS_SET          = ' '
  I_CALLBACK_USER_COMMAND           = 'F_USER_COMMAND'
   I_CALLBACK_TOP_OF_PAGE            = 'TOP_OF_PAGE'
  I_CALLBACK_HTML_TOP_OF_PAGE       = ' '
  I_CALLBACK_HTML_END_OF_LIST       = ' '
  I_STRUCTURE_NAME                  =
  I_BACKGROUND_ID                   = ' '
   I_GRID_TITLE                      = I_TITLE_EKPO
  I_GRID_SETTINGS                   =
  IS_LAYOUT                         =
   IT_FIELDCAT                       = I_FIELDCAT[]
  IT_EXCLUDING                      =
  IT_SPECIAL_GROUPS                 =
  IT_SORT                           =
  IT_FILTER                         =
  IS_SEL_HIDE                       =
  I_DEFAULT                         =
   I_SAVE                            = 'A'
  IS_VARIANT                        =
   IT_EVENTS                         = V_EVENTS
  TABLES
    T_OUTTAB                          = IT_EKPO
EXCEPTIONS
   PROGRAM_ERROR                     = 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.
ENDFORM.
reward points to all helpful answers
kiran.M

Similar Messages

  • How to delimit leading zero in vendor number in OO ABAP ALV without using conversion routine

    Hi,
    How to delimit leading zero in OO ABAP ALV without using conversion routine, because I have many fields like vendor, customer, material number etc..
    How to address this leading zero.
    I appreciate your quick response.
    Regards,
    Nalini S.

    Hi Nalini,
    Delimiting leading zeros in fields has to be done via conversion routines, as suggested by Vadamalai you need to pass on the conversion routine name in you field catalog variable.
    Now as to which object oriented approach are you using to have your table contents display in ALV as it matters  -
    Using FACTORY method of CL_SALV_TABLE class, or
    Using SET_TABLE_FOR_FIRST_DISPLAY method of CL_GUI_ALV_GRID class.
    Using FACTORY method of CL_SALV_TABLE will do your own work, no need to apply any conversion routines or set long/medium/short text for columns as we do in field catalogs!
    Cheers,
    Varun

  • Radio button in ALV without using field catalog

    Hi All,
    My requirement is i want to create a RFC function module to display the header table.
    while executing the function module the output is of alv grid format.
    i have used the structure for this.
    i didnt create a layout and fieldcatalog.
    now i need to add a radio button in that alv grid display.
    how to create the radio button without using field catalog.
    Thank in Advance.

    Hi Aishwarya,
    You need to use the field catalog for displaying a field as a radio button in ALV grid.
    Please refer to this link for doing so. [Radio buttons in ALV Grid|http://wiki.sdn.sap.com/wiki/display/Snippets/ABAP-RadioButtonsinALVGRIDREPORT]
    You can use LVC_FIELDCATALOG_MERGE wherein you can use your structure and the Icon for Radiobutton.
    Refer to this link -[Radiobuttons in ALV Grid 2|http://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/a02535ce-9eaf-2910-ae8c-f2f2afc1c8e7?quicklink=index&overridelayout=true]
    Best Regards,
    Sharmila
    Edited by: Sharmila Subramanian on Mar 18, 2011 12:34 PM

  • How do i lock all fields without using the signature function with adobe lifecycle designer 9

    How do i lock all fields without using the signature function with adobe lifecycle designer 9 ...
    I want it to have the same affect as when a signature is used but not use that function. I want a button that says lock all fields. And then you can click it again to unlock all fields...
    Thanks

    Here you go!
    LOCK the form once its SAVEd?

  • I want to download an audiobook, but my daughter has a giftcard credit on the account. How can I download my audiobook without using the money from her giftcard?

    I want to download an audiobook, but my daughter has a gift card on the account.  How can I download my audiobook without using the money from her gift card?

    go directly to your ibook app. and you're going to find it. it's only with ibooks app.
    best
    Olivier
    <Edited by Host>

  • How can I track my iPod without using an app ?

    Hey I lost my iPod touch in school and I think one of my classmates took it how do I track it down without using an app ?

    The only way to track it at all is to first have enabled an iCloud account on it before it was lost, with the find my iPod setting in that account's setting panel set to "ON".
    If that was done, you can log in to your iCloud account in a web browser and you can try to track it.  It must be on, and it must have an active wifi data connection to be trackable.
    Without an iCloud account already on it though, there is no way to track it.

  • I have an apple emac powerpc G4 which is running 10.3.9 software. I downloaded the 10.5 leopard software. Does anyone know how to install the 10.5 without using the dvd installer? In dummy terms please?

    If any one could help me with this. i'd be enternally grateful as i'm getting nowhere on my own!
    I have an apple emac powerpc G4 which is running 10.3.9 software. I downloaded the 10.5 leopard software. Does anyone know how to install the 10.5 without using the dvd installer? In dummy terms please

    The only way to get 10.5 is to purchase it on CD. Such as http://www.amazon.com/Mac-OS-Leopard-10-5-10-51/dp/B0012RAVRC where is being sold for $179.99.
    If your optical drive is broken, you will either need to replace it or get an external. There is no other way.
    Why do wish to upgrade? As you can see it is going to be expensive, probably more the Mac is worth.
    Allan

  • How to create an apple id without using credit card

    how to create an apple id without using credit card.. i have recently purchased apple iphone 3gs bt unable to get apps because of giving credit card info which i dnt hav.. so plz tel me some way to process..

    To get the none option, sign out of anything apple you're signed into. Go to the app store and try to download a free app, any free app. Instead of signing in, take the option to to make a new apple ID. Then go through the steps to make the ID and you'll see the 'none' option.

  • Create database table using Forms Developer 6/6i without using SQL*Plus

    hello there,
    I need help in creating tables in Oracle using Forms Developer 6/6i without using SQL*Plus interface.
    your help is appreciated
    email: [email protected]

    please use Forms_ddl package to create a table dynamically
    from the Developer6/6i.
    you can check the success or failure by using the
    form_success builtin.
    if u want to avoid using the Forms_ddl package
    use stored procedure or create a sql querry record group.
    regards
    sriram.

  • How can I start windows 8 without useing my password

    how can I start windows 8 without useing my password

    Hi,
    Review the information posted in this thread.
    HP DV9700, t9300, Nvidia 8600, 4GB, Crucial C300 128GB SSD
    HP Photosmart Premium C309G, HP Photosmart 6520
    HP Touchpad, HP Chromebook 11
    Custom i7-4770k,Z-87, 8GB, Vertex 3 SSD, Samsung EVO SSD, Corsair HX650,GTX 760
    Custom i7-4790k,Z-97, 16GB, Vertex 3 SSD, Plextor M.2 SSD, Samsung EVO SSD, Corsair HX650, GTX 660TI
    Windows 7/8 UEFI/Legacy mode, MBR/GPT

  • How do I restart a process without using a loop?

    Hi,
    How can I restart a process without using the While action from the palette?
    The Wait action from the palette doesn't seem to do that.
    I simply want to restart a process after testing a condition in the Switch action.
    Thanks,
    Alexandru

    Hi,
    You can use the replay feature. Look at the BPEL references under the samples directory.
    hth,
    ~ronen

  • How to Start process in ProcessChain Without using Repeat option?

    How to Start process in ProcessChain Without using Repeat option?

    Se16 -- table:RSPCPROCESSLOG - click on display entries.
    Entet the variant, instance start date (this info you can get from the "display message" of PC.
    Now execute to display the table entries of RSPCPROCESSLOG.
    Next goto SE37 transaction --enter RSPC_PROCESS_FINISH
    Take the entries from the above table to set the input parameters of the FM.
    I_logid = log_id(from above table)
    I_type = type(from above table)
    i_variant = varaint (from above table)
    i_instance = (from above table)
    Click on F8(EXECUTE)
    now the actual process is set to gree and the process chain will be triggered (rest of the PC with out repeating the step from where is was red).

  • Can we create Interactive forms only with ABAP & without using GP,  or Java

    Hi,
    I would like to know if we can create Interactive forms only with ABAP & without using GP or Java. We want to develop an offline solution using Interactive forms, but would like to use only ABAP for creating the forms. All the documents so far either refer to creating the forms, in reference to / in sync with: ISR (Service Requests), GP (General Procedures) or Java. Can this be done with ABAP alone?
    Regards,
    Ramesh
    Edited by: Ramesh Nallabelli on Apr 16, 2008 12:02 AM

    Hello Ramesh,
    You should be able to create Adobe Interactive Forms using only the ABAP stack (without GP, Java, etc). Please refer to the thread below. Hope it helps.
    Re: help for-offline interactive forms based on sending receiving mails in ABAP
    Regards,
    Rao

  • How do I register with iTunes without using a credit card it's not giving me a none option???

    How can I register with iTunes without using a credit card it's not giving me a none option!!

    Did you follow these instructions? You have to. Also, you have to use an email addresss that you have not used with Apple before, it has to be a new acciount.
    Creating an iTunes Store, App Store, iBookstore, and Mac App Store account without a credit card

  • How to display row to columns without using pivot keyword

    hi,
    could someone help me how to dispaly rows into columns without using pivot keyword and actuall my scenario is,iam having two tables with names and sample data is shown below
    ID PROJECT MID MINAME TASKID TASKNAME
    1     PROJ1     1     AA     100     PR1_TASK1
    1     PROJ1     3     CC     102     PR1_TASK3
    1     PROJ1     4     DD     103     PR1_TASK4
    1     PROJ1     5     EE     104     PR1_TASK5
    1     PROJ1     6     FF     105     PR1_TASK6
    2     PROJ2     5     EE     114     PR2_TASK1
    2     PROJ2     6     FF     115     PR2_TASK2
    2     PROJ2     7     GG     116     PR2_TASK3
    2     PROJ2     8     HH     117     PR2_TASK4
    2     PROJ2     9     JJ     118     PR2_TASK5
    2     PROJ2     10     KK     119     PR2_TASK6
    2     PROJ2     1     AA     120     PR2_TASK7
    The output should display project and count of tasks in particular milestone as shown below
    project AA BB CC DD EE FF GG HH JJ KK
    1 2 0 1 5 3 2 0 2 1 0
    2 1 2 0 2 1 0 2 4 3 1
    Thanks in advance ,
    vvr

    WITH t1 AS
    (SELECT 1 ID,
             'PROJ1' PROJECT,
             1 MID,
             'AA' MINAME,
             100 TASKID,
             'PR1_TASK1' TASKNAME
        FROM DUAL
      UNION
      SELECT 1, 'PROJ1', 3, 'CC', 102, 'PR1_TASK3'
        FROM DUAL
      UNION
      SELECT 1, 'PROJ1', 4, 'DD', 103, 'PR1_TASK4'
        FROM DUAL
      UNION
      SELECT 1, 'PROJ1', 5, 'EE', 104, 'PR1_TASK5'
        FROM DUAL
      UNION
      SELECT 1, 'PROJ1', 6, 'FF', 105, 'PR1_TASK6'
        FROM DUAL
      UNION
      SELECT 2, 'PROJ2', 5, 'EE', 114, 'PR2_TASK1'
        FROM DUAL
      UNION
      SELECT 2, 'PROJ2', 6, 'FF', 115, 'PR2_TASK2'
        FROM DUAL
      UNION
      SELECT 2, 'PROJ2', 7, 'GG', 116, 'PR2_TASK3'
        FROM DUAL
      UNION
      SELECT 2, 'PROJ2', 8, 'HH', 117, 'PR2_TASK4'
        FROM DUAL
      UNION
      SELECT 2, 'PROJ2', 9, 'JJ', 118, 'PR1_TASK5'
        FROM DUAL
      UNION
      SELECT 2, 'PROJ2', 10, 'KK', 119, 'PR1_TASK6'
        FROM DUAL
      UNION
      SELECT 2, 'PROJ2', 1, 'AA', 120, 'PR1_TASK7' FROM DUAL)
    SELECT id project,
           NVL((SELECT mid
                 FROM t1
                WHERE miname = 'AA'
                  AND id = t_out.id),
               0) AA,
           NVL((SELECT mid
                 FROM t1
                WHERE miname = 'BB'
                  AND id = t_out.id),
               0) BB,
           NVL((SELECT mid
                 FROM t1
                WHERE miname = 'CC'
                  AND id = t_out.id),
               0) CC,
           NVL((SELECT mid
                 FROM t1
                WHERE miname = 'DD'
                  AND id = t_out.id),
               0) DD,
           NVL((SELECT mid
                 FROM t1
                WHERE miname = 'EE'
                  AND id = t_out.id),
               0) EE,
           NVL((SELECT mid
                 FROM t1
                WHERE miname = 'FF'
                  AND id = t_out.id),
               0) FF,
           NVL((SELECT mid
                 FROM t1
                WHERE miname = 'GG'
                  AND id = t_out.id),
               0) GG,
           NVL((SELECT mid
                 FROM t1
                WHERE miname = 'HH'
                  AND id = t_out.id),
               0) HH,
           NVL((SELECT mid
                 FROM t1
                WHERE miname = 'JJ'
                  AND id = t_out.id),
               0) JJ,
           NVL((SELECT mid
                 FROM t1
                WHERE miname = 'KK'
                  AND id = t_out.id),
               0) KK
      FROM (SELECT DISTINCT id FROM t1) t_out
    PROJECT     AA     BB     CC     DD     EE     FF     GG     HH     JJ     KK
    1     1     0     3     4     5     6     0     0     0     0
    2     1     0     0     0     5     6     7     8     9     10As I understand, you want MID of MINAMEs displayed ? But output is not like yours.. What is exactly your requirements?

Maybe you are looking for

  • Query Builder in 10g Developer Suite

    I am accustomed to using previous versions of Oracle developer (2000,6 i...), and there was "Query Builder", which is very useful for us, especially when we do statistics and complex Reports. Now the Staff has chosen 10g Developer Suite that unfortun

  • How can I uninstall Quicktime to install an earlier version?

    I am using Adobe Premiere on 10.3.9 and I have had a ton of problems each time I upgrade anything, including Quicktime - Apparently, the optimum version of quicktime to run Premiere is 6.5.2 - - I have trashed everything that says quicktime from ever

  • ORA-12704: character set mismatch odbc

    Hi I have a query which is working find in most of the machines through ODBC connection. On one oracle server i am getting "ORA-12704: character set mismatch" SELECT '' as Col1, Fname from CustTable Where FPrefix = ''

  • Re: No sound in video files when audio is an mp3 stream

    There are others jmf player projects in internet. Take a look at them and test they can play your problematic files. But i think its a jmf bug.

  • SRM 7.0 EHP2 Supplier Qualification Process

    Dear experts, i customized the registration of suppliers via wda_e_suco_sreg, WebDynPro. The process: 1. Potential supplier obtained a link to the self registration questionaire 2. Potential Supplier fills out the questionaire and push the button <se