Regarding Line Selection

I am displaying the data in a alv grid /  alv list.if i double click a particular field the related data should come(As at line selection).how can i write the code for this

check below code.....
*& Report  ZFI_DOC_STATUS_REPORT                                       *
REPORT  zfi_doc_status_report LINE-SIZE  120
                              LINE-COUNT 60
                              MESSAGE-ID zz.
                  TABLES                                            *
TABLES: zfap_history,
        bkpf,
        bseg,
        t001.
                  TYPE POOLS                                         *
TYPE-POOLS: slis.
                  TYPES                                              *
TYPES: BEGIN OF ty_zfap_history,
         zbukrs     TYPE bukrs,
         zbelnr     TYPE belnr_d,
         zapprlevel TYPE zapprlevel,
         zdate      TYPE crdat,
         ztime      TYPE cvdicrtime,
         zsapuserid TYPE zuserid,
         zstatus    TYPE zstat,
       END OF ty_zfap_history,
       BEGIN OF ty_doc_data,
         blart TYPE blart,
         budat TYPE budat,
         stblg TYPE stblg,
         stodt TYPE stodt,
         waers TYPE waers,
         kzwrs TYPE kzwrs,
         bukrs TYPE bukrs,
         belnr TYPE belnr_d,
       END OF ty_doc_data,
       BEGIN OF ty_final_data,
         zbelnr TYPE belnr_d,
         blart TYPE blart,
         budat TYPE budat,
         waers TYPE waers,
         wrbtr TYPE wrbtr,
         kzwrs TYPE kzwrs,
         dmbe2 TYPE dmbe2,
         name TYPE char80,
         zdate TYPE crdat,
         zstatus TYPE zstat,
         stblg TYPE stblg,
         stodt TYPE stodt,
         writ TYPE char20,
         time TYPE p decimals 2,
       END OF ty_final_data,
       BEGIN OF ty_sec_final,
         zbelnr TYPE belnr_d,
         name TYPE char80,
         approver TYPE zrole_desc,
         date TYPE zbegdat,
         zstatus TYPE zstat,
       END OF ty_sec_final,
       BEGIN OF ty_time,
         zbukrs type bukrs,
         zbelnr type belnr_d,
         diff type p decimals 2,
       END OF ty_time.
                   I N T E R N A L  T A B L E S                     *
DATA: it_zfap_history    TYPE STANDARD TABLE OF ty_zfap_history,
      wa_it_zfap_history TYPE ty_zfap_history,
      it_temp1           TYPE STANDARD TABLE OF ty_zfap_history,
      wa_it_temp1        TYPE ty_zfap_history,
      it_temp2           TYPE STANDARD TABLE OF ty_zfap_history,
      wa_it_temp2        TYPE ty_zfap_history,
      it_zfap_hist       TYPE STANDARD TABLE OF ty_zfap_history,
      wa_it_zfap_hist    TYPE ty_zfap_history,
      it_doc_data        TYPE STANDARD TABLE OF ty_doc_data,
      wa_it_doc_data     TYPE ty_doc_data,
      it_final_data      TYPE STANDARD TABLE OF ty_final_data,
      wa_it_final_data   TYPE ty_final_data,
      it_sec_final       TYPE STANDARD TABLE OF ty_sec_final,
      wa_it_sec_final    TYPE ty_sec_final,
      it_time            TYPE STANDARD TABLE OF ty_time,
      wa_it_time         TYPE ty_time,
      it_fcat            TYPE slis_t_fieldcat_alv WITH HEADER LINE,
      it_fcat_sec        TYPE slis_t_fieldcat_alv WITH HEADER LINE.
*--Structure for layout settings
DATA: wa_layout                 TYPE   slis_layout_alv.
*--Internal table and structure for events
DATA: it_events                 TYPE   slis_t_event,
      wa_events                 TYPE   slis_alv_event.
Variable Declaration
DATA : w_doc_no TYPE belnr_d ,
       w_repid  TYPE sy-repid ,
       w_diff   TYPE p decimals 2.
                  S E L E C  T I O N  S C R E E N                   *
SELECTION-SCREEN: BEGIN OF BLOCK b1 WITH FRAME TITLE text-t01.
SELECTION-SCREEN: SKIP.
SELECT-OPTIONS: s_bukrs      FOR t001-bukrs,
                s_blart      FOR bkpf-blart,
                s_crdat      FOR zfap_history-zdate,
                s_userid     FOR zfap_history-zsapuserid,
                s_budat      FOR bkpf-budat.
SELECTION-SCREEN: END OF BLOCK b1.
               S T A R T  O F  S E L E C T I O N                    *
START-OF-SELECTION.
to get history data
  PERFORM get_history_data.
to get elpased time
  PERFORM get_elapsed_time.
to get document data
  PERFORM get_doc_data.
to move data to final table
  PERFORM move_data.
               E N D O F  S E L E C T I O N                         *
END-OF-SELECTION.
to display data
  PERFORM display_data.
to list secondary list
PERFORM sec_list_data.
*&      Form  GET_HISTORY_DATA
      text
-->  p1        text
<--  p2        text
FORM get_history_data .
  SELECT zbukrs
         zbelnr
         zapprlevel
         zdate
         ztime
         zsapuserid
         zstatus
     FROM zfap_history
     INTO TABLE it_zfap_history
     WHERE   zbukrs     IN s_bukrs  AND
             zdate      IN s_crdat  AND
             zsapuserid IN s_userid AND
             zstatus = 'Submitted'.
  SELECT zbukrs
         zbelnr
         zapprlevel
         zdate
         ztime
         zsapuserid
         zstatus
     FROM zfap_history
     INTO TABLE it_zfap_hist
     FOR ALL ENTRIES IN it_zfap_history
     WHERE   zbukrs = it_zfap_history-zbukrs
     AND     zbelnr = it_zfap_history-zbelnr.
ENDFORM.                    " GET_HISTORY_DATA
*&      Form  GET_DOC_DATA
      text
-->  p1        text
<--  p2        text
FORM get_doc_data .
  SELECT blart
         budat
         stblg
         stodt
         waers
         kzwrs
         bukrs
         belnr
     FROM bkpf
     INTO TABLE it_doc_data
     FOR ALL ENTRIES IN it_zfap_history
          WHERE bukrs = it_zfap_history-zbukrs
          AND   belnr = it_zfap_history-zbelnr
          AND   blart IN s_blart
          AND   budat IN s_budat.
ENDFORM.                    " GET_DOC_DATA
*&      Form  MOVE_DATA
      text
-->  p1        text
<--  p2        text
FORM move_data .
  DATA : l_wrbtr TYPE wrbtr,
         l_dmbe2 TYPE dmbe2,
         l_persnumber TYPE ad_persnum,
         l_name_first TYPE ad_namefir,
         l_name_last TYPE ad_namelas.
  LOOP AT it_zfap_history INTO wa_it_zfap_history.
    READ TABLE it_doc_data INTO wa_it_doc_data
         WITH KEY bukrs = wa_it_zfap_history-zbukrs
                  belnr = wa_it_zfap_history-zbelnr.
    IF sy-subrc = 0.
      wa_it_final_data-zbelnr = wa_it_zfap_history-zbelnr.
      wa_it_final_data-blart = wa_it_doc_data-blart.
      wa_it_final_data-budat = wa_it_doc_data-budat.
      wa_it_final_data-waers = wa_it_doc_data-waers.
      IF wa_it_doc_data-kzwrs is INITIAL.
        wa_it_final_data-kzwrs = 'USD'.
      ELSE.
        wa_it_final_data-kzwrs = wa_it_doc_data-kzwrs.
      ENDIF.
      wa_it_final_data-zdate = wa_it_zfap_history-zdate.
      wa_it_final_data-zstatus = wa_it_zfap_history-zstatus.
      wa_it_final_data-stblg = wa_it_doc_data-stblg.
      wa_it_final_data-stodt = wa_it_doc_data-stodt.
      SELECT SINGLE wrbtr dmbe2
             FROM bseg
             INTO (l_wrbtr, l_dmbe2)
             WHERE bukrs = wa_it_doc_data-bukrs
             AND   belnr = wa_it_doc_data-belnr.
      wa_it_final_data-wrbtr = l_wrbtr.
      wa_it_final_data-dmbe2 = l_dmbe2.
      SELECT SINGLE persnumber
             FROM usr21
             INTO l_persnumber
             WHERE bname = wa_it_zfap_history-zsapuserid.
      SELECT SINGLE name_first name_last
             FROM adrp
             INTO (l_name_first, l_name_last)
             WHERE persnumber = l_persnumber.
      CONCATENATE l_name_last l_name_first INTO wa_it_final_data-name
                              SEPARATED BY space.
      if wa_it_final_data-name is initial.
        wa_it_final_data-name = wa_it_zfap_history-zsapuserid.
      endif.
      wa_it_final_data-writ = ' '.
      read table it_time into wa_it_time
           with key zbukrs = wa_it_zfap_history-zbukrs
                    zbelnr = wa_it_zfap_history-zbelnr.
      if sy-subrc = 0.
        wa_it_final_data-time = wa_it_time-diff.
      endif.
      APPEND wa_it_final_data TO it_final_data.
    ENDIF.
    CLEAR : wa_it_zfap_history, wa_it_doc_data, wa_it_final_data,
            l_wrbtr, l_persnumber, l_name_first, l_name_last, l_dmbe2.
  ENDLOOP.
ENDFORM.                    " MOVE_DATA
*&      Form  DISPLAY_DATA
      text
-->  p1        text
<--  p2        text
FORM display_data .
  w_repid = sy-repid.
  CALL FUNCTION 'REUSE_ALV_FIELDCATALOG_MERGE'
    EXPORTING
      i_program_name         = w_repid
      i_internal_tabname     = 'IT_SRCTRANS'
      i_inclname             = w_repid
    CHANGING
      ct_fieldcat            = it_fcat[]
    EXCEPTIONS
      inconsistent_interface = 1
      program_error          = 2
      OTHERS                 = 3.
  IF sy-subrc   <> 0.
    MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
            WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
  ENDIF.
  IF NOT it_final_data[] IS INITIAL.
    IF it_fcat[] IS INITIAL.
      CLEAR  it_fcat.
      it_fcat-tabname     = 'IT_FINAL_DATA'.
      it_fcat-fieldname   = 'ZBELNR'.
      it_fcat-seltext_l  = 'Document Number'.
      it_fcat-col_pos     = 1.
      it_fcat-outputlen  = 15.
      it_fcat-key = 'X'.
      APPEND it_fcat.
      CLEAR  it_fcat.
      it_fcat-tabname     = 'IT_FINAL_DATA'.
      it_fcat-fieldname   = 'BLART'.
      it_fcat-seltext_l  = 'Document Type'.
      it_fcat-col_pos     = 2.
      it_fcat-outputlen  = 13.
      APPEND it_fcat.
      CLEAR  it_fcat.
      it_fcat-tabname     = 'IT_FINAL_DATA'.
      it_fcat-fieldname   = 'BUDAT'.
      it_fcat-seltext_l  = 'Posting Date'.
      it_fcat-col_pos     = 3.
      it_fcat-outputlen  = 12.
      APPEND it_fcat.
      CLEAR  it_fcat.
      it_fcat-tabname     = 'IT_FINAL_DATA'.
      it_fcat-fieldname   = 'WAERS'.
      it_fcat-seltext_l  = 'Document Currency'.
      it_fcat-col_pos     = 4.
      it_fcat-outputlen  = 17.
      APPEND it_fcat.
      CLEAR  it_fcat.
      it_fcat-tabname     = 'IT_FINAL_DATA'.
      it_fcat-fieldname   = 'WRBTR'.
      it_fcat-seltext_l  = 'Doc Curr Amt'.
      it_fcat-col_pos     = 5.
      it_fcat-outputlen  = 22.
      APPEND it_fcat.
      CLEAR  it_fcat.
      it_fcat-tabname     = 'IT_FINAL_DATA'.
      it_fcat-fieldname   = 'KZWRS'.
      it_fcat-seltext_l  = 'Group Currency'.
      it_fcat-col_pos     = 6.
      it_fcat-outputlen  = 14.
      APPEND it_fcat.
      CLEAR  it_fcat.
      it_fcat-tabname     = 'IT_FINAL_DATA'.
      it_fcat-fieldname   = 'DMBE2'.
      it_fcat-seltext_l  = 'Grp Curr Amt'.
      it_fcat-col_pos     = 7.
      it_fcat-outputlen  = 22.
      APPEND it_fcat.
      CLEAR  it_fcat.
      it_fcat-tabname     = 'IT_FINAL_DATA'.
      it_fcat-fieldname   = 'NAME'.
      it_fcat-seltext_l  = 'Name of Submitter/Requestor'.
      it_fcat-col_pos     = 8.
      it_fcat-outputlen  = 60.
      APPEND it_fcat.
      CLEAR  it_fcat.
      it_fcat-tabname     = 'IT_FINAL_DATA'.
      it_fcat-fieldname   = 'ZDATE'.
      it_fcat-seltext_l  = 'Creation Date'.
      it_fcat-col_pos     = 9.
      it_fcat-outputlen  = 13.
      APPEND it_fcat.
      CLEAR  it_fcat.
      it_fcat-tabname     = 'IT_FINAL_DATA'.
      it_fcat-fieldname   = 'ZSTATUS'.
      it_fcat-seltext_l  = 'Status'.
      it_fcat-col_pos     = 10.
      it_fcat-outputlen  = 6.
      APPEND it_fcat.
      CLEAR  it_fcat.
      it_fcat-tabname     = 'IT_FINAL_DATA'.
      it_fcat-fieldname   = 'TIME'.
      it_fcat-seltext_l  = 'Elpsed time in Mins'.
      it_fcat-col_pos     = 11.
      it_fcat-outputlen  = 20.
      APPEND it_fcat.
      CLEAR  it_fcat.
      it_fcat-tabname     = 'IT_FINAL_DATA'.
      it_fcat-fieldname   = 'STBLG'.
      it_fcat-seltext_l  = 'Reversal No'.
      it_fcat-col_pos     = 12.
      it_fcat-outputlen  = 12.
      APPEND it_fcat.
      CLEAR  it_fcat.
      it_fcat-tabname     = 'IT_FINAL_DATA'.
      it_fcat-fieldname   = 'STODT'.
      it_fcat-seltext_l  = 'Reversal Posting Date'.
      it_fcat-col_pos     = 13.
      it_fcat-outputlen  = 20.
      APPEND it_fcat.
      CLEAR  it_fcat.
      it_fcat-tabname     = 'IT_FINAL_DATA'.
      it_fcat-fieldname   = 'WRIT'.
      it_fcat-seltext_l  = 'Work Item'.
      it_fcat-col_pos     = 14.
      it_fcat-outputlen  = 20.
      APPEND it_fcat.
    ENDIF.
    CALL FUNCTION 'REUSE_ALV_EVENTS_GET'
      EXPORTING
        i_list_type     = 0
      IMPORTING
        et_events       = it_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.
    wa_layout-colwidth_optimize = 'X'.
    CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
        EXPORTING
        i_callback_program                = w_repid
        is_layout                = wa_layout
        i_callback_user_command  = 'USER_COMMAND_ACCT'
        i_grid_title             = 'Document Status Report'
         it_fieldcat                       = it_fcat[]
     IT_SORT                        = IT_SORT[]
         it_events                = it_events
         TABLES
           t_outtab                        = it_final_data[]
      EXCEPTIONS
        program_error                     = 1
        OTHERS                            = 2.
  ENDIF.
ENDFORM.                    " DISPLAY_DATA
*&      Form  user_command_acct
      text
     -->P_UCOMM    text
     -->P_SELFLD   text
FORM user_command_acct USING p_ucomm TYPE sy-ucomm
                        p_selfld TYPE slis_selfield.
  CASE p_ucomm.
*when double clicked on ALV grid , report id is passed to transaction
    WHEN '&IC1'.    "Double click
      clear p_ucomm.
      IF p_selfld-fieldname = 'ZBELNR'.
        w_doc_no = p_selfld-value.
*--Form to get second list records based on Doc number
        PERFORM sec_list_data.
        IF NOT it_sec_final IS INITIAL .
*--Form to get the second list fieldcatolog
          PERFORM fill_fieldcat_sec.
*Perform to display the Second ALV report
          PERFORM display_sec_list.
        ENDIF.
      ELSE.
        MESSAGE i001(zz) WITH text-004.
      ENDIF.
  ENDCASE.
ENDFORM.                    "user_command_acct
*&      Form  SEC_LIST_DATA
      text
-->  p1        text
<--  p2        text
FORM sec_list_data .
  DATA: l_role_id TYPE zroleid,
        l_zrole_desc TYPE zrole_desc,
         l_persnumber TYPE ad_persnum,
         l_name_first TYPE ad_namefir,
         l_name_last TYPE ad_namelas.
  CLEAR : it_sec_final .
  REFRESH : it_sec_final .
  LOOP AT it_zfap_hist INTO wa_it_zfap_hist WHERE zbelnr = w_doc_no.
    IF wa_it_zfap_hist-zstatus = 'Submitted'.
      CLEAR : wa_it_sec_final.
      wa_it_sec_final-zbelnr     = wa_it_zfap_hist-zbelnr.
      SELECT SINGLE persnumber
             FROM usr21
             INTO l_persnumber
             WHERE bname = wa_it_zfap_hist-zsapuserid.
      SELECT SINGLE name_first name_last
             FROM adrp
             INTO (l_name_first, l_name_last)
             WHERE persnumber = l_persnumber.
      CONCATENATE l_name_last l_name_first INTO wa_it_sec_final-name
                              SEPARATED BY space.
    ENDIF.
    IF wa_it_zfap_hist-zstatus NE 'Submitted'.     " 'Approve'.
      wa_it_sec_final-date = wa_it_zfap_hist-zdate.
      wa_it_sec_final-zstatus = wa_it_zfap_hist-zstatus.
      SELECT SINGLE persnumber
             FROM usr21
             INTO l_persnumber
             WHERE bname = wa_it_zfap_hist-zsapuserid.
      SELECT SINGLE name_first name_last
             FROM adrp
             INTO (l_name_first, l_name_last)
             WHERE persnumber = l_persnumber.
     CONCATENATE l_name_last l_name_first INTO wa_it_sec_final-approver
                             SEPARATED BY space.
      APPEND wa_it_sec_final TO it_sec_final.
      CLEAR : l_role_id, l_zrole_desc.
    ENDIF.
    CLEAR : wa_it_zfap_hist.
  ENDLOOP.
sort it_sec_final by zbelnr .
delete adjacent duplicates from it_sec_final .
ENDFORM.                    " SEC_LIST_DATA
*&      Form  fill_fieldcat_sec
      text
-->  p1        text
<--  p2        text
FORM fill_fieldcat_sec .
  CLEAR : it_fcat_sec[]   .
  REFRESH : it_fcat_sec[].
  CALL FUNCTION 'REUSE_ALV_FIELDCATALOG_MERGE'
    EXPORTING
      i_program_name         = w_repid
      i_internal_tabname     = 'IT_SEC_FINAL'
      i_inclname             = w_repid
    CHANGING
      ct_fieldcat            = it_fcat_sec[]
    EXCEPTIONS
      inconsistent_interface = 1
      program_error          = 2
      OTHERS                 = 3.
  IF sy-subrc   <> 0.
    MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
            WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
  ENDIF.
  IF NOT it_sec_final[] IS INITIAL.
    IF it_fcat_sec[] IS INITIAL.
      CLEAR  it_fcat_sec.
      it_fcat_sec-tabname     = 'IT_SEC_FINAL'.
      it_fcat_sec-fieldname   = 'ZBELNR'.
      it_fcat_sec-seltext_l  = 'Document Number'.
      it_fcat_sec-col_pos     = 1.
      it_fcat_sec-outputlen  = 15.
      it_fcat_sec-key = 'X'.
      APPEND it_fcat_sec.
      CLEAR  it_fcat_sec.
      it_fcat_sec-tabname     = 'IT_SEC_FINAL'.
      it_fcat_sec-fieldname   = 'NAME'.
      it_fcat_sec-seltext_l  = 'Name'.
      it_fcat_sec-col_pos     = 2.
      it_fcat_sec-outputlen  = 40.
      APPEND it_fcat_sec.
      CLEAR  it_fcat_sec.
      it_fcat_sec-tabname     = 'IT_SEC_FINAL'.
      it_fcat_sec-fieldname   = 'APPROVER'.
      it_fcat_sec-seltext_l  = 'Approver'.
      it_fcat_sec-col_pos     = 3.
      it_fcat_sec-outputlen  = 12.
      APPEND it_fcat_sec.
      CLEAR  it_fcat_sec.
      it_fcat_sec-tabname     = 'IT_SEC_FINAL'.
      it_fcat_sec-fieldname   = 'DATE'.
      it_fcat_sec-seltext_l  = 'Date'.
      it_fcat_sec-col_pos     = 4.
      it_fcat_sec-outputlen  = 17.
      APPEND it_fcat_sec.
      CLEAR  it_fcat_sec.
      it_fcat_sec-tabname     = 'IT_SEC_FINAL'.
      it_fcat_sec-fieldname   = 'ZSTATUS'.
      it_fcat_sec-seltext_l  = 'Status'.
      it_fcat_sec-col_pos     = 5.
      it_fcat_sec-outputlen  = 40.
      APPEND it_fcat_sec.
    ENDIF.
  ENDIF.
ENDFORM.                    " fill_fieldcat_sec
*&      Form  display_sec_list
      text
-->  p1        text
<--  p2        text
FORM display_sec_list .
  wa_layout-colwidth_optimize = 'X'.
  CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
      EXPORTING
       i_callback_program                = w_repid
      is_layout                         = wa_layout
      i_grid_title             = 'Document Status Report - Approver'
       it_fieldcat                       = it_fcat_sec[]
     IT_SORT                        = IT_SORT[]
      it_events                     =  it_events
       TABLES
         t_outtab                        = it_sec_final[]
    EXCEPTIONS
      program_error                     = 1
      OTHERS                            = 2.
ENDFORM.                    " display_sec_list
*&      Form  get_elapsed_time
      text
-->  p1        text
<--  p2        text
form get_elapsed_time .
DATA: date1 type d,
      date2 type d,
      time1 type t,
      time2 type t,
      date type p,
      time type p.
  it_temp1[] = it_zfap_hist[].
  it_temp2[] = it_zfap_hist[].
  delete it_temp1 where zstatus NE 'Submitted'.
  delete it_temp2 where zstatus NE 'Approve'.
  sort it_temp1 by zbukrs zbelnr zdate ztime descending.
  delete adjacent duplicates from it_temp1 comparing zbukrs zbelnr.
  sort it_temp2 by zbukrs zbelnr zdate ztime descending.
  delete adjacent duplicates from it_temp1 comparing zbukrs zbelnr.
  loop at it_temp1 into wa_it_temp1.
    read table it_temp2 into wa_it_temp2
         with key zbukrs = wa_it_temp1-zbukrs
                  zbelnr = wa_it_temp1-zbelnr.
    if sy-subrc = 0.
      date1 = wa_it_temp1-zdate.
      date2 = wa_it_temp2-zdate.
      time1 = wa_it_temp1-ztime.
      time2 = wa_it_temp2-ztime.
      PERFORM datetime_diff using date1 date2 time1 time2
                            changing time date.
      IF DATE > 0.
        DATE = DATE * 86400.
        TIME = DATE + TIME.
        w_DIFF = TIME / 60.
      ELSE.
        w_diff = TIME / 60.
      ENDIF.
    else.
      w_diff = space.
    endif.
    wa_it_time-zbukrs = wa_it_temp1-zbukrs.
    wa_it_time-zbelnr = wa_it_temp1-zbelnr.
    wa_it_time-diff   = w_diff.
    append wa_it_time to it_time.
    clear : wa_it_temp1, wa_it_temp2, date1, date2, time1, time2,
            date, time, w_diff, wa_it_time.
  endloop.
endform.                    " get_elapsed_time
*&      Form  datetime_diff
      text
     -->P_DATE1  text
     -->P_DATE2  text
     -->P_TIME1  text
     -->P_TIME2  text
     <--P_TIME  text
     <--P_DATE  text
form datetime_diff using date1 type d
                         date2 type d
                         time1 type t
                         time2 type t
                   changing time type p
                            date type p.
  DATA: D1 TYPE D, D2 TYPE D, T1 TYPE T, T2 TYPE T.
    D1 = DATE1.
    T1 = TIME1.
    D2 = DATE2.
    T2 = TIME2.
Calculate hours difference
  TIME = T2 - T1.
If no date difference then exit
  IF D2 = D1.
    DATE = 0.
    EXIT.
  ENDIF.
Check for time underflow and correct second date
  IF TIME > T2.
    D2 = D2 - 1.
  ENDIF.
Calculate date difference
  DATE = D2 - D1.
endform.                    " datetime_diff

Similar Messages

  • How To Print Field Value in TOP-OF-PAGE During Line Selection.

    How To Print Field Value in TOP-OF-PAGE During Line Selection when double click on field.

    (If my memory serves me well (not used for long time ago)
    Assign values to system fields sy-tvar0 - sy-tvar9, they will replace the placeholders "&0" through "&9" in the list headers and column headers.
    TOP-OF-PAGE DURING LINE-SELECTION.
         WRITE: / 'Interactive Report &3'.
      WRITE record-vbeln TO sy-tvar3.
    Regards,
    Raymond

  • How to implement line selectability for a table control using table Wizard?

    Hello SDN Community,
    I have created a table control using the Table Wizard.  I found my exact question in this forum, but unfortunately it had not been andsered.  While I cannot paste a screen-print into this plane-text area, here are the steps I followed...
    1) SE51
    2) Create new screen 0100
    3) Click Layout button
    4) Clidk Table Control (with Wizard) and draw box on canvas.
    5) Step is "Start" - click Continue
    6) Step is "Name of Table Control" - provided name
    7) Step is "Table Name" - provided name of dictionary table (AUFK)
    8) Step is "Definition of Columns" - selected order numver and order text
    9) Step is "Table Control Attributes" - Line Selectability is in display mode - cannot set it.
    I would like to have a selectability column for my table.  Would appreciate any insight into how to do this.
    Thank you,
    Dean Atteberry.

    This is a puzzling...
    For the table control wizard, in the Table Control Attributes step, I was able to get line selectability to open up by declaring a char01 data element at the beginning of my type.
    The puzzling is in regards to the "Selection col. fld" entry field.
    If I leave it blank and try to go to the next step, I get message "Enter the name of the selection column if you are using a program table"
    So it looked like it wanted to know the name of my selection column.  So I type in "CHAR1".  and got the message "The field "CHAR1" for the selection column is already contained in the table."
    Hmmmmm.... don't understand............
    Dean Atteberry.

  • TOP-OF-PAGE During line-selection in alv report

    Hi Expart
    In intractive Alv report u using top-of-page during line-selection . If u using so u give me one example with codeing .
    Regards
    Bhabani

    Hi,
    try this code...
    *& Report  ZCS_PRG8
    REPORT  Z_SJALV__PRG8.
    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 IT_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 if helpful
    regards
    Shashi

  • Page number in Top of page during line selection

    Hi All,
    I am generating an interactive report.
    I want to display the same header at each page break.
    How to restrict the page size in At line-selection?
    I want to display page in format Page X of Y for each page break?How to handle it?
    Thanks in advance.
    Regards,
    Sandy

    Hi,
    Try the code:
    REPORT ZPAGETEST NO STANDARD PAGE HEADING LINE-SIZE 40
    LINE-COUNT 20.
    DATA:COUNT(6) TYPE N.
    DATA: LAST_PAGE_NO LIKE SY-PAGNO.
    DATA: TOTPAGE(6) TYPE C .
    TOP-OF-PAGE.
    WRITE:20 SY-PAGNO ,'of', '££££££'.
    START-OF-SELECTION.
    DO 100 TIMES.
    WRITE: / COUNT.
    COUNT = COUNT + 1.
    ENDDO.
    LAST_PAGE_NO = SY-PAGNO.
    TOTPAGE = SY-PAGNO.
    DO LAST_PAGE_NO TIMES.
    READ LINE 1 OF PAGE SY-INDEX .
    REPLACE '££££££' WITH TOTPAGE INTO SY-LISEL.
    MODIFY CURRENT LINE.
    ENDDO.
    Regards,
    Sesh

  • At user-command & At Line-selection

    Hi,
    I am using ECC5 ver. of ABAP.
    Can I use AT USER-COMMAND and AT LINE-SELECTION
    in the same report?
    I have used it but only At user command works, not At line selection.
    When I remove Set pf-Status, At line selection works.
    Here is my code.
    REPORT PF&ATLINE.
    AT LINE-SELECTION.
      MESSAGE 'Line Selected' TYPE 'I'.
    AT USER-COMMAND.
      IF sy-ucomm = 'PUSH'.
        MESSAGE 'Button Pushed' type 'I'.
      elseif sy-ucomm = 'EXIT'.
        LEAVE PROGRAM.
      ENDIF.
    START-OF-SELECTION.
      SET PF-STATUS 'ZRND3'.
      DO 10 TIMES.
        WRITE:/01 SY-INDEX HOTSPOT.
      ENDDO.
    END-OF-SELECTION.

    Hi Rajiv,
    Setting the PICK function code to F2 will definitely solve it..
    and it triggers the at user-command and at line-selection event as per user interaction...
    If it is not working properly... then there might me something wrong in your code...
    can you place the code... so that we can know the exact problem
    regards
    padma

  • At line selection for ALV

    Hello experts ,
    can anybody plz tell me How to implement the line selection event in alv ? I want to retrieve value of the filed clicked by the user and query another table with that field value and display that data ....

    Hi,
    Below is the sample code.
      CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
         EXPORTING
           I_CALLBACK_PROGRAM = G_REPID
           I_CALLBACK_USER_COMMAND  = 'USER_COMMAND'
           IT_FIELDCAT        = i_FCAT[]
         TABLES
           T_OUTTAB           = i_invoice[]
         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.
    FORM user_command USING pv_ucomm    TYPE syucomm
                            ps_selfield TYPE slis_selfield.
    *Handle the specific user-commands.                                    *
      CASE pv_ucomm.
    Or some other GUI-functions                                         *
    Handle double click or hotspot on a specific field.                  *
    These are some examples                                              *
        WHEN gc_double_click.
          CASE ps_selfield-fieldname.
            WHEN 'BELNR'.
              i_invoice-belnr = g_belnr.
              i_invoice-gjahr = g_gjahr.
              READ TABLE i_invoice INDEX ps_selfield-tabindex.
              IF sy-subrc EQ 0 AND NOT i_invoice-belnr IS INITIAL.
                SET PARAMETER ID 'RBN' FIELD i_invoice-belnr.
                SET PARAMETER ID 'GJR' FIELD i_invoice-gjahr.
                CALL TRANSACTION 'MIR4' AND SKIP FIRST SCREEN.
              ENDIF.
            WHEN 'EBELN'.
              READ TABLE i_invoice INDEX ps_selfield-tabindex.
              IF sy-subrc EQ 0 AND NOT i_invoice IS INITIAL.
                SET PARAMETER ID 'BES' FIELD i_invoice-ebeln.
                CALL TRANSACTION 'ME23N' AND SKIP FIRST SCREEN.
              ENDIF.
          endcase.
      endcase.
    endform.                    "user_command
    Regards,
    Jayanth G

  • Need help AT LINE SELECTION

    Hi Guys,
    I need ur help regarding my coding: AT LINE SELECTION.
    Here is my codes, but it is not working.
    AT LINE-SELECTION.
    IF ( wa_list-auart = 'ZCS' AND wa_list-auart = 'ZSA' ).
        IF NOT wa_list-sonum IS INITIAL.
          SET PARAMETER ID 'AUN' FIELD wa_list-sonum.
          CALL TRANSACTION 'VF01' AND SKIP FIRST SCREEN.
          CLEAR wa_list-sonum.
        ENDIF.
      ELSE.
        IF NOT wa_list-drnum IS INITIAL.
          SET PARAMETER ID 'AUN' FIELD wa_list-drnum.
          CALL TRANSACTION 'VF01' AND SKIP FIRST SCREEN.
          CLEAR wa_list-drnum.
        ENDIF.
      ENDIF.
    The requirements are:
    1. Data selection on column ‘Item’ + Magnifying Glass Icon click will direct user to transaction code VF01 ====>><b>its working,  but the problem is when i click the line item no 1, it wasnt work. Line item no 1 only but the rest items its workin.</b>
    2. Sales Order No (VBAK-VBELN) – will be the default value on document column of VF01 if Sales Order Type (VBAK-AUART) = ZCS or ZSA else Delivery No (LIKP-VBELN) will be the default value on document column of VF01. ===><b>the problem is when i click the line item, there is no default Sales Order No or Delivery NO on parameter 'AUN' <Document column> based on if statement.</b>
    3. Warning Message ‘Select a line item to proceed.’  will be displayed if no line item selected on  magnifying glass icon click. ===> <b>help me on how to codes this one if i click to a non line item, there should be a Warning Message ‘Select a line item to proceed.’</b>
    Thanks in advance.
    zhien.

    hi joycee
    i think one of the command written by u
    :-"IF NOT wa_list-sonum IS INITIAL."
    shoud be written like
    :- IF wa_list-sonum IS NOT INITIAL.

  • Getting error of Defining an internal table with header line, SELECT-OPTIO

    Hi all,
    i have a coding for my smart form,In this coding i have define an structure which being used,but when i execute it it give me
    error of Defining an internal table with header line, SELECT-OPTIONS, and RANGES is not allowed within a structure.Even tough you can see that in  my coding im not using SELECT-OPTION or RANGES,but can't understand why it gives me this error.
    Following are the code:
      DATA: BEGIN OF traptab OCCURS 50.
            INCLUDE STRUCTURE mseg.
      DATA: vgart LIKE mkpf-vgart,
            blart LIKE mkpf-blart,
            blaum LIKE mkpf-blaum,
            bldat LIKE mkpf-bldat,
            budat LIKE mkpf-budat,
            cpudt LIKE mkpf-cpudt,
            cputm LIKE mkpf-cputm,
            aedat LIKE mkpf-aedat,
            usnam LIKE mkpf-usnam,
            tcode LIKE mkpf-tcode,
            xblnr LIKE mkpf-xblnr,
            bktxt LIKE mkpf-bktxt,
            frath LIKE mkpf-frath,
            frbnr LIKE mkpf-frbnr,
            wever LIKE mkpf-wever,
          END OF traptab. 
    Thanks & Regards,
    sappk25

    thanks

  • "AT LINE-SELECTION" event in a Query (SQ01 or SQ02)

    Hi there
    I want to know if it's possible to put "AT LINE-SELECTION" event in an ABAP Query? I'm trying that in SQ02 - the infoset - but nothing happens when I double-click on the output lines. I cannot find any place to type codes in SQ01.
    The purpose is to call a transaction VA03 when people double-click on the output field "sales order number" and here is the code I put in "Free coding" section of SQ02.
    AT LINE-SELECTION.
      DATA: w_cucol TYPE sy-cucol.
      w_cucol = sy-cucol + sy-staco.
      w_cucol = w_cucol - 2.
      IF w_cucol BETWEEN 103 AND 119.
        SET PARAMETER ID 'AUN' FIELD vbkd-vbeln.
        CALL TRANSACTION 'VA03' AND SKIP FIRST SCREEN.
      ENDIF.
    yu

    Hi ,
    You must create infoset based on join VBKD with VBAK and LIPS.
    Also you must put VBAK-VBELN and LIPS-VBELN as a column output.
    There is no problem to use 2 report assignment ( there is no loss ).
    There is no necessity to use " some ABAP code at line-selection ".
    This works.
    By the way is more correct from the beginning to formulate the issue including all the data about your problem and not include them by adding a little at a time.
    Regards.

  • Problem with at line-selection

    hi mates
    i have written a interactive report program, when i click the hotspot in the basic list the event at line-selection is not getting triggered insead my at user-command is geting executed. is there a sequence that i need to follow?. below is my code. thanks in advance.
    tables: vbak.
    selection-screen begin of block b1 with frame title t1.
      select-options: salesdoc for vbak-vbeln.
    selection-screen end of block b1.
    types: begin of vbak_ty,
           vbeln type vbak-vbeln,
           erdat type vbak-erdat,
           ernam type vbak-ernam,
           end of vbak_ty.
    types: begin of vbap_type,
           vbeln type vbap-vbeln,
           posnr type vbap-posnr,
           matnr type vbap-matnr,
           charg type vbap-charg,
           end of vbap_type.
    types: begin of vbap_ty,
           posnr type vbap-posnr,
           matwa type vbap-matwa,
           arktx type vbap-arktx,
           end of vbap_ty.
    data: vbap_wa type vbap_type,
          vbap_it type table of vbap_type,
          vbak_wa type vbak_ty,
          vbak_it type table of vbak_ty,
          vbap_wa1 type vbap_ty,
          vbap_it1 type table of vbap_type,
          fname(20),fvalue(10).
    initialization.
           t1 = 'enter sales doc header'.
    start-of-selection.
      set pf-status 'VA01'.
      SELECT vbeln
             erdat
             ernam
             from vbak into table vbak_it
             where vbeln in salesdoc.
       if sy-subrc = 0.
       loop at vbak_it into vbak_wa.
         write: /25 vbak_wa-vbeln hotspot,
                 50 vbak_wa-erdat,
                 75 vbak_wa-ernam.
         hide vbak_wa-vbeln.
         clear vbak_wa-vbeln.
         endloop.
         ELSE.
           message e000(01) with 'no records found '.
           endif.
        at line-selection.
          case sy-lsind.
            when '1'.
              perform headerdata.
            when '2'.
              perform itemdata.
           endcase.
      at user-command.
        case sy-ucomm.
          when 'ITEMDATA'.
          get cursor  field fname value fvalue.
          if fvalue = 'vbap_wa-vbeln'.
             perform itemdata.
           else.
             message e000(03) with 'click only on hotspots'.
           endif.
          when 'SALEOR'.
           get cursor field fname value fvalue.
           if fvalue = 'vbak_wa-vbeln'.
            set parameter id 'AUN' field fvalue.
            call transaction 'VA01' and skip first screen.
           else.
             message e000(04) with 'click only on hotspots'.
           endif.
        endcase.
        form headerdata.
        set pf-status 'HEADER'.
        select vbeln
               posnr
               matnr
               charg
               from vbap into table vbap_it
               where vbeln = vbak_wa-vbeln.
          if sy-subrc = 0.
       loop at vbap_it into vbap_wa.
         write: /25 vbap_wa-vbeln hotspot,
                 50 vbap_wa-posnr,
                 75 vbap_wa-matnr,
                 90 vbap_wa-charg.
         hide vbap_wa-vbeln.
         clear vbap_wa-vbeln.
         endloop.
         else.
           message e000(02) with ' no data found'.
           endif.
           endform.
        form itemdata.
             select vbeln
               posnr
               matwa
               arktx
               from vbap into table vbap_it1
               where vbeln = vbap_wa-vbeln.
      if sy-subrc = 0.
       loop at vbap_it1 into vbap_wa1.
         write: /25 vbap_wa1-posnr,
                 75 vbap_wa1-matwa,
                 90 vbap_wa1-arktx.
          endloop.
           else.
           message e000(02) with ' no data found'.
           endif.
           endform.
    REGARDS
    MANO

    AT LINE-SELECTION.
    Effect
    This statement defines an event block whose event is triggered by the ABAP runtime environment during the display of a screen list - provided the scren cursor is on a list line and you select a function using the function code PICK. Through the definition of this event block, the standard list status is automatically enhanced in such a way that the function code F2 and, with it, the double-click mouse function is linked up to the function code PICK.
    Note
    If the function key F2 is linked with a function code different than PICK, each double click will trigger its even, usually AT USER-COMMAND, and not AT LINE-SELECTION.
    Example
    This program works with the standard list status. A line selection with the left mouse key causes the event AT LINE-SELECTION and creates details lists.
    REPORT demo_at_line_selection.
    START-OF-SELECTION.
      WRITE 'Click me!' COLOR = 5 HOTSPOT.
    AT LINE-SELECTION.
      WRITE: / 'You clicked list', sy-listi,
             / 'You are on list',  sy-lsind.
      IF sy-lsind < 20.
        SKIP.
        WRITE: 'More ...' COLOR = 5 HOTSPOT.
      ENDIF.
    The above sample program works with the standard list status Since your program has the PF-status set, i think AT LINE-SELECTION will not work. So do use AT USER-COMMAND to capture the "PICK" event.
    Hope this helps.
    Thanks
    Balaji

  • Unable to double click after using at line-selection

    hi all...
    unable to double click after using at line-selection. But if i comment set pf-status, i can double click on the line but on first double click everytime i just get last record i.e. 200th and after second double click i'm not getting output. what is the problem? plz reply...
    REPORT  YP2 line-count 10(2).
    tables: lfa1, LFB1.
    data: itab like lfa1 occurs 0 with header line,
          JTAB LIKE LFB1 OCCURS 0 WITH HEADER LINE.
    SELECT-OPTIONS: vendor_n for lfa1-lifnr.
    *SET PF-STATUS 'MENU'.
    INITIALIZATION.
    vendor_n-low = '1'.
    vendor_n-high = '200'.
    vendor_n-option = 'BT'.
    APPEND vendor_n.
    clear vendor_n.
    At selection-screen.
    IF VENDOR_N-LOW < 1.
    MESSAGE w000(sabapdocu).
    clear vendor_n.
    ELSEIF vendor_n-HIGH > 200.
    MESSAGE S001(sabapdocu).
    ENDIF.
    START-OF-SELECTION.
    SELECT * FROM lfa1 INTO TABLE ITAB WHERE lifnr IN vendor_n.
    WRITE:5 SY-ULINE(72).
    LOOP AT ITAB.
    WRITE: /5 SY-VLINE,9 ITAB-lifnr,20 SY-VLINE, 22 ITAB-name1,58 SY-VLINE, 60 ITAB-telf1, 76 SY-VLINE.
    ENDLOOP.
    top-of-page.
    WRITE:/5 SY-ULINE(72).
    WRITE: /5 SY-VLINE, 'Vendor_code', 20 SY-VLINE, 28 'Name' ,58 SY-VLINE, 60 'Phone', 76 SY-VLINE.
    WRITE:/5 SY-ULINE(72).
    end-of-page.
    WRITE:5 SY-ULINE(72).
    WRITE:/ 'THE PAGE NO IS',SY-PAGNO.
    WRITE:/5 SY-ULINE(72).
    END-OF-SELECTION.
    WRITE: /5 sy-uline(72),/ 'THE RECORD IS CLOSED'.
    AT LINE-SELECTION.
    IF SY-LSIND = 1.
    SELECT * FROM  LFA1 INTO TABLE ITAB WHERE LIFNR = ITAB-LIFNR.
    LOOP AT ITAB.
    WRITE: /5 SY-VLINE,9 ITAB-lifnr,20 SY-VLINE, 22 ITAB-name1,58 SY-VLINE, 60 ITAB-telf1, 76 SY-VLINE.
    ENDLOOP.
    WRITE:/5 SY-ULINE(72).
    ELSEIF SY-LSIND = 2.
    WRITE:/5 SY-VLINE,6 'Vendor No.',17 SY-VLINE,18 'Company code',28 SY-VLINE, 29 'Created by',39 SY-VLINE.
    SELECT * FROM LFB1 INTO TABLE JTAB WHERE LIFNR = JTAB-LIFNR.
    LOOP AT JTAB.
    WRITE:/5 SY-VLINE,6 JTAB-LIFNR,17 SY-VLINE,18 JTAB-BUKRS,28 SY-VLINE, 29 JTAB-ERNAM,39 SY-VLINE.
    ENDLOOP.
    WRITE:/5 SY-ULINE(72).
    ENDIF.
    AT PF7.
    IF SY-LSIND = 1.
    SELECT * FROM  LFA1 INTO TABLE ITAB WHERE LIFNR = ITAB-LIFNR.
    LOOP AT ITAB.
    WRITE: /5 SY-VLINE,9 ITAB-lifnr,20 SY-VLINE, 22 ITAB-name1,58 SY-VLINE, 60 ITAB-telf1, 76 SY-VLINE.
    ENDLOOP.
    WRITE:/5 SY-ULINE(72).
    ELSEIF SY-LSIND = 2.
    SELECT * FROM LFB1 INTO TABLE JTAB WHERE LIFNR = JTAB-LIFNR.
    LOOP AT JTAB.
    WRITE:/5 SY-VLINE,6 JTAB-LIFNR,17 SY-VLINE,18 JTAB-BUKRS,28 SY-VLINE, 29 JTAB-ERNAM,39 SY-VLINE.
    ENDLOOP.
    WRITE:/5 SY-ULINE(72).
    ENDIF.
    AT USER-COMMAND.
    IF SY-UCOMM = '0001'.
    IF SY-LSIND = 1.
    SELECT * FROM  LFA1 INTO TABLE ITAB WHERE LIFNR = ITAB-LIFNR.
    LOOP AT ITAB.
    WRITE: /5 SY-VLINE,9 ITAB-lifnr,20 SY-VLINE, 22 ITAB-name1,58 SY-VLINE, 60 ITAB-telf1, 76 SY-VLINE.
    ENDLOOP.
    WRITE:/5 SY-ULINE(72).
    ELSEIF SY-LSIND = 2.
    SELECT * FROM LFB1 INTO TABLE JTAB WHERE LIFNR = JTAB-LIFNR.
    LOOP AT JTAB.
    WRITE:/5 SY-VLINE,6 JTAB-LIFNR,17 SY-VLINE,18 JTAB-BUKRS,28 SY-VLINE, 29 JTAB-ERNAM,39 SY-VLINE.
    ENDLOOP.
    WRITE:/5 SY-ULINE(72).
    ENDIF.
    ENDIF.

    Hi,
    copy and paste the code given below it works....
    START-OF-SELECTION.
    SELECT * FROM lfa1 INTO TABLE ITAB WHERE lifnr IN vendor_n.
    WRITE:5 SY-ULINE(72).
    LOOP AT ITAB.
    WRITE: /5 SY-VLINE,9 ITAB-lifnr,20 SY-VLINE, 22 ITAB-name1,58 SY-VLINE, 60 ITAB-telf1, 76 SY-VLINE.
    hide : itab-lifnr.
    ENDLOOP.
    clear itab.
    top-of-page.
    WRITE:/5 SY-ULINE(72).
    WRITE: /5 SY-VLINE, 'Vendor_code', 20 SY-VLINE, 28 'Name' ,58 SY-VLINE, 60 'Phone', 76 SY-VLINE.
    WRITE:/5 SY-ULINE(72).
    end-of-page.
    WRITE:5 SY-ULINE(72).
    WRITE:/ 'THE PAGE NO IS',SY-PAGNO.
    WRITE:/5 SY-ULINE(72).
    END-OF-SELECTION.
    WRITE: /5 sy-uline(72),/ 'THE RECORD IS CLOSED'.
    AT LINE-SELECTION.
    IF itab-lifnr is not initial.
    IF SY-LSIND = 1.
    SELECT * FROM  LFA1 INTO TABLE ITAB WHERE LIFNR = ITAB-LIFNR.
    LOOP AT ITAB.
    WRITE: /5 SY-VLINE,9 ITAB-lifnr,20 SY-VLINE, 22 ITAB-name1,58 SY-VLINE, 60 ITAB-telf1, 76 SY-VLINE.
    HIDE ITAB-LIFNR.
    ENDLOOP.
    CLEAR ITAB.
    WRITE:/5 SY-ULINE(72).
    ELSEIF SY-LSIND = 2.
    WRITE:/5 SY-VLINE,6 'Vendor No.',17 SY-VLINE,18 'Company code',28 SY-VLINE, 29 'Created by',39 SY-VLINE.
    SELECT * FROM LFB1 INTO TABLE JTAB WHERE LIFNR = ITAB-LIFNR.
    LOOP AT JTAB.
    WRITE:/5 SY-VLINE,6 JTAB-LIFNR,17 SY-VLINE,18 JTAB-BUKRS,28 SY-VLINE, 29 JTAB-ERNAM,39 SY-VLINE.
    ENDLOOP.
    CLEAR ITAB.
    WRITE:/5 SY-ULINE(72).
    ENDIF.
    ENDIF.
    AT PF7.
    IF itab-lifnr is not initial.
    IF SY-LSIND = 1.
    SELECT * FROM  LFA1 INTO TABLE ITAB WHERE LIFNR = ITAB-LIFNR.
    LOOP AT ITAB.
    WRITE: /5 SY-VLINE,9 ITAB-lifnr,20 SY-VLINE, 22 ITAB-name1,58 SY-VLINE, 60 ITAB-telf1, 76 SY-VLINE.
    HIDE ITAB-LIFNR.
    ENDLOOP.
    CLEAR ITAB.
    WRITE:/5 SY-ULINE(72).
    ELSEIF SY-LSIND = 2.
    SELECT * FROM LFB1 INTO TABLE JTAB WHERE LIFNR = JTAB-LIFNR.
    LOOP AT JTAB.
    WRITE:/5 SY-VLINE,6 JTAB-LIFNR,17 SY-VLINE,18 JTAB-BUKRS,28 SY-VLINE, 29 JTAB-ERNAM,39 SY-VLINE.
    ENDLOOP.
    CLEAR ITAB.
    WRITE:/5 SY-ULINE(72).
    ENDIF.
    ENDIF.
    AT USER-COMMAND.
    IF SY-UCOMM = '0001' and itab-lifnr is not initial.
    IF SY-LSIND = 1.
    SELECT * FROM  LFA1 INTO TABLE ITAB WHERE LIFNR = ITAB-LIFNR.
    LOOP AT ITAB.
    WRITE: /5 SY-VLINE,9 ITAB-lifnr,20 SY-VLINE, 22 ITAB-name1,58 SY-VLINE, 60 ITAB-telf1, 76 SY-VLINE.
    HIDE ITAB-LIFNR.
    ENDLOOP.
    clear ITAB.
    WRITE:/5 SY-ULINE(72).
    ELSEIF SY-LSIND = 2.
    SELECT * FROM LFB1 INTO TABLE JTAB WHERE LIFNR = JTAB-LIFNR.
    LOOP AT JTAB.
    WRITE:/5 SY-VLINE,6 JTAB-LIFNR,17 SY-VLINE,18 JTAB-BUKRS,28 SY-VLINE, 29 JTAB-ERNAM,39 SY-VLINE.
    ENDLOOP.
    CLEAR ITAB.
    WRITE:/5 SY-ULINE(72).
    ENDIF.
    ENDIF.
    Regards,
    Siddarth

  • Table control: Line selection single issue

    Hi experts,
    I have created a table control and in the screen painter I have defined the line selection as "Single" for table control.
    The table control can display upto 20 lines in a screen and i can select a single record only which pertains to my requirement. if I try to select two records it will not allow.
    Issue: consider  i select a single record from the first 20 lines displayed in screen, then i scroll the records in the table control so that it displays the records from 21 to 40. if I select a single record now from line 21 to 40, the first record that i selected is not getting deselected. That is, totally two lines are getting selected.
    How to overcome this issue
    Thanks in advance
    Regards
    Anand

    Ok
    The "problem" is here:
    Types: Begin of ty_ic,
      ic(20),
      desc(20),
      sel(1)                                 <--------------------------------
    End of ty_ic.
    You've ha a field for selected line and that field is used in table control definition as you've written:
    "Note: wa_ic is the structure used in table control and wa_ic-sel is the mark field defined the table control attributes"
    So you're using the structure WA_IC as header line of internal table IT_IC and also as input/put field of your table control (I mean the screen fields of table control are based on WA_IC).
    You don't need any code in PBO to move the data from internal table to table control, because the headerline of IT_IC and field of table control are the same, infact you've implemented only the code in PAI to save the data from table control to IT_IC:
    Loop at it_ic.
    Modify it_ic from wa_ic index tc_ic-current_line
    Endloop
    t's a good solution if it needs to transfer all data to table control automatically: it doesn't need any code in PBO
    but, of course, there'll be a problem when you don't need to display something, in this case you have to think a solution, I mean you have to write a code in order to avoid to display those data.
    It's the case of the selected line: in your situation all selected lines keep the selection, because the code to clear IT_IC-SEL is missing: only the user can deselect a line, but if he doesn't do it, the line will remain selected after navigation.
    So you make to be sure to clear all selected lines are not displayed.
    You need to create a code in PAI out of the loop of table control where you clear the flag SEL, in order to do it you need to consider:
    - The index of the first record displayed in table control is stored in field TC_IC-TOP_LINE
    - The index of the last record displayed in table control can be calculated: the variable SY-LOOPC indicates how many rows can be displayed in table control, so the last record will be: TC_IC-TOP_LINE + SY-LOOPC.
    So you need to clear the field SEL for all records not displayed, a code like this:
    PROCESS PAI.
      LOOP AT IT_IC.
         MODULE GET_LOOPC.
      ENDLOOP.
      MODULE CLEAR_SEL.
      MODULE GET_LOOPC..
          TOT_LINE_DISPLAYED = SY-LOOPC.
      ENDMODULE
      MODULE CLEAR_SEL.
    * Here you need to clear the selection of the records before of TOP_LINE
           IF TC_IC-TOP_LINE > 1.
              LOOP AT IT_IC INTO WA_IC  TO TC_IC-TOP_LINE.
                 CLEAR WA_IC-SEL.
                 MODIFY IT_IC FROM WA_IC.
              ENDLOOP.
         ENDIF.
    * Here you need to clear the selection of the records after the last one:
          LAST_INDEX = TOT_LINE_DISPLAYED + TC_IC-TOP_LINE.
         DESCRIBE TABLE IT_IC LINES SY-TABIX,
         IF SY-TABIX > LAST_INDEX.
              LOOP AT IT_IC INTO WA_IC  FROM LAST_INDEX.
                 CLEAR WA_IC-SEL.
                 MODIFY IT_IC FROM WA_IC.
              ENDLOOP.
         ENDIF.
      ENDMODULE.

  • Regarding line item dimension

    Hi all,
    what are the necessary prerequisities will u take regarding line item dimension.
    for eg., for sd cubes we r using sales doc no., i.obj as a line item dimension? why can't the other i.obj?
    plz explain me clearly?
    Thanks & Regards,
    V.Vijay.

    HI,
    Line Item and High Cardinality
    When compared to a fact table, dimensions ideally have a small cardinality. However, there is an exception to this rule. For example, there are InfoCubes in which a characteristic document is used, in which case almost every entry in the fact table is assigned to a different document. This means that the dimension (or the associated dimension table) has almost as many entries as the fact table itself. We refer here to a degenerated dimension. In BW 2.0, this was also known as a line item dimension, in which case the characteristic responsible for the high cardinality was seen as a line item. Generally, relational and multi-dimensional database systems have problems to efficiently process such dimensions. You can use the indicators line item and high cardinality to execute the following optimizations:
    Line Item Dimensions
    Line item: This means the dimension contains precisely one characteristic. This means that the system does not create a dimension table. Instead, the SID table of the characteristic takes on the role of dimension table. Removing the dimension table has the following advantages:
    ¡        When loading transaction data, no IDs are generated for the entries in the dimension table. This number range operation can compromise performance precisely in the case where a degenerated dimension is involved.
    ¡        A table- having a very large cardinality- is removed from the star schema. As a result, the SQL-based queries are simpler. In many cases, the database optimizer can choose better execution plans.
    Nevertheless, it also has a disadvantage: A dimension marked as a line item cannot subsequently include additional characteristics. This is only possible with normal dimensions.
    High Cardinality
    If your dim table size exceeds the 20% of your fact table then you can say it as high cardinality, for ex: your fact table contains 100 records and your customer dimension contains 25 records means this dim is with high cardinality. you can check with your client for the expected records for those dimensions or for the info objects which you define in one dimension. to know the sizes of the dimension tables and fact tables you can runa a program in SE37 SAP_INFOCUBE_DESIGNS, it displays all your info cubes fact and dimension tables with sizes, if any dimension exceeds the more than 10% to 20% it will be in RED.
    It means that the dimension is to have a large number of instances (that is, a high cardinality). This information is used to carry out optimizations on a physical level in depending on the database platform. Different index types are used than is normally the case. A general rule is that a dimension has a high cardinality when the number of dimension entries is at least 20% of the fact table entries. If you are unsure, do not select a dimension having high cardinality.
    http://help.sap.com/saphelp_nw04/helpdata/en/b2/fbb859c64611d295dd00a0c929b3c3/frameset.htm
    http://help.sap.com/saphelp_nw70/helpdata/en/a7/d50f395fc8cb7fe10000000a11402f/frameset.htm
    http://help.sap.com/saphelp_nw04/helpdata/en/5c/d14d3c306f090ae10000000a11405a/frameset.htm
    Note: In SAP BW 3.0, the term line item dimension from SAP BW 2.0 must a) have precisely one characteristic and b) this characteristic must have a high cardinality. Before, the term line item dimension was often only associated with a). Hence the inclusion of this property in the above. Be aware that a line item dimension has a different meaning now than in SAP BW2.0.
    SAP recommends that you use ODS objects, where possible, instead of InfoCubes for line items.
    Tarak

  • AT LINE SELECTION EVENT IN BLOCKED ALV

    hi friends,
    i have developed blocked alv report.
    i wanted to use at line selection event..
    pls halp me if u know..
    thanks and regards,
    shridevi.l

    hi
    there is no particulat at line selection event in REUSE_ALV_EVENTS_GET.
    at line selection we get fct 'PICK' code for double click.
    so using that fct code we do the operations using at user_command. which is other way of implemnting at line-selection
    If any quieries revert, reward if helpful
    Try this code
    *& Report  ZP_ALV8
    REPORT  zp_alv8.
    TABLES: kna1, mara, vbak, mard.
    TYPE-POOLS: slis.
    **TYPE DECLERATION
    TYPES: BEGIN OF ty_kna1,
             kunnr LIKE kna1-kunnr,
             land1 LIKE kna1-land1,
             name1 LIKE kna1-name1,
             ort01 LIKE kna1-ort01,
           END OF ty_kna1.
    TYPES: BEGIN OF ty_mara,
             matnr LIKE mara-matnr,
             ersda LIKE mara-ersda,
             ernam LIKE mara-ernam,
           END OF ty_mara.
    TYPES: BEGIN OF ty_vbak,
             vbeln LIKE vbak-vbeln,
             erdat LIKE vbak-erdat,
             ernam LIKE vbak-ernam,
           END OF ty_vbak.
    TYPES: BEGIN OF ty_mard,
             matnr LIKE mard-matnr,
             werks LIKE mard-werks,
             lgort LIKE mard-lgort,
          END OF ty_mard.
    **DATA DECLERATION
    DATA: it_kna1 TYPE STANDARD TABLE OF ty_kna1,
          wa_kna1 TYPE ty_kna1.
    DATA: it_mara TYPE STANDARD TABLE OF ty_mara,
          wa_mara TYPE ty_mara.
    DATA: it_vbak TYPE STANDARD TABLE OF ty_vbak,
          wa_vbak TYPE ty_vbak.
    DATA: it_mard TYPE STANDARD TABLE OF ty_mard,
          wa_mard TYPE ty_mard.
    DATA: it_fieldcat_kna1 TYPE slis_t_fieldcat_alv,
          wa_fieldcat_kna1 TYPE slis_fieldcat_alv,
          it_fieldcat_mara TYPE slis_t_fieldcat_alv,
          wa_fieldcat_mara TYPE slis_fieldcat_alv,
          it_fieldcat_vbak TYPE slis_t_fieldcat_alv,
          wa_fieldcat_vbak TYPE slis_fieldcat_alv,
          it_fieldcat_mard TYPE slis_t_fieldcat_alv,
          wa_fieldcat_mard TYPE slis_fieldcat_alv.
    DATA: it_event_kna1 TYPE slis_t_event,
          wa_event_kna1 TYPE slis_alv_event,
          it_event_mara TYPE slis_t_event,
          wa_event_mara TYPE slis_alv_event,
          it_event_vbak TYPE slis_t_event,
          wa_event_vbak TYPE slis_alv_event,
          it_event_mard TYPE slis_t_event,
          wa_event_mard TYPE slis_alv_event.
    DATA: wa_layout TYPE slis_layout_alv,
          it_listheader TYPE slis_t_listheader,
          wa_listheader TYPE slis_listheader.
    selection-screen begin of block b1 with frame title text-001.
    select-options: s_kunnr for kna1-kunnr default '1000' to '1050'.
    selection-screen end of block b1.
    selection-screen begin of block b2 with frame title text-002.
    select-options: s_matnr for mara-matnr default '1' to '100'.
    selection-screen end of block b2.
    **INITIALIZATION
    INITIALIZATION.
      PERFORM layout.
      PERFORM fieldcat_kna1.
      PERFORM fieldcat_mara.
      PERFORM event_kna1.
      PERFORM event_mara.
      PERFORM eventpopulate_kna1.
      PERFORM eventpopulate_mara.
    **START OF SELECTION AND FIRST LIST DISPLAY
    START-OF-SELECTION.
      SELECT kunnr land1 name1 ort01
             FROM kna1
             INTO TABLE it_kna1
             where kunnr in s_kunnr.
           UP TO 10 ROWS.
      SELECT matnr ersda ernam
             FROM mara
             INTO TABLE it_mara
             where matnr in s_matnr.
            UP TO 20 ROWS.
      PERFORM display.
    **FORM LAYOUT
    *&      Form  layout
          text
    -->  p1        text
    <--  p2        text
    FORM layout .
      wa_layout-zebra ='X'.
      wa_layout-get_selinfos      = 'X'.
      wa_layout-key_hotspot = 'X'.
    ENDFORM.                    " layout
    *FIELD CATALOUGE*******************************
    *&      Form  fieldcat_kna1
          text
    -->  p1        text
    <--  p2        text
    FORM fieldcat_kna1 .
      REFRESH it_fieldcat_kna1.
      CLEAR wa_fieldcat_kna1.
      wa_fieldcat_kna1-fieldname = 'KUNNR'.
      wa_fieldcat_kna1-seltext_l = 'CUSTOMER NUMBER'.
      wa_fieldcat_kna1-datatype = 'CHAR'.
      wa_fieldcat_kna1-outputlen = 30.
      wa_fieldcat_kna1-tabname = 'IT_KNA1'.
      wa_fieldcat_kna1-key = 'X'.
      wa_fieldcat_kna1-hotspot = 'X'.
      wa_fieldcat_kna1-col_pos = 1.
      wa_fieldcat_kna1-emphasize = 'C21'.
      APPEND wa_fieldcat_kna1 TO it_fieldcat_kna1.
      CLEAR wa_fieldcat_kna1.
      wa_fieldcat_kna1-fieldname = 'LAND1'.
      wa_fieldcat_kna1-seltext_l = 'COUNTRY CODE'.
      wa_fieldcat_kna1-datatype = 'CHAR'.
      wa_fieldcat_kna1-outputlen = 30.
      wa_fieldcat_kna1-tabname = 'IT_KNA1'.
      wa_fieldcat_kna1-hotspot = 'X'.
      wa_fieldcat_kna1-col_pos = 2.
      wa_fieldcat_kna1-emphasize = 'C31'.
      APPEND wa_fieldcat_kna1 TO it_fieldcat_kna1.
      CLEAR wa_fieldcat_kna1.
      wa_fieldcat_kna1-fieldname = 'NAME1'.
      wa_fieldcat_kna1-seltext_l = 'CUSTOMER NAME'.
      wa_fieldcat_kna1-datatype = 'CHAR'.
      wa_fieldcat_kna1-outputlen = 30.
      wa_fieldcat_kna1-tabname = 'IT_KNA1'.
      wa_fieldcat_kna1-hotspot = 'X'.
      wa_fieldcat_kna1-col_pos = 3.
      wa_fieldcat_kna1-emphasize = 'C71'.
      APPEND wa_fieldcat_kna1 TO it_fieldcat_kna1.
      CLEAR wa_fieldcat_kna1.
      wa_fieldcat_kna1-fieldname = 'ORT01'.
      wa_fieldcat_kna1-seltext_l = 'COUNTRY '.
      wa_fieldcat_kna1-datatype = 'CHAR'.
      wa_fieldcat_kna1-outputlen = 30.
      wa_fieldcat_kna1-tabname = 'IT_KNA1'.
      wa_fieldcat_kna1-hotspot = 'X'.
      wa_fieldcat_kna1-col_pos = 4.
      wa_fieldcat_kna1-emphasize = 'C51'.
      APPEND wa_fieldcat_kna1 TO it_fieldcat_kna1.
      CLEAR wa_fieldcat_kna1.
    ENDFORM.                    " fieldcat_kna1
    *&      Form  fieldcat_kna2
          text
    FORM fieldcat_mara  .
      wa_fieldcat_mara-fieldname = 'MATNR'.
      wa_fieldcat_mara-seltext_l = 'MATERIAL NUMBER'.
      wa_fieldcat_mara-datatype = 'CHAR'.
      wa_fieldcat_mara-outputlen = 30.
      wa_fieldcat_mara-tabname = 'IT_MARA'.
      wa_fieldcat_mara-key = 'X'.
      wa_fieldcat_mara-hotspot = 'X'.
      wa_fieldcat_mara-col_pos = 1.
      wa_fieldcat_mara-emphasize = 'C21'.
      APPEND wa_fieldcat_mara TO it_fieldcat_mara.
      CLEAR wa_fieldcat_mara.
      wa_fieldcat_mara-fieldname = 'ERSDA'.
      wa_fieldcat_mara-seltext_l = 'CREATED ON'.
      wa_fieldcat_mara-datatype = 'CHAR'.
      wa_fieldcat_mara-outputlen = 30.
      wa_fieldcat_mara-tabname = 'IT_MARA'.
      wa_fieldcat_mara-hotspot = 'X'.
      wa_fieldcat_mara-col_pos = 2.
      wa_fieldcat_mara-emphasize = 'C41'.
      APPEND wa_fieldcat_mara TO it_fieldcat_mara.
      CLEAR wa_fieldcat_mara.
      wa_fieldcat_mara-fieldname = 'ERNAM'.
      wa_fieldcat_mara-seltext_l = 'CREATED BY'.
      wa_fieldcat_mara-datatype = 'CHAR'.
      wa_fieldcat_mara-outputlen = 30.
      wa_fieldcat_mara-tabname = 'IT_MARA'.
      wa_fieldcat_mara-hotspot = 'X'.
      wa_fieldcat_mara-col_pos = 3.
      wa_fieldcat_mara-emphasize = 'C61'.
      APPEND wa_fieldcat_mara TO it_fieldcat_mara.
      CLEAR wa_fieldcat_mara.
    ENDFORM.                    "fieldcat_kna2
    *&      Form  FIELDCAT_VBAK
          text
    FORM fieldcat_vbak.
      wa_fieldcat_vbak-fieldname = 'VBELN'.
      wa_fieldcat_vbak-seltext_l = 'SALES ORDER'.
      wa_fieldcat_vbak-datatype = 'CHAR'.
      wa_fieldcat_vbak-outputlen = 30.
      wa_fieldcat_vbak-tabname = 'IT_VBAK'.
      wa_fieldcat_vbak-hotspot = 'X'.
      wa_fieldcat_vbak-col_pos = 3.
      wa_fieldcat_vbak-emphasize = 'C31'.
      APPEND wa_fieldcat_vbak TO it_fieldcat_vbak.
      CLEAR wa_fieldcat_vbak.
      wa_fieldcat_vbak-fieldname = 'ERDAT'.
      wa_fieldcat_vbak-seltext_l = 'CREATED ON'.
      wa_fieldcat_vbak-datatype = 'DATS'.
      wa_fieldcat_vbak-outputlen = 30.
      wa_fieldcat_vbak-tabname = 'IT_VBAK'.
      wa_fieldcat_vbak-hotspot = 'X'.
      wa_fieldcat_vbak-col_pos = 3.
      wa_fieldcat_vbak-emphasize = 'C41'.
      APPEND wa_fieldcat_vbak TO it_fieldcat_vbak.
      CLEAR wa_fieldcat_vbak.
      wa_fieldcat_vbak-fieldname = 'ERNAM'.
      wa_fieldcat_vbak-seltext_l = 'CREATED BY'.
      wa_fieldcat_vbak-datatype = 'CHAR'.
      wa_fieldcat_vbak-outputlen = 30.
      wa_fieldcat_vbak-tabname = 'IT_VBAK'.
      wa_fieldcat_vbak-hotspot = 'X'.
      wa_fieldcat_vbak-col_pos = 3.
      wa_fieldcat_vbak-emphasize = 'C51'.
      APPEND wa_fieldcat_vbak TO it_fieldcat_vbak.
      CLEAR wa_fieldcat_vbak.
    ENDFORM.                    "FIELDCAT_VBAK
    *&      Form  fieldcat_mard
          text
    FORM fieldcat_mard.
      wa_fieldcat_mard-fieldname = 'MATNR'.
      wa_fieldcat_mard-seltext_l = 'MATERIAL NUMBER'.
      wa_fieldcat_mard-datatype = 'CHAR'.
      wa_fieldcat_mard-outputlen = 30.
      wa_fieldcat_mard-tabname = 'IT_MARD'.
      wa_fieldcat_mard-hotspot = 'X'.
      wa_fieldcat_mard-col_pos = 1.
      wa_fieldcat_mard-emphasize = 'C31'.
      APPEND wa_fieldcat_mard TO it_fieldcat_mard.
      CLEAR wa_fieldcat_mard.
      wa_fieldcat_mard-fieldname = 'WERKS'.
      wa_fieldcat_mard-seltext_l = 'PLANT'.
      wa_fieldcat_mard-datatype = 'CHAR'.
      wa_fieldcat_mard-outputlen = 30.
      wa_fieldcat_mard-tabname = 'IT_MARD'.
      wa_fieldcat_mard-hotspot = 'X'.
      wa_fieldcat_mard-col_pos = 2.
      wa_fieldcat_mard-emphasize = 'C61'.
      APPEND wa_fieldcat_mard TO it_fieldcat_mard.
      CLEAR wa_fieldcat_mard.
      wa_fieldcat_mard-fieldname = 'LGORT'.
      wa_fieldcat_mard-seltext_l = 'STORAGE LOCATION'.
      wa_fieldcat_mard-datatype = 'CHAR'.
      wa_fieldcat_mard-outputlen = 30.
      wa_fieldcat_mard-tabname = 'IT_MARD'.
      wa_fieldcat_mard-hotspot = 'X'.
      wa_fieldcat_mard-col_pos = 3.
      wa_fieldcat_mard-emphasize = 'C81'.
      APPEND wa_fieldcat_mard TO it_fieldcat_mard.
      CLEAR wa_fieldcat_mard.
    ENDFORM  .                    "fieldcat_mard
    **FORM DISPLAY
    *&      Form  Display
          text
    -->  p1        text
    <--  p2        text
    FORM display .
      CALL FUNCTION 'REUSE_ALV_BLOCK_LIST_INIT'
        EXPORTING
          i_callback_program = sy-repid
      I_CALLBACK_PF_STATUS_SET       = ' '
       I_CALLBACK_USER_COMMAND        = 'USER_COMMAND'.
      IT_EXCLUDING                   =
      CALL FUNCTION 'REUSE_ALV_BLOCK_LIST_APPEND'
        EXPORTING
          is_layout                        = wa_layout
          it_fieldcat                      = it_fieldcat_kna1
          i_tabname                        = 'IT_KNA1'
         it_events                         = it_event_kna1
      IT_SORT                          =
      I_TEXT                           = ' '
        TABLES
          t_outtab                         = it_kna1
       EXCEPTIONS
         program_error                    = 1
         maximum_of_appends_reached       = 2
         OTHERS                           = 3
      IF sy-subrc <> 0.
        MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
                WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
      ENDIF.
      CALL FUNCTION 'REUSE_ALV_BLOCK_LIST_APPEND'
        EXPORTING
          is_layout                        = wa_layout
          it_fieldcat                      = it_fieldcat_mara
          i_tabname                        = 'IT_MARA'
          it_events                        = it_event_mara
      IT_SORT                          =
      I_TEXT                           = ' '
        TABLES
          t_outtab                         = it_mara
       EXCEPTIONS
         program_error                    = 1
         maximum_of_appends_reached       = 2
         OTHERS                           = 3
      IF sy-subrc <> 0.
        MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
                WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
      ENDIF.
      CALL FUNCTION 'REUSE_ALV_BLOCK_LIST_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
    **EVENTS FOR KNA1 AND MARA
    *&      Form  EVENT_KNA1
          text
    -->  p1        text
    <--  p2        text
    FORM event_kna1 .
      CALL FUNCTION 'REUSE_ALV_EVENTS_GET'
        EXPORTING
          i_list_type     = 0
        IMPORTING
          et_events       = it_event_kna1
        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_KNA1
    *&      Form  EVENT_MARA
          text
    -->  p1        text
    <--  p2        text
    FORM event_mara .
      CALL FUNCTION 'REUSE_ALV_EVENTS_GET'
        EXPORTING
          i_list_type     = 0
        IMPORTING
          et_events       = it_event_mara
        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_MARA
    **POPULATING EVENTS
    *&      Form  eventpopulate_kna1
          text
    -->  p1        text
    <--  p2        text
    FORM eventpopulate_kna1 .
      READ TABLE it_event_kna1 INTO wa_event_kna1 WITH KEY name = 'TOP_OF_PAGE'.
      IF sy-subrc = 0.
        wa_event_kna1-form = 'TOP_OF_PAGE_KNA1'.
        MODIFY it_event_kna1 FROM wa_event_kna1 TRANSPORTING form WHERE name = wa_event_kna1-name.
      ENDIF.
    READ TABLE it_event_kna1 INTO wa_event_kna1 WITH KEY name = 'USER_COMMAND'.
    IF sy-subrc = 0.
       wa_event_kna1-form = 'USER_COMMAND_KNA1'.
       MODIFY it_event_kna1 FROM wa_event_kna1 TRANSPORTING form WHERE name = wa_event_kna1-name.
    ENDIF.
    ENDFORM.                    " eventpopulate_kna1
    *&      Form  eventpopulate_mara
          text
    -->  p1        text
    <--  p2        text
    FORM eventpopulate_mara .
      READ TABLE it_event_mara INTO wa_event_mara WITH KEY name = 'TOP_OF_PAGE'.
      IF sy-subrc = 0.
        wa_event_mara-form = 'TOP_OF_PAGE_MARA'.
        MODIFY it_event_mara FROM wa_event_mara TRANSPORTING form WHERE name = wa_event_mara-name.
      ENDIF.
    READ TABLE it_event_mara INTO wa_event_mara WITH KEY name = 'USER_COMMAND'.
    IF sy-subrc = 0.
       wa_event_mara-form = 'USER_COMMAND_MARA'.
       MODIFY it_event_mara FROM wa_event_mara TRANSPORTING form WHERE name = wa_event_mara-name.
    ENDIF.
    ENDFORM.                    " eventpopulate_mara
    **TOP OF PAGE
    *&      Form  TOP_OF_PAGE_KNA1
          text
    FORM top_of_page_kna1.
    wa_listheader-typ = 'H'.
    wa_listheader-info = 'CUSTOMER DETAILS' .
    APPEND wa_listheader TO it_listheader.
    CLEAR wa_listheader.
      WRITE:/ 'CUSTOMER DETAILS'.
    ENDFORM.                    "TOP_OF_PAGE_KNA1
    *&      Form  TOP_OF_PAGE_MARA
          text
    FORM top_of_page_mara.
    wa_listheader-typ = 'H'.
    wa_listheader-info = 'MATERIAL DETAILS' .
    APPEND wa_listheader TO it_listheader.
    CLEAR wa_listheader.
      WRITE:/ 'MATERIAL DETAILS' .
    ENDFORM.                    "TOP_OF_PAGE_KNA1
    **CODE FOR SECOND LIST DISPLAY FOR VBAK
    *&      Form  USER_COMMAND
          text
         -->UCOMM      text
         -->R_SELFIELD text
    FORM user_command
         USING ucomm LIKE sy-ucomm
               r_selfield TYPE slis_selfield.
    CASE UCOMM.
      when '&IC1'.
        CASE R_SELFIELD-TABNAME.
          WHEN 'IT_KNA1'.
            DATA: CUST(10) TYPE n.
            CUST = r_selfield-value.
             SELECT vbeln erdat ernam
                    FROM vbak
                    INTO TABLE it_vbak
                    WHERE kunnr = cust.
             PERFORM fieldcat_vbak.
             PERFORM display_vbak.
          WHEN 'IT_MARA'.
            DATA: MAT(18) TYPE N.
            MAT = R_selfield-value.
              SELECT matnr werks lgort
                   FROM mard
                   INTO TABLE it_mard
                   WHERE matnr = mat.
            PERFORM fieldcat_mard.
            PERFORM display_mard.
         ENDCASE.
      ENDCASE.
    ENDFORM.                    "USER_COMMAND
    **&      Form  USER_COMMAND_MARA
          text
         -->UCOMM      text
         -->S_SELFIELD text
    *FORM user_command_mara
        USING ucomm LIKE sy-ucomm
              s_selfield TYPE slis_selfield.
    SELECT matnr werks lgort
            FROM mard
            INTO TABLE it_mard
            WHERE matnr = s_selfield-value.
    PERFORM fieldcat_mard.
    PERFORM display_mard.
    *ENDFORM.                    "USER_COMMAND_MARA
    *&      Form  DISPLAY_VBAK
          text
    -->  p1        text
    <--  p2        text
    FORM display_vbak .
    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          = ' '
      I_CALLBACK_USER_COMMAND           = ' '
      I_CALLBACK_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_GRID_SETTINGS                   =
       IS_LAYOUT                         = wa_layout
       IT_FIELDCAT                       = it_fieldcat_vbak
      IT_EXCLUDING                      =
      IT_SPECIAL_GROUPS                 =
      IT_SORT                           =
      IT_FILTER                         =
      IS_SEL_HIDE                       =
      I_DEFAULT                         = 'X'
      I_SAVE                            = ' '
      IS_VARIANT                        =
      IT_EVENTS                         =
      IT_EVENT_EXIT                     =
      IS_PRINT                          =
      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                          = it_vbak
    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_VBAK
    *&      Form  display_mard
          text
    FORM display_mard .
      CALL FUNCTION 'REUSE_ALV_LIST_DISPLAY'
       EXPORTING
      I_INTERFACE_CHECK              = ' '
      I_BYPASSING_BUFFER             =
      I_BUFFER_ACTIVE                = ' '
         i_callback_program             = sy-repid
      I_CALLBACK_PF_STATUS_SET       = ' '
        i_callback_user_command        = 'USER_COMMAND_MARD'
      I_STRUCTURE_NAME               =
         is_layout                      = wa_layout
         it_fieldcat                    = it_fieldcat_mard
      IT_EXCLUDING                   =
      IT_SPECIAL_GROUPS              =
      IT_SORT                        =
      IT_FILTER                      =
      IS_SEL_HIDE                    =
      I_DEFAULT                      = 'X'
      I_SAVE                         = ' '
      IS_VARIANT                     =
        it_events                      = it_event_mard
      IT_EVENT_EXIT                  =
      IS_PRINT                       =
      IS_REPREP_ID                   =
      I_SCREEN_START_COLUMN          = 0
      I_SCREEN_START_LINE            = 0
      I_SCREEN_END_COLUMN            = 0
      I_SCREEN_END_LINE              = 0
      IR_SALV_LIST_ADAPTER           =
      IT_EXCEPT_QINFO                =
      I_SUPPRESS_EMPTY_DATA          = ABAP_FALSE
    IMPORTING
      E_EXIT_CAUSED_BY_CALLER        =
      ES_EXIT_CAUSED_BY_USER         =
        TABLES
          t_outtab                       = it_mard
    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_mard
    REGARDS
    PRASANTH

Maybe you are looking for

  • ESS Claim Application Behaviour

    Hi ESS Experts, I have configured Claims Functionality. Now when I am trying to raise new claim request, system is not displaying Dropdown LOV's. It was properly and i was able to update records in R/3. We have not done any changes in Configuration .

  • Upgrading RAM cards not showing up in system profiler... is this normal?

    Just replaced both 1GB RAM cards in my macbook pro with two 2GB RAM cards, but when I go into "about my mac" it is still saying that I only have 2GB of memory, and when I go into system profiler and click "memory" it is still showing/giving details o

  • ** Start a workflow from BPM

    How do we start a workflow from BPM ? (For example, to send messages to that workfolw and receive messages like these purposes) Kind Regards, Jeg P.

  • Infamous 0x80072EE6 error WSUS (Server 2012)

    Hi Folks In a test test lab I have setup a windows 2012 R2 server (home-dc-01.pcecorp.com) and a few domain joined windows 8 clients.  The server has WSUS installed and I have configured a group policy with WSUS settings. However the test clients rep

  • Intrastat - Mode of Transport missing in purchase order header

    We have a problem where for a supplier there is missing import data for some materials - but not others. As far as I can tell the Info Records for those with missing data are identical to those where there is no data. For example, the Incoterms field