Alv report problem

hi,
i have problem in ALV.
my requirement is in a ALV report if i double click on a row it has to take me to another transaction ( say for eg vf03).
how should i do it.
john.

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

Similar Messages

  • ALV report problem. empty catalog.

    Hi everybody,
    I'm having a lot of problems with the ALV displaying stuff, i can see no problems in the code but the alv doesnt display anything at all, the catalog is built but any data is displayed  in the list, i even took the function call out of the perform and called REUSE_ALV_GRID_DISPLAY directly to avoid posting any parametres...but the list is still empty.
    here i post the code, is really simple alv example. take info from it001, 002 and 006 and (try to )display that in a alv list.
    If someone see something wrong i would really apreciate it.
    Thanks in advance,
    Ruben.
    REPORT  ZPRR3_12.
    TYPE-POOLS
    CONSTANTS: C_CHECK TYPE c VALUE  'X'.
    DATA : v_rep_id TYPE sy-repid.
    DATA: BEGIN OF t_employee OCCURS 0,
        pernr TYPE persno,
        begda TYPE begda,
        endda TYPE endda,
        bukrs TYPE bukrs,
        werks TYPE persa,
        persg TYPE persg,
        persk TYPE persk,
        orgeh TYPE orgeh,
        plans TYPE plans,
        stell TYPE stell,
        nachn TYPE pad_nachn,
        vorna TYPE pad_vorna,
        gesch TYPE gesch,
        gbdat TYPE gbdat,
        pstlz TYPE pstlz_hr,
        ort02 TYPE pad_ort02,
      END OF t_employee.
    " for alv functions.
    TYPE-POOLS: slis, truxs.
    DATA: gs_layout     TYPE slis_layout_alv,
          it_field      TYPE slis_t_fieldcat_alv,
          tt_fieldcat   TYPE slis_fieldcat_alv.
    TYPES: tt_fieldcat   TYPE STANDARD TABLE OF slis_fieldcat_alv.
    INITIALIZATION.
      v_rep_id = sy-repid.
    SELECTION-SCREEN BEGIN OF BLOCK parametres WITH FRAME TITLE text-001.
    SELECT-OPTIONS: persnum FOR t_employee-pernr DEFAULT 000.
    SELECT-OPTIONS: ccode FOR t_employee-bukrs DEFAULT 'ES01'.
    SELECT-OPTIONS: date  FOR sy-datum.
    SELECTION-SCREEN END OF BLOCK parametres.
    SELECTION-SCREEN BEGIN OF BLOCK options WITH FRAME TITLE text-002.
    PARAMETERS:
       op_alv   TYPE c AS CHECKBOX,
       op_excel TYPE c AS CHECKBOX.
    SELECTION-SCREEN END OF BLOCK options.
    INITIALIZATION.
      "initialize select-options
      op_alv = C_CHECK.
      op_excel = ''.
    START-OF-SELECTION.
      PERFORM data_request.
    END-OF-SELECTION.
      IF op_excel EQ C_CHECK.
    *PERFORM excel_save.
      ENDIF.
      IF op_alv EQ C_CHECK.
        PERFORM display_alv.
      ELSE.
        PERFORM write_raw USING t_employee.
      ENDIF.
    FORMS
    *&      Form  CHARGE_DATA
    FORM data_request.
      SELECT  pa0001pernr pa0001begda pa0001endda pa0001bukrs pa0001~werks
              pa0001persg pa0001persk pa0001orgeh pa0001plans pa0001~stell
              pa0002nachn pa0002vorna pa0002gesch pa0002gbdat
              pa0006pstlz pa0006ort02
      INTO CORRESPONDING FIELDS OF t_employee
      FROM pa0001 JOIN pa0002 ON pa0001pernr = pa0002pernr
                  JOIN pa0006 ON pa0002pernr = pa0006pernr
      WHERE pa0001~pernr IN persnum AND
            pa0001~bukrs IN ccode AND
            pa0001~begda IN date.
      ENDSELECT.
    ENDFORM.                    " CHARGE_DATA
    *&      Form  display_alv
    FORM display_alv.
      PERFORM build_header.
      PERFORM build_layout.
      write t_employee-pernr.
      CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
       EXPORTING
         i_callback_program                = 'g_repid'
         is_layout                         =  gs_layout
         it_fieldcat                       =  it_field
        TABLES
          t_outtab                          = t_employee
       EXCEPTIONS
         program_error                     = 1
         OTHERS                            = 2
      IF sy-subrc <> 0.
        MESSAGE i799(cu) WITH 'Error creando el ALV'(008) 'Código'(009) sy-subrc.
      ENDIF.
    PERFORM call_alv using t_employee.
    ENDFORM.                    "display_alv
    *&      Form  build_HEADER
    form build_header.
      DATA: wa_field TYPE slis_fieldcat_alv. "work area for field catalog
      wa_field-fieldname = 'pernr'.   " name of field from internal table
      wa_field-tabname = 't_employee'. " internal table name
      wa_field-outputlen = 10.        " output length on screen
      wa_field-checkbox = c_check.   " print as checkbox
      wa_field-edit = c_check.       " make field open for input
      wa_field-seltext_l = text-006.      " header information
      APPEND wa_field TO it_field.   " append field catalog internal table
      CLEAR wa_field.                " clear field catalog work area
      wa_field-fieldname = 'begda'.  " name of field from internal table
      wa_field-tabname = 't_employee'. " internal table name
      wa_field-outputlen = 12.       " output length on screen
      wa_field-seltext_l = text-003. " header information
      APPEND wa_field TO it_field.   " append field catalog internal table
      CLEAR wa_field.                " clear field catalog work area
      wa_field-fieldname = 'endda'.  " name of field from internal table
      wa_field-tabname = 't_employee'. " internal table name
      wa_field-outputlen = 12.       " output length on screen
      wa_field-seltext_l = text-004. " header information
      APPEND wa_field TO it_field.   " append field catalog internal table
      CLEAR wa_field.                " clear field catalog work area
      wa_field-fieldname = 'bukrs'.  " name of field from internal table
      wa_field-tabname = 't_employee'. " internal table name
      wa_field-outputlen = 12.       " output length on screen
      wa_field-seltext_l = text-005. " header information
      APPEND wa_field TO it_field.   " append field catalog internal table
      CLEAR wa_field.                " clear field catalog work area
      wa_field-fieldname = 'werks'.  " name of field from internal table
      wa_field-tabname = 't_employee'. " internal table name
      wa_field-outputlen = 12.       " output length on screen
      wa_field-seltext_l = text-007. " header information
      APPEND wa_field TO it_field.   " append field catalog internal table
      CLEAR wa_field.                " clear field catalog work area
      wa_field-fieldname = 'persg'.  " name of field from internal table
      wa_field-tabname = 't_employee'. " internal table name
      wa_field-outputlen = 12.       " output length on screen
      wa_field-seltext_l = text-008. " header information
      APPEND wa_field TO it_field.   " append field catalog internal table
      CLEAR wa_field.                " clear field catalog work area
      wa_field-fieldname = 'persk'.  " name of field from internal table
      wa_field-tabname = 't_employee'. " internal table name
      wa_field-outputlen = 12.       " output length on screen
      wa_field-seltext_l = text-009. " header information
      APPEND wa_field TO it_field.   " append field catalog internal table
      CLEAR wa_field.                " clear field catalog work area
      wa_field-fieldname = 'orgeh'.  " name of field from internal table
      wa_field-tabname = 't_employee'. " internal table name
      wa_field-outputlen = 12.       " output length on screen
      wa_field-seltext_l = text-010. " header information
      APPEND wa_field TO it_field.   " append field catalog internal table
      CLEAR wa_field.                " clear field catalog work area
      wa_field-fieldname = 'plans'.  " name of field from internal table
      wa_field-tabname = 't_employee'. " internal table name
      wa_field-outputlen = 12.       " output length on screen
      wa_field-seltext_l = text-011. " header information
      APPEND wa_field TO it_field.   " append field catalog internal table
      CLEAR wa_field.                " clear field catalog work area
      wa_field-fieldname = 'stell'.  " name of field from internal table
      wa_field-tabname = 't_employee'. " internal table name
      wa_field-outputlen = 12.       " output length on screen
      wa_field-seltext_l = text-012. " header information
      APPEND wa_field TO it_field.   " append field catalog internal table
      CLEAR wa_field.                " clear field catalog work area
      wa_field-fieldname = 'nachn'.  " name of field from internal table
      wa_field-tabname = 't_employee'. " internal table name
      wa_field-outputlen = 12.       " output length on screen
      wa_field-seltext_l = text-013. " header information
      APPEND wa_field TO it_field.   " append field catalog internal table
      CLEAR wa_field.                " clear field catalog work area
      wa_field-fieldname = 'vorna'.  " name of field from internal table
      wa_field-tabname = 't_employee'. " internal table name
      wa_field-outputlen = 12.       " output length on screen
      wa_field-seltext_l = text-014. " header information
      APPEND wa_field TO it_field.   " append field catalog internal table
      CLEAR wa_field.                " clear field catalog work area
      wa_field-fieldname = 'gesch'.  " name of field from internal table
      wa_field-tabname = 't_employee'. " internal table name
      wa_field-outputlen = 12.       " output length on screen
      wa_field-seltext_l = text-015. " header information
      APPEND wa_field TO it_field.   " append field catalog internal table
      CLEAR wa_field.                " clear field catalog work area
      wa_field-fieldname = 'gbdat'.  " name of field from internal table
      wa_field-tabname = 't_employee'. " internal table name
      wa_field-outputlen = 12.       " output length on screen
      wa_field-seltext_l = text-016. " header information
      APPEND wa_field TO it_field.   " append field catalog internal table
      CLEAR wa_field.                " clear field catalog work area
      wa_field-fieldname = 'pstlz'.  " name of field from internal table
      wa_field-tabname = 't_employee'. " internal table name
      wa_field-outputlen = 12.       " output length on screen
      wa_field-seltext_l = text-017. " header information
      APPEND wa_field TO it_field.   " append field catalog internal table
      CLEAR wa_field.                " clear field catalog work area
      wa_field-fieldname = 'ort0z'.  " name of field from internal table
      wa_field-tabname = 't_employee'. " internal table name
      wa_field-outputlen = 12.       " output length on screen
      wa_field-seltext_l = text-018. " header information
      APPEND wa_field TO it_field.   " append field catalog internal table
      CLEAR wa_field.                " clear field catalog work area
    endform.                    " PREPARE_FIELD_CATALOG
    *&      Form  build_layout
          text
    FORM build_layout.
      gs_layout-colwidth_optimize = 'X'. "Optimizar ancho del listado
      gs_layout-zebra = 'X'.           "Mostrar líneas tipo cebra.
      gs_layout-detail_popup = 'X'.    "Mostrar opción de información detalle
    ENDFORM.                    "build_layout
    *&      Form  call_alv
          text
         -->ALV_EMPLOYEE  text
    *FORM call_alv using alv_employee LIKE t_employee.
    ABAP List Viewer
    **WRITE: alv_employee-pernr.
    CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
      EXPORTING
        i_callback_program                = 'g_repid'
        is_layout                         = gs_layout
        it_fieldcat                       = it_field[]
       TABLES
         t_outtab                          = alv_employee
      EXCEPTIONS
        program_error                     = 1
        OTHERS                            = 2
    IF sy-subrc <> 0.
       MESSAGE i799(cu) WITH 'Error creando el ALV'(008) 'Código'(009) sy-subrc.
    ENDIF.
    *ENDFORM.                    "CALL_ALV
    FORM write_raw  USING  p_ta_employee LIKE t_employee.
      WRITE:  p_ta_employee-pernr,p_ta_employee-begda,p_ta_employee-endda,p_ta_employee-bukrs,p_ta_employee-werks,p_ta_employee-persg,
              p_ta_employee-persk,p_ta_employee-orgeh,p_ta_employee-plans,p_ta_employee-stell,p_ta_employee-nachn,p_ta_employee-vorna,
              p_ta_employee-gesch,p_ta_employee-gbdat,p_ta_employee-pstlz,p_ta_employee-ort02.
    ENDFORM.                    " WRITE_RAW

    Hi,
         Past the code in between code option <>  so that every one can read it clearly.
    1) Instead of using SELECT and ENDSELECT use below syntax,
    SELECT  pa0001~pernr
                  pa0001~begda
                  pa0001~endda
                  pa0001~bukrs
                  pa0001~werks
                  pa0001~persg
                   pa0001~persk
                  pa0001~orgeh
                  pa0001~plans
                  pa0001~stell
                  pa0002~nachn
                  pa0002~vorna
                  pa0002~gesch
                  pa0002~gbdat
                  pa0006~pstlz
                  pa0006~ort02
                  INTO CORRESPONDING FIELDS OF TABLE t_employee   " use TABLE
      FROM ( ( pa0001 inner JOIN pa0002 ON pa0001~pernr = pa0002~pernr )
      INNER JOIN pa0006 ON pa0002~pernr = pa0006~pernr )
      WHERE pa0001~pernr IN persnum AND
                   pa0001~bukrs IN ccode AND
                   pa0001~begda IN date.
    2) In FM
    CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
        EXPORTING
          i_callback_program = v_rep_id                 "you were using 'g_repid' which is not at all declared
          is_layout          = gs_layout
          it_fieldcat        = it_field
        TABLES
          t_outtab           = t_employee
        EXCEPTIONS
          program_error      = 1
          OTHERS             = 2.
      IF sy-subrc <> 0.
        MESSAGE i799(cu) WITH 'Error creando el ALV'(008) 'Código'(009) sy-subrc.
      ENDIF.
    3) Check wether the Table t_employee is consisting any data or not, by keeping a BREAK-POINT after the SELECT statement.
    4) If possible while filling the field catalog fill ROW_POS and COL_POS, and always use capital letters when ever you give any value in single quotes.
    wa_field-row_pos = '1'.
      wa_field-col_pos = '1'.
      wa_field-fieldname = 'PERNR'. " name of field from internal table
      wa_field-tabname = 'T_EMPLOYEE'. " internal table name
      wa_field-outputlen = 10. " output length on screen
      wa_field-checkbox = c_check. " print as checkbox
      wa_field-edit = c_check. " make field open for input
      wa_field-seltext_l = text-006. " header information
      APPEND wa_field TO it_field. " append field catalog internal table
      CLEAR wa_field. " clear field catalog work area
    Regards
    Bala Krishna

  • INTERACTIVE ALV REPORT problem

    requirement is that when we click sales order  in alv grid display,it should take to the screen  of va03's displaying  list .

    Hi rahul
    i have code for VL03N (Delivery ) jus see that and do for VA03
    TYPE-POOLS:SLIS.
    DATA:IT_FIELDCAT  TYPE  SLIS_T_FIELDCAT_ALV,
         WA_FIELD LIKE LINE OF IT_FIELDCAT.
    DATA: BEGIN OF IT_LIKP OCCURS 0,
           VBELN TYPE LIKP-VBELN,
          END OF IT_LIKP.
    WA_FIELD-FIELDNAME = 'VBELN'.
    WA_FIELD-TABNAME = 'IT_LIKP'.
    WA_FIELD-HOTSPOT = 'X'.
    APPEND WA_FIELD TO IT_FIELDCAT.
    SELECT VBELN FROM LIKP
    UP TO 10 ROWS
    INTO TABLE IT_LIKP.
    CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
      EXPORTING
        I_CALLBACK_PROGRAM      = SY-REPID
        I_CALLBACK_USER_COMMAND = 'USER_COMMAND'
        IT_FIELDCAT             = IT_FIELDCAT
      TABLES
        T_OUTTAB                = IT_LIKP
      EXCEPTIONS
        PROGRAM_ERROR           = 1.
    *&      Form  user_Command
    *       text
    *      -->UCOMM      text
    *      -->SELFIELD   text
    FORM USER_COMMAND USING UCOMM TYPE SY-UCOMM
                        SELFIELD TYPE SLIS_SELFIELD.
      CASE UCOMM.
        WHEN '&IC1'.
          IF SELFIELD-FIELDNAME = 'VBELN'.
            SET PARAMETER ID 'VL'  FIELD SELFIELD-VALUE.
            CALL TRANSACTION 'VL03N' AND SKIP FIRST SCREEN.
          ENDIF.
      ENDCASE.
    ENDFORM. "user_Command

  • Problem in ALV report

    Hi Friends,
    I have the following 2 problems in ALV report
    1) Logo is not getting displayed in the report.
    2) When i click on the Purchase order number in the report  the interactive report is not working,i am not able to see report of First interactive level.
    can you help it out friends.
    Thanks and regards
    Dinesh
    REPORT  YSDBALV1
    tables: ekko , ekpo .
    type-pools: slis .
    Table for Display Header
    data:i_header type slis_t_listheader with header line.
    *Fieldcat Declaration
    data:fieldcatalog type slis_T_fieldcat_alv  WITH HEADER LINE.
    *Table of Events
    data:i_event type slis_t_event with header line .
    For Layout
    data:i_layout type slis_layout_alv .
    data: text(30) .
    *Internal Table Declaration
    data: begin of it_final occurs 0 ,
          ebeln like ekko-ebeln ,           "Purchasing Document No.
          bedat like ekko-bedat ,           "Purchasing Document Date
          matnr like ekpo-matnr ,           "Material No.
          netwr like ekpo-netwr ,         "Net Order Value in PO Currancy
          meins like ekpo-meins ,           "UOM
          chk(1) ,
          light(1) ,
          change like ekpo-menge ,
          end of it_final .
    **select option Declaration
    selection-screen begin of block block.
    select-options: s_ebeln for ekko-ebeln  .
    selection-screen end of block block .
    selection-screen begin of block block1 .
    parameters:grid radiobutton group r .
    parameters:list radiobutton group r .
    selection-screen end of block block1 .
    at selection screen
    at selection-screen .
    select single * from ekko where ebeln in s_ebeln .
    if sy-subrc <> 0 .
       message e000(8I) WITH 'No Data Exists' .
    endif .
    start-of-selection .
    if grid = 'X' .
    perform get_data .
    perform event using i_event[] .
    perform field using fieldcatalog[] .
    perform layout using i_layout .
    perform grid_display .
    endif .
    *&      Form  get_data
          text
    -->  p1        text
    <--  p2        text
    form get_data .
    *DATA Retrieval from tables
    SELECT EKKO~EBELN
           EKKO~BEDAT
           EKPO~EBELP
           EKPO~MATNR
           EKPO~NETWR
           EKPO~MEINS
           EKPO~MENGE
           EKPO~BPRME
           INTO CORRESPONDING FIELDS OF  table IT_FINAL
           FROM EKKO INNER JOIN EKPO ON EKKOEBELN = EKPOEBELN
           WHERE EKKO~EBELN IN S_EBELN.
           APPEND IT_FINAL.
    endform.                    " get_data
    *Getting the Event for Top of Page display.
    *&      Form  event
          text
         -->P_I_event[]  text
    form event  using    p_i_event type slis_t_event.
      clear p_i_event .
      refresh p_i_event .
    CALL FUNCTION 'REUSE_ALV_EVENTS_GET'
    EXPORTING
       I_LIST_TYPE           = 0
       IMPORTING
         ET_EVENTS             = p_i_event
    EXCEPTIONS
       LIST_TYPE_WRONG       = 1
       OTHERS                = 2
    read table p_i_event with key name = slis_ev_top_of_page into i_event.
          if sy-subrc = 0.
                 move 'TOP_OF_PAGE_PO' to i_event-form.
                 modify p_i_event from i_event index sy-tabix transporting form.
          endif.
          clear i_event.
    endform.                    " event
    *Display Top-of –Page Details and Logo
    form top_of_page_po .
           clear i_header .
           refresh i_header .
           write sy-datum to text.
           i_header-typ = 'H'.
           i_header-info = 'PURCHASE OREDER DETAILS'.
           append i_header.
          *Logo Display
          CALL FUNCTION 'REUSE_ALV_COMMENTARY_WRITE'
                 EXPORTING
                     it_list_commentary       = i_header[]
                     I_LOGO                   = 'ENJOYSAPLOGO'.
    endform .
    *Field Catalog Append
    *&      Form  field
          text
         -->P_fieldCATALOG[]  text
    form field using  p_fieldcatalog type slis_t_fieldcat_alv.
         clear fieldcatalog.
          fieldcatalog-fieldname   = 'EBELN'.
          fieldcatalog-seltext_m   = 'Purchase Order No'.
          fieldcatalog-col_pos     = 1.
          append fieldcatalog .
          clear fieldcatalog.
          fieldcatalog-fieldname   = 'BEDAT'.
          fieldcatalog-seltext_m   = 'PO Date'.
          fieldcatalog-col_pos     = 2.
          append fieldcatalog .
          clear fieldcatalog.
          fieldcatalog-fieldname   = 'MATNR'.
          fieldcatalog-seltext_m   = 'Material No'.
          fieldcatalog-col_pos     = 4.
          fieldcatalog-outputlen   = 20.
          append fieldcatalog .
          clear fieldcatalog.
          fieldcatalog-fieldname   = 'NETWR'.
          fieldcatalog-seltext_m   = 'Net Value '.
          fieldcatalog-col_pos     = 5.
          fieldcatalog-outputlen   = 20.
          fieldcatalog-do_sum = 'X'.
          append fieldcatalog .
          clear fieldcatalog.
          fieldcatalog-fieldname   = 'MEINS'.
          fieldcatalog-seltext_m   = 'Units'.
          fieldcatalog-col_pos     = 6.
          fieldcatalog-outputlen   = 4.
          append fieldcatalog .
          clear fieldcatalog.
    endform.                    " field
    *&      Form  layout
          text
    form layout  using    p_i_layout TYPE SLIS_LAYOUT_ALV .
    i_layout-zebra  = 'X'.
        i_layout-lights_fieldname = 'LIGHT'.
        i_layout-lights_tabname = 'IT_FINAL'.
        i_layout-box_fieldname = 'CHK'.
        i_layout-box_tabname  = 'IT_FINAL'.
        i_layout-edit = ' '.
    endform.
    *To display Buttons in the MENU BAR if needed
    FORM SET_PO_PF_STATUS USING  P_I_EXTAB TYPE
                     SLIS_T_EXTAB.
                     SET PF-STATUS 'MENUPO'.
      ENDFORM.
    *Event for Interactive display of ALV report
    form USER_COMMAND  using r_ucomm like sy-ucomm
                             rs_selfield type slis_selfield .
      if r_ucomm = '&IC1'.
      READ TABLE IT_FINAL  index   rs_selfield-tabindex.
      write:/ IT_FINAL-ebeln.
      endif.
    endform .
    *Parameters of FM  REUSE_ALV_GRID_DISPLAY
    *&      Form  grid_display
          text
    -->  p1        text
    <--  p2        text
    form grid_display .
    CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
      EXPORTING
        I_CALLBACK_PROGRAM                = SY-REPID
       I_CALLBACK_PF_STATUS_SET          = 'SET_PO_PF_STATUS'
        I_CALLBACK_USER_COMMAND           = 'USER_COMMAND'
        IS_LAYOUT                         = I_LAYOUT
        IT_FIELDCAT                       = FIELDCATALOG[]
        IT_EVENTS                         = I_EVENT[]
      TABLES
        t_outtab                          = IT_FINAL.
    endform.                    " grid_display

    *& Report  YSDBALV1
    REPORT  YSDBALV1.
    tables: ekko , ekpo .
    type-pools: slis .
    Table for Display Header
    data:i_header type slis_t_listheader with header line.
    *Fieldcat Declaration
    data:fieldcatalog type slis_T_fieldcat_alv WITH HEADER LINE.
    *Table of Events
    data:i_event type slis_t_event with header line ,
         wa_event type line of slis_t_event.
    For Layout
    data:i_layout type slis_layout_alv .
    data: text(30) .
    *Internal Table Declaration
    data: begin of it_final occurs 0 ,
    ebeln like ekko-ebeln , "Purchasing Document No.
    bedat like ekko-bedat , "Purchasing Document Date
    matnr like ekpo-matnr , "Material No.
    netwr like ekpo-netwr , "Net Order Value in PO Currancy
    meins like ekpo-meins , "UOM
    chk(1) ,
    light(1) ,
    change like ekpo-menge ,
    end of it_final .
    **select option Declaration
    selection-screen begin of block block.
    select-options: s_ebeln for ekko-ebeln .
    selection-screen end of block block .
    selection-screen begin of block block1 .
    parameters:grid radiobutton group r .
    parameters:list radiobutton group r .
    selection-screen end of block block1 .
    at selection screen
    at selection-screen .
    select single * from ekko where ebeln in s_ebeln .
    if sy-subrc <> 0 .
    message e000(8I) WITH 'No Data Exists' .
    endif .
    start-of-selection .
    if grid = 'X' .
    perform get_data .
    perform event using i_event[] .
    perform field using fieldcatalog[] .
    perform layout using i_layout .
    perform grid_display .
    endif .
    *& Form get_data
    text
    --> p1 text
    <-- p2 text
    form get_data .
    *DATA Retrieval from tables
    SELECT EKKO~EBELN
    EKKO~BEDAT
    EKPO~EBELP
    EKPO~MATNR
    EKPO~NETWR
    EKPO~MEINS
    EKPO~MENGE
    EKPO~BPRME
    INTO CORRESPONDING FIELDS OF table IT_FINAL
    FROM EKKO INNER JOIN EKPO ON EKKOEBELN = EKPOEBELN
    WHERE EKKO~EBELN IN S_EBELN.
    APPEND IT_FINAL.
    endform. " get_data
    *Getting the Event for Top of Page display.
    *& Form event
    text
    -->P_I_event[] text
    form event using p_i_event type slis_t_event.
    clear p_i_event .
    refresh p_i_event .
    CALL FUNCTION 'REUSE_ALV_EVENTS_GET'
    EXPORTING
    I_LIST_TYPE = 0
    IMPORTING
    ET_EVENTS = p_i_event.
    EXCEPTIONS
    LIST_TYPE_WRONG = 1
    OTHERS = 2.
    read table p_i_event with key name = slis_ev_top_of_page into wa_event.
    if sy-subrc = 0.
    move 'TOP_OF_PAGE_PO' to i_event-form.
    modify p_i_event from i_event index sy-tabix transporting form.
    endif.
    clear i_event.
    endform. " event
    *Display Top-of –Page Details and Logo
    form top_of_page_po .
    clear i_header .
    refresh i_header .
    write sy-datum to text.
    i_header-typ = 'H'.
    i_header-info = 'PURCHASE OREDER DETAILS'.
    append i_header.
    *Logo Display
    CALL FUNCTION 'REUSE_ALV_COMMENTARY_WRITE'
    EXPORTING
    it_list_commentary = i_header[]
    I_LOGO = 'ENJOYSAP_LOGO'.
    endform .
    *Field Catalog Append
    *& Form field
    text
    -->P_fieldCATALOG[] text
    form field using p_fieldcatalog type slis_t_fieldcat_alv.
    clear fieldcatalog.
    fieldcatalog-fieldname = 'EBELN'.
    fieldcatalog-seltext_m = 'Purchase Order No'.
    fieldcatalog-col_pos = 1.
    append fieldcatalog .
    clear fieldcatalog.
    fieldcatalog-fieldname = 'BEDAT'.
    fieldcatalog-seltext_m = 'PO Date'.
    fieldcatalog-col_pos = 2.
    append fieldcatalog .
    clear fieldcatalog.
    fieldcatalog-fieldname = 'MATNR'.
    fieldcatalog-seltext_m = 'Material No'.
    fieldcatalog-col_pos = 4.
    fieldcatalog-outputlen = 20.
    append fieldcatalog .
    clear fieldcatalog.
    fieldcatalog-fieldname = 'NETWR'.
    fieldcatalog-seltext_m = 'Net Value '.
    fieldcatalog-col_pos = 5.
    fieldcatalog-outputlen = 20.
    fieldcatalog-do_sum = 'X'.
    append fieldcatalog .
    clear fieldcatalog.
    fieldcatalog-fieldname = 'MEINS'.
    fieldcatalog-seltext_m = 'Units'.
    fieldcatalog-col_pos = 6.
    fieldcatalog-outputlen = 4.
    append fieldcatalog .
    clear fieldcatalog.
    endform. " field
    *& Form layout
    text
    form layout using p_i_layout TYPE SLIS_LAYOUT_ALV .
    i_layout-zebra = 'X'.
    i_layout-lights_fieldname = 'LIGHT'.
    i_layout-lights_tabname = 'IT_FINAL'.
    i_layout-box_fieldname = 'CHK'.
    i_layout-box_tabname = 'IT_FINAL'.
    i_layout-edit = ' '.
    endform.
    *To display Buttons in the MENU BAR if needed
    FORM SET_PO_PF_STATUS USING P_I_EXTAB TYPE
    SLIS_T_EXTAB.
    SET PF-STATUS 'MENUPO'.
    ENDFORM.
    *Event for Interactive display of ALV report
    form USER_COMMAND using r_ucomm like sy-ucomm
    rs_selfield type slis_selfield .
    if r_ucomm = '&IC1'.
    READ TABLE IT_FINAL index rs_selfield-tabindex.
    set parameter id 'VL1' field it_final-ebeln.
    call transaction 'ME23N'.
    endif.
    endform .
    *Parameters of FM REUSE_ALV_GRID_DISPLAY
    *& Form grid_display
    text
    --> p1 text
    <-- p2 text
    form grid_display .
    CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
    EXPORTING
    I_CALLBACK_PROGRAM = SY-REPID
    I_CALLBACK_PF_STATUS_SET = 'SET_PO_PF_STATUS'
    I_CALLBACK_USER_COMMAND = 'USER_COMMAND'
    IS_LAYOUT = I_LAYOUT
    IT_FIELDCAT = FIELDCATALOG[]
    IT_EVENTS = I_EVENT[]
    TABLES
    t_outtab = IT_FINAL.
    endform. " grid_display
    Regards,
    Rusidar S.

  • OOP ALV report custom control performance problem

    HI
    how to write OOP ALV report without custom control.. Actually with custom control which taking long time... and time out happens for huge selection of data..
    Regards
    Roops.

    timeout is not an alv problem. If you try to display a "huge" amount of data, any display technology will fail. Even sap programs fail, their wise solution is to ask user to restrict data to be displayed. Or reduce database selection time, or display amount. Or propose the user to download data as a spool, or output to a file on server.
    Otherwise, read some advices about how to handle timeout in [Note 25528 - Parameter rdisp/max_wprun_time|http://service.sap.com/sap/support/notes/25528].
    About your question, if you still want to try, look at [example code with alv class cl_salv_table for simple display|http://help.sap.com/saphelp_nw2004s/helpdata/en/f9/1ab54099de3726e10000000a1550b0/frameset.htm]

  • ALV Report performance & export problem

    Hi,
    We have developed an complex ALV report which accesses the data from FI Tables like BKPF, BSEG, BSAK etc.,   There are almost 100 lac records in BSEG and every day around 20000 records are getting added to that.  Eventhough I have used specific search criteria, system is taking lot of time.  Due to this I forced to run the report in background.  In background also it is taking around 4 - 6 hours.
    1) How can I improve the performance of the report.  Especially to access data from huge database table like BSEG with lot of conditions.  Any best practices
    2) I want to have an option (at selection screen) to get the report directly saved in a Excel file at desired path. 
    Please help me.
    Thanks in advance,
    Mallik

    Hi Mallik,
         Already i faced this problem before. At that time i follow some precuations:
    1) Check the estimation cost for that report with the basis people.
    2) The selection fields mentionedin the select statement and fields order in the internal; table should match with order of Data base fields order.
    3) Define type statements and then refer internal table to that types.
    4) Define secondary indexes in the where condition properly.
    5) Add BINARY SEARCH to read table statement.
    6) if possible attach package size n to the select statement.
    7) Avoid nested loops and nested selects.
    8) After populating the final internal table free all the internal tables.
    9) check how much time taking for each select statemnt through SY05.
    Hope this helps you. reply for queries.
    Regards,
    Kumar.

  • Importing problems in alv report (stored versions)

    HI ALL, i have;
    DATA gt_results TYPE sp_data_type OCCURS 0 WITH HEADER LINE .
    FORM X .
    EXPORT gt_results TO DATABASE sp_ver_dat ID INDXKEY.
    ENDFORM .
    FORM Y .
    IMPORT gt_results  FROM DATABASE sp_ver_dat ID INDXKEY.
    ENDFORM .
    I coded this for storing alv datas as a version . Suppose i executed "form x" in 2008. After 1 year later, i would like to see this 2008 record. But my internal table type (sp_data_type) was changed (This change is obligatory). In example new 2 fields were added and 1 field was deleted. In spite of this, i have an error when i am attempting to run "form y"  because clustered data in database does not fit gt_results anymore. 
    How can i run such old stored versions of this alv report? How should i design this subroutines so there will be no problems even if internal table type frequently change in future..?
    I am expecitng your suggestions..
    Thanks..

    I think this is good solution for the versions which we will be created .  Unfortunately there is no way to save (excute) old versions in which structure of internal table  has changed  many times. We have to handle them manually..
    It means, we can save future but not past.. 
    ISN'T IT?
    Thanks all

  • Problems in ALV Report

    Hi all,
    I have a Problem with the ALV report felated to FI Data. Where in the Selection screen I have two fields Commitment Item, Fund Center and Fiscal Year. When i am executing the report it is printing correctly.
    The Problem is that when i give a commitment which is not related to the Fund Center It is displaying all the records.
    That is nothing but it is displaying all the data where the data of the selection screen is not in the internal table.
    instead i should display a message that the Commitment item is not related to Fund Center. and the ALV Should not print any values. How do i achieve this?
    Please help me in solving the problem. Rewards will be awarded.
    Message was edited by:
            sravan varanasi

    Hi,
    Here is a small ex.
    SELECT mtart mtbez FROM t134t
      INTO CORRESPONDING FIELDS OF TABLE it_t134t
      WHERE mtart IN so_mtart AND spras = 'EN'.
      IF sy-subrc = 0.
        *********PERFORM display   
      ELSE.
        MESSAGE ID 'Selection error' TYPE 'E' NUMBER '0040'.
      ENDIF.
    Hope useful.
    Regards
    Harish.

  • Problem with Page Break In ALV Report

    Hi
    I have got a problem in my ALV report. I have a checkbox in the user input screen where users decide whether they want a page break or not in the print preview (or print) page. Now i also have the option to have layout name in the input screen. so If i leave the layout box empty the check or not check of page break works fine. but if use a save layout name in the layout box the add check box doesn't work anymore. If i have a layout name in the layout box it doesn't matter whether i have checked for page break or not it does the same thing.(in one report it always puts the page breaked)
    Any ideas where to look for the error?
    here is the code for the page break. Opt5 is the check box.
      perform build_sort tables pt_sort changing ls_sort.
      ls_sort-fieldname = 'PERNR'.
      ls_sort-subtot    = 'X'.
    IF OPT5 = 'X'.
       ls_sort-GROUP = '*'.
      ENDIF.
      append ls_sort to pt_sort.
      ls_sort-subtot    = ' '.
      ls_sort-GROUP = ''.

    Never mind it was acting like the page break was not working because the layout was saved with the page break on/OFF.

  • Problem in alv report output

    Hi friends,
    i have created alv report .no problem of getting output . but i m getting question mark in the standard menu. it is displaying 10 question mark (sub menu has print preview etc), edit ,question marks(ABC Analysis) ,question marks (abap list viewer etc ), settings ,system , help.
    i don't want these question marks. how to candle this.i haven't moved to test or production , but iwant  to know  in development  why it is coming..
    if any one knows please let me know.
    thanks and regards,
    kani.

    The Problem is with some GUI inconsistency.
    to overcome there are 2 solutions.
    1. You need to run a program Which i don't remember exactly.
    2. Using the Status event.
    CALL FUNCTION 'REUSE_ALV_LIST_DISPLAY'
      EXPORTING
        i_callback_program = sy-repid
        it_fieldcat        = it_fieldcat
    I_CALLBACK_PF_STATUS_SET = 'STATUS'  "important
        it_sort            = it_sort
      TABLES
        t_outtab           = it_data
      EXCEPTIONS
        program_error      = 1.
    form status using extab tyoe slis_t_extab.
    "This status you can set using the program SAPLKKBL
    " go to se41 transaction, enter the program name SAPLKKBL
    "status as STANDARD , and click the Button Copy status
    "Now in the popup for Option to enter your program name and
    "press ok, then save and activate the status
    "now come here and activate the code and test now..
    set pf-status 'STANDARD' excluding extab.
    endform.

  • Problem in Print Out of ALV report

    Dear All..
    I am trying to take print out of an ALV report. there are 36 columns in my report. when i try to take print out, warning appears which says system cannot print the last 277 columns of report.
    i have tried using different formats for printer like :
    Format                  Description
    X_PAPER                 ABAP/4 list: Default list formatting
    X_SPOOLERR          ABAP list: Spooler problem report
    ZX_65_284               65 Rows and 285 Columns
    X_65_255                ABAP/4 list: At least 65 rows with a maximum number of c
    X_65_200                ABAP list: at least 65 lines with 200 columns (not for a
    X_58_170                ABAP/4 list: At least 58 rows by 170 columns
    X_65_132                ABAP list: At least 65 rows by 132 columns
    X_90_120                ABAP list: At least 90 rows by 120 columns
    X_44_120                ABAP/4 list: At least 44 rows by 120 columns
    X_65_80                 ABAP/4 list: At least 65 rows by 80 columns
    but every time the same message appears even on A3 size paper..
    i am using REUSE_ALV_GRID_DISPLAY to display ALV.
    Please help to to take out prints(can be in condensed mode) so that all columns appear on the print out..

    HI sujeet,
    Thanks for ur response. i had already checked the printer settings.. i think there is no problem with this. Can u Please suggest something else. thanks
    Hiii jyojit..
    Thanks for reply. I had already checked the said check box in spool admin. but the problem still exists. Please suggest something to get rid of the problem.

  • Problem when I call a perfor using ALV report

    Hello my dear expert.
    I showed an ALV report when the user do double clic in any colunm  of this ALV I needo to the program show a other ALV report whit five columns. so In this case I made a internal table and put my option on it.
    El problem is that When i do double click in the first ALV report the program shows a dump.
    i do not know what is the problem, there is something sure is the dump is showed when I do double on the firts ALV report.
    thanks for helping me.
    the source code is the nextÑ
    Moderator message - Please respect the 2,500 character maximum when posting. Post only the relevant portions of code
    thanks alot
    Edited by: Rob Burbank on Apr 19, 2010 5:49 PM

    Thanks I have found my porblem
    this was:
    i_callback_user_command = 'process_click'
    proces_click is in lower_letterr instead of capitals so the program di not find the permorf.
    thanks anyway

  • ALV report run in background creates problem

    hi All,
    i have a ALV report which works fine in foreground but when i run the report in background
    (Execute in beackground option) the job always gets cancelled.
    As i was thinking that its due to quantity and currency field i passed the below parameters inMY FIELD CAT
    w_fieldcat-CFIELDNAME  =  p_001.
       w_fieldcat-CURRENCY    = 'WAERS'.
    w_fieldcat-CFIELDNAME  =  p_001.
        w_fieldcat-QUANTITY    = 'MEINS'.
    Still the job gets cancelled always , can anybody help me with this issue?
    Please give some useful suggestions?

    Hi Bhanu
    After populating the Grid/List elements, may be you were using 'REUSE_ALV_LIST/GRID_DISPLAY' function module.
    As some Function Modules will give problems in background execution,please call the same function module using CL_GUI_ALV_GRID => REUSE_ALV_LIST_DISPLAY for some cases it is the good solution.
    Regards,
    Sreeram Kumar.Madisetty

  • Filter Function problems on ALV report. [Resolved]

    Hi,
    I developed an ALV report by using function as below:
    CALL FUNCTION 'REUSE_ALV_LIST_DISPLAY'
             EXPORTING
                  I_CALLBACK_PROGRAM = G_REPID
    *            I_CALLBACK_PF_STATUS_SET = status_set
    *            I_CALLBACK_USER_COMMAND  = USER_COMMAND
                  I_STRUCTURE_NAME = 'T_BSIK'
                  IS_LAYOUT        = GS_LAYOUT
                  IT_FIELDCAT      = GT_FIELDCAT[]
             TABLES
                  T_OUTTAB    = TAB_BSIK.
    And this ALV custom report is referenced from standard function FBL5N.
    After i completed this report, i made an comparision of FBL5N and my custom report.
    When I apply the filter function, for example, on the document type, I cannot input 2 characters in the document type field under the filter function. The field length is only 1 character. Similar case results on the field document date.
    While the standard function FBL5N works very nice.
    What should i do to make the filter function of my own ALV report as the same as the standard function FBL5N do?
    Thanks in advance.
    Lala
    Message was edited by:
            Hoo lala

    Oh, i found where the problem is...
    add below 2 statements, then the question is resolved.
      LS_FIELDCAT-ref_fieldname = ****
      LS_FIELDCAT-ref_tabname = ***
    FORM FIELDCAT_INIT tables RT_FIELDCAT.
    CLEAR LS_FIELDCAT.
      LS_FIELDCAT-COL_POS   =  3.
      LS_FIELDCAT-FIELDNAME = 'BLART'.
      LS_FIELDCAT-TABNAME   = 'TAB_BSIK'.
      LS_FIELDCAT-SELTEXT_L = 'Document Type'.
      LS_FIELDCAT-ref_fieldname = 'BLART'.
      LS_FIELDCAT-ref_tabname = 'BSIK'.
      APPEND LS_FIELDCAT TO  RT_FIELDCAT.
    endform.
    Fine now.
    Lala

  • ALV Report with Logo .. Print Out Problem

    Hello Guys..
    I am facing and differerent problem , I have created one Report in ALV contain logo of my company and some other details as per selection screen.
    At the time of taking printoput the logo is not coming in print out only report data is  coming.
    How I take logo and ALV report in one print out .
    Please do the needful.
    Regards
    Swati....

    We Can't take logo of ALV in print out.

Maybe you are looking for