How to Open new screen for single click on ALV icon.

Hi All,
Can any body help me regarding the below ALV requirement.
I need to create a executable program ZPROGRAM with a table having field to store long text.The ALV report should display records according to the selection screen parameters with a icon in each record when clicked should open a new screen with present data in the field and must be able to save the entered long text.
Can any body give me the idea after displaying the simple ALV in the output,
How to open new screen(not the Pop-up’s) after single click on the icon,
in that I should be able to modify & save the long text in my ZTABLE and
able to retrieve the same text for single clicked icon record.
which function modules/Classes/Methods can we use for this requirement.
And how retrieve the same text for this record.
Thanks in advance.
Regards,
Kalam A.

*& Report  ZTEST_ALV
REPORT  ZTEST_ALV.
TYPE-POOLS slis.
DATA: gt_fieldcat TYPE TABLE OF slis_fieldcat_alv .
DATA: gs_layout  TYPE slis_layout_alv.
DATA: gt_list_top_of_page TYPE slis_t_listheader.
DATA: gt_sortinfo_alv   TYPE  slis_t_sortinfo_alv.
DATA: gs_print_alv TYPE slis_print_alv.
DATA: gs_grid TYPE lvc_s_glay.
DATA: gt_event TYPE slis_t_event.
DATA: gs_event TYPE slis_alv_event.
DATA: BEGIN OF GT_DISPLAY OCCURS 100.
   INCLUDE STRUCTURE MARA.
   DATA: BOX.
DATA: END OF GT_DISPLAY.
START-OF-SELECTION.
SELECT * FROM MARA UP TO 50 ROWS
  INTO CORRESPONDING FIELDS OF TABLE GT_DISPLAY.
End-of-Selection.
  PERFORM build_alv.
  PERFORM display_screen .
FORM build_alv .
  DATA: ls_fieldcat LIKE LINE OF gt_fieldcat.
  DATA: ls_top TYPE LINE OF slis_t_listheader.
  DATA: ls_sort TYPE slis_sortinfo_alv.
  CLEAR: ls_fieldcat, gt_fieldcat[], ls_top,gt_list_top_of_page[],
         ls_sort,gs_grid,gs_print_alv,gt_sortinfo_alv[].
*&-----gs_layout definition.
gs_layout-zebra = 'X'.
gs_layout-detail_popup = 'X'.          "ÊÇ·ñµ¯³öÏêϸÐÅÏ¢´°¿Ú
gs_layout-f2code = '&ETA'.             "ÉèÖô¥·¢µ¯³öÏêϸÐÅÏ¢´°¿ÚµÄ¹¦ÄÜÂë,ÕâÀïÊÇË«»÷
  gs_layout-no_vline = ' '.              "ÉèÖÃÁмä¸ôÏß
  gs_layout-colwidth_optimize = 'X'.     "ÓÅ»¯Áпí
  gs_layout-detail_initial_lines = 'X'.
gs_layout-coltab_fieldname = 'LINE_COLOR'. "Line_colorΪgt_displayµÄÒ»¸ö×Ö¶Î,¾ßÌåÑÕÉ«ÉèÖüûÏÂÃæ˵Ã÷.
  gs_layout-hotspot_fieldname = 'MATNR'.
gs_layout-detail_titlebar = 'ÏêϸÄÚÈÝ'. "ÉèÖõ¯³ö´°¿ÚµÄ±êÌâÀ¸
gs_layout-group_change_edit = 'X'.
*&-----gs_grid definition.
  gs_grid-top_p_only = 'X'.
*&-----gs_print_alv definition.
  gs_print_alv-prnt_title = 'X'.
  gs_print_alv-prnt_info = 'X'.
*&-----gt_sortinfo_alv definition. С¼Æ
  ls_sort-fieldname = 'MTART'.
  ls_sort-tabname =  'GT_DISPLAY'.
  ls_sort-subtot = 'X'.
  ls_sort-spos      = 1.
  ls_sort-up        = 'X'.
ls_sort-group = 'UL'.
  APPEND ls_sort TO gt_sortinfo_alv.
  ls_sort-fieldname = 'AENAM'.
  ls_sort-tabname =  'GT_DISPLAY'.
  ls_sort-subtot = 'X'.
  ls_sort-spos      = 1.
  ls_sort-up        = 'X'.
ls_sort-group = 'UL'.
  APPEND ls_sort TO gt_sortinfo_alv.
*&-----slis_t_listheader definition. title.
  CLEAR  ls_top.
  ls_top-key  = 'µ±Ç°ÈÕÆÚ:'.
  ls_top-typ  = 'S'.  " H = Header, S = Selection, A = Action
  CONCATENATE  sy-datum0(4)   '-' sy-datum4(2) '-' sy-datum+6(2) INTO ls_top-info .
  APPEND ls_top TO gt_list_top_of_page.
  CLEAR  ls_top.
  ls_top-key  = 'title'.
  ls_top-typ  = 'S'.  " H = Header, S = Selection, A = Action
  ls_top-info = space.
  APPEND ls_top TO gt_list_top_of_page.
*&-----gs_print_alv definition.
  gs_print_alv-prnt_title = 'X'.
  gs_print_alv-prnt_info = 'X'.
*&-----gt_fieldcat definition.
CALL FUNCTION 'REUSE_ALV_FIELDCATALOG_MERGE'
   EXPORTING
     i_program_name     = sy-repid
     i_internal_tabname = 'GT_DISPLAY'
      i_structure_name = 'MARA'
      I_CLIENT_NEVER_DISPLAY = 'X'
     i_inclname         = sy-repid
   CHANGING
     ct_fieldcat        = gt_fieldcat[]
   EXCEPTIONS
     inconsistent_interface = 1
     program_error          = 2
     OTHERS                 = 3.
  ls_fieldcat-hotspot = 'X'.
  MODIFY gt_fieldcat FROM ls_fieldcat INDEX 2.
**-1. definition with macro.
  DEFINE macro.
   col_pos = col_pos + 1.
   ls_fieldcat-tabname   = 'it_typ_data'.
    ls_fieldcat-fieldname = '&1'.
    ls_fieldcat-seltext_l =  &2.
   ls_fieldcat-col_pos   =  col_pos.
    ls_fieldcat-outputlen =  '&3'.
   ls_fieldcat-datatype  =  '&4'.
   ls_fieldcat-do_sum    =  &5.
   ls_fieldcat-edit    =   &6.
   ls_fieldcat-checkbox  =   &7.
   ls_fieldcat-key   =   &9.
   ls_fieldcat-fix_column =  &10.
   ls_fieldcat-no_out =  &11.
    ls_fieldcat-ref_fieldname = &4.    " System F4 Effect.
    ls_fieldcat-ref_tabname   =  &5.   " System F4 Effect.
    ls_fieldcat-hotspot   =   &6.
    append ls_fieldcat to gt_fieldcat.
    clear ls_fieldcat.
  END-OF-DEFINITION.
  macro matnr     'matnr'            18   'MATNR'   'MARA'  'X'.
  macro MTART     'MTART'            18      'MTART' 'MARA'  ''.
  macro  AENAM    'AENAM'            18       'MAENAM'  'MARA'   ''.
**-2. definition one-by-one.
CLEAR ls_fieldcat.
ls_fieldcat-fieldname = 'MATNR'.
ls_fieldcat-seltext_s = 'ÎïÁÏ'.
ls_fieldcat-ref_fieldname = 'ROLLNAME'.
ls_fieldcat-ref_tabname   =  'DD03L'.
APPEND ls_fieldcat TO gt_fieldcat.
ENDFORM.                    "build_alv
FORM display_screen .
CALL FUNCTION 'REUSE_ALV_EVENTS_GET'
   EXPORTING
     i_list_type     = 0
   IMPORTING
     et_events       = gt_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 gt_event INTO gs_event WITH KEY name = 'TOP_OF_PAGE'.
IF sy-subrc EQ 0.
   gs_event-form = 'TOP_OF_PAGE'.
   MODIFY gt_event FROM gs_event INDEX sy-tabix.
ENDIF.
  CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
    EXPORTING
  I_INTERFACE_CHECK                 = ' '
  I_BYPASSING_BUFFER                = ' '
  I_BUFFER_ACTIVE                   = ' '
     i_callback_program                = sy-repid
    i_callback_pf_status_set          = 'PF_STATUS_SET '
     i_callback_user_command           = 'USER_COMMAND'
    i_callback_top_of_page            = 'TOP_OF_PAGE'
   I_CALLBACK_HTML_TOP_OF_PAGE       = 'HTML_TOP_OF_PAGE'
  I_CALLBACK_HTML_END_OF_LIST       = ' '
  I_STRUCTURE_NAME                  =
    I_BACKGROUND_ID                   = 'ALV_BACKGROUND'    "When top-of-page is initial.
  I_GRID_TITLE                      =
  I_GRID_SETTINGS                   =
     is_layout                         = gs_layout
     it_fieldcat                       = gt_fieldcat[]
  IT_EXCLUDING                      =
  IT_SPECIAL_GROUPS                 =
    it_sort                           =  gt_sortinfo_alv[]
  IT_FILTER                         =
  IS_SEL_HIDE                       =
  I_DEFAULT                         = 'X'
   I_SAVE                            = 'A'
  IS_VARIANT                        =
  IT_EVENTS                         = gt_event
  IT_EVENT_EXIT                     =
   IS_PRINT                          = gs_print_alv
  IS_REPREP_ID                      =
  I_SCREEN_START_COLUMN             = 0
  I_SCREEN_START_LINE               = 0
  I_SCREEN_END_COLUMN               = 0
  I_SCREEN_END_LINE                 = 0
  I_HTML_HEIGHT_TOP                 = 0
  I_HTML_HEIGHT_END                 = 0
  IT_ALV_GRAPHICS                   =
  IT_HYPERLINK                      =
  IT_ADD_FIELDCAT                   =
  IT_EXCEPT_QINFO                   =
  IR_SALV_FULLSCREEN_ADAPTER        =
IMPORTING
  E_EXIT_CAUSED_BY_CALLER           =
  ES_EXIT_CAUSED_BY_USER            =
    TABLES
      t_outtab                          = gt_display
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_screen
FORM user_command          USING ucomm LIKE sy-ucomm
                           selfield TYPE slis_selfield.
Data ref1 type ref to cl_gui_alv_grid.
  CALL FUNCTION 'GET_GLOBALS_FROM_SLVC_FULLSCR' "Check Box need fieldcat-checkbox, input and edit.
     IMPORTING
       E_GRID = ref1.
  CASE ucomm.
    WHEN '&IC1'. " SAP standard code for double-clicking
READ TABLE gt_display INTO gs_display INDEX  slis_selfield-tabindex.
CHECK sy-subrc = 0.
     CASE  selfield-fieldname  .
       WHEN 'PLNUM'.
         SET PARAMETER ID 'PAF' FIELD gs_display-plnum.
         CALL TRANSACTION 'MD12' AND SKIP FIRST SCREEN.
       WHEN  'POSNR'.
       SUBMIT  rvscd100 USING SELECTION-SCREEN '1000' WITH vbeln = gs_display-vbeln
                                                      WITH posnr = gs_display-posnr
                                                      WITH zinfo = 'X'
                                                      AND RETURN.
     ENDCASE.
   IF selfield-sel_tab_field = 'OUT_ITAB-PI_SL'. " Line detail.
       READ TABLE i_output INTO pisl_itab INDEX selfield-tabindex.
       IF sy-subrc EQ 0.
   ENDIF.
    WHEN 'CHANGE'.
     CALL METHOD ref1->check_changed_data.
     CALL METHOD ref1->refresh_table_display.
*5´Ë´¦´úÂë×èÖ¹'REUSE_ALV_GRID_DISPLAY´´½¨ÐµÄÆÁÄ»£¬Ôì³ÉÆÁÄ»¶à²ã
     selfield-refresh = 'X'.
    WHEN 'SWITCH'.
     PERFORM switch_edit_mode.
    WHEN OTHERS.
  ENDCASE.
ENDFORM.                    "user_command
Add your code in user_command form.
WHEN you click matnr ucomm eq '&IC1'.
Message was edited by:
        Chunhai Hu

Similar Messages

  • I can no longer open new tabs, either by clicking on the icon or hitting control T. I have tried reinstalling.

    I can no longer open new tabs, either by clicking on the plus sign or by hitting control T. I tried re-installing, but it didn't help.

    Try uninstalling the Ask toolbar and it should work again. There is a compatibility issue with the Ask toolbar and the current version of Firefox.

  • Enabling screen for single click in OOABAP alvs

    Hello All,
    I have a requirement where I am displaying ALV grid in screen 100. In this grid I have defined double click event in which I call 101 screen (with coordinates i.e. starting at 10 10) which displays another grid. The problem here is that in screen 101 the buttons and screen fields are not responding to single click. I mean that for every action (change the cell value in 101 screen ot selecting a row or clicking on pushbutton in this 101 screen) I have to click twice. But I want all this actions to be performed with single click. If anyone knows the solution to know please let me know.
    Note: <b>Helpful answers will be duly rewarded.</b>

    Please do not make duplicate postings.
    Rob

  • Runtime.exec() - how to open new window for new program?

    Hi,
    I have searched through the forums but haven't found an answer to this one yet. I am using runtime.exec() to start up a new java program. At first I thought it wasn't running properly but, after checking task manager, I have discovered that the new program I open runs, it is just completely invisible to me. I am wondering how I can get the new program to run in a command window or something where I can monitor it.
    Thank you for your help,
    Drew

    Thank you all. After trying to figure out why the start command wouldn't work in the runtime.exec() call(not an executable - I am a dolt), I tried putting it in a batch file and it worked perfectly. Thanks for your help,
    Drew

  • How to open new browser window on click of command button

    Hi,
    We have a requirement to open an image in new window when a command button is clicked. Is there any sample explaining how to do that?
    Thanks in Advance,
    Pradeep

    Hi,
    I have to load an applet viewer in the new browser window. I have URL to the PDF.
    I ma able to load the applet viewer in new browser window using javascript. But I have to load the new PDF if the same window in already opened.
    The issue here is , i am loosing the window handle if the parent page is refreshed. I want to store the window handle in session scope variable and use the same.
    How do i update the session scope variable using javascript?
    Thanks and Regards,
    Pradeep

  • FillBy always fills in the same row in data grid view. How to make it fill in a new row for each click of the Fillby Button? VB 2010 EXPRESS?

    Hi there, 
    I am a beginner in Visual Basic Express 2010. I have a Point of Sale program that uses DataGridView to display records from an external microsoft access
    database using the fillby query. 
    It works, but it repopulates the same row each time, but i want to be able to display multiple records at the same time, a new row should be filled for
    each click of the fillby button. 
    also I want to be able to delete any records if the customer suddenly decides to not buy an item after it has already been entered. 
    so actually 2 questions here: 
    1. how to populate a new row for each click of the fillby button 
    2. how to delete records from data grid view after an item has been entered 
    Thanks 
    Vishwas

    Hello,
    The FillBy method loads data according to what the results are from the SELECT statement, so if there is one row then you get one row in the DataGridView, have two rows then two rows show up.
    Some examples
    Form load populates our dataset with all data as it was defined with a plain SELECT statement. Button1 loads via a query I created after the fact to filter on a column, the next button adds a new row to the existing data. When adding a new row it is appended
    to the current data displayed and the primary key is a negative value but the new key is shown after pressing the save button on the BindingNavigator or there are other ways to get the new key by manually adding the row to the backend table bypassing the Adapter.
    The following article with code shows this but does not address adapters.
    Conceptually speaking the code in the second code block shows how to get the new key
    Public Class Form1
    Private Sub StudentsBindingNavigatorSaveItem_Click(
    sender As Object, e As EventArgs) Handles StudentsBindingNavigatorSaveItem.Click
    Me.Validate()
    Me.StudentsBindingSource.EndEdit()
    Me.TableAdapterManager.UpdateAll(Me.MyDataSet)
    End Sub
    Private Sub Form1_Load(sender As Object, e As EventArgs) Handles MyBase.Load
    'TODO: This line of code loads data into the 'MyDataSet.Students' table. You can move, or remove it, as needed.
    Me.StudentsTableAdapter.Fill(Me.MyDataSet.Students)
    End Sub
    Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
    Me.StudentsTableAdapter.FillBy(Me.MyDataSet.Students, ComboBox1.Text)
    End Sub
    Private Sub Button2_Click(sender As Object, e As EventArgs) Handles Button2.Click
    Me.MyDataSet.Students.AddStudentsRow("Jane", "Adams", "Female")
    End Sub
    End Class
    Get new key taken from
    this article.
    Public Function AddNewRow(ByVal sender As Customer, ByRef Identfier As Integer) As Boolean
    Dim Success As Boolean = True
    Try
    Using cn As New OleDb.OleDbConnection With {.ConnectionString = Builder.ConnectionString}
    Using cmd As New OleDb.OleDbCommand With {.Connection = cn}
    cmd.CommandText = InsertStatement
    cmd.Parameters.AddWithValue("@CompanyName", sender.CompanyName)
    cmd.Parameters.AddWithValue("@ContactName", sender.ContactName)
    cmd.Parameters.AddWithValue("@ContactTitle", sender.ContactTitle)
    cn.Open()
    cmd.ExecuteNonQuery()
    cmd.CommandText = "Select @@Identity"
    Identfier = CInt(cmd.ExecuteScalar)
    End Using
    End Using
    Catch ex As Exception
    Success = False
    End Try
    Return Success
    End Function
    In closing I have not given you a solution but hopefully given you some stuff/logic to assist with this issue, if not perhaps I missed what you want conceptually speaking.
    Additional resources
    http://msdn.microsoft.com/en-us/library/fxsa23t6.aspx
    Please remember to mark the replies as answers if they help and unmark them if they provide no help, this will help others who are looking for solutions to the same or similar problem.

  • My mum has an iPad 1, the email programme will not open properly.  If you click on the icon it opens only for a few seconds but then shuts.  In that few seconds you cant select anything that you see on screen.  Any ideas? Thanks

    My mum has an iPad 1, the email programme will not open properly.  If you click on the icon it opens only for a few seconds but then shuts.  In that few seconds you cant select anything that you see on screen.  Any ideas? Thanks

    If the Reset Ian mentioned doesn't work...
    Shut down and restart the Mail app...
    - From any Home Screen, double tap the home button to bring up the Recents List
    - Tap and hold any icon in this list until they wiggle
    - Press the red to delete the Mail app from this list.
    - Press the home button twice when done.
    - Restart the Mail app

  • How much is a new screen for a mac book pro

    how much is a new screen for a mac book pro? - mine is cracked and shattered, everything else seems to work at mo?

    check this link ifixit.com

  • How come I am not able to open new tabs? I clicked on new tab and I've tried to click on the + sign next to the current tab, but still I am not able to.

    How come I am not able to open new tabs? I clicked on new tab and I've tried to click on the + sign next to the current tab, but still I am not able to.

    Ask toolbar is the culprit...Thanks!!!

  • I need a new screen for my i phone 3 gs how much is it in the uk

    i need a new screen for my i phone 3 gs how much is it in the uk

    Apple does not repair iPhones, but will replace the entire iPhone for a flat fee; see the Repair Pricing section here:
    http://www.apple.com/support/iphone/service/faq/
    There are independent iPhone repair services that may be able to replace the screen for less. Do a web search for "iPhone repair". Note, though, that if you elect to have the iPhone serviced by an unauthorized shop, all further warranty will be void.
    Regards.

  • One specific webites's zoom is too big how can I decrease the zoom. (the font is normal) If I open new tab for new site that's normal. Im using a laptop. THANKS

    One specific webites's zoom is too big how can I decrease the zoom. (the font is normal) If I open new tab for new site that's normal. Im using a laptop. THANKS

    Reset the page zoom on pages that cause problems: <b>View > Zoom > Reset</b> (Ctrl+0 (zero); Cmd+0 on Mac)
    * http://kb.mozillazine.org/Zoom_text_of_web_pages

  • HT1349 How much is a new screen for iphone 4s?

    Does anyone know how much is a new screen for Iphone 4s?
    Many thanks!!
    C.

    Apple does not sell iPhone parts, and for the iPhone 4S, the replace the phone. Cost is US $199.

  • I would like to know how much it would cost to have a new screen for my iPhone 4? Does anyone know? Thanks

    I would like to know how much it would cost to have a new screen for my iPhone 4? Does anyone know? Thanks

    It depends on the country:
    In the U.S:
    Out-of-Warranty Service
    If you own an iPhone that is ineligible for warranty service but is eligible for Out-of-Warranty (OOW) Service, Apple will service your iPhone for the Out-of-Warranty Service fee listed below.
    iPhone model
    Out-of-Warranty Service
    iPhone 4S
    $199
    iPhone 4, iPhone 3GS,
    iPhone 3G, Original iPhone
    $149
    A $6.95 shipping fee will be added if you arrange service online or by calling Apple Technical Support. All fees are in U.S. dollars and are subject to local tax"
    http://support.apple.com/kb/index?page=servicefaq&geo=United_States&product=ipho ne

  • Need Help to create new screen for RF Sapconsole

    Hi Guru's
    I'm new on RF (but some years in ABAP) since last week.
    I need help to create new screens for RF (SAPLLMOB).
    Can someone explain me the procedure to create screen (with ABAP code after) or perhaps someone have an exemple (simple or not) ?
    I have to develop 2 new screens with really few time.
    And, another subsidiary question :
    how SAP can transfert information between the flash gun and the screen i have developped.
    Is there some code to add to enable this functionality or it is include in SAPLLMOB on standard fields ????
    It's a new strange world for me today...
    Many thanks to everyone who can explain me
    Alain

    hi,
    I am facing this problem as well. Is there any reference to create the new screen?
    Hope someone can help! Thanks!
    Regards,
    Darren

  • How to open new window and generate oracle report from apex

    Hi,
    I had created an application that generates PDF files using Oracle Reports, following this Guide.
    http://www.oracle.com/technology/products/database/application_express/howtos/howto_integrate_oracle_reports.html
    And I followed 'Advanced Technique', so that users can't generate PDF file by changing URL and parameters. This is done for security reasons.
    But in this tutorial, when 'Go' button is pressed, the PDF file is displayed on the same window of apex application. If so, user might close the window by mistake. In order to avoid this, another window have to be opened.
    So, I put this code in the BRANCH - URL Target. (Note that this is not in Optional URL Redirect in the button property, but the branch which is called by the button.)
    javascript:popupURL('&REPORTS_URL.quotation&P2100_REP_JOB_ID.')
    But if the button is pressed, I get this error.
    ERR-1777: Page 2100 provided no page to branch to. Please report this error to your application administrator.
    Restart Application
    If I put the code 'javascritpt ....' in the Optional URL Redirect, another window opens successfully, but the Process to generate report job is not executed.
    Does anyone know how to open new window from the Branch in this case?

    G'day Shohei,
    Try putting your javascript into your plsql process using the htp.p(); procedure.
    For example, something along these lines should do it:
    BEGIN
    -- Your other process code goes here...
    htp.p('<script type="javascript/text">');
    htp.p('popupURL("&REPORTS_URL.quotation&P2100_REP_JOB_ID.")');
    htp.p('</script>');
    END;
    What happens is the javascript is browser based whereas your plsql process is server based and so if you put the javascript into your button item Optional URL Redirect it is executed prior to getting to the page plsql process and therefore it will never execute the process. When you have it in your branch which normally follows the processes, control has been handed to the server and the javascript cannot be executed and so your page throws the error "Page 2100 provided no page to branch to"... By "seeding" the plsql process with the embedded javascript in the htp.p() procedure you can achieve the desired result. You could also have it as a separate process also as long as it is sequenced correctly to follow your other process.
    HTH
    Cheers,
    Mike

Maybe you are looking for