Interactive reports using ABAP query

I have developed an ABAP query which prints the sales documents in ALV list display.
In that  list display I would do develop a functionality is , when ever i double click on the sales doc number it will directly go to the VA03 transaction for the corresponding VBELN.
Can anybody explain how to do this?

Hi,
When you double-click on any cell of alv, use this code to fetch the data of the line that you currently clicked, its working:-
When you double click on the ALV line, you will have sy-ucomm = '&IC1'.
So when you define a i_callback_user_command for the FM reuse_alv_list_display,
     i_callback_user_command           = 'COMMAND' " for User-Command
and create it as:-
FORM command USING ucomm LIKE sy-ucomm selfield TYPE slis_selfield.
  DATA : ok_code TYPE sy-ucomm.
  ok_code = ucomm.
  CASE ok_code.
    WHEN '&IC1'. "for double click on alv line
      " your code
  ENDCASE.
ENDFORM.
As you have used selfield TYPE slis_selfield, the field selfield will hold all the values.
To know on which row you have clicked and to retain that line, use code:-
Suppose you are currently displaying data from internal table itab and corresponding to it you have work area wa.
read table itab into wa index selfield-tabindex. "index value of line you clicked
" now you have the contents of line that you double clicked currently
Now to know the field name that you clicked, use:-
selfield-fieldname " will fetch you the name of field that you clicked
Now using the work-area and the name of field that you clicked, you can easily make out the details of the field i.e., field name and field value and you can code as per your requirement.
Refer:-
CASE selfield-fieldname.
  WHEN 'VBELN'.
    SET PARAMETER ID 'AUN' FIELD <wa-vbeln>. "value for work area for vbeln
    CALL TRANSACTION 'VA03' AND SKIP FIRST SCREEN.
ENDCASE.
Hope this helps you.
Regards,
Tarun

Similar Messages

  • Generating a report using ABAP query

    Hi All,
    I want to generate a anlytical report using ABAP query, There are 3 different transactions/steps have to be executed to get this data in an actionable form.
    1. MB52 - Unrestricted Stock
    2. ZCustomquery - Custom query in SAP R3
    3. Combine above two in a single report.
    Please suggest me how can i proceed,
    1. Example i have created query name called Finalrepot
    2. How can i call above zcustomquery and Transaction (MB52) in the Query.
    Thanks for your help
    Pradeep

    Hi,
    Check below link to create ABAP query (SAP Query)
    http://www.thespot4sap.com/Articles/SAP_ABAP_Queries_Create_The_Query.asp
    http://help.sap.com/printdocu/core/Print46c/en/data/pdf/BCSRVQUE/BCSRVQUE.pdf
    Best regards,
    Brijesh

  • Development of Reports using ABAP Query

    Hi
    can anyone please tell me about 'Development of Reports using ABAP Query' and how to use it in real time
    Thanks
    jay

    look here:
    http://help.sap.com/saphelp_47x200/helpdata/en/b7/26ddebb1f311d295f40000e82de14a/frameset.htm
    A.

  • Hoe top create summary and detail report using ABAP QUERY

    Hi ,
    Can any one suggest me how to create summary and detailed report using ABAP Quey.
    Regards,
    Raghu.

    Hi,
    Table Declaration
    tables:mara,mast.
    *Declaring the internal table
    data: begin of itab_new occurs 0,
          matnr like mara-matnr,     "Material No
          ernam like mara-ernam,     "Material Created by
          mtart like mara-mtart,     "Material Type
          matkl like mara-matkl,     "Material Desc
          werks like mast-werks,     "Plant
          aenam like mast-aenam,     "BOM created
          stlal like mast-stlal,     "Alternative BOM
          end of itab_new.
    select-options: p_matnr for mara-matnr.
    CODE A : Retrieving the data from the database
         select  f~matnr f~ernam f~mtart f~matkl m~werks m~aenam m~stlal
         into table itab_new
         from mara as f inner join mast as m
         on f~matnr = m~matnr
         where f~matnr in p_matnr.
    CODE B : Retrieving the data from the database.
        SELECT FMATNR FERNAM FMTART FMATKL MWERKS MAENAM M~STLAL
        INTO TABLE ITAB_NEW
        FROM MARA AS F INNER JOIN MAST AS M
        ON FMATNR = MMATNR
        WHERE F~MATNR = P_MATNR.
        SORT ITAB_NEW BY ERNAM.
    loop at itab_new.
    write:/5  itab_new-matnr,itab_new-ernam,itab_new-mtart,itab_new-matkl,itab_new-werks,itab_new-aenam,itab_new-stlal.
    endloop.
    *TABLES: MARA , MAST.
    *DATA:BEGIN OF ITAB_NEW OCCURS 0,
                 MATNR LIKE MARA-MATNR,
                 ERNAM LIKE MARA-ERNAM,
                 MTART LIKE MARA-MTART,
                 MATKL LIKE MARA-MATKL,
                 END OF ITAB_NEW.
       SELECT MATNR ERNAM MTART MATKL
       INTO TABLE ITAB_NEW
       FROM MARA
       WHERE MTART = 'T'
       ORDER BY MATNR ERNAM MTART MATKL.
    *DATA: BEGIN OF ITAB OCCURS 0,
         MATNR LIKE MARA-MATNR,
         END OF ITAB.
    Thank U,
    Jay....

  • Excess Inventory/Scheduled Receipts Report using ABAP Query.

    Hi All,
    I want to create a ABAP query for Excess inventory & Scheduled receipts in a single report. I have identified tables, fields and some extra calculated fields in the report. Here are the following tables and fields.
    EKPO-MATNR      ( Material number)
    EKPO-WERKS     ( Plant)
    MAKT-MAKTX       (Material Discription)
    MARC-MAABC      ( ABC indicator)
    LFA1-NAME1        ( Supplier name)
    MBEW-STPRS      (Total value)
    EKET-EINDT         ( Item delivery date)
    RIBOF-AMOUNT
    S939-SPWOC or S032-SPWOC
    Calculation fields : Value execess this week.extend value, over or under this week, onhand inventory for last week and this week.
    Here my question is, when i was creating a infoset, how do i maintain relationship or joins from one table to another table...Is there any sequence for the above tables? Pl suggest. When i was adding all the tables in a infoset and try join the tables...it says illegal join...
    Pl suggest me.
    Thanks for your help
    PRadeep
    Edited by: Venkata Pr Papulugari on Jul 18, 2008 1:37 AM

    Hi Gordon,
    What i need to display is the remainder of the transaction that was received... if it is zero (0), i don't want to display it.
    i.e.
    transact # 100 inqty = 5
    transact # 200 outqty =1
    I'd like to display
    transact # 100     qty on hand = 4
    right know the transaction # that i am displaying is transact # 200.
    And also, it needs to be warehouse oriented. because i can have multiple warehose transactions.... and i am getting that wrong too.
    Regards,
    Manuel Roman

  • Interactive reports in abap objects

    Hi,
           plz send me the code of  interactive report using ABAP Objects .
    Thanks,
    T.Sreekanth.

    Hi,
    It will be similar to what you do in normal report.
    Here you may create an object instance and then call some method on the object.
    AT LINE-SELECTION.
    create object obj.
    CALL METHOD obj->method1
    IMPORTING
      text = im_text.
    write: im_text.
    Regards,
    Sesh

  • Interactive list musing abap query and how to create infoset records

    hi,
    Can any one suggest how to create interactive list using ABAP Query .And also infosets and ranked list ..thanks in advance
    Regards,
    Raghu.

    Hi,
    Check this
    Re: How to make output of ABAp query interactive(drill down)..?
    some info on the ABAP query
    https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/40bec8da-4cd8-2910-27a9-81f5ce10676c
    hope it helps.
    Regards!

  • Interactive report using Infoset quiereis with SQ01,SQ02,SQ03.

    Hi,
             I have to create a report by using the infoset query with SQ01,SQ02 and  SQ03 Tcodes. But problem my requerment is that I have to create one interactive report with these quereis.
    Can any body tell me how to create this interactive report using infoset quereis OR are there any standard quereis which are having interactive nature.
    Pleas send me the solution and thanks in advance.
    regards,
    J.

    Yes, but I am not able to figure exactly how to implement it? I mean I can do this same code in SE38 where I know names of the internal tables. But when in SQ02 we can't modify/read system tables (I found name of the system tables using report generated by SQ01). So how you will access them, then how you will reflect our changes in output ALV grid?
    Example:
    Data:
    Rate Cat.      Installation     Date
    71     60000984     20/10/2009
    71     60000984     20/12/2009
    71     60001101     10/09/2009
    78     60000310     10/09/2009
    78     60000315     10/09/2009
    83     60000297     10/09/2009
    so in this case I want output:
    Rate Cat.      Installation     Date
    71     60000984     20/12/2009
    71     60001101     10/09/2009
    78     60000310     10/09/2009
    78     60000315     10/09/2009
    83     60000297     10/09/2009
    You will see 71     60000984     20/10/2009 is not the latest one, therefore I don't want that row. I can do the ABAP logic for this, but exactly what and how to implement in SQ02?

  • Programs generated using ABAP query vanishes after upgrade

    Hi all,
    The programs generated using abap query in sq01 vanishes after upgrading from 4.6C to ECC 6.0 system.
    Is this a know issue, do we have a solution for this?
    Can anyone help
    Thanks
    Senthil

    Hi,
    Try to generate the Queries again in the new system...using the FM : RSAQ_GENERATE_PROGRAM
    The input needed is the Query name and the usergroup...The details can be obtained from the table AQLQCAT(local queries areas) and AQGQCAT(global areas queries).
    Once you generate the query , a program gets created...
    if you have lots of queries to be genretated, write a custom report by fetching the data from the above tables and use the FM to generate the same...
    Hope this helps you..
    Reward if useful
    Regards
    Shiva

  • Custom pagination for APEX 4.2 interactive report using Page Zero

    Hi,
    I want to implement an «Custom pagination for APEX 4.2 interactive report» using a «page zero».
    I recently migrate from Apex 3.1 to Apex 4.2 and my «Custom pagination for APEX 3.1 interactive report» using a «page zero»  is not working any more.
    So now I try to adapt an excellent example of Jari Laine for 4.0 but using a page zero.
    I put the code JavaScript to Page zero but I must create an dynamic action to fire only for an interactive report region.
    It’s a good idea?
    Thank you

    Thought I would try once more with my DatePicker question.
    On the Apex.Oracle.Com website I have created a 1 page application that has an Interactive Report.
    [url http://apex.oracle.com/pls/apex/f?p=15655:1]
    user = 'test'
    password = 'test'
    I have 2 questions :
    (1) In IE7, press 'Actions', 'Filter'. On the Column dropdown list, select 'Order Timestamp'.
    Notice the prompt icon to the right of the 'expression'. This should change to the Datepicker, but in IE7 it does not. Try the samething in Firefox or Chrome and the Datepicker will appear.
    Is this a BUG, or does Apex 4.02 not support IE7 ?
    (2) In Firefox or Chrome, where you can now see the Datepicker, you will notice that it is the new style picker, not the old style ( called 'classic' ). I want to change it so that it shows the 'classic' datepicker not the new, but cannot see how to do it, if indeed you actually can.
    I would really appreciate it if someone could take a look and let me know if I am going mad, or if we need to get all our users onto IE8. We have now gone live with Apex 4.02 and need to resolve these issues.
    Thanks in advance.
    Edited by: DooRon on 10-Mar-2011 05:13

  • Crystal report using ABAP from SAP ECC6.0 EHP 3.0

    Hi Gurus,
    Can i create crystal report using ABAP in SAP ECC 6.0 EHP 3 . as i am not able to see this link in SPRO.
    IMG > SAP NetWeaver > Application Server > SAP List Viewer > Maintain SAP GUI Specific Settings.
    Kindly guide me urgently.

    http://help.sap.com/saphelp_slc/helpdata/en/27/c9ee1951fc4fb9ac322ac7e6fa7372/content.htm
    If I understood your question correctly.
    Have a look in the link above.
    It is possible to use Crystal Reports from ALV.
    Tammy Powlas also has some good guides on how to do this.
    The ABAP however is not covered that much.
    Best Regards
    Ingrid

  • Missing code in "Offline Interactive Forms Using ABAP" SDN document?

    I am trying to build a sample offline form scenario using the code published in the SDN document "Offline Interactive Forms Using ABAP" written by Vani Krishnamoorthy. Everything works perfectly up to the point where we instantiate the PDF Object to extract the data from the form. Then there seems to be some code missing just before we call the method SET_DOCUMENT. We are supposed to export the parameter pdfdata = pdf_data , but I cannot find where pdf_data variable is declared or assigned. Also, an ENDTRY statement seems to be missing.
    Has anyone had success with Vani's offline scenario, and if so, do you know what code is missing, if any?
    Thanks in advance for any help you can offer.

    I found the missing code in sample program FP_PDF_TEST_06. Everything works well now.
    The PDF file that was uploaded from the PC first needs to be converted from binary to XSTRING before you can create the PDF object:
    data: lt_rawtab type standard table of raw255,
            g_pdfdata type xstring,
            l_len type i.
      call method cl_gui_frontend_services=>gui_upload
        exporting
          filename                = l_filename
          filetype                = 'BIN'
        importing
          filelength              = l_len
        changing
          data_tab                = lt_rawtab   "PDF file (binary)
        exceptions
          file_open_error         = 1
          file_read_error         = 2
          etc. etc.
    Convert binary tab to Xstring
      call function 'SCMS_BINARY_TO_XSTRING'
        exporting
          input_length = l_len
        importing
          buffer       = g_pdfdata              "converted to Xstring         
        tables
          binary_tab   = lt_rawtab
        exceptions
          failed       = 1
          others       = 2.
      if sy-subrc is not initial.
        message id sy-msgid type sy-msgty number sy-msgno
                   with sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
      endif.
    Instantiate PDF object..
      data: l_fp     type ref to if_fp value is initial,
            l_pdfobj type ref to if_fp_pdf_object value is initial,
            l_fpex    type ref to cx_fp_runtime,
            l_type    type string,
            l_errmsg  type string.
    Get FP reference
      l_fp = cl_fp=>get_reference( ).
    Handle exceptions with Try..Endtry
      try.
      Create PDF Object using destination 'ADS' (<--this is how it is
      defined in SM59)
          l_pdfobj = l_fp->create_pdf_object( connection = 'ADS' ).
      Set document
          l_pdfobj->set_document( exporting pdfdata = g_pdfdata ). 
      Tell PDF object to extract data
          l_pdfobj->set_extractdata( ).
      Execute the call to ADS
          l_pdfobj->execute( ).
        catch cx_fp_runtime_internal
              cx_fp_runtime_system
              cx_fp_runtime_usage into l_fpex.
          case cl_abap_classdescr=>get_class_name( l_fpex ).
            when '\CLASS=CX_FP_RUNTIME_INTERNAL'.
              l_type = 'INTERNAL ERROR'.
            when '\CLASS=CX_FP_RUNTIME_SYSTEM'.
              l_type = 'SYSTEM ERROR'.
            when '\CLASS=CX_FP_RUNTIME_USAGE'.
              l_type = 'USAGE ERROR'.
          endcase.
          l_errmsg = l_fpex->get_short( ).
          message e010(ad) with l_type ':' l_errmsg.
      endtry.

  • Open CR report using ABAP

    Hi experts,
    I publish a CR report to BOE. Can I open that CR report using ABAP? If it can, How to do it ?
    Thanks

    Hi Henry,
    There is an environment for report layout designing. For a list of possible data sources, take a look at http://support.businessobjects.com/library/kbase/articles/c2001031.asp.
    Also you can refer to the following ling for all CR related implementation in SAP:
    https://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/004aacbb-4983-2b10-8da7-cdff5dcbb948.
    Hope it helps...

  • WebI Report using BW Query

    Hi,
    I am using WebI Report using BW Query. I don't see some Formulas in Universe which is there in BEx Query.
    Did anybody face the same problem before?

    Hi,
    I meant that you should post in the forum the calculation contained in the formula that you cannot see in your universe.
    But let's start from the begining since you are new to SAP: Did you generated the universe yourself? If the formula was added in the query after the universe was created then you must refresh your universe (In the Universe designer  please select the option "Refresh structure" under the "view" menu) in order to get the newly created formula (I assume we are takling about a calculate figure here) in your universe also.
    Regards,
    Stratos

  • Interactive report using alv.

    Hello all,
    I want to create an interactive report using alv grid display.I tried it using the normal method,as in using hide n sy-lsind but could not get the display.Canu please help me out with the problem.
    Thanks and Regards.
    Seema.

    hai Seema,
    for interactivereporting u can use get cursor fieldstatement.
    GET CURSOR FIELD <f> [VALUE <val>] .
    or try this one using the user command function.
    EXAMPLE:
    DEFINE m_fieldcat.
      add 1 to ls_fieldcat-col_pos.
      ls_fieldcat-fieldname   = &1.
      ls_fieldcat-ref_tabname = &2.
      append ls_fieldcat to lt_fieldcat.
    END-OF-DEFINITION.
    TABLES : vbak.                         " Sales Document: Header Data
    TYPE-POOLS: slis.                      " ALV Global types
    SELECT-OPTIONS :
      s_vkorg FOR vbak-vkorg,              " Sales organization
      s_kunnr FOR vbak-kunnr,              " Sold-to party
      s_vbeln FOR vbak-vbeln.              " Sales document
    SELECTION-SCREEN :
      SKIP, BEGIN OF LINE,COMMENT 5(27) v_1 FOR FIELD p_max.    "#EC NEEDED
    PARAMETERS p_max(2) TYPE n DEFAULT '20' OBLIGATORY.
    SELECTION-SCREEN END OF LINE.
    DATA:
    Data displayed in the first list
      BEGIN OF gt_vbak OCCURS 0,
        vkorg LIKE vbak-vkorg,             " Sales organization
        kunnr LIKE vbak-kunnr,             " Sold-to party
        vbeln LIKE vbak-vbeln,             " Sales document
        netwr LIKE vbak-netwr,             " Net Value of the Sales Order
      END OF gt_vbak,
    Data displayed in the second list
      BEGIN OF gt_vbap OCCURS 0,
        vbeln  LIKE vbap-vbeln,            " Sales document
        posnr  LIKE vbap-posnr,            " Sales document item
        matnr  LIKE vbap-matnr,            " Material number
        arktx  LIKE vbap-arktx,            " Short text for sales order item
        kwmeng LIKE vbap-kwmeng,           " Order quantity
        netwr  LIKE vbap-netwr,            " Net value of the order item
      END OF gt_vbap.
    INITIALIZATION.
      v_1 = 'Maximum of records to read'.
    START-OF-SELECTION.
      PERFORM f_read_data_vbak.
      PERFORM f_display_data_vbak.
         Form  f_read_data_vbak
    FORM f_read_data_vbak.
      SELECT * INTO CORRESPONDING FIELDS OF TABLE gt_vbak
               FROM vbak
                 UP TO p_max ROWS
              WHERE kunnr IN s_kunnr
                AND vbeln IN s_vbeln
                AND vkorg IN s_vkorg.
    ENDFORM.                               " F_READ_DATA_VBAK
         Form  f_display_data_vbak
    FORM f_display_data_vbak.
      DATA:
        ls_fieldcat TYPE slis_fieldcat_alv,
        lt_fieldcat TYPE slis_t_fieldcat_alv.
    Build the field catalog
      m_fieldcat 'VKORG' 'VBAK'.
      m_fieldcat 'KUNNR' 'VBAK'.
      m_fieldcat 'VBELN' 'VBAK'.
      m_fieldcat 'NETWR' 'VBAK'.
    Display the first list
      CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
           EXPORTING
                i_callback_program      = sy-cprog
                i_callback_user_command = 'USER_COMMAND'
                it_fieldcat             = lt_fieldcat
           TABLES
                t_outtab                = gt_vbak.
    ENDFORM.                               " F_DISPLAY_DATA_VBAK
          FORM USER_COMMAND                                             *
    FORM user_command USING u_ucomm     LIKE sy-ucomm
                            us_selfield TYPE slis_selfield.     "#EC CALLED
      CASE u_ucomm.
        WHEN '&IC1'.
          READ TABLE gt_vbak INDEX us_selfield-tabindex.
          CHECK sy-subrc EQ 0.
          PERFORM f_read_data_vbap.        " Read data from VBAP
          PERFORM f_display_data_vbap.
      ENDCASE.
    ENDFORM.                               " USER_COMMAND
         Form  f_read_data_vbap
    FORM f_read_data_vbap.
      SELECT * INTO CORRESPONDING FIELDS OF TABLE gt_vbap
               FROM vbap
              WHERE vbeln = gt_vbak-vbeln.
    ENDFORM.                               " F_READ_DATA_VBAP
         Form  f_display_data_vbap
    FORM f_display_data_vbap.
      DATA:
        ls_fieldcat TYPE slis_fieldcat_alv,
        lt_fieldcat TYPE slis_t_fieldcat_alv.
    Build the field catalog
      m_fieldcat 'VBELN'  'VBAP'.
      m_fieldcat 'POSNR'  'VBAP'.
      m_fieldcat 'MATNR'  'VBAP'.
      m_fieldcat 'ARKTX'  'VBAP'.
      m_fieldcat 'KWMENG' 'VBAP'.
      m_fieldcat 'NETWR'  'VBAP'.
    Display the second list
      CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
           EXPORTING
                it_fieldcat = lt_fieldcat
           TABLES
                t_outtab    = gt_vbap.
    ENDFORM.   
    regards,
    praba.

Maybe you are looking for

  • Error while creating the 'LOV' type parameter in Siebel 8.1.1.5

    Hi, One of my Customer is facing the below error while creatting the parameter of type 'LOV' in Parameter applet in Siebel 8.1.1.5 Runtime Error! Program: C:\Program Files\Internet Explorer\iexplorer.exe This application has requested the Runtime to

  • Soap adapter default encoding

    Hi there, we have a XI <-> webservice scenario, where the XML messages are sent in a string (the wsdl is wrapped, literal) with digital signing. As of now, we have a problem in the digital signing, since the webservice won't validate the signature. W

  • How to empty start up disk

    How do I empty or reduce the items in my start up disk?

  • Help with times please

    I basically want to know if this is normal or not, some real short videos are taking forever to export. For example, I have a sony HD SR-12 recording in HD format, and I had two clips in a final cut sequence that I put together, totaling about 7 minu

  • Entire album has turned orange in color

    Anyone have any of your photos in iPhoto turn orange? Wow, just like real film...amazing - an entire album of 100+ photos is orange! Ideas why this would happen or ? Thank you!