Reg: REUSE_ALV_GRID_DISPLAY

Hi Friends,
                I am using REUSE_ALV_GRID_DISPLAY Function Module to display the report.I need SAVE button Should be enabled.
I have done coding as below.
CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
       EXPORTING
            i_callback_program       = v_repid
            i_callback_user_command  = 'DELETE_ENTRIES'
            i_callback_pf_status_set = 'SET_PF_STATUS'
            is_layout                = ls_layout
            it_fieldcat              = i_fieldcat[]
            i_save                   = 'A'
       TABLES
            t_outtab                 = i_final
       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.
Pls. give me suugestion how can i achieve the save button should enable.

CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
EXPORTING
i_callback_program = v_repid
i_callback_user_command = 'DELETE_ENTRIES'
i_callback_pf_status_set = 'SET_PF_STATUS'
is_layout = ls_layout
it_fieldcat = i_fieldcat[]
i_save = 'A'
TABLES
t_outtab = i_final
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.
add a subroutine with name 'SET_PF_STATUS'
form SET_PF_STATUS.
set pf-status 'MYSTATUS'.
endform.
Create a status MYSTATUS by copying the STANDARD status of the program and standard alv example and then add save button on the application toolbar for the MYSTATUS pf-status.
Regards,
Ravi

Similar Messages

  • Reg: ALV (REUSE_ALV_GRID_DISPLAY)

    Hi Experts,
    I need to know how to give drop down list in one of the field in my ALV.
    I found some posting in sdn, but that are related to OOPS concepts.
    But i am using REUSE function module.
    Can you please provide me the solution how to achecive drop down list in ALV using REUSE_ALV_GRID_DISPLAY.
    Thanks
    Vijay.R

    Hi Vijayendran,
       There is only oops method available to create drop down list in ALV.
    Go through the program below and modify your program accordingly.
    Only thing that you have to do is to create container for your alv and use this container for displaying drop down list.
    This program displays a dropdown list in one of the fields of the ALV.
    *& Report  Z_LISTBOX_ALV
    *& Program to display a dropdown list in ALV.
    REPORT  z_listbox_alv.
    TYPE-POOLS: slis.
    TYPES: BEGIN OF ty_rating,
             task(20) TYPE c,
             rating TYPE i,
             weightage(2) TYPE c,
             comments(40) TYPE c,
           END OF ty_rating.
    DATA: g_alvgrid TYPE REF TO cl_gui_alv_grid,
          g_alv_container TYPE REF TO cl_gui_custom_container,
          int_fieldcat TYPE lvc_t_fcat,
          ok_code TYPE sy-ucomm.
    DATA: int_outputdata TYPE TABLE OF ty_rating.
    INITIALIZATION.
    START-OF-SELECTION.
    * call new screen for displaying the oop alv
      CALL SCREEN 1100.
    * Double click on the screen, it takes you the screen painter (SE51). Create
    * Custom Container on the screen and name is as u2018CONTAINERu2019. Set the Ok-Code
    * the screen as u2018OK_CODEu2019. Also create a GUI status named 'STANDARD' and
    * in set Ok-code '&F03' for the back button.
    * The screen 1100 thus gets created to hold the grid ALV.
    * In the PBO of the screen, call the modules to set pf-status, title and
    * to display the ALV list.
    * In case we have an interactive ALV or for additional functionalities we can
    * create OK-CODES and based on the user command we do the coding in the PAI.
    *&      Module  STATUS_0600  OUTPUT
    *       set the PF status of the screen. Called in PBO of screen.
    MODULE status_0600 OUTPUT.
      SET PF-STATUS 'STANDARD'.
    ENDMODULE.                 " STATUS_0600  OUTPUT
    *&      Module  DISPLAY_ALV  OUTPUT
    *       Displays the alv list. Called in PBO of screen.
    MODULE display_alv OUTPUT.
    *  get the data.
      PERFORM retrieve_data.
    *  prepare fieldcatalog for displaying the alv
      PERFORM prepare_fieldcatalog.
    *  create a container to display the list
      CREATE OBJECT g_alv_container
        EXPORTING
          container_name = 'CONTAINER'.
    *  create a reference for the alv
      CREATE OBJECT g_alvgrid
        EXPORTING
          i_parent = g_alv_container.
    *  prepare a listbox for the rating column
      PERFORM fill_dropdown.
    *  call the method to display the list
      CALL METHOD g_alvgrid->set_table_for_first_display
        EXPORTING
          i_bypassing_buffer            = 'X'
          i_save                        = 'X'
        CHANGING
          it_outtab                     = int_outputdata
          it_fieldcatalog               = int_fieldcat
        EXCEPTIONS
          invalid_parameter_combination = 1
          program_error                 = 2
          too_many_lines                = 3
          others                        = 4
      IF sy-subrc <> 0.
       MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
                  WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
      ENDIF.
    ENDMODULE.                    "DISPLAY_ALV OUTPUT
    *&      Form  PREPARE_FIELDCATALOG
    *       prepares fieldcatalog
    FORM prepare_fieldcatalog .
      DATA: lws_fieldcat TYPE lvc_s_fcat.
      CLEAR int_fieldcat.
      CLEAR lws_fieldcat.
      lws_fieldcat-col_pos   = 1.
      lws_fieldcat-fieldname = 'TASK'.
      lws_fieldcat-scrtext_m = 'TASK'.
      APPEND lws_fieldcat TO int_fieldcat.
      CLEAR lws_fieldcat.
      lws_fieldcat-col_pos   = 2.
      lws_fieldcat-fieldname = 'RATING'.
      lws_fieldcat-edit = 'X'.
      lws_fieldcat-scrtext_m = 'RATING'.
      lws_fieldcat-just = 'L'.
      lws_fieldcat-outputlen = '6'.
      lws_fieldcat-drdn_hndl = '1'.        "handle for listbox
      APPEND lws_fieldcat TO int_fieldcat.
      CLEAR lws_fieldcat.
      lws_fieldcat-col_pos   = 3.
      lws_fieldcat-fieldname = 'WEIGHTAGE'.
      lws_fieldcat-scrtext_m = 'WEIGHTAGE'.
      lws_fieldcat-outputlen = '9'.
      APPEND lws_fieldcat TO int_fieldcat.
      CLEAR lws_fieldcat.
      lws_fieldcat-col_pos   = 4.
      lws_fieldcat-fieldname = 'COMMENTS'.
      lws_fieldcat-scrtext_m = 'COMMENTS'.
      lws_fieldcat-edit = 'X'.
      APPEND lws_fieldcat TO int_fieldcat.
    ENDFORM.                    " PREPARE_FIELDCATALOG
    *&      Form  RETRIEVE_DATA
    *       retreives the data to be displayed
    FORM retrieve_data .
      DATA: lws_outputdata TYPE ty_rating.
      CLEAR int_outputdata.
      CLEAR lws_outputdata.
      lws_outputdata-task = 'proj. related'.
      lws_outputdata-weightage = '20'.
      APPEND lws_outputdata TO int_outputdata.
      CLEAR lws_outputdata.
      lws_outputdata-task = 'process. related'.
      lws_outputdata-weightage = '10'.
      APPEND lws_outputdata TO int_outputdata.
      CLEAR lws_outputdata.
      lws_outputdata-task = 'knowledge mgnt.'.
      lws_outputdata-weightage = '30'.
      APPEND lws_outputdata TO int_outputdata.
    ENDFORM.                    " RETRIEVE_DATA
    *&      Form  FILL_DROPDOWN
    *       prepares the listbox to be displayed and assigns it to the alv
    FORM fill_dropdown .
      DATA: lint_dropdown TYPE lvc_t_drop,
            lws_dropdown TYPE lvc_s_drop.
      CLEAR lint_dropdown.
      CLEAR lws_dropdown.
      lws_dropdown-handle = '1'.
      lws_dropdown-value = '5'.
      APPEND lws_dropdown TO lint_dropdown.
      CLEAR lws_dropdown.
      lws_dropdown-handle = '1'.
      lws_dropdown-value = '4'.
      APPEND lws_dropdown TO lint_dropdown.
      CLEAR lws_dropdown.
      lws_dropdown-handle = '1'.
      lws_dropdown-value = '3'.
      APPEND lws_dropdown TO lint_dropdown.
      CLEAR lws_dropdown.
      lws_dropdown-handle = '1'.
      lws_dropdown-value = '2'.
      APPEND lws_dropdown TO lint_dropdown.
      CLEAR lws_dropdown.
      lws_dropdown-handle = '1'.
      lws_dropdown-value = '1'.
      APPEND lws_dropdown TO lint_dropdown.
      CALL METHOD g_alvgrid->set_drop_down_table
        EXPORTING
          it_drop_down = lint_dropdown.
    ENDFORM.                    " FILL_DROPDOWN
    *&      Module  HANDLE_GOBACK  INPUT
    *       handles 'back' button. Called in PAI of the screen.
    MODULE handle_goback INPUT.
      IF ok_code EQ '&F03'.
        LEAVE PROGRAM.
      ENDIF.
    ENDMODULE.
    Get back to me for any clarification.
    Regards,
    Bhavesh

  • Reg : Gird Title In REUSE_ALV_GRID_DISPLAY

    Hi Friends,
    I am working with ALV Grid Display . In that my requirement is i need keep the grid title at 30th column out of 60 colums.
    So i am providing space infront of grid title like this : '  ALV Grid' but after 75 characters space it is going to dump.
    So how can i rectify this problem . Please help me.
    Thanks ,
    Laxmi

    Hi,
    Laxmi
    just go through the following piece of code..
    REPORT  alv_top_of_page.
    TABLES : t001.
    TYPE-POOLS: slis.
    DATA : w_repid LIKE sy-repid.
    TYPES : BEGIN OF ty_comp.
            INCLUDE STRUCTURE t001.
    TYPES : END OF ty_comp.
    DATA: wa_layout  TYPE slis_layout_alv.
    DATA: it_fieldcat TYPE slis_t_fieldcat_alv,
          wa_fieldcat TYPE slis_fieldcat_alv.
    DATA : it_comp TYPE TABLE OF ty_comp.
    INITIALIZATION.
      w_repid = sy-repid.
    START-OF-SELECTION.
      SELECT * FROM t001 INTO TABLE it_comp.
    END-OF-SELECTION.
      CALL FUNCTION 'REUSE_ALV_FIELDCATALOG_MERGE'
        EXPORTING
          i_program_name         = w_repid
          i_internal_tabname     = 'IT_COMP'
          i_inclname             = w_repid
        CHANGING
          ct_fieldcat            = it_fieldcat[]
        EXCEPTIONS
          inconsistent_interface = 1
          program_error          = 2
          OTHERS                 = 3.
      CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
        EXPORTING
          i_callback_program          = w_repid
          i_callback_html_top_of_page = 'HTML_TOP_OF_PAGE'
          is_layout                   = wa_layout
          it_fieldcat                 = it_fieldcat
        TABLES
          t_outtab                    = it_comp
        EXCEPTIONS
          program_error               = 1
          OTHERS                      = 2.
    *&      Form  html_top_of_page
    FORM html_top_of_page USING document TYPE REF TO cl_dd_document.
      DATA: text TYPE sdydo_text_element.
      CALL METHOD document->add_gap
        EXPORTING
          width = 100.
      text =  'Company Code Data'.
      CALL METHOD document->add_text
        EXPORTING
          text      = text
          sap_style = 'HEADING'.
      CALL METHOD document->new_line.
      CALL METHOD document->new_line.
      CALL METHOD document->new_line.
      text = 'User Name : '.
      CALL METHOD document->add_text
        EXPORTING
          text         = text
          sap_emphasis = 'Strong'.
      CALL METHOD document->add_gap
        EXPORTING
          width = 6.
      text = sy-uname.
      CALL METHOD document->add_text
        EXPORTING
          text      = text
          sap_style = 'Key'.
      CALL METHOD document->add_gap
        EXPORTING
          width = 50.
      text = 'Date : '.
      CALL METHOD document->add_text
        EXPORTING
          text         = text
          sap_emphasis = 'Strong'.
      CALL METHOD document->add_gap
        EXPORTING
          width = 6.
      text = sy-datum.
      CALL METHOD document->add_text
        EXPORTING
          text      = text
          sap_style = 'Key'.
      CALL METHOD document->add_gap
        EXPORTING
          width = 50.
      text = 'Time : '.
      CALL METHOD document->add_text
        EXPORTING
          text         = text
          sap_emphasis = 'Strong'.
      CALL METHOD document->add_gap
        EXPORTING
          width = 6.
      text = sy-uzeit.
      CALL METHOD document->add_text
        EXPORTING
          text      = text
          sap_style = 'Key'.
      CALL METHOD document->new_line.
      CALL METHOD document->new_line.
    ENDFORM.                    "HTML_TOP_OF_PAGE
    i hope u will get the solution...
    Thansk
    Ashu

  • EDIT_MODE in REUSE_ALV_GRID_DISPLAY

    Hi everybody.
    I am calling FM REUSE_ALV_GRID_DISPLAY to display certain data in an ALV grid. Some of the fields are supposed to be editable, so I modify the field catalogue accordingly (fieldcat-edit = 'X'). Since I want to edit some of the grid data I set the LAYOUT structure fields EDIT to 'X' and EDIT_MODE to ' ', respectively.
    Now I have two problems:
    The first problem is that all fields are editable, not just the ones I set fieldcat-edit = 'X' for. Even those with fieldcat-edit = ' ' are editable.
    The second problem is that the internal table isn't always updated when I change the data in the ALV grid. I enter new text in one of the fields, but the internal table is changed only when I press the enter key or do some other stuff that causes a PAI (at least that's what I think). When I press 'SAVE' whithout hitting enter before, the data isn't updatet at all!!!
    Is there a solution to this problem? Do I have to set the parameters EDIT or EDIT_MODE of the LAYOUT structure to any magic values before alling REUSE... ?
    Any comments?
    Regards, Joerg

    Hi, 
    See the following line in the below code,
    line_fieldcat-edit      = 'X'.  This is the way how u shld make the field editable.
    REPORT zsomalv3 NO STANDARD PAGE HEADING.
    TYPE-POOLS: slis.
    DATA: BEGIN OF i_data OCCURS 0,
            qmnum      LIKE qmel-qmnum,
            qmart      LIKE qmel-qmart,
            qmtxt      LIKE qmel-qmtxt,
            ws_row     TYPE i,
            ws_char(5) TYPE c,
            chk,
          END OF i_data.
    DATA: report_id  LIKE sy-repid.
    DATA: ws_title   TYPE lvc_title VALUE 'An ALV Report'.
    DATA: i_layout   TYPE slis_layout_alv.
    DATA: i_fieldcat TYPE slis_t_fieldcat_alv.
    SELECT qmnum
           qmart
           qmtxt
           INTO TABLE i_data
           FROM qmel
           WHERE qmnum <= '00030000010'.
    LOOP AT i_data.
      i_data-ws_row = sy-tabix.
      i_data-ws_char = 'AAAAA'.
      MODIFY i_data.
    ENDLOOP.
    report_id = sy-repid.
    PERFORM f1000_layout_init CHANGING i_layout.
    PERFORM f2000_fieldcat_init CHANGING i_fieldcat.
    CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
    EXPORTING
    *   I_INTERFACE_CHECK                 = ' '
    *   I_BYPASSING_BUFFER                =
    *   I_BUFFER_ACTIVE                   = ' '
       i_callback_program                = report_id
    *   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                      = ws_title
    *   I_GRID_SETTINGS                   =
       is_layout                         = i_layout
       it_fieldcat                       = i_fieldcat
    *   IT_EXCLUDING                      =
    *   IT_SPECIAL_GROUPS                 =
    *   IT_SORT                           =
    *   IT_FILTER                         =
    *   IS_SEL_HIDE                       =
    *   I_DEFAULT                         = 'X'
       i_save                            = 'A'
    *   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
    *   IT_ALV_GRAPHICS                   =
    *   IT_ADD_FIELDCAT                   =
    *   IT_HYPERLINK                      =
    * IMPORTING
    *   E_EXIT_CAUSED_BY_CALLER           =
    *   ES_EXIT_CAUSED_BY_USER            =
      TABLES
        t_outtab                          = i_data
    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  F1000_Layout_Init
    FORM f1000_layout_init USING i_layout TYPE slis_layout_alv.
      CLEAR i_layout.
      i_layout-colwidth_optimize = 'X'.
      i_layout-edit = 'X'.
    ENDFORM.                    " F1000_Layout_Init
    *&      Form  f2000_fieldcat_init
    FORM f2000_fieldcat_init CHANGING i_fieldcat TYPE slis_t_fieldcat_alv.
      DATA: line_fieldcat TYPE slis_fieldcat_alv.
      CLEAR line_fieldcat.
      line_fieldcat-fieldname = 'QMNUM'.    
      line_fieldcat-tabname   = 'I_DATA'.   
      line_fieldcat-key       = 'X'. 
      line_fieldcat-seltext_m = 'Notification No.'.
      APPEND line_fieldcat TO i_fieldcat.
      CLEAR line_fieldcat.
      line_fieldcat-fieldname = 'QMART'.
      line_fieldcat-ref_tabname = 'I_DATA'.
      line_fieldcat-hotspot = 'X'.          
      line_fieldcat-seltext_m = 'Notif Type'.
      APPEND line_fieldcat TO i_fieldcat.
      CLEAR line_fieldcat.
      line_fieldcat-fieldname = 'QMTXT'.
      line_fieldcat-tabname   = 'I_DATA'.
      line_fieldcat-seltext_m = 'Description'.
      APPEND line_fieldcat TO i_fieldcat.
      CLEAR line_fieldcat.
      line_fieldcat-fieldname = 'WS_ROW'.
      line_fieldcat-tabname   = 'I_DATA'.
      line_fieldcat-seltext_m = 'Row Number'.
      APPEND line_fieldcat TO i_fieldcat.
      CLEAR line_fieldcat.
      line_fieldcat-fieldname = 'WS_CHAR'.
      line_fieldcat-tabname   = 'I_DATA'.
      line_fieldcat-seltext_l = 'Test Character Field'.
      line_fieldcat-datatype  = 'CHAR'.
      line_fieldcat-outputlen = '15'.
      APPEND line_fieldcat TO i_fieldcat.
      CLEAR line_fieldcat.
      line_fieldcat-fieldname = 'CHK'.
      line_fieldcat-tabname   = 'I_DATA'.
      line_fieldcat-seltext_l = 'Checkbox'.
      line_fieldcat-checkbox  = 'X'.    
      line_fieldcat-edit      = 'X'.    
      APPEND line_fieldcat TO i_fieldcat.
    ENDFORM.                    " f2000_fieldcat_init
    Regs,
    Venkat

  • How to color a specific cell in ALV (not REUSE_ALV_GRID_DISPLAY)

    Hi
    I want to change color font or background to a specify position in ALV grid
    It is possible but by creating ALV container (not FM for example REUSE_ALV_GRID_DISPLAY)?

    Hi,
    REPORT ZALV_LIST1.
    TABLES:
    SPFLI.
    TYPE-POOLS:
    SLIS.
    PARAMETERS:
    P_COL TYPE I ,
    P_ROW TYPE I,
    P_COLOR(4) TYPE C .
    DATA:
    T_FIELDCAT TYPE SLIS_T_FIELDCAT_ALV,
    FS_FIELDCAT LIKE LINE OF T_FIELDCAT,
    FS_LAYOUT TYPE SLIS_LAYOUT_ALV ,
    W_COLOR(4) ,
    W_ROW TYPE I,
    W_FIELDNAME(20),
    W_PROG TYPE SY-REPID.
    DATA:
    BEGIN OF T_SPFLI OCCURS 0,
    COLOR(4),
    CHECKBOX ,
    CELL TYPE SLIS_T_SPECIALCOL_ALV,
    CARRID TYPE SPFLI-CARRID,
    CONNID TYPE SPFLI-CONNID,
    CITYFROM TYPE SPFLI-CITYFROM,
    CITYTO TYPE SPFLI-CITYTO,
    DISTANCE TYPE SPFLI-DISTANCE,
    END OF T_SPFLI.
    DATA:
    FS_CELL LIKE LINE OF T_SPFLI-CELL.
    SELECT *
    FROM SPFLI
    INTO CORRESPONDING FIELDS OF TABLE T_SPFLI.
    W_COLOR = P_COLOR.
    T_SPFLI-COLOR = P_COLOR.
    IF P_COL IS INITIAL AND P_ROW GT 0.
    MODIFY T_SPFLI INDEX P_ROW TRANSPORTING COLOR.
    ENDIF.
    FS_FIELDCAT-FIELDNAME = 'CARRID'.
    FS_FIELDCAT-REF_TABNAME = 'SPFLI'.
    FS_FIELDCAT-COL_POS = 1.
    FS_FIELDCAT-KEY = 'X'.
    FS_FIELDCAT-HOTSPOT = 'X'.
    APPEND FS_FIELDCAT TO T_FIELDCAT.
    CLEAR FS_FIELDCAT .
    FS_FIELDCAT-FIELDNAME = 'CONNID'.
    FS_FIELDCAT-REF_TABNAME = 'SPFLI'.
    FS_FIELDCAT-COL_POS = 2.
    FS_FIELDCAT-KEY = 'X'.
    FS_FIELDCAT-HOTSPOT = 'X'.
    APPEND FS_FIELDCAT TO T_FIELDCAT.
    CLEAR FS_FIELDCAT .
    FS_FIELDCAT-FIELDNAME = 'DISTANCE'.
    FS_FIELDCAT-REF_TABNAME = 'SPFLI'.
    FS_FIELDCAT-COL_POS = 3.
    FS_FIELDCAT-KEY = ' '.
    FS_FIELDCAT-EDIT = 'X'.
    APPEND FS_FIELDCAT TO T_FIELDCAT.
    CLEAR FS_FIELDCAT.
    FS_FIELDCAT-FIELDNAME = 'CITYFROM'.
    FS_FIELDCAT-REF_TABNAME = 'SPFLI'.
    FS_FIELDCAT-COL_POS = 4.
    FS_FIELDCAT-KEY = ' '.
    APPEND FS_FIELDCAT TO T_FIELDCAT.
    LOOP AT T_FIELDCAT INTO FS_FIELDCAT.
    IF FS_FIELDCAT-COL_POS EQ P_COL.
    FS_FIELDCAT-EMPHASIZE = P_COLOR.
    W_FIELDNAME = FS_FIELDCAT-FIELDNAME.
    IF P_ROW IS INITIAL AND P_COL GT 0.
    MODIFY T_FIELDCAT FROM FS_FIELDCAT TRANSPORTING EMPHASIZE.
    ENDIF.
    ENDIF.
    ENDLOOP.
    FS_CELL-FIELDNAME = W_FIELDNAME .
    FS_CELL-COLOR-COL = 6.
    FS_CELL-NOKEYCOL = 'X'.
    APPEND FS_CELL TO T_SPFLI-CELL.
    IF P_ROW IS NOT INITIAL AND P_COL IS NOT INITIAL.
    MODIFY T_SPFLI INDEX P_ROW TRANSPORTING CELL.
    ENDIF.
    FS_LAYOUT-INFO_FIELDNAME = 'COLOR'.
    FS_LAYOUT-BOX_FIELDNAME = 'CHECKBOX'.
    FS_LAYOUT-COLTAB_FIELDNAME = 'CELL'.
    FS_LAYOUT-F2CODE = '&ETA'.
    W_PROG = SY-REPID.
    CALL FUNCTION 'REUSE_ALV_LIST_DISPLAY'
    EXPORTING
    I_CALLBACK_PROGRAM = W_PROG
    IS_LAYOUT = FS_LAYOUT
    IT_FIELDCAT = T_FIELDCAT
    TABLES
    T_OUTTAB = T_SPFLI
    EXCEPTIONS
    PROGRAM_ERROR = 1
    OTHERS = 2

  • Mail can't send email from 123-reg accounts

    Hi all,
    I've got an issue with Mac Mail can’t send email from 123-reg accounts.
    I know there is a lot of articles on simular matters and some I have tried out with no luck, others are just speaking a whole other language.
    Any help would be greatly recived, here's my situation below:
    Running a iMac 2.8GHz Intel Core i5 on OS X 10.8.3
    I’m using 3 accounts on Macs Mail client, one is my iCloud account that is working fine and the other two are my 123-reg accounts that I use for business purposes. I’ve been working like this for a couple of years now and about 6 months ago I upgrade my operating system from Snow Leopard to Mountain Lion.
    2 or 3 months ago I randomly got a problem where I was unable to send any emails from my 123-reg account, I could only receive emails. I checked my settings and they were all correct and unchanged so I attempted to delete them and recreate the account but with no such luck.
    I then decided to check if it was a problem at 123-regs end and attempted to log into web mail. This worked and was able to both send and receive emails so eliminated that possibility.
    I also have these accounts set up on my iPhone, so checked if there was any issues and everything was working fine. I then checked my iphone details and made sure the same was on my desktop and still no such luck.
    I’ve tried out some of the articles I’ve found on here (the ones written in plain English) still no results. I’m not very IT illiterate and just wondered if anyone else has got any ideas, whether there is something specific with 123-reg accounts and Mac Mail?
    Many thanks.

    Thanks
    I just had another hunt around looking at posts and discovered that it was because I recently changed to BT Infinity and they had a block on.
    I didn't even think to question the ISP.
    https://discussions.apple.com/message/21173608#21173608

  • What is diff b/w reuse_alv_grid_display and reuse_alv_grid_display_lvc

    Hi everbody,
    what is diff b/w reuse_alv_grid_display and reuse_alv_grid_display_lvc.
    can u give a dteils on it .
    Regards,
    Priya

    ALV
    1. Please give me general info on ALV.
    http://www.sapfans.com/forums/viewtopic.php?t=58286
    http://www.sapfans.com/forums/viewtopic.php?t=76490
    http://www.sapfans.com/forums/viewtopic.php?t=20591
    http://www.sapfans.com/forums/viewtopic.php?t=66305 - this one discusses which way should you use - ABAP Objects calls or simple function modules.
    2. How do I program double click in ALV?
    http://www.sapfans.com/forums/viewtopic.php?t=11601
    http://www.sapfans.com/forums/viewtopic.php?t=23010
    3. How do I add subtotals (I have problem to add them)...
    http://www.sapfans.com/forums/viewtopic.php?t=20386
    http://www.sapfans.com/forums/viewtopic.php?t=85191
    http://www.sapfans.com/forums/viewtopic.php?t=88401
    http://www.sapfans.com/forums/viewtopic.php?t=17335
    4. How to add list heading like top-of-page in ABAP lists?
    http://www.sapfans.com/forums/viewtopic.php?t=58775
    http://www.sapfans.com/forums/viewtopic.php?t=60550
    http://www.sapfans.com/forums/viewtopic.php?t=16629
    5. How to print page number / total number of pages X/XX in ALV? http://www.sapfans.com/forums/viewtopic.php?t=29597 (no direct solution)
    6. ALV printing problems. The favourite is: The first page shows the number of records selected but I don't need this.
    http://www.sapfans.com/forums/viewtopic.php?t=64320
    http://www.sapfans.com/forums/viewtopic.php?t=44477
    7. How can I set the cell color in ALV? http://www.sapfans.com/forums/viewtopic.php?t=52107
    8. How do I print a logo/graphics in ALV?
    http://www.sapfans.com/forums/viewtopic.php?t=81149
    http://www.sapfans.com/forums/viewtopic.php?t=35498
    http://www.sapfans.com/forums/viewtopic.php?t=5013
    9. How do I create and use input-enabled fields in ALV?
    http://www.sapfans.com/forums/viewtopic.php?t=84933
    http://www.sapfans.com/forums/viewtopic.php?t=69878
    10. How can I use ALV for reports that are going to be run in background?
    http://www.sapfans.com/forums/viewtopic.php?t=83243
    http://www.sapfans.com/forums/viewtopic.php?t=19224
    11. How can I display an icon in ALV? (Common requirement is traffic light icon).
    http://www.sapfans.com/forums/viewtopic.php?t=79424
    http://www.sapfans.com/forums/viewtopic.php?t=24512
    12. How can I display a checkbox in ALV? http://www.sapfans.com/forums/viewtopic.php?t=88376
    http://www.sapfans.com/forums/viewtopic.php?t=40968
    http://www.sapfans.com/forums/viewtopic.php?t=6919
    Check this for basic concepts of OOPS
    https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/com.sap.km.cm.docs/library/webas/abap/abap%20code%20samples/abap%20objects/abap%20code%20sample%20to%20learn%20basic%20concept%20of%20object-oriented%20programming.doc
    https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/com.sap.km.cm.docs/library/webas/abap/abap%20code%20samples/alv%20grid/abap%20code%20sample%20to%20display%20data%20in%20alv%20grid%20using%20object%20oriented%20programming.doc
    Tabstrip
    https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/com.sap.km.cm.docs/library/webas/abap/abap%20code%20samples/alv%20grid/abap%20code%20sample%20for%20tab%20strip%20in%20alv.pdf
    Editable ALV
    https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/com.sap.km.cm.docs/library/webas/abap/abap%20code%20samples/alv%20grid/abap%20code%20sample%20to%20edit%20alv%20grid.doc
    Tree
    http://www.sapdevelopment.co.uk/reporting/alv/alvtree/alvtree_usrint.htm
    General Tutorial for OOPS
    https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/com.sap.km.cm.docs/library/webas/abap/an%20easy%20reference%20for%20alv%20grid%20control.pdf
    http://www.sapdevelopment.co.uk/reporting/alvhome.htm
    http://www.sap-img.com/abap/what-is-alv-programming.htm
    http://www.sap-img.com/abap-function.htm
    http://www.geocities.com/mpioud/Abap_programs.html
    http://www.sapdevelopment.co.uk/reporting/alv/alvtree%5Calvtree_basic.htm
    http://esnips.com/doc/ad20dca9-6182-4903-8d8f-96a66dc8590c/ALV.pdf
    http://www.sap-img.com/abap-function.htm

  • ** Filtering is not working correctly in ALV (REUSE_ALV_GRID_DISPLAY)

    Hi Friends,
    We have one Z report that output is displayed in ALV. We are using the standard FM 'REUSE_ALV_GRID_DISPLAY. 
    We have requirement to remove leading zeros for the field like Material Number (MATNR), Equipment Number (EQUNR) etc. We did the changes by applying the field catalog properties as below.
    lw_fieldcat-lzero = space.
    lw_fieldcat-no_zero = 'X'.
    After this, the MATNR and EQUNR is displayed correctly in the ALV. (Leading zeros are suppressed). But, when we do filter for these fields, in the filter window it displays all the values with leading zeros.
    1. We don't understand why it is showing in the Filter widow with all leading zeros. All it shows all the records instead of unique items.
    Later on, we removed the above fieldcat coding. Then, we have called the CONVERSION_EXIT routines (in the domain) for the fields to remove leading zeros.
    Now, the MATNR and EQUNR is displayed correctly (without leading zeros) in ALV. When we do filter, it is also doing filtering correctly. But, when we do filter which have EQUNR having long values (after zero suppression), it is not working correctly. i.e no items are displayed in the ALV.
    Not only for this items. If we filter character columns which have long text, it is not filtering correctly.
    2. It is not able to understand why the filtering is not working for long items. But in the standard report, the filtering is working correctly.
    We are using SAP ECC 6.0.
    Friends, can you clarify the about doubts. It is surprising for me.
    Kind regards,
    Jegathees P.
    Our customer is asked to remove the leading zeros for the numeric field

    Hi Clemens Li
    I agreed on your point. When we define the Internal table the type for element EQUNR & QUMNR , we are referring the SAP data element for EQUNR, QMNUM field.
    Our doubt is even though we refer the standard data element, in the ALV display, it shows with leading zeros and also it creates problems in the filtering and in the filter window all values instead of unique nos.
    Hi Abhii
    I have given below the fieldcat coding.
    Friends, can you kindly clarify the above said problems. Since we use SAP ECC 6.0 any notes or patches apply is required. ( this is the basic functionality in ALV, that is my doubt).
        wls_fieldcat-col_pos   = wpv_pos.
        wls_fieldcat-fieldname = wpv_champ.
        wls_fieldcat-tabname   = wlc_tabname.
      wls_fieldcat-seltext_s = wls_fieldcat-seltext_m
        wls_fieldcat-seltext_l = wpv_libelle.
        wls_fieldcat-ddictxt   = 'L'.
        wls_fieldcat-no_out    = wv_no_out.
        APPEND wls_fieldcat TO gt_fieldcat.
    Kind regards,
    Jegathees P.

  • Reg : data is not getting in the output

    hi team,
                 data is not getting in the  output, but it is getting in the debug mode
    REPORT ZSAPP10 .
    *tables : pernr.
    TABLES : PA0001.
    type-pools : slis.
    types : begin of itab,
            pernr type pernr,
            orgeh type orgeh,
            abkrs type abkrs,
            end of itab,
            begin of itab2,
            pernr type pernr,
            vorna type pad_vorna,
            nachn type pad_nachn,
            end of itab2.
    parameter : p_pernr like pa0001-pernr.
    *DATA:  g_cprog  tYPE SY-CPROG.
    data : i_itab1 type table of itab initial size 0,
           i_itab2 type table of itab2 initial size 0.
    data : w_itab type itab,
           w_itab2 type itab2.
    data : t_fieldcat type slis_t_fieldcat_alv,
            w_fieldcat type slis_fieldcat_alv.
    data : t_event type slis_t_event,
            w_event type slis_alv_event.
    data : t_listheader type slis_t_listheader,
           w_listheader type slis_listheader.
    *get pernr.
    w_event-form = 'TOP_OF_PAGE'.
    w_event-form = 'sub1'.
    append w_event to t_event.
    w_listheader-typ = 'H'.
    w_listheader-info = 'this is new top of page'.
    append w_listheader to t_listheader.
    select pernr
           orgeh
           abkrs from pa0001 into table i_itab1 where pernr = p_pernr.
    w_fieldcat-col_pos = 1.
    w_fieldcat-seltext_m = 'personnal no'.
    w_fieldcat-fieldname = 'pernr'.
    w_fieldcat-tabname = 'i_itab1'.
    w_fieldcat-outputlen = '20'.
    append w_fieldcat to t_fieldcat.
    w_fieldcat-col_pos = 2.
    w_fieldcat-seltext_m = 'org. unit'.
    w_fieldcat-tabname = 'i_itab1'.
    w_fieldcat-fieldname = 'orgeh'.
    w_fieldcat-outputlen = '20'.
    append w_fieldcat to t_fieldcat.
    w_fieldcat-col_pos = 3.
    w_fieldcat-seltext_m = 'payroll area'.
    w_fieldcat-tabname = 'i_itab1'.
    w_fieldcat-fieldname = 'abkrs'.
    w_fieldcat-outputlen = '20'.
    append w_fieldcat to t_fieldcat.
    *g_cprog = SY-CPROG.
    CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
    EXPORTING
               I_INTERFACE_CHECK                 = ' '
               I_BYPASSING_BUFFER                =
               I_BUFFER_ACTIVE                   = ' '
                 I_CALLBACK_PROGRAM                = SY-CPROG
               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                         =
                 IT_FIELDCAT                       = T_FIELDCAT
               IT_EXCLUDING                      =
               IT_SPECIAL_GROUPS                 =
               IT_SORT                           =
               IT_FILTER                         =
               IS_SEL_HIDE                       =
               I_DEFAULT                         = 'X'
               I_SAVE                            = ' '
               IS_VARIANT                        =
                 IT_EVENTS                         = T_EVENT
               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
               IT_ALV_GRAPHICS                   =
               IT_ADD_FIELDCAT                   =
               IT_HYPERLINK                      =
               I_HTML_HEIGHT_TOP                 =
               I_HTML_HEIGHT_END                 =
               IT_EXCEPT_QINFO                   =
             IMPORTING
               E_EXIT_CAUSED_BY_CALLER           =
               ES_EXIT_CAUSED_BY_USER            =
                 TABLES
                 T_OUTTAB                          = I_ITAB1[]
              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 sub1                                                     *
    FORM sub1.
      CALL FUNCTION 'REUSE_ALV_COMMENTARY_WRITE'
        EXPORTING
          IT_LIST_COMMENTARY       = t_listheader
      I_LOGO                   =
      I_END_OF_LIST_GRID       =
    ENDFORM.                                                    " sub1

    write this way...
        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.

  • ALV Grid Excel in Place using REUSE_ALV_GRID_DISPLAY

    I have a ALV grid displayed in a report and i have a bunch of layouts created by various users and the layouts works fine when selected. But when I use 'Excel'  (excel-in-place) button to export the grid into an excel sheet, the order of the columns are all jumbled up and not in sync with the ALV grid layout on the screen. However, when I use export to local file>excel option, the order of columns are in sync with the layout. Can any one explain why this is happening and how I can fix it ? Is there any OSS note or something that I need to apply ?
    PS : I am using REUSE_ALV_GRID_DISPLAY to display the report and I am building the fieldcatalog manually
    Eg :
    CLEAR r_fieldcatalog.
      MOVE 'TB_OUTPUT'  TO r_fieldcatalog-tabname.
      MOVE 'BUKRS'      TO r_fieldcatalog-fieldname.
      MOVE 'VBAK'       TO r_fieldcatalog-ref_tabname.
      MOVE 'BUKRS_VF'   TO r_fieldcatalog-ref_fieldname.
      MOVE text-f01     TO r_fieldcatalog-seltext_s.
      MOVE text-f01     TO r_fieldcatalog-seltext_m.
      MOVE text-f01     TO r_fieldcatalog-seltext_l.
      add '1' to lv_col_pos .
      move lv_col_pos to r_fieldcatalog-col_pos .
      APPEND r_fieldcatalog TO tc_fieldcatalog.
      CLEAR r_fieldcatalog.
      MOVE 'TB_OUTPUT'  TO r_fieldcatalog-tabname.
      MOVE 'VKORG'      TO r_fieldcatalog-fieldname.
      MOVE 'VBAK'       TO r_fieldcatalog-ref_tabname.
      MOVE 'VKORG'      TO r_fieldcatalog-ref_fieldname.
      MOVE text-f02     TO r_fieldcatalog-seltext_s.
      MOVE text-f02     TO r_fieldcatalog-seltext_m.
      MOVE text-f02     TO r_fieldcatalog-seltext_l.
      add '1' to lv_col_pos .
      move lv_col_pos to r_fieldcatalog-col_pos .
      APPEND r_fieldcatalog     TO tc_fieldcatalog.
    Thanks in advance,
    Shareen

      CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
        EXPORTING
          i_callback_pf_status_set = 'ALV_PF_STATUS'
          i_callback_program       = sy-repid
          is_layout                = gs_layout
          it_fieldcat              = gt_fieldcat[]
          i_default                = ' '
          i_save                   = g_save
        TABLES
          t_outtab                 = it_tab
        EXCEPTIONS
          program_error            = 1
          OTHERS                   = 2.
    and beneath this just put a form.as its shown.
    FORM alv_pf_status USING l_alv_excl TYPE STANDARD TABLE.
      SET PF-STATUS 'STANDARD_FULLSCREEN' "excluding lt_extab
                    OF PROGRAM 'SAPLSETB'.
    ENDFORM.                    "alv_pf_status

  • Reg :  Z report for Stock on given date

    Dear ABAP Guru's,
                                   Iam in need of urgent report inorder to find Stock on given(particular) single date but not SAP standard report.That Stock Value should match the MC.9 value.Pls help me

    Hi,
    This code may help you.
    *& Report  ZDH_ITC_STOREP
    REPORT  ZDH_ITC_STOREP.
    TABLES: T001L.
    type-pools slis.
    DATA: GT_FIELDCAT TYPE SLIS_T_FIELDCAT_ALV.
    DATA: GT_HEADER TYPE SLIS_T_LISTHEADER.
    DATA: GS_LAYOUT TYPE SLIS_LAYOUT_ALV.
    DATA: GT_EVENTS TYPE SLIS_T_EVENT.
    TYPES: BEGIN OF TY_FINAL,
           MATNR TYPE MCHB-MATNR,
           MATDES TYPE MAKT-MAKTX,
           BATNO TYPE MCHB-CHARG,
           UMIL TYPE MCHB-CLABS,
           UCFC TYPE MCHB-CLABS,
           BMIL TYPE MCHB-CSPEM,
           BCFC TYPE MCHB-CLABS,
           TMIL TYPE MCHB-CLABS,
           TCFC TYPE MCHB-CLABS,
           END OF TY_FINAL.
    TYPES: BEGIN OF TY_MCHB,
          MATNR TYPE MCHB-MATNR,      " Material Number
          CHARG TYPE MCHB-CHARG,      " Batch Number
          CLABS TYPE MCHB-CLABS,      " Valuated Unrestricted-Use Stock
          CSPEM TYPE MCHB-CSPEM,      " Blocked Stock
          UCFC TYPE MCHB-CLABS,
          bcfc TYPE MCHB-CLABS,
          END OF TY_MCHB.
    *TYPES: BEGIN OF TY_MARA,
    *     MATNR TYPE MARA-MATNR,
    *     END OF TY_MARA.
    TYPES: BEGIN OF TY_MAKT,
         MATNR TYPE MAKT-MATNR,       " Material Number
         MAKTX TYPE MAKT-MAKTX,       " MATERIAL DESCRIPTION
         END OF TY_MAKT.
    TYPES:BEGIN OF TY_MARM,
         MATNR TYPE MARM-MATNR,       "MATERIAL NUMBER
         UMREN TYPE MARM-UMREN,       "Denominator for conversion to base units of measure
         UMREZ TYPE MARM-UMREZ,       "Numerator for Conversion to Base Units of Measure
       END OF TY_MARM.
    DATA: IT_FINAL TYPE STANDARD TABLE OF TY_FINAL,
          WA_FINAL TYPE TY_FINAL.
    DATA: IT_MCHB TYPE STANDARD TABLE OF TY_MCHB,
          WA_MCHB TYPE TY_MCHB.
    *DATA: IT_MARA TYPE STANDARD TABLE OF TY_MARA,
    *      WA_MARA TYPE TY_MARA.
    DATA: IT_MAKT TYPE STANDARD TABLE OF TY_MAKT,
          WA_MAKT TYPE TY_MAKT.
    DATA: IT_MARM TYPE STANDARD TABLE OF TY_MARM,
          WA_MARM TYPE TY_MARM.
    data: atot, btot type MCHB-CLABS.
    PARAMETERS: PA_FACT TYPE T001W-WERKS OBLIGATORY,                  "FACTORY
                PA_DATE TYPE SY-DATUM OBLIGATORY.                     "DATE
    SELECT-OPTIONS: SO_STLO FOR T001L-LGORT OBLIGATORY.               " STORAGE LOCATION
    * GETTING THE MATERIALS
    SELECT MATNR CHARG CLABS CSPEM
      FROM MCHB
      INTO TABLE IT_MCHB
      WHERE WERKS = PA_FACT
      AND LGORT IN SO_STLO.
    * GETTING THE BRAND DESCRIPTION FROM THE ABOVE SELECTED MATERIAL
    SELECT MATNR MAKTX
      FROM MAKT
      INTO TABLE IT_MAKT
      FOR ALL ENTRIES IN IT_MCHB
      WHERE MATNR = IT_MCHB-MATNR
      AND SPRAS = 'EN'.
    * GETTING THE BATCH CODE FOR THE ABOVE MATERIAL AND BRAND
    SELECT MATNR UMREN UMREZ
      FROM MARM
      INTO TABLE IT_MARM
      FOR ALL ENTRIES IN IT_MCHB
      WHERE MATNR = IT_MCHB-MATNR.
    * CALCULATING THE TOTALS OF BLOCKED AND UNRESTRICTED QTY
    LOOP AT IT_MCHB INTO WA_MCHB.
      READ TABLE IT_MARM INTO WA_MARM WITH KEY MATNR = WA_MCHB-MATNR.
      WA_MCHB-ucfc  = ( ( WA_MARM-UMREN / WA_MARM-umrez ) * wa_mchb-clabs ).
        WA_MCHB-bcfc = ( ( wa_marm-umren / wa_marm-umrez ) * wa_mchb-cspem ).
    *  WA_MCHB-ucfc = atot.
    *  WA_MCHB-bcfc = btot.
      modify IT_MCHB from WA_MCHB TRANSPORTING ucfc bcfc WHERE MATNR = WA_MCHB-MATNR.
      READ TABLE it_makt into wa_makt with key MATNR = WA_MCHB-matnr.
      WA_FINAL-matnr = WA_MCHB-MATNR.
      WA_FINAL-MATDES = wa_makt-maktx.
      WA_FINAL-BATNO = wa_mchb-CHARG.
      WA_FINAL-UMIL = wa_MCHB-CLABS.
      wa_final-UCFC = WA_MCHB-ucfc.
      wa_final-bcfc = WA_MCHB-bcfc.
      wa_final-bmil = WA_MCHB-CSPEM.
      WA_FINAL-tmil = WA_MCHB-clabs + WA_MCHB-CSPEM.
      WA_FINAL-tcfc = WA_MCHB-ucfc + WA_MCHB-bcfc.
    append wa_final to IT_FINAL.
    ENDLOOP.
    perform buildheader USING GT_HEADER[].
    PERFORM FIELDCATINIT USING GT_FIELDCAT[].
    perform alvdisplay.
    PERFORM build_layout USING GS_LAYOUT.
    *&      Form  buildheader
    *       text
    *  -->  p1        text
    *  <--  p2        text
    FORM buildheader USING RT_HEADER TYPE SLIS_T_LISTHEADER..
    DATA: TP TYPE SLIS_LISTHEADER.
      DATA: TEXT(20) TYPE C,
            DT TYPE SY-DATUM.
      TP-TYP = 'H'.
      TP-INFO = 'STOCK REPORT '.
      APPEND TP TO RT_HEADER.
      CLEAR TP.
      WRITE SY-DATUM TO DT DD/MM/YYYY.
      CONCATENATE 'DATE :' DT INTO TEXT.
      TP-TYP = 'S'.
      TP-INFO = TEXT.
      APPEND TP TO RT_HEADER.
      CLEAR TP.
    ENDFORM.                    " buildheader
    *&      Form  alvdisplay
    *       text
    *  -->  p1        text
    *  <--  p2        text
    FORM alvdisplay .
    CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
    EXPORTING
    *   I_INTERFACE_CHECK                 = ' '
    *   I_BYPASSING_BUFFER                = ' '
    *   I_BUFFER_ACTIVE                   = ' '
       I_CALLBACK_PROGRAM                 = 'ZDH_ITC_STOREP'
    *   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                          = GS_LAYOUT
       IT_FIELDCAT                        = GT_FIELDCAT[]
    *   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_FINAL
    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.                    " alvdisplay
    *&      Form  FIELDCATINIT
    *       text
    *  -->  p1        text
    *  <--  p2        text
    FORM FIELDCATINIT USING FINIT TYPE SLIS_T_FIELDCAT_ALV.
      DATA: LS_FIELDCAT TYPE SLIS_FIELDCAT_ALV.
      LS_FIELDCAT-FIELDNAME       =  'MATNR'.
      LS_FIELDCAT-SELTEXT_L       =  'MATERIAL NO'.
      LS_FIELDCAT-KEY        =  'X'.
      LS_FIELDCAT-JUST = 'L'.
      APPEND LS_FIELDCAT TO FINIT.
      CLEAR LS_FIELDCAT.
      LS_FIELDCAT-FIELDNAME       =  'MATDES'.
      LS_FIELDCAT-SELTEXT_L       =  'BRAND'.
      LS_FIELDCAT-KEY        =  'X'.
      LS_FIELDCAT-JUST = 'L'.
      APPEND LS_FIELDCAT TO FINIT.
      CLEAR LS_FIELDCAT.
      LS_FIELDCAT-FIELDNAME       =  'BATNO'.
      LS_FIELDCAT-SELTEXT_L       =  'BATCH NO'.
      APPEND LS_FIELDCAT TO FINIT.
      CLEAR LS_FIELDCAT.
      LS_FIELDCAT-FIELDNAME       =  'UMIL'.
      LS_FIELDCAT-SELTEXT_L       =  'RESTRICTED'.
      APPEND LS_FIELDCAT TO FINIT.
      CLEAR LS_FIELDCAT.
      LS_FIELDCAT-FIELDNAME       =  'UCFC'.
      LS_FIELDCAT-SELTEXT_L       =  'UCFC'.
      APPEND LS_FIELDCAT TO FINIT.
      CLEAR LS_FIELDCAT.
      LS_FIELDCAT-FIELDNAME       =  'BMIL'.
      LS_FIELDCAT-SELTEXT_L       =  'BLOCKED'.
      APPEND LS_FIELDCAT TO FINIT.
      CLEAR LS_FIELDCAT.
      LS_FIELDCAT-FIELDNAME       =  'BCFC'.
      LS_FIELDCAT-SELTEXT_L       =  'BCFC'.
      APPEND LS_FIELDCAT TO FINIT.
      CLEAR LS_FIELDCAT.
      LS_FIELDCAT-FIELDNAME       =  'TMIL'.
      LS_FIELDCAT-SELTEXT_L       =  'TOTAL MIL'.
      APPEND LS_FIELDCAT TO FINIT.
      CLEAR LS_FIELDCAT.
      LS_FIELDCAT-FIELDNAME       =  'TCFC'.
      LS_FIELDCAT-SELTEXT_L       =  'TCFC'.
      APPEND LS_FIELDCAT TO FINIT.
      CLEAR LS_FIELDCAT.
    ENDFORM.                    " FIELDCATINIT
    *&      Form  BUILDLAYOUT
    *       text
    *      -->P_GS_LAYOUT[]  text
    FORM BUILD_LAYOUT USING RS_LAYOUT TYPE SLIS_LAYOUT_ALV.
      RS_LAYOUT-NO_INPUT = 'X'.
      RS_LAYOUT-ZEBRA = 'X'.
      RS_LAYOUT-COLWIDTH_OPTIMIZE = ' '.
      RS_LAYOUT-NO_COLHEAD = ' '.
      RS_LAYOUT-NO_VLINE = ' '.
      RS_LAYOUT-INFO_FIELDNAME = 'WS_COLOR'.
    ENDFORM.
                        " BUILDLAYOUT
    HTH
    Regards,
    Dhruv Shah

  • Reg: Message and BPM

    Hi
    I'm having a scenario where i use a JDBC adapter to extract data from a DB. As a result of the query say, 10 rows are returned as message to XI server. I have a transformation (BPM) set and the receiver(target system) is a file. When i open the file to see its contents i can see only the first record been transfered. The mapping part used for the transformation node is having IF condition. But all the fetched records satisfies the conditions in the mapping.
    Pls let me know the corrective step.
    reg: Prabhu

    Hi,
    1)Check the input XML i.e all 10 records are coming into XI . This you can check in SXMB_MONI
    2) Then you can test the mapping in the integration Reposiotry .. So now you can get if any mapping problem. For this , check is the occurence of target strcuture is 1..n or 0.n
    /people/michal.krawczyk2/blog/2005/09/16/xi-how-to-test-your-mapping-in-real-life-scenarios
    3) If mapping is correct , then check the RWB->Message Monitoring->Message Display Tool and check the payload.
    4) If this is correct, then check the File COntent Conversion of the Receiver File Adapter.
    Hope this helps,
    Regards,
    Moorthy

  • Total in REUSE_ALV_GRID_DISPLAY

    Hi,
    If we CHECK total option in REUSE_ALV_GRID_DISPLAY we get a total of numeric value with yellow color at the bottom.
    Requirement:
    Let say I have 3 line item records in the display, with 20 fields and one amount field. So I get the total of the amount field. Apart from that I want the Total number of LINE ITEMS to get displayed on that line. Is that possible . How?
    Thanks in Advance.

    Just call Reuse_alv_list_display instead of gris. Rest of functionality is same.
    *& Report  ZDEMO_ALVGRID                                               *
    *& Example of a simple ALV Grid Report                                 *
    *& The basic requirement for this demo is to display a number of       *
    *& fields from the EKKO table.                                         *
    REPORT  zdemo_alvgrid                 .
    TABLES:     ekko.
    type-pools: slis.                                 "ALV Declarations
    *Data Declaration
    TYPES: BEGIN OF t_ekko,
      ebeln TYPE ekpo-ebeln,
      ebelp TYPE ekpo-ebelp,
      statu TYPE ekpo-statu,
      aedat TYPE ekpo-aedat,
      matnr TYPE ekpo-matnr,
      menge TYPE ekpo-menge,
      meins TYPE ekpo-meins,
      netpr TYPE ekpo-netpr,
      peinh TYPE ekpo-peinh,
    END OF t_ekko.
    DATA: it_ekko TYPE STANDARD TABLE OF t_ekko INITIAL SIZE 0,
          wa_ekko TYPE t_ekko.
    *ALV data declarations
    data: fieldcatalog type slis_t_fieldcat_alv with header line,
          gd_tab_group type slis_t_sp_group_alv,
          gd_layout    type slis_layout_alv,
          gd_repid     like sy-repid.
    *Start-of-selection.
    START-OF-SELECTION.
    perform data_retrieval.
    perform build_fieldcatalog.
    perform build_layout.
    perform display_alv_report.
    *&      Form  BUILD_FIELDCATALOG
    *       Build Fieldcatalog for ALV Report
    form build_fieldcatalog.
    * There are a number of ways to create a fieldcat.
    * For the purpose of this example i will build the fieldcatalog manualy
    * by populating the internal table fields individually and then
    * appending the rows. This method can be the most time consuming but can
    * also allow you  more control of the final product.
    * Beware though, you need to ensure that all fields required are
    * populated. When using some of functionality available via ALV, such as
    * total. You may need to provide more information than if you were
    * simply displaying the result
    *               I.e. Field type may be required in-order for
    *                    the 'TOTAL' function to work.
      fieldcatalog-fieldname   = 'EBELN'.
      fieldcatalog-seltext_m   = 'Purchase Order'.
      fieldcatalog-col_pos     = 0.
      fieldcatalog-outputlen   = 10.
      fieldcatalog-emphasize   = 'X'.
      fieldcatalog-key         = 'X'.
    *  fieldcatalog-do_sum      = 'X'.
    *  fieldcatalog-no_zero     = 'X'.
      append fieldcatalog to fieldcatalog.
      clear  fieldcatalog.
      fieldcatalog-fieldname   = 'EBELP'.
      fieldcatalog-seltext_m   = 'PO Item'.
      fieldcatalog-col_pos     = 1.
      append fieldcatalog to fieldcatalog.
      clear  fieldcatalog.
      fieldcatalog-fieldname   = 'STATU'.
      fieldcatalog-seltext_m   = 'Status'.
      fieldcatalog-col_pos     = 2.
      append fieldcatalog to fieldcatalog.
      clear  fieldcatalog.
      fieldcatalog-fieldname   = 'AEDAT'.
      fieldcatalog-seltext_m   = 'Item change date'.
      fieldcatalog-col_pos     = 3.
      append fieldcatalog to fieldcatalog.
      clear  fieldcatalog.
      fieldcatalog-fieldname   = 'MATNR'.
      fieldcatalog-seltext_m   = 'Material Number'.
      fieldcatalog-col_pos     = 4.
      append fieldcatalog to fieldcatalog.
      clear  fieldcatalog.
      fieldcatalog-fieldname   = 'MENGE'.
      fieldcatalog-seltext_m   = 'PO quantity'.
      fieldcatalog-col_pos     = 5.
      append fieldcatalog to fieldcatalog.
      clear  fieldcatalog.
      fieldcatalog-fieldname   = 'MEINS'.
      fieldcatalog-seltext_m   = 'Order Unit'.
      fieldcatalog-col_pos     = 6.
      append fieldcatalog to fieldcatalog.
      clear  fieldcatalog.
      fieldcatalog-fieldname   = 'NETPR'.
      fieldcatalog-seltext_m   = 'Net Price'.
      fieldcatalog-col_pos     = 7.
      fieldcatalog-outputlen   = 15. 
      fieldcatalog-do_sum      = 'X'        "Display column total
      fieldcatalog-datatype     = 'CURR'.
      append fieldcatalog to fieldcatalog.
      clear  fieldcatalog.
      fieldcatalog-fieldname   = 'PEINH'.
      fieldcatalog-seltext_m   = 'Price Unit'.
      fieldcatalog-col_pos     = 8.
      append fieldcatalog to fieldcatalog.
      clear  fieldcatalog.
    endform.                    " BUILD_FIELDCATALOG
    *&      Form  BUILD_LAYOUT
    *       Build layout for ALV grid report
    form build_layout.
      gd_layout-no_input          = 'X'.
      gd_layout-colwidth_optimize = 'X'.
      gd_layout-totals_text       = 'Totals'(201).
    *  gd_layout-totals_only        = 'X'.
    *  gd_layout-f2code            = 'DISP'.  "Sets fcode for when double
    *                                         "click(press f2)
    *  gd_layout-zebra             = 'X'.
    *  gd_layout-group_change_edit = 'X'.
    *  gd_layout-header_text       = 'helllllo'.
    endform.                    " BUILD_LAYOUT
    *&      Form  DISPLAY_ALV_REPORT
    *       Display report using ALV grid
    form display_alv_report.
      gd_repid = sy-repid.
      call function 'REUSE_ALV_GRID_DISPLAY'
           exporting
                i_callback_program      = gd_repid
    *            i_callback_top_of_page   = 'TOP-OF-PAGE'  "see FORM
    *            i_callback_user_command = 'USER_COMMAND'
    *            i_grid_title           = outtext
                is_layout               = gd_layout
                it_fieldcat             = fieldcatalog[]
    *            it_special_groups       = gd_tabgroup
    *            IT_EVENTS                = GT_XEVENTS
                i_save                  = 'X'
    *            is_variant              = z_template
           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  DATA_RETRIEVAL
    *       Retrieve data form EKPO table and populate itab it_ekko
    form data_retrieval.
    select ebeln ebelp statu aedat matnr menge meins netpr peinh
    up to 10 rows
      from ekpo
      into table it_ekko.
    endform.                    " DATA_RETRIEVAL

  • Reg : F4 help for custom fields in ALV report

    hi friends..
    in my internal table i have fields including 1 custom field..
    DATA : BEGIN OF i_final OCCURS 0,
      pernr LIKE p0000-pernr,
      begda LIKE p0000-begda,
      plans LIKE ZPOSITION-plans,  (custom)
      werks LIKE pspar-werks,
      end of i_final.
    i want to display this i_final table in alv. for that i genetrate one fieldcatalog
    PERFORM fcat USING:
                      'I_FINAL' 'PERNR' 'P0000' 'PERNR' '15' 'X' '',
                      'I_FINAL' 'BEGDA' 'P0000' 'BEGDA' '10' 'X' '',
                      'I_FINAL' 'PLANS' 'ZPOSITION' 'PLANS' '8' 'X' '',
                      'I_FINAL' 'WERKS' 'PSPAR' 'WERKS' '14' 'X' ''.
    in custom table zposition, i maintain serch help for custom field "PLANS".
    then i used reuse_alv_grid_display.. for all the std fields along wit custom fields
    i got f4 all std fields but for my custom i am not getting the f4 help
    how can i get the F$ help for this custom fields Zposition-plans..
    plz give some idea

    Hi
    In that Ztable against the field
    PLANS give the check table name as  <b>T528B</b>
    then it will automatically give the search help
    or you can create your own search help(elementary) and add to that field
    Reward if useful
    regards
    Anji

  • Checkbox field in ALV for REUSE_ALV_GRID_DISPLAY

    how to handle Checkbox field in ALV for REUSE_ALV_GRID_DISPLAY????
    For example Alv has displayed 400 entries if user checks 4 entries and wants to donwload only those 4 entries from ALV using Copy to local file option then how should it be done. please provide some help...

    REPORT  YHRMR_LTC_TAXABLE NO STANDARD PAGE HEADING LINE-SIZE 120.
    TYPE-POOLS: SLIS.
    Start of Data Declaration                                            *
    DATA: G_PLVAR               TYPE PLVAR.
    DATA: P_MONTH               TYPE TFMATAGE.
    DATA: TOTAL_NO              TYPE I.
    DATA: TOTAL_NO_SUM          TYPE I.
    DATA: COUNT_15              TYPE I.
    DATA: COUNT_15_SUM          TYPE I.
    DATA: COUNT_LTC             TYPE I.
    DATA: COUNT_LTC_SUM         TYPE I.
    DATA: COUNT_ERROR_IT15      TYPE I.
    DATA: COUNT_ERROR_IT15_SUM  TYPE I.
    DATA: COUNT_ERROR_LTC       TYPE I.
    DATA: COUNT_ERROR_LTC_SUM   TYPE I.
    DATA: COUNT_ENTRY_IT15      TYPE I.
    DATA: COUNT_ENTRY_IT15_SUM  TYPE I.
    --LOCAL TABLE TYPE--
    DATA: T_DATA_LTC     LIKE YHRMT_LTC OCCURS 0 WITH HEADER LINE.
    DATA: T_DATA_LTC_NEW LIKE YHRMT_LTC OCCURS 0 WITH HEADER LINE.
    DATA: T_PA0015 LIKE PA0015 OCCURS 0 WITH HEADER LINE.
    DATA: T_P0015 LIKE PA0015 OCCURS 0 WITH HEADER LINE.
    DATA: BEGIN OF T_FINAL OCCURS 0,
          CHECK_BOX(1),
          MANDT        TYPE MANDT,
          PERNR        TYPE PERSNO,
          ABKRS        TYPE ABKRS,
          PERSK        TYPE PERSK,
          WAGETYPE     TYPE LGART,
          LTCSTART     TYPE YAJAHR,
          LTCEND       TYPE YYAJAHR,
          FLAG         TYPE YCHAR1,
          SEQNR        TYPE SEQNR,
          LEVSTART     TYPE URBEG,
          LEVEND       TYPE BDATU_052R,
          PAYDATE      TYPE YBEGDA,
          AMOUNTPAY    TYPE AMUNT,
          TAXYR        TYPE PHK_TAXYR,
          DOCUNO       TYPE YCHAR20,
          DOCUDATE     TYPE YENDDA,
          VOUCHNO      TYPE YCHAR20,
          APDATE       TYPE BPS_APPDA,
          CANCEL_MOD   TYPE YCANCELMOD,
          LTC_IND      TYPE ATZH1,
          APPL_TAG     TYPE YAPPTAG,
          CANCEL_DATE  TYPE AEDTM,
          CANCEL_USER  TYPE AENAM,
          LASTCHANGE   TYPE AEDTM,
          USERNAME     TYPE AENAM,
          END OF T_FINAL.
    DATA: BEGIN OF T_PA0001 OCCURS 0,
          PERNR LIKE PA0001-PERNR,
          ABKRS LIKE PA0001-ABKRS,
          END OF T_PA0001.
    --Message Part Declaration--
    DATA: BEGIN OF T_SUCCESS OCCURS 0,
          PERNR       TYPE PERSNO,
          MESSAGE(50) TYPE C,
          END OF T_SUCCESS.
    DATA: BEGIN OF T_ERROR OCCURS 0,
          PERNR       TYPE PERSNO,
          MESSAGE(50)  TYPE C,
          END OF T_ERROR.
    --TABLE TYPE OF SLIS TYPE-GROUP--
    DATA: G_FLD TYPE SLIS_T_FIELDCAT_ALV,
          G_EV TYPE SLIS_T_EVENT,
          G_SORT TYPE SLIS_T_SORTINFO_ALV,
          G_LST TYPE SLIS_T_LISTHEADER.
    DATA: FIELDCATALOG TYPE SLIS_T_FIELDCAT_ALV WITH HEADER LINE,
          GD_TAB_GROUP TYPE SLIS_T_SP_GROUP_ALV,
          GD_LAYOUT    TYPE SLIS_LAYOUT_ALV,
          I_EVENTS TYPE SLIS_T_EVENT,
          GD_REPID     LIKE SY-REPID.
    --STRUCTURE TYPE OF SLIS TYPE-GROUP--
    DATA: L_EV TYPE SLIS_ALV_EVENT.
    CONSTANTS : C_PF TYPE SLIS_FORMNAME VALUE 'PF_STATUS_SET',
                C_UCOM TYPE SLIS_FORMNAME VALUE 'USER_COMMAND'.
    *---- Start Change by Bibek/Shankar Dated : 12-03-2008 via cmr no : J/08/03/062/1.
    DATA: L_ENDDATE   LIKE SY-DATUM.
    *---- End   Change by Bibek/Shankar Dated : 12-03-2008 via cmr no : J/08/03/062/1.
    End of Data Declaration                                              *
    Start of Selection screen Parameters                                 *
    SELECTION-SCREEN BEGIN OF BLOCK A WITH FRAME TITLE TEXT-002.
    *START CHANGE BY SHAYARI ON 18.02.2008, CMR No.:- J/08/02/323
    PARAMETERS:P_ABKRS LIKE PA0001-ABKRS OBLIGATORY.
    *END CHANGE BY SHAYARI ON 18.02.2008,  CMR No.:- J/08/02/323
    *START CHANGE BY BIBEk Dt : 06.03.2008, CMR No.:- J/08/03/062/1
    SELECTION-SCREEN BEGIN OF LINE.
    SELECTION-SCREEN POSITION 1.
    SELECTION-SCREEN COMMENT 1(78) TEXT-006 FOR FIELD P_LES.
    PARAMETER P_LES RADIOBUTTON GROUP RB1.
    SELECTION-SCREEN END OF LINE.
    *END CHANGE BY BIBEk Dt : 06.03.2008, CMR No.:- J/08/03/062/1
    SELECTION-SCREEN BEGIN OF LINE.
    SELECTION-SCREEN POSITION 1.
    SELECTION-SCREEN COMMENT 1(78) TEXT-003 FOR FIELD P_ONE.
    PARAMETER P_ONE RADIOBUTTON GROUP RB1.
    SELECTION-SCREEN END OF LINE.
    SELECTION-SCREEN BEGIN OF LINE.
    SELECTION-SCREEN POSITION 1.
    SELECTION-SCREEN COMMENT 1(78) TEXT-004 FOR FIELD P_TWO.
    PARAMETER P_TWO  RADIOBUTTON GROUP RB1.
    SELECTION-SCREEN END OF LINE.
    SELECTION-SCREEN BEGIN OF LINE.
    SELECTION-SCREEN POSITION 1.
    SELECTION-SCREEN COMMENT 1(78) TEXT-005 FOR FIELD P_MORE.
    PARAMETER P_MORE RADIOBUTTON GROUP RB1.
    SELECTION-SCREEN END OF LINE.
    SELECTION-SCREEN END OF BLOCK A.
    End of Selection screen Parameters                                   *
    *Get Plan Version
    CALL FUNCTION 'RH_GET_PLVAR'
      IMPORTING
        PLVAR = G_PLVAR.
    PERFORM CLEAR.
    CALL FUNCTION 'HR_JP_MONTH_BEGIN_END_DATE'
      EXPORTING
        IV_DATE                   = SY-DATUM
    IMPORTING
      EV_MONTH_BEGIN_DATE       =
        EV_MONTH_END_DATE         = L_ENDDATE.
    SELECT *
      FROM YHRMT_LTC
      INTO TABLE T_DATA_LTC
    WHERE FLAG   = '1'
       AND WAGETYPE = '1640'
       AND LEVEND LE L_ENDDATE
       AND PAYDATE GE '20080101'.
    If SY-SUBRC <> 0.
    MESSAGE I398(00) with 'No Records to display '.
    ENDIF.
    DELETE T_DATA_LTC WHERE LEVEND = '00000000'.
    *START CHANGE BY BIBEk Dt : 06.03.2008, CMR No.:- J/08/03/062/1
    *For Less Than One Month from Leave End Date
    IF P_LES = 'X'.
      LOOP AT T_DATA_LTC.
        CLEAR P_MONTH.
        CALL FUNCTION 'HR_AUPBS_MONTH_DAY'
          EXPORTING
            BEG_DA   = T_DATA_LTC-LEVEND
            END_DA   = SY-DATUM
          IMPORTING
            NO_MONTH = P_MONTH.
        IF P_MONTH LT '1'.
          T_FINAL-MANDT       =  T_DATA_LTC-MANDT.
          T_FINAL-PERNR       =  T_DATA_LTC-PERSONNELNO.
          T_FINAL-PERSK       =  T_DATA_LTC-PERSK.
          T_FINAL-WAGETYPE    =  T_DATA_LTC-WAGETYPE.
          T_FINAL-LTCSTART    =  T_DATA_LTC-LTCSTART.
          T_FINAL-LTCEND      =  T_DATA_LTC-LTCEND.
          T_FINAL-FLAG        =  T_DATA_LTC-FLAG.
          T_FINAL-SEQNR       =  T_DATA_LTC-SEQNR.
          T_FINAL-LEVSTART    =  T_DATA_LTC-LEVSTART.
          T_FINAL-LEVEND      =  T_DATA_LTC-LEVEND.
          T_FINAL-PAYDATE     =  T_DATA_LTC-PAYDATE.
          T_FINAL-AMOUNTPAY   =  T_DATA_LTC-AMOUNTPAY.
          T_FINAL-TAXYR       =  T_DATA_LTC-TAXYR.
          T_FINAL-DOCUNO      =  T_DATA_LTC-DOCUNO.
          T_FINAL-DOCUDATE    =  T_DATA_LTC-DOCUDATE.
          T_FINAL-VOUCHNO     =  T_DATA_LTC-VOUCHNO.
          T_FINAL-APDATE      =  T_DATA_LTC-APDATE.
          T_FINAL-CANCEL_MOD  =  T_DATA_LTC-CANCEL_MOD.
          T_FINAL-LTC_IND     =  T_DATA_LTC-LTC_IND.
          T_FINAL-APPL_TAG    =  T_DATA_LTC-APPL_TAG.
          T_FINAL-CANCEL_DATE =  T_DATA_LTC-CANCEL_DATE.
          T_FINAL-CANCEL_USER =  T_DATA_LTC-CANCEL_USER.
          T_FINAL-LASTCHANGE  =  T_DATA_LTC-LASTCHANGE.
          T_FINAL-USERNAME    =  T_DATA_LTC-USERNAME.
          APPEND T_FINAL.
          CLEAR  T_FINAL.
        ENDIF.
      ENDLOOP.
    *For One Month from Leave End Date
    ELSEIF P_ONE = 'X'.
      LOOP AT T_DATA_LTC.
        CLEAR P_MONTH.
        CALL FUNCTION 'HR_AUPBS_MONTH_DAY'
          EXPORTING
            BEG_DA   = T_DATA_LTC-LEVEND
            END_DA   = SY-DATUM
          IMPORTING
            NO_MONTH = P_MONTH.
        IF P_MONTH EQ '1' AND P_MONTH LT '2'.
          T_FINAL-MANDT       =  T_DATA_LTC-MANDT.
          T_FINAL-PERNR       =  T_DATA_LTC-PERSONNELNO.
          T_FINAL-PERSK       =  T_DATA_LTC-PERSK.
          T_FINAL-WAGETYPE    =  T_DATA_LTC-WAGETYPE.
          T_FINAL-LTCSTART    =  T_DATA_LTC-LTCSTART.
          T_FINAL-LTCEND      =  T_DATA_LTC-LTCEND.
          T_FINAL-FLAG        =  T_DATA_LTC-FLAG.
          T_FINAL-SEQNR       =  T_DATA_LTC-SEQNR.
          T_FINAL-LEVSTART    =  T_DATA_LTC-LEVSTART.
          T_FINAL-LEVEND      =  T_DATA_LTC-LEVEND.
          T_FINAL-PAYDATE     =  T_DATA_LTC-PAYDATE.
          T_FINAL-AMOUNTPAY   =  T_DATA_LTC-AMOUNTPAY.
          T_FINAL-TAXYR       =  T_DATA_LTC-TAXYR.
          T_FINAL-DOCUNO      =  T_DATA_LTC-DOCUNO.
          T_FINAL-DOCUDATE    =  T_DATA_LTC-DOCUDATE.
          T_FINAL-VOUCHNO     =  T_DATA_LTC-VOUCHNO.
          T_FINAL-APDATE      =  T_DATA_LTC-APDATE.
          T_FINAL-CANCEL_MOD  =  T_DATA_LTC-CANCEL_MOD.
          T_FINAL-LTC_IND     =  T_DATA_LTC-LTC_IND.
          T_FINAL-APPL_TAG    =  T_DATA_LTC-APPL_TAG.
          T_FINAL-CANCEL_DATE =  T_DATA_LTC-CANCEL_DATE.
          T_FINAL-CANCEL_USER =  T_DATA_LTC-CANCEL_USER.
          T_FINAL-LASTCHANGE  =  T_DATA_LTC-LASTCHANGE.
          T_FINAL-USERNAME    =  T_DATA_LTC-USERNAME.
          APPEND T_FINAL.
          CLEAR  T_FINAL.
        ENDIF.
      ENDLOOP.
    *For Two Month from Leave End Date
    ELSEIF P_TWO = 'X'.
      LOOP AT T_DATA_LTC.
        CLEAR P_MONTH.
        CALL FUNCTION 'HR_AUPBS_MONTH_DAY'
          EXPORTING
            BEG_DA   = T_DATA_LTC-LEVEND
            END_DA   = SY-DATUM
          IMPORTING
            NO_MONTH = P_MONTH.
        IF P_MONTH EQ '2' AND P_MONTH LT '3'.
          T_FINAL-MANDT       =  T_DATA_LTC-MANDT.
          T_FINAL-PERNR       =  T_DATA_LTC-PERSONNELNO.
          T_FINAL-PERSK       =  T_DATA_LTC-PERSK.
          T_FINAL-WAGETYPE    =  T_DATA_LTC-WAGETYPE.
          T_FINAL-LTCSTART    =  T_DATA_LTC-LTCSTART.
          T_FINAL-LTCEND      =  T_DATA_LTC-LTCEND.
          T_FINAL-FLAG        =  T_DATA_LTC-FLAG.
          T_FINAL-SEQNR       =  T_DATA_LTC-SEQNR.
          T_FINAL-LEVSTART    =  T_DATA_LTC-LEVSTART.
          T_FINAL-LEVEND      =  T_DATA_LTC-LEVEND.
          T_FINAL-PAYDATE     =  T_DATA_LTC-PAYDATE.
          T_FINAL-AMOUNTPAY   =  T_DATA_LTC-AMOUNTPAY.
          T_FINAL-TAXYR       =  T_DATA_LTC-TAXYR.
          T_FINAL-DOCUNO      =  T_DATA_LTC-DOCUNO.
          T_FINAL-DOCUDATE    =  T_DATA_LTC-DOCUDATE.
          T_FINAL-VOUCHNO     =  T_DATA_LTC-VOUCHNO.
          T_FINAL-APDATE      =  T_DATA_LTC-APDATE.
          T_FINAL-CANCEL_MOD  =  T_DATA_LTC-CANCEL_MOD.
          T_FINAL-LTC_IND     =  T_DATA_LTC-LTC_IND.
          T_FINAL-APPL_TAG    =  T_DATA_LTC-APPL_TAG.
          T_FINAL-CANCEL_DATE =  T_DATA_LTC-CANCEL_DATE.
          T_FINAL-CANCEL_USER =  T_DATA_LTC-CANCEL_USER.
          T_FINAL-LASTCHANGE  =  T_DATA_LTC-LASTCHANGE.
          T_FINAL-USERNAME    =  T_DATA_LTC-USERNAME.
          APPEND T_FINAL.
          CLEAR  T_FINAL.
        ENDIF.
      ENDLOOP.
    *For More than Two Month from Leave End Date
    ELSEIF P_MORE = 'X'.
      LOOP AT T_DATA_LTC.
        CLEAR P_MONTH.
        CALL FUNCTION 'HR_AUPBS_MONTH_DAY'
          EXPORTING
            BEG_DA   = T_DATA_LTC-LEVEND
            END_DA   = SY-DATUM
          IMPORTING
            NO_MONTH = P_MONTH.
        IF P_MONTH GT '2' .
          T_FINAL-MANDT       =  T_DATA_LTC-MANDT.
          T_FINAL-PERNR       =  T_DATA_LTC-PERSONNELNO.
          T_FINAL-PERSK       =  T_DATA_LTC-PERSK.
          T_FINAL-WAGETYPE    =  T_DATA_LTC-WAGETYPE.
          T_FINAL-LTCSTART    =  T_DATA_LTC-LTCSTART.
          T_FINAL-LTCEND      =  T_DATA_LTC-LTCEND.
          T_FINAL-FLAG        =  T_DATA_LTC-FLAG.
          T_FINAL-SEQNR       =  T_DATA_LTC-SEQNR.
          T_FINAL-LEVSTART    =  T_DATA_LTC-LEVSTART.
          T_FINAL-LEVEND      =  T_DATA_LTC-LEVEND.
          T_FINAL-PAYDATE     =  T_DATA_LTC-PAYDATE.
          T_FINAL-AMOUNTPAY   =  T_DATA_LTC-AMOUNTPAY.
          T_FINAL-TAXYR       =  T_DATA_LTC-TAXYR.
          T_FINAL-DOCUNO      =  T_DATA_LTC-DOCUNO.
          T_FINAL-DOCUDATE    =  T_DATA_LTC-DOCUDATE.
          T_FINAL-VOUCHNO     =  T_DATA_LTC-VOUCHNO.
          T_FINAL-APDATE      =  T_DATA_LTC-APDATE.
          T_FINAL-CANCEL_MOD  =  T_DATA_LTC-CANCEL_MOD.
          T_FINAL-LTC_IND     =  T_DATA_LTC-LTC_IND.
          T_FINAL-APPL_TAG    =  T_DATA_LTC-APPL_TAG.
          T_FINAL-CANCEL_DATE =  T_DATA_LTC-CANCEL_DATE.
          T_FINAL-CANCEL_USER =  T_DATA_LTC-CANCEL_USER.
          T_FINAL-LASTCHANGE  =  T_DATA_LTC-LASTCHANGE.
          T_FINAL-USERNAME    =  T_DATA_LTC-USERNAME.
          APPEND T_FINAL.
          CLEAR  T_FINAL.
        ENDIF.
      ENDLOOP.
    ENDIF.
    ****Payroll Area Put
    SELECT PERNR ABKRS FROM PA0001
    INTO CORRESPONDING FIELDS OF TABLE T_PA0001
    FOR ALL ENTRIES IN T_FINAL
    WHERE PERNR = T_FINAL-PERNR
    AND ABKRS = P_ABKRS
    AND BEGDA LE SY-DATUM
    AND ENDDA GE SY-DATUM.
    LOOP AT T_FINAL.
      READ TABLE T_PA0001 WITH KEY PERNR = T_FINAL-PERNR.
      IF SY-SUBRC = 0.
        T_FINAL-ABKRS = T_PA0001-ABKRS.
        MODIFY T_FINAL.
        CLEAR  T_FINAL.
      ENDIF.
    ENDLOOP.
    CLEAR T_FINAL.
    DELETE T_FINAL WHERE ABKRS = ''.
    *Output Form ALV List
    PERFORM ALV.
    *&      Form  ALV
    FORM ALV .
      PERFORM BUILD_FIELDCATALOG.
      PERFORM BUILD_EVENT.
      PERFORM DISPLAY_DATA.
    ENDFORM.                    " ALV
    *&      Form  BUILD_FIELDCATALOG
    FORM BUILD_FIELDCATALOG .
      FIELDCATALOG-TABNAME     = 'T_FINAL'.
      FIELDCATALOG-FIELDNAME   = 'PERNR'.
      FIELDCATALOG-SELTEXT_M   = 'Personnel number'.
      FIELDCATALOG-COL_POS     = 1.
      FIELDCATALOG-OUTPUTLEN   = 17.
      APPEND FIELDCATALOG TO FIELDCATALOG.
      CLEAR  FIELDCATALOG.
      FIELDCATALOG-TABNAME     = 'T_FINAL'.
      FIELDCATALOG-FIELDNAME   = 'ABKRS'.
      FIELDCATALOG-SELTEXT_M   = 'Payroll Area'.
      FIELDCATALOG-COL_POS     = 2.
      FIELDCATALOG-OUTPUTLEN   = 17.
      APPEND FIELDCATALOG TO FIELDCATALOG.
      CLEAR  FIELDCATALOG.
      FIELDCATALOG-TABNAME     = 'T_FINAL'.
      FIELDCATALOG-FIELDNAME   = 'LTCSTART'.
      FIELDCATALOG-SELTEXT_M   = 'LTC Start year'.
      FIELDCATALOG-COL_POS     = 3.
      FIELDCATALOG-OUTPUTLEN   = 15.
      APPEND FIELDCATALOG TO FIELDCATALOG.
      CLEAR  FIELDCATALOG.
      FIELDCATALOG-TABNAME     = 'T_FINAL'.
      FIELDCATALOG-FIELDNAME   = 'LTCEND'.
      FIELDCATALOG-SELTEXT_M   = 'LTC End year'.
      FIELDCATALOG-COL_POS     = 4.
      FIELDCATALOG-OUTPUTLEN   = 15.
      APPEND FIELDCATALOG TO FIELDCATALOG.
      CLEAR  FIELDCATALOG.
      FIELDCATALOG-TABNAME     = 'T_FINAL'.
      FIELDCATALOG-FIELDNAME   = 'LEVSTART'.
      FIELDCATALOG-SELTEXT_M   = 'Start of leave'.
      FIELDCATALOG-COL_POS     = 5.
      FIELDCATALOG-OUTPUTLEN   = 15.
      APPEND FIELDCATALOG TO FIELDCATALOG.
      CLEAR  FIELDCATALOG.
      FIELDCATALOG-TABNAME     = 'T_FINAL'.
      FIELDCATALOG-FIELDNAME   = 'LEVEND'.
      FIELDCATALOG-SELTEXT_M   = 'End of leave'.
      FIELDCATALOG-COL_POS     = 6.
      FIELDCATALOG-OUTPUTLEN   = 15.
      APPEND FIELDCATALOG TO FIELDCATALOG.
      CLEAR  FIELDCATALOG.
      FIELDCATALOG-TABNAME     = 'T_FINAL'.
      FIELDCATALOG-FIELDNAME   = 'AMOUNTPAY'.
      FIELDCATALOG-SELTEXT_M   = 'Amount'.
      FIELDCATALOG-DO_SUM      = 'X'.
      FIELDCATALOG-COL_POS     = 7.
      FIELDCATALOG-OUTPUTLEN   = 13.
      APPEND FIELDCATALOG TO FIELDCATALOG.
      CLEAR  FIELDCATALOG.
      FIELDCATALOG-TABNAME     = 'T_FINAL'.
      FIELDCATALOG-FIELDNAME   = 'PAYDATE'.
      FIELDCATALOG-SELTEXT_M   = 'Payment Date'.
      FIELDCATALOG-COL_POS     = 8.
      FIELDCATALOG-OUTPUTLEN   = 15.
      APPEND FIELDCATALOG TO FIELDCATALOG.
      CLEAR  FIELDCATALOG.
      FIELDCATALOG-TABNAME     = 'T_FINAL'.
      FIELDCATALOG-FIELDNAME   = 'APPL_TAG'.
      FIELDCATALOG-SELTEXT_M   = 'Application Tag '.
      FIELDCATALOG-COL_POS     = 9.
      FIELDCATALOG-OUTPUTLEN   = 15.
      APPEND FIELDCATALOG TO FIELDCATALOG.
      CLEAR  FIELDCATALOG.
    *Check Box Field Add
      CLEAR GD_LAYOUT.
      GD_LAYOUT-BOX_FIELDNAME = 'CHECK_BOX'.
      GD_LAYOUT-BOX_TABNAME = 'T_FINAL'.
    ENDFORM.                    " BUILD_FIELDCATALOG
    *&      Form  BUILD_EVENT
    FORM BUILD_EVENT .
    *Event Handler
      CALL FUNCTION 'REUSE_ALV_EVENTS_GET'
        EXPORTING
          I_LIST_TYPE     = 0
        IMPORTING
          ET_EVENTS       = G_EV
        EXCEPTIONS
          LIST_TYPE_WRONG = 1
          OTHERS          = 2.
      IF SY-SUBRC <> 0.
      ELSE.
        READ TABLE G_EV INTO L_EV WITH KEY NAME = SLIS_EV_PF_STATUS_SET.
        IF SY-SUBRC = 0.
          MOVE C_PF TO L_EV-FORM.
          MODIFY G_EV FROM L_EV INDEX SY-TABIX TRANSPORTING FORM.
        ENDIF.
        READ TABLE G_EV INTO L_EV WITH KEY NAME = SLIS_EV_USER_COMMAND.
        IF SY-SUBRC = 0.
          MOVE C_UCOM TO L_EV-FORM.
          MODIFY G_EV FROM L_EV INDEX SY-TABIX TRANSPORTING FORM.
        ENDIF.
      ENDIF.
    ENDFORM.                    " BUILD_EVENT
    *&      Form  DISPLAY_DATA
    FORM DISPLAY_DATA .
      GD_REPID = SY-REPID.
      CLEAR I_EVENTS. REFRESH I_EVENTS.
      CALL FUNCTION 'REUSE_ALV_LIST_DISPLAY'
        EXPORTING
          I_CALLBACK_PROGRAM       = GD_REPID
          I_CALLBACK_PF_STATUS_SET = C_PF
          I_CALLBACK_USER_COMMAND  = C_UCOM
          IS_LAYOUT                = GD_LAYOUT
          IT_FIELDCAT              = FIELDCATALOG[]
          IT_EVENTS                = G_EV
        TABLES
          T_OUTTAB                 = T_FINAL.
    ENDFORM.                    " DISPLAY_DATA
          FORM PF_STATUS_SET                                            *
    FORM PF_STATUS_SET USING RX_TAB TYPE SLIS_T_EXTAB.
      SET PF-STATUS 'LTC'.
    ENDFORM.                    "PF_STATUS_SET
          FORM USER_COMMAND                                             *
    FORM USER_COMMAND USING R_UCOM LIKE SY-UCOMM
                            RS_SELFIELD TYPE SLIS_SELFIELD.
      CASE R_UCOM.
        WHEN 'POST'.
          PERFORM POST_IT15_LTC_TABLE.
      ENDCASE.
    ENDFORM.                    "USER_COMMAND
    *&      Form  POST_IT15_LTC_TABLE
    FORM POST_IT15_LTC_TABLE .
    ENDFORM.                    " POST_IT15_LTC_TABLE
    *&      Form  clear
    FORM CLEAR .
      CLEAR   T_DATA_LTC.
      REFRESH T_DATA_LTC.
      CLEAR   T_DATA_LTC_NEW.
      REFRESH T_DATA_LTC_NEW.
      CLEAR   T_FINAL.
      REFRESH T_FINAL.
      CLEAR   T_PA0015.
      REFRESH T_PA0015.
      CLEAR   T_SUCCESS.
      REFRESH T_SUCCESS.
      CLEAR   T_ERROR.
      REFRESH T_ERROR.
      CLEAR G_PLVAR.
      CLEAR P_MONTH.
      CLEAR COUNT_15.
      CLEAR COUNT_15_SUM.
      CLEAR COUNT_LTC.
      CLEAR COUNT_LTC_SUM.
      CLEAR TOTAL_NO.
      CLEAR TOTAL_NO_SUM.
      CLEAR COUNT_ERROR_IT15.
      CLEAR COUNT_ERROR_IT15_SUM.
      CLEAR COUNT_ERROR_LTC.
      CLEAR COUNT_ERROR_LTC_SUM.
      CLEAR COUNT_ENTRY_IT15.
      CLEAR COUNT_ENTRY_IT15_SUM.
    ENDFORM.                    " clear

Maybe you are looking for

  • Oracle VM EBS 12.1.3 template, import issues

    Hi guys I have concatenated the .tar files and created the following, as mentioned with the readme.txt file # cat OVM_OL5U6_X86_64_EBIZ12.1.3_APPS_VIS_PVM.tgz.0 \ OVM_OL5U6_X86_64_EBIZ12.1.3_APPS_VIS_PVM.tgz.1 \ OVM_OL5U6_X86_64_EBIZ12.1.3_APPS_VIS_P

  • Maximum number of st unit in single bin

    Hi All,   Can anybody tell me maximum how much storage unit can be present in the Bin. Dev

  • Using long longs in a 32 bit app

    What restrictions do I need to observe if I use long long ints (or off_t or fpos_t) in a 32 bit app? If I return a 64 bit value from a function, will that change the alignment of all function calls in the project? Can I use structs that contain long

  • Reference Object to Refresh Work Order Field Data

    Dear Gurus, In IW21/IW22 the reference object will populate the Responsibilities section of the Notification tab, and fields on the Location Data tab.  When the reference object is changed, those same fields will update or refresh.  The reference obj

  • ALV Export to excel (spreadsheet) without line break

    my ALV report contains 76 columns, if i try to download it in an excel sheel its not getting displayed in correct format. Few columns are automatically displayed in the second row and also all my values are getting collapsed due to this display. In t