Regarding pushbutton operation in alv report

hi,
I have a requiement in which i will get list display which contains certain no of records(let us say 10  records)...now the issue is *if i selet one record and if it is correct record* and if i hit the insert pushbutton it should go and insert into z-table which i hav created.....and if the record which i hav selected is error record.....it should throw an error message saying that it is the error record....as error record stops further process i hav used it as information message and i used 'display like 'E''....so that it wont affect further proceedings.....
and if i select the 2nd record and if i hit the pushbutton it is taking to the sap initial screen which i dont want .....
how to solve this issue?
can anyone plz help me in this issue....

Hi Needy ,
  M giving you a sample code where you can set your pf-status and how to handle the check box etc .
This code shows you hoe to select and deselect the check boxes ..
All that you have to do is apply your logic...
set pf-status 'SELECT' .
at user-command .
  describe table t_lpr lines w_lines .
  case sy-ucomm .
    when 'SELECTALL' .
      set pf-status 'SELECT' excluding 'SELECTALL' immediately.
      do w_lines times .
        read line w_line field value w_check . " INTO W_CHECK .
        if w_check = space .
          w_check = 'X' .
          modify line w_line field value w_check.    "INTO W_CHECK .
          add 1 to w_line .
        endif .                        " IF W_CHECK = ' '
      enddo .                          " DO W_LINES TIMES
      clear w_line .
    when 'DESELECT' .
      set pf-status 'SELECT' excluding 'DESELECT' immediately.
      do w_lines times .
        read line w_line field value w_check .
        if w_check = 'X' .
          w_check = space .
          modify line w_line field value w_check .
          add 1 to w_line .
        endif .                        " IF W_CHECK = 'X' .
      enddo .                          " DO W_LINES TIMES
      clear w_line .
     Here w_line : Line that is being read
             w_lines : Total number of lines in your table(or list if you use 'list number of lines w_lines)
            w_check is my checkbox .
Hope your need will be done!!
Much Regards ,
Amuktha .

Similar Messages

  • Regarding download of the ALV report to excel

    Hi experts,
    I have an ALV report which took long time to extract records from various table. So while there is some restriction the report can be executed well in foreground. And the report can be extracted well to excel sheet. But while there is hudge records, i have to execute the report in backgroung. And then from spool i generally prefers to download the report to excel.
    There is a field UOM where it contains value ' " ' for some records. And also there may be possiblity that other fields can also contain the same.
    Now my problem is: while download to excel... When ever there is a value ' " ' from this point to the next value ' " '. It is treating as one record. and keep that in a same position in the excel sheet.
    But i want to keep all the values in there respective fields. Can you please how can i do that? Please give me some solution...
    regards,
    charles.

    Actually now I think there is another way to do this, storing file on application server can create problems as sometimes the users don't have directory write access or things like that.
    Instead you should export your data to a memory or database cluster and import it back using abother program.
    The proposed changes would be
    1: At the point you are calling your alv grid function, check if the sy-batch is 'X' for background job, if yes than export to database table INDX or you can create your own. suppose your data is in internal table ITAB than in case of background job, you will do
    data: keyf like indx-srtfd.
    *We just assign username, date time to this
    concatenate sy-uname sy-datum sy-uzeit into keyf.
    EXPORT itab TO DATABASE indx(ZZ) ID keyf.
    check for subrc if export is successfull.
    Now you have stored your itab in database for later processing. remember to have keyf. In case of background job you can have it write in the output so from spool output you can check what was the keyf to use.
    You have to write another program to import itab from database and download it or display it.....
    This program will have keyf as input parameter and you must define ITAB same as the orignal program.
    parameters: p_keyf like like indx-srtfd.
    import itab from database indx(ZZ) id keyf.
    *Now you have itab. do whatever you want with it. download it using GUI_DOWNLOAD function or display it in an ALV grid.......
    Hope you got the overall idea.

  • Regarding the Extract in alv report

    Hi gurus,
    please explain to me what is the Extract in ALV's.
    i have an alv report in which they declaired avariable like disextract and assigned a radio button, if the radiobutton is check then the data is stored in extract.what is the use of the extract?

    Hi,
    Please check below thread;
    Extract from ALV List
    Regards
    Jana

  • Regarding excel download from ALV report tree

    Hi Experts,
    I have a ALV report tree program. In that i need the functionality to download report output in excel file.
    Can any body suggest how can i achieve download to excel functionality in it.
    Any useful suggestion will be appreciated.
    Thanks in advance,
    Akash

    The data for the tree exist in the NODE table in a different format. So, even you download that table, it will not be downloaded in the TREE format. So, the user will not be able to understand the data unlike the case of a ALV GRID.
    Whether it is a TREE / GRID, ultimately its the data of a internal table, that gets downloaded. But in case a TREE, we don't have the data in a straight forward way . i thnk it is not possible . i am not sure too for this .

  • Regarding Date format in ALV Report

    Dear All,
                  In ALV Reoport I have inserted Field BSTDK table VBKD by comparing vbeln my Date is getting displayed, but Problem is that  i want my date in this format for ex: 29.10.2008 but it is diaplaying as 20081029. this is an ex. same is repeating for all the dates against respective vbeln. 
    code as follows.
    LOOP AT GT_OUT1.
       SELECT SINGLE BSTDK INTO GT_OUT1-BSTDK
             FROM VBKD WHERE VBELN = GT_OUT1-AUBEL.
         MODIFY GT_OUT1.
    ENDLOOP.

    Moderator message - Please see How to post code in SCN, and some things NOT to do... before posting (date question) - post locked
    Rob

  • Regarding ABAP dump in ALV reports

    hi all,
         we are migrating the report programs from 4.7 to ECC...some of the reports am getting ABAP dump like this.....INCORRECT VALUE IN THE DYNAMIC TABLE.....if i comment the sort portion in grid display or list display  function module..output is coming please guided me in this...we are not upgrading..just migrating all the reports to ECC server..

    hi ,
    Error in the ABAP Application Program
    The current ABAP program "SAPLKKBL" had to be terminated because it has
    come across a statement that unfortunately cannot be executed.
    An exception occurred that is explained in detail below.
      The exception, which is assigned to class 'CX_SY_DYN_TABLE_ILL_COMP_VAL',
       not caught in
      procedure "FB_OUTTAB_SORT2" "(FORM)", nor was it propagated by a RAISING
       clause.
      Since the caller of the procedure could not have anticipated that the
      exception would occur, the current program is terminated.
      The reason for the exception is:
      The table "\FUNCTION-POOL=KKBL\FORM=FB_OUTTAB_SORT2\DATA=LT_SORTBYTAB" con
       an incorrect value in row 1 in the
      component with the name "NAME".
      In this particular case, the condition mentioned below was violated:
      (" ") The addition AS TEXT can only be used for character-type fields.
       IF RT_SORT-DOWN = 'X'.
         ls_sortbytab-descending = 'X'.
       ENDIF.
       append ls_sortbytab to lt_sortbytab.
    ENDLOOP.
    if RFLG_STABLE eq 'X'.
       sort rt_outtab stable by (lt_sortbytab).*******here dump is coming
    else.
       sort rt_outtab by (lt_sortbytab).
    endif.

  • Display a cell in ALV report as Pushbutton

    Hi,
    I am having an ALV report. I want to display one cell of the ALV report as a Pushbutton. How is it possible ?
    Thanks and regards.

    Hi WTM,
      To display a cell as pushbutton in container display of a simple, two-dimensional table, use the cell type BUTTON.
    cell type -->
    In the content of your ALV output, you are able to display various elements in place of text. Some of these elements can be treated as a click area for the user. You are able to display the following elements:
    ·        Checkbox
    In list-type ALV ouputs, the checkbox is disabled. With the content of the column, you are only to display whether the checkbox is set or not.
    In the tree structure, however, you are able to handle users actions on this element using an event.
    ·        Pushbutton
    You are able to handle user actions on this element with an event.
    ·        Hyperlink
    You specify the Internet addresses (URLs). Users can then call up the corresponding page in the Internet browser by clicking on one of these Internet addresses.
    ·        Click Area
    You are able to handle user actions on this element with an event.
    Hope this helps u,
    Regards,
    Nagarajan.

  • How to call ALV Report and SMARTFORMS through Pushbutton

    hi,
    i have created a report.My task is to create two buttons:
    1)ALV Report.
    2)SMARTFROMS.
    Through these button i have to call ALV Report and SMARTFORMS. i have created both button and when i execute the program,
    it shows me the button but not working when i click on it.
    this is the coding i have used in my report for calling ALV Report.
    ''Tables sscrfields,
    DATA flag(1) Type c.
    selection-screen: begin of screen 500 AS WINDOW TITLE tit,
    BEGIN OF LINE,
    PUSHBUTTON 2(18) but1 USER-COMMAND cli1,
    end of line,
    BEGIN OF LINE,
    PUSHBUTTON 2(18) but2 USER-COMMAND cli2,
    end of line,
    end of screen 500.
    SET PF-STATUS 'STATUS_0100'.
    at selection-screen.
    case sscrfields.
    WHEN 'cli1'.
    flag = '1'.
    WHEN 'cli2'.
    flag = '2'.
    endcase.
    at USER-COMMAND.
    CASE SY-UCOMM.
    WHEN 'Detail'.
    select vbakkunnr VBakernam VBAkaudat vbakaufnr vbapKWMENG vbapmatnr vbap~ARKTX
    into but1
    from vbak inner join vbap
    on vbakvbeln = vbapvbeln.
    ENDSELECT.
    ENDCASE.
    START-OF-SELECTION.
    tit = 'Format'.
    but1 = 'ALV Report'.
    but2 = 'SMARTFORMS'.
    CALL SELECTION-SCREEN 500.
    and i also use in my report
    ''case sscrfields-ucomm'' and ''submit my_report'' but the still button doesn't show the result.
    Thanks & Regards,

    Hi,
             I  understood your requirement. What i found is,  you are creating screen 500 and call it after START-OF-SELECTION,
    at that time your AT USER-COMMAND doesn't work.
    So what i would suggest , u should create GUI STATUS named ' PFSTAT' 
    having one functional key 'EXIT'  that is standard u can just name it
    and
    other two u can assign in Freely assigned Function keys as 'BUT1' & 'BUT2'.  and than in Application Toolbar u jst have it in ITEM LIST by typing BUT1 and BUT2.
    For 'BUT1'  text would be 'ALV'  and 'BUT2' text would be 'SMARTFORMS'.
    Now in Program you can code,,,
    START-OF-SELECTION.
    SET PF-STATUS 'PFSTAT'.
    WRITE:/ 'TEST'.
    at user-command.
      case SY-UCOMM.
        WHEN 'BUT1'.
        WHEN 'BUT2'.
        WHEN 'EXIT'.
           LEAVE PROGRAM.
      endcase.
    In Program u set PF STATUS and use at user-command event, whcih gets triggered when u click on button . When u execute program you get two button in application tooldbar.
    Please do needful.
    Thanks,
    Saurin SHah

  • Issue regarding ALV report

    Hi all,
             I've created an ALV report which is having a editable checkbox box field and some more fields that are not editable.
    My requirement is that when i check any checkbox, some of the fields in that particular row should become editable.
    In table control it can be done easily but can it be done in ALV.
    Note: I have created the ALV through container as it was required.
    Thanks in Advance.
    Regards
    Dheeraj

    Hi,
    Basically you will have to first register the data change event after you display the grid as follows:-
        CALL METHOD y_lobj_grid->register_edit_event
          EXPORTING
            i_event_id = cl_gui_alv_grid=>MC_EVT_MODIFIED
          EXCEPTIONS
            error      = 1
            OTHERS     = 2.
    Here Y_LOBJ_GRID is my grid object of type CL_GUI_ALV_GRID.
    Then you will have to set a handler method for this.
       SET HANDLER y_obj_evt_handler->y_m_handle_cell_modified
        FOR Y_LOBJ_GRID.
    Here y_obj_evt_handler is a local class in your program and y_m_handle_cell_modified is the method of that class.
    In this method you can change the fields to make then editable or non editable.
    Regards,
    Ankur Parab

  • Hi experts 1 query regarding alv report running in background

    when i run my alv report with 40 columns in background in spool when i get output disturbed 20 lines of first row is moving to second row so when i download to excel the o/p is completely disturbed and no use for me is there any way to solve this problem.please reply

    hi ,
    this will solve your problem
    http://www.****************/Tutorials/ALV/Spool/width.htm
    Increasing the width of the spool when using ALV List
    By Aafaque Husain, YASH Technologies
    Whenever an ALV report (with more number of columns) is scheduled in background, the output will be displayed in a zigzag fashion as shown below:  
    If we try to download the output from the spool or try to view the output, then we observe that the output is not in an appropriate fashion.  
    To get the right format of output in the spool we generally increase the u201Cno. of columns fieldu201D in the Format typesu201D. Have a look at the following screenshot:   
    Sometimes even when we change this field, we get the output truncated at the end, like last few columns are not displayed. There is certain limitation for this field, so that even if increase this value again, we find no change in the output display in spool. 
    This value is effective only when we check the check box u201CNumber of columns from list display formatu201D in the SPAD transaction.
    Ø       GO to SPAD Transaction code
    Ø       In the menu Settings -> Spool System as shown belowu2026
    Ø       In the others tab check the first check box in the Output Controller block, SAVE and exit.
    Now Schedule the ALV report again by providing the output device and format, and then we get the full output in the spool as shown below: 
    Regards,
    Madhavi

  • Regarding Conversion of the Charecter field Into Lowercase in an ALV REPORT

    HI ALL,
    I have created an editable alv Report. In which i have a coloumn with charecter field where i can enter 64 charecters. when ever i have enter and moved to another Tab its converting into Capital Letters. I need to stop it conversion. Can any one suggest me Regarding It. I am Using the Docking Container and method set_table_for_first_display for displaying the Grid.
    Please give some suggestion in order to control conversion of charecters.
    Thanks in Advance.
    Naresh

    What Kind of Dataelement/Domain you are using? CHAR60? Then try TEXT60 f.e.
    Maybe you check this out
    http://help.sap.com/saphelp_erp2005/helpdata/DE/bf/3bd1369f2d280ee10000009b38f889/frameset.htm
    and there the FC option lowercase..
    Edited by: Mathias Maerker on Apr 23, 2009 2:14 PM

  • Help needed regarding ALV report

    Hi,
    I have a query regarding ALV report.
    The requirement is as follows:-
    When the user executes the ALV report and if he sums one numeric field column values and filters out some of the field columns ( for example there r 5 columns in the report and the user has filtered out 2 of them and viewing only 3 columns)
    and now the requirements is that when the user runs the report later he should see the modified report ( i mean only 3 cloumns and the total value of the column which he has made) but not the original output which was there when the report was developed.
    First of all i wanna know is it possible to do r not. If yes then how
    Hope u have got what i want.
    eagerly waiting for ur reply.
    regards,
    maqsood

    Hi
    Yes you can! You have to manage the layout variant.
    So when you call your ALV you have to set the parameter I_SAVE = 'A'.
    In this way you'll allow the user to save the variants for layout.
    After you has to have a chance to choose the variant in selection-screen.
    See the demo program BCALV_GRID_11 to manage the variant in selection-screen.
    Max

  • URGENT: REGARDING POSTING DATE AND DELETION OF ZEROS IN ALV REPORT

    Hi,
      I had made a report in which i have to display 'POSTING DATE' (iseg-budat) when we execute the report i.e. it should be displayed as  PERIOD :- _______  to _______ .
    2nd problem is i had displayed the material no. ,but there are zeros which are displaying in dere ,i want to remove dem ... example, if the mat.no. is  2321 ,it is displaying 000002321. i want to remove these zeros.
    Its request to all of u dat plz help me as fast as possible as it is most urgent to me and if any body provide me help he or sh e will be definately rewarded..
    Regards,
    ric.s

    Here i am giving you one of the ALV reports i have generated. Check this program. I hope it will be helpful to you.
    REPORT  ZFI_ASSIGNED_FUNDS_FINAL.
    TABLES: FMIT,FMCIT,FPOS,IFMEISA1,FMFCTRT,BSEG,ZREV_BUDGET.
    TYPE-POOLS: SLIS.
    *ALV data declarations
    DATA: FIELDCATALOG TYPE SLIS_T_FIELDCAT_ALV WITH HEADER LINE,
          GD_SORT      TYPE SLIS_T_SORTINFO_ALV WITH HEADER LINE,
          GD_TAB_GROUP TYPE SLIS_T_SP_GROUP_ALV,
          GD_LAYOUT    TYPE SLIS_LAYOUT_ALV,
          GD_REPID     LIKE SY-REPID.
    *For ALV top of page
    DATA : IT_LIST_TOP_OF_PAGE TYPE SLIS_T_LISTHEADER.
    *For ALV Events
    DATA : IT_EVENT1 TYPE SLIS_T_EVENT.
    *For ALV Events
    DATA : IT_EVENT TYPE SLIS_ALV_EVENT.
    *For top of page heading
    DATA: IT_LINE TYPE SLIS_LISTHEADER.
    SELECTION-SCREEN BEGIN OF BLOCK B1 WITH FRAME TITLE TEXT-001.
    PARAMETER : RADIO RADIOBUTTON GROUP R1.
    IF RADIO EQ 'X'.
      SELECT-OPTIONS: FIPEX  FOR FPOS-FIPEX,                  " SELECTION FOR FUNDS CENTER & COMMITMENT ITEM
                      RFISTL FOR FMIT-RFISTL.
    ENDIF.
    PARAMETER: RADIO1 RADIOBUTTON GROUP R1.
    IF RADIO1 EQ 'X'.
      SELECT-OPTIONS : HKONT FOR BSEG-HKONT,                 " SELECTION FOR COST CENTER & G/L ACCOUNT
                       KOSTL FOR ZREV_BUDGET-KOSTL.
    ENDIF.
    SELECTION-SCREEN END OF BLOCK B1.
    SELECTION-SCREEN BEGIN OF BLOCK B2 WITH FRAME TITLE TEXT-001.
    SELECT-OPTIONS: PERDE  FOR IFMEISA1-PERDE DEFAULT '01' TO '12' OBLIGATORY.
    PARAMETER :     RYEAR  LIKE FMIT-RYEAR OBLIGATORY.
    SELECTION-SCREEN END OF BLOCK B2.
    DATA: BEGIN OF IT_TAB OCCURS 0,
             FIKRS LIKE FMFCTR-FIKRS,
             FICTR LIKE CSKS-KOSTL,
             CTR_OBJNR LIKE FMFCTR-CTR_OBJNR,
             RFISTL LIKE FMIT-RFISTL,
             OBJNR LIKE BPPE-OBJNR,
          END OF IT_TAB.
    DATA: BEGIN OF IT_TAB1 OCCURS 0,
             CO_OBJNR LIKE BPIJ-CO_OBJNR,
             POSIT LIKE BPPE-POSIT,
             FIPEX LIKE FMPOSIT-FIPEX,
             FICTR LIKE FMFCTR-FICTR,
             KSTAR LIKE COSP-KSTAR,
             RFISTL LIKE FMIT-RFISTL,
             OBJNR1 LIKE BPPE-OBJNR,
          END OF IT_TAB1.
    DATA: BEGIN OF IT_FMIT OCCURS 0,
            RYEAR LIKE FMIT-RYEAR,
            FIKRS LIKE FMIT-FIKRS,
            RFISTL LIKE ZREV_BUDGET-KOSTL,
            RFIPEX LIKE ZREV_BUDGET-KSTAR,
            HSL01 LIKE FMIT-HSL01,
            HSL02 LIKE FMIT-HSL02,
            HSL03 LIKE FMIT-HSL03,
            HSL04 LIKE FMIT-HSL04,
            HSL05 LIKE FMIT-HSL05,
            HSL06 LIKE FMIT-HSL06,
            HSL07 LIKE FMIT-HSL07,
            HSL08 LIKE FMIT-HSL08,
            HSL09 LIKE FMIT-HSL09,
            HSL10 LIKE FMIT-HSL10,
            HSL11 LIKE FMIT-HSL11,
            HSL12 LIKE FMIT-HSL12,
            HSL13 LIKE FMIT-HSL13,
            HSL14 LIKE FMIT-HSL14,
            HSL15 LIKE FMIT-HSL15,
            HSL16 LIKE FMIT-HSL16,
         END OF IT_FMIT.
    DATA: BEGIN OF IT_FMIT1 OCCURS 0,
            RYEAR LIKE FMIT-RYEAR,
            FIKRS LIKE FMIT-FIKRS,
            RFISTL LIKE ZREV_BUDGET-KOSTL,
            RFIPEX LIKE FMPG-FIPEX,
            TOTAL LIKE FMIT-TSL01,
            TOTAL1 LIKE FMIT-TSL01,
            OBJNR LIKE BPPE-OBJNR,
            POSIT LIKE BPPE-POSIT,
         END OF IT_FMIT1.
    DATA: BEGIN OF IT_BPPE OCCURS 0,
            OBJNR LIKE BPPE-OBJNR,
            POSIT LIKE BPPE-POSIT,
            GJAHR LIKE BPPE-GJAHR,
            WLP01 LIKE BPPE-WLP01,
            WLP02 LIKE BPPE-WLP02,
            WLP03 LIKE BPPE-WLP03,
            WLP04 LIKE BPPE-WLP04,
            WLP05 LIKE BPPE-WLP05,
            WLP06 LIKE BPPE-WLP06,
            WLP07 LIKE BPPE-WLP07,
            WLP08 LIKE BPPE-WLP08,
            WLP09 LIKE BPPE-WLP09,
            WLP10 LIKE BPPE-WLP10,
            WLP11 LIKE BPPE-WLP11,
            WLP12 LIKE BPPE-WLP12,
          END OF IT_BPPE.
    DATA: BEGIN OF IT_BPPE1 OCCURS 0,
            OBJNR LIKE BPPE-OBJNR,
            POSIT LIKE BPPE-POSIT,
            GJAHR LIKE BPPE-GJAHR,
            RFISTL LIKE FMIT-RFISTL,
            FIPEX LIKE FPOS-FIPEX,
            TOTAL2 LIKE BPPE-WLP01,
          END OF IT_BPPE1.
    DATA: BEGIN OF IT_CSKS OCCURS 0,
           KOKRS LIKE CSKS-KOKRS,
           KOSTL LIKE CSKS-KOSTL,
           BUKRS LIKE CSKS-BUKRS,
           OBJNR LIKE CSKS-OBJNR,
         END OF IT_CSKS.
    DATA: BEGIN OF IT_COSP OCCURS 0,
           OBJNR LIKE COSP-OBJNR,
           GJAHR LIKE COSP-GJAHR,
           KSTAR LIKE COSP-KSTAR,
           BEKNZ LIKE COSP-BEKNZ,
           WKG001 LIKE COSP-WKG001,
           WKG002 LIKE COSP-WKG002,
           WKG003 LIKE COSP-WKG003,
           WKG004 LIKE COSP-WKG004,
           WKG005 LIKE COSP-WKG005,
           WKG006 LIKE COSP-WKG006,
           WKG007 LIKE COSP-WKG007,
           WKG008 LIKE COSP-WKG008,
           WKG009 LIKE COSP-WKG009,
           WKG010 LIKE COSP-WKG010,
           WKG011 LIKE COSP-WKG011,
           WKG012 LIKE COSP-WKG012,
         END OF IT_COSP.
    DATA: BEGIN OF IT_COSP2 OCCURS 0,
           OBJNR LIKE COSP-OBJNR,
           GJAHR LIKE COSP-GJAHR,
           KSTAR LIKE COSP-KSTAR,
           FIPEX LIKE FMPG-FIPEX,
           TOTAL LIKE COSP-WKG001,
           TOTAL1 LIKE COSP-WKG001,
           OBJNR1 LIKE BPPE-OBJNR,
           POSIT LIKE BPPE-POSIT,
         END OF IT_COSP2.
    IF RADIO EQ 'X'.
      DATA: BEGIN OF IT_FINAL OCCURS 0,
             FIKRS LIKE FMIT-FIKRS,
             RFISTL LIKE FMIT-RFISTL,
             RFIPEX LIKE FMIT-RFIPEX,
             TEXT LIKE FMCIT-TEXT1,
             ALLOC LIKE FMIT-TSL16,
             USED LIKE FMIT-TSL16,
             REMAIN LIKE FMIT-TSL16,
             BEZEICH LIKE FMFCTRT-BEZEICH,
           END OF IT_FINAL.
    ENDIF.
    IF RADIO1 EQ 'X'.
      DATA: BEGIN OF IT_FINAL1 OCCURS 0,
              GJAHR LIKE ZREV_BUDGET-GJAHR,
              KOSTL LIKE ZREV_BUDGET-KOSTL,
              KSTAR LIKE ZREV_BUDGET-KSTAR,
              TOTAL1 LIKE COSP-WKG001,
              TOTAL3 LIKE COSP-WKG001,
              TEXT LIKE CSKU-KTEXT,
              VARIANCE LIKE COSP-WKG001,
              BEZEICH LIKE FMFCTRT-BEZEICH,
            END OF IT_FINAL1.
    ENDIF.
    DATA: BEGIN OF IT_FISTL OCCURS 0,
           RFISTL LIKE FMIT-RFISTL,
           BEZEICH LIKE FMFCTRT-BEZEICH,
          END OF IT_FISTL.
    DATA: BEGIN OF IT_HKONT OCCURS 0,
           KSTAR LIKE CSKU-KSTAR,
           KTEXT LIKE CSKU-KTEXT,
          END OF IT_HKONT.
    DATA: PERIOD1 TYPE I,
          PERIOD2 TYPE I,
          PERIOD3 TYPE I,
          PERIO TYPE I.
    DATA: BEZEICH LIKE FMFCTRT-BEZEICH.
    CONSTANTS: C_00 TYPE MONAT VALUE '00',
               C_13 TYPE MONAT VALUE '13'.
    DATA : IT_RETURN LIKE DDSHRETVAL OCCURS 0 WITH HEADER LINE.
    DATA: FIPEX1 LIKE COSP-KSTAR.
    A T - S E L E C T I O N  S C R E E N
    AT SELECTION-SCREEN.
      LOOP AT PERDE.
        IF  PERDE-LOW >= C_13 OR PERDE-HIGH >= C_13 .
          MESSAGE E022(ZA)  WITH 'Enter Period values from 1 to 12'.
          EXIT.
        ENDIF.
      ENDLOOP.
      IF NOT PERDE-LOW IS INITIAL.
        PERIOD1 = PERDE-LOW.
      ENDIF.
      IF NOT PERDE-HIGH IS INITIAL.
        PERIOD2 = PERDE-HIGH.
        PERIOD3 = PERIOD2 - PERIOD1.
        PERIOD3 = PERIOD3 + 1.
      ELSE.
        PERIOD3 = 1.
      ENDIF.
      PERIO = PERIOD1.
    AT SELECTION-SCREEN ON VALUE-REQUEST FOR RFISTL-LOW.
      SELECT FICTR BEZEICH INTO TABLE IT_FISTL FROM FMFCTRT
                                               WHERE SPRAS EQ 'EN'
                                               AND   FIKRS EQ 'NFFM'.
      CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'
        EXPORTING
          RETFIELD   = 'RFISTL'
          VALUE_ORG  = 'S'
        TABLES
          VALUE_TAB  = IT_FISTL
          RETURN_TAB = IT_RETURN.
      IF SY-SUBRC = 0.
        READ TABLE IT_RETURN INDEX 1.
        MOVE IT_RETURN-FIELDVAL TO RFISTL-LOW.
      ENDIF.
    AT SELECTION-SCREEN ON VALUE-REQUEST FOR RFISTL-HIGH.
      SELECT FICTR BEZEICH INTO TABLE IT_FISTL FROM FMFCTRT
                                               WHERE SPRAS EQ 'EN'
                                               AND   FIKRS EQ 'NFFM'.
      CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'
        EXPORTING
          RETFIELD   = 'RFISTL'
          VALUE_ORG  = 'S'
        TABLES
          VALUE_TAB  = IT_FISTL
          RETURN_TAB = IT_RETURN.
      IF SY-SUBRC = 0.
        READ TABLE IT_RETURN INDEX 1.
        MOVE IT_RETURN-FIELDVAL TO RFISTL-HIGH.
      ENDIF.
    AT SELECTION-SCREEN ON VALUE-REQUEST FOR HKONT-LOW.
      SELECT KSTAR KTEXT INTO TABLE IT_HKONT FROM CSKU WHERE SPRAS EQ 'EN'.
      SORT IT_HKONT BY KSTAR.
      CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'
        EXPORTING
          RETFIELD   = 'HKONT'
          VALUE_ORG  = 'S'
        TABLES
          VALUE_TAB  = IT_HKONT
          RETURN_TAB = IT_RETURN.
      IF SY-SUBRC = 0.
        READ TABLE IT_RETURN INDEX 1.
        MOVE IT_RETURN-FIELDVAL TO HKONT-LOW.
      ENDIF.
    AT SELECTION-SCREEN ON VALUE-REQUEST FOR HKONT-HIGH.
      SELECT  KSTAR KTEXT INTO TABLE IT_HKONT FROM CSKU WHERE SPRAS EQ 'EN'.
      SORT IT_HKONT BY KSTAR.
      CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'
        EXPORTING
          RETFIELD   = 'HKONT'
          VALUE_ORG  = 'S'
        TABLES
          VALUE_TAB  = IT_HKONT
          RETURN_TAB = IT_RETURN.
      IF SY-SUBRC = 0.
        READ TABLE IT_RETURN INDEX 1.
        MOVE IT_RETURN-FIELDVAL TO HKONT-HIGH.
      ENDIF.
    AT SELECTION-SCREEN ON VALUE-REQUEST FOR KOSTL-LOW.
      SELECT FICTR BEZEICH INTO TABLE IT_FISTL FROM FMFCTRT
                                               WHERE SPRAS EQ 'EN'
                                               AND   FIKRS IN KOSTL.
      CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'
        EXPORTING
          RETFIELD   = 'KOSTL'
          VALUE_ORG  = 'S'
        TABLES
          VALUE_TAB  = IT_FISTL
          RETURN_TAB = IT_RETURN.
      IF SY-SUBRC = 0.
        READ TABLE IT_RETURN INDEX 1.
        MOVE IT_RETURN-FIELDVAL TO KOSTL-LOW.
      ENDIF.
    AT SELECTION-SCREEN ON VALUE-REQUEST FOR KOSTL-HIGH.
      SELECT FICTR BEZEICH INTO TABLE IT_FISTL FROM FMFCTRT
                                               WHERE SPRAS EQ 'EN'
                                               AND   FIKRS IN KOSTL.
      CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'
        EXPORTING
          RETFIELD   = 'KOSTL'
          VALUE_ORG  = 'S'
        TABLES
          VALUE_TAB  = IT_FISTL
          RETURN_TAB = IT_RETURN.
      IF SY-SUBRC = 0.
        READ TABLE IT_RETURN INDEX 1.
        MOVE IT_RETURN-FIELDVAL TO KOSTL-HIGH.
      ENDIF.
    *START-OF-SELECTION
    START-OF-SELECTION.
      IF RADIO EQ 'X'.                     " FOR FUNDS CENTER AND COMMITMENT ITEM
        PERFORM GET_DATA.
        PERFORM PROCESS_DATA.
      ENDIF.
      IF RADIO1 EQ 'X'.                    " FOR COST CENTER AND G/L ACCOUNT
        PERFORM GET_DATA1.
        PERFORM PROCESS_DATA1.
      ENDIF.
    *END OF SELECTION
      PERFORM BUILD_LAYOUT.
      PERFORM BUILD_EVENTS.
      IF RADIO EQ 'X'.
        PERFORM BUILD_FIELDCATALOG.
        PERFORM BUILD_SORT.
        PERFORM DISPLAY_ALV_REPORT.
      ENDIF.
      IF RADIO1 EQ 'X'.
        PERFORM BUILD_FIELDCATALOG1.
        PERFORM BUILD_SORT1.
        PERFORM DISPLAY_ALV_REPORT1.
      ENDIF.
    *&      Form  GET_DATA
          text
    -->  p1        text
    <--  p2        text
    FORM GET_DATA .
      SELECT FIKRS FICTR CTR_OBJNR INTO TABLE IT_TAB FROM FMFCTR
                                                     WHERE FIKRS EQ 'NFFM'
                                                     AND   FICTR IN RFISTL.
      SELECT CO_OBJNR POSIT INTO TABLE IT_TAB1 FROM BPIJ
                                               FOR ALL ENTRIES IN IT_TAB
                                               WHERE CO_OBJNR EQ IT_TAB-CTR_OBJNR.
      LOOP AT IT_TAB1.
        SELECT SINGLE FIPEX INTO IT_TAB1-FIPEX FROM FMPOSIT WHERE FIKRS EQ 'NFFM'
                                               AND   POSIT EQ IT_TAB1-POSIT
                                               AND   FIPEX IN FIPEX.
        IF SY-SUBRC EQ '0'.
          MODIFY IT_TAB1.
        ELSE.
          DELETE IT_TAB1.
        ENDIF.
      ENDLOOP.
      SELECT OBJNR
             POSIT
             GJAHR
             WLP01
             WLP02
             WLP03
             WLP04
             WLP05
             WLP06
             WLP07
             WLP08
             WLP09
             WLP10
             WLP11
             WLP12
             INTO TABLE IT_BPPE
             FROM BPPE
             FOR ALL ENTRIES IN IT_TAB1
             WHERE OBJNR EQ IT_TAB1-CO_OBJNR
             AND   POSIT EQ IT_TAB1-POSIT
             AND   GJAHR EQ RYEAR
             AND   VORGA IN ('KBFR','KBUE','KBUS').
      LOOP AT IT_BPPE.
        MOVE-CORRESPONDING IT_BPPE TO IT_BPPE1.
        IT_BPPE1-RFISTL = IT_BPPE1-OBJNR+6(4).
        CALL FUNCTION 'CONVERSION_EXIT_ALPHA_OUTPUT'
          EXPORTING
            INPUT  = IT_BPPE1-RFISTL
          IMPORTING
            OUTPUT = IT_BPPE1-RFISTL.
        CALL FUNCTION 'FM_FIPEX_GET_FROM_POSIT'
          EXPORTING
            I_FIKRS = 'NFFM'
            I_POSIT = IT_BPPE1-POSIT
          IMPORTING
            E_FIPEX = IT_BPPE1-FIPEX.
        PERIOD1 = PERIO.
        DO PERIOD3 TIMES.
          CASE PERIOD1.
            WHEN 1.
              IT_BPPE1-TOTAL2 =  IT_BPPE1-TOTAL2 + IT_BPPE-WLP01.
            WHEN 2.
              IT_BPPE1-TOTAL2 = IT_BPPE1-TOTAL2 + IT_BPPE-WLP02.
            WHEN 3.
              IT_BPPE1-TOTAL2 = IT_BPPE1-TOTAL2 + IT_BPPE-WLP03.
            WHEN 4.
              IT_BPPE1-TOTAL2 = IT_BPPE1-TOTAL2 + IT_BPPE-WLP04.
            WHEN 5.
              IT_BPPE1-TOTAL2 = IT_BPPE1-TOTAL2 + IT_BPPE-WLP05.
            WHEN 6.
              IT_BPPE1-TOTAL2 = IT_BPPE1-TOTAL2 + IT_BPPE-WLP06.
            WHEN 7.
              IT_BPPE1-TOTAL2 = IT_BPPE1-TOTAL2 + IT_BPPE-WLP07.
            WHEN 8.
              IT_BPPE1-TOTAL2 = IT_BPPE1-TOTAL2 + IT_BPPE-WLP08.
            WHEN 9.
              IT_BPPE1-TOTAL2 = IT_BPPE1-TOTAL2 + IT_BPPE-WLP09.
            WHEN 10.
              IT_BPPE1-TOTAL2 = IT_BPPE1-TOTAL2 + IT_BPPE-WLP10.
            WHEN 11.
              IT_BPPE1-TOTAL2 = IT_BPPE1-TOTAL2 + IT_BPPE-WLP11.
            WHEN 12.
              IT_BPPE1-TOTAL2 = IT_BPPE1-TOTAL2 + IT_BPPE-WLP12.
          ENDCASE.
          IF PERIOD2 >= PERIOD1.
            PERIOD1 = PERIOD1 + 1.
          ENDIF.
        ENDDO.
        COLLECT IT_BPPE1.
        CLEAR PERIOD1.
        CLEAR IT_BPPE1.
      ENDLOOP.
      SELECT RYEAR
             FIKRS
             RFISTL
             RFIPEX
             HSL01
             HSL02
             HSL03
             HSL04
             HSL05
             HSL06
             HSL07
             HSL08
             HSL09
             HSL10
             HSL11
             HSL12
             HSL13
             HSL14
             HSL15
             HSL16
             INTO TABLE IT_FMIT FROM FMIT
             FOR ALL ENTRIES IN IT_BPPE1
             WHERE RYEAR EQ RYEAR
             AND   FIKRS EQ 'NFFM'
            AND   RFIPEX EQ IT_BPPE1-FIPEX
             AND  RFIPEX IN FIPEX
             AND   RFISTL EQ IT_BPPE1-RFISTL.
      LOOP AT IT_FMIT.
        MOVE-CORRESPONDING IT_FMIT TO IT_FMIT1.
        PERIOD1 = PERIO.
        DO PERIOD3 TIMES.
          CASE PERIOD1.
            WHEN 1.
              IT_FMIT1-TOTAL =  IT_FMIT1-TOTAL + IT_FMIT-HSL01.
            WHEN 2.
              IT_FMIT1-TOTAL = IT_FMIT1-TOTAL + IT_FMIT-HSL02.
            WHEN 3.
              IT_FMIT1-TOTAL = IT_FMIT1-TOTAL + IT_FMIT-HSL03.
            WHEN 4.
              IT_FMIT1-TOTAL = IT_FMIT1-TOTAL + IT_FMIT-HSL04.
            WHEN 5.
              IT_FMIT1-TOTAL = IT_FMIT1-TOTAL + IT_FMIT-HSL05.
            WHEN 6.
              IT_FMIT1-TOTAL = IT_FMIT1-TOTAL + IT_FMIT-HSL06.
            WHEN 7.
              IT_FMIT1-TOTAL = IT_FMIT1-TOTAL + IT_FMIT-HSL07.
            WHEN 8.
              IT_FMIT1-TOTAL = IT_FMIT1-TOTAL + IT_FMIT-HSL08.
            WHEN 9.
              IT_FMIT1-TOTAL = IT_FMIT1-TOTAL + IT_FMIT-HSL09.
            WHEN 10.
              IT_FMIT1-TOTAL = IT_FMIT1-TOTAL + IT_FMIT-HSL10.
            WHEN 11.
              IT_FMIT1-TOTAL = IT_FMIT1-TOTAL + IT_FMIT-HSL11.
            WHEN 12.
              IT_FMIT1-TOTAL = IT_FMIT1-TOTAL + IT_FMIT-HSL12.
          ENDCASE.
          IF PERIOD2 >= PERIOD1.
            PERIOD1 = PERIOD1 + 1.
          ENDIF.
        ENDDO.
        IT_FMIT1-TOTAL1 = IT_FMIT1-TOTAL * -1 .
        COLLECT IT_FMIT1.
        CLEAR PERIOD1.
        CLEAR IT_FMIT1.
      ENDLOOP.
    ENDFORM.                    " GET_DATA
    *&      Form  PROCESS_DATA
          text
    -->  p1        text
    <--  p2        text
    FORM PROCESS_DATA .
      SORT IT_FMIT1 BY FIKRS RFISTL RFIPEX.
      SORT IT_BPPE1 BY RFISTL FIPEX.
      LOOP AT IT_BPPE1.
        IT_FINAL-RFISTL = IT_BPPE1-RFISTL.
        IT_FINAL-RFIPEX = IT_BPPE1-FIPEX.
        IT_FINAL-ALLOC   = IT_BPPE1-TOTAL2.
        READ TABLE IT_FMIT1 WITH KEY RFISTL = IT_BPPE1-RFISTL  RFIPEX = IT_BPPE1-FIPEX.
        IF SY-SUBRC EQ 0.
          IT_FINAL-USED   = IT_FMIT1-TOTAL1.
        ENDIF.
        CALL FUNCTION 'CONVERSION_EXIT_ALPHA_OUTPUT'
          EXPORTING
            INPUT  = IT_FMIT1-RFIPEX
          IMPORTING
            OUTPUT = IT_FMIT1-RFIPEX.
        CALL FUNCTION 'CONVERSION_EXIT_ALPHA_OUTPUT'
          EXPORTING
            INPUT  = IT_FMIT1-RFISTL
          IMPORTING
            OUTPUT = IT_FMIT1-RFISTL.
    Changes made on 13/11/2007  *******************************
       SELECT SINGLE TEXT1 INTO IT_FINAL-TEXT FROM FMCIT WHERE SPRAS EQ 'EN'
                                                         AND   FIPEX EQ  IT_FMIT1-RFIPEX.
        SELECT SINGLE TEXT1 INTO IT_FINAL-TEXT FROM FMCIT WHERE SPRAS EQ 'EN'
                                                          AND   FIPEX EQ  IT_BPPE1-FIPEX.
    Changes made on 13/11/2007  *******************************
        SELECT SINGLE BEZEICH INTO IT_FINAL-BEZEICH FROM FMFCTRT
                                                    WHERE SPRAS EQ 'EN'
                                                    AND   FICTR EQ IT_FMIT1-RFISTL.
        CALL FUNCTION 'CONVERSION_EXIT_ALPHA_OUTPUT'
          EXPORTING
            INPUT  = IT_FINAL-RFIPEX
          IMPORTING
            OUTPUT = IT_FINAL-RFIPEX.
        IT_FINAL-REMAIN = IT_FINAL-ALLOC - IT_FINAL-USED.
        APPEND IT_FINAL.
        CLEAR IT_FINAL.
      ENDLOOP.
    SORT IT_FINAL BY FIKRS RFISTL RFIPEX.
       LOOP AT IT_FMIT1.
        READ TABLE IT_FINAL WITH KEY RFISTL = IT_FMIT1-RFISTL RFIPEX = IT_FMIT1-RFIPEX.
        IF SY-SUBRC NE 0.
          IT_FINAL-RFISTL = IT_FMIT1-RFISTL.
          IT_FINAL-RFIPEX = IT_FMIT1-RFIPEX.
          IT_FINAL-USED   = IT_FMIT1-TOTAL1.
        IT_FINAL-ALLOC   = '0'.
          CALL FUNCTION 'CONVERSION_EXIT_ALPHA_OUTPUT'
            EXPORTING
              INPUT  = IT_FMIT1-RFIPEX
            IMPORTING
              OUTPUT = IT_FMIT1-RFIPEX.
          CALL FUNCTION 'CONVERSION_EXIT_ALPHA_OUTPUT'
            EXPORTING
              INPUT  = IT_FMIT1-RFISTL
            IMPORTING
              OUTPUT = IT_FMIT1-RFISTL.
          SELECT SINGLE TEXT1 INTO IT_FINAL-TEXT FROM FMCIT WHERE SPRAS EQ 'EN'
                                                            AND   FIPEX EQ  IT_FMIT1-RFIPEX.
          SELECT SINGLE BEZEICH INTO IT_FINAL-BEZEICH FROM FMFCTRT
                                                      WHERE SPRAS EQ 'EN'
                                                      AND   FICTR EQ IT_FMIT1-RFISTL.
          IT_FINAL-REMAIN = IT_FINAL-ALLOC - IT_FINAL-USED.
          APPEND IT_FINAL.
          CLEAR IT_FINAL.
        ELSE.
          DELETE IT_FMIT1.
        ENDIF.
      ENDLOOP.
      SORT IT_FINAL BY FIKRS RFISTL RFIPEX.
    ENDFORM.                    " PROCESS_DATA
    *&      Form  GET_DATA1
          text
    -->  p1        text
    <--  p2        text
    FORM GET_DATA1 .
      SELECT KOKRS KOSTL BUKRS OBJNR INTO TABLE IT_CSKS
                                     FROM CSKS
                                     WHERE KOKRS EQ '1000'
                                     AND   KOSTL IN KOSTL
                                     AND   BUKRS EQ 'NFCL'.
      SELECT OBJNR
             GJAHR
             KSTAR
             BEKNZ
             WKG001
             WKG002
             WKG003
             WKG004
             WKG005
             WKG006
             WKG007
             WKG008
             WKG009
             WKG010
             WKG011
             WKG012
             FROM COSP
             INTO TABLE IT_COSP
             FOR ALL ENTRIES IN IT_CSKS
             WHERE OBJNR EQ IT_CSKS-OBJNR
             AND   GJAHR EQ RYEAR
             AND   KSTAR IN HKONT.
      LOOP AT IT_COSP.
        MOVE-CORRESPONDING IT_COSP TO IT_COSP2.
        PERIOD1 = PERIO.
        DO PERIOD3 TIMES.
          CASE PERIOD1.
            WHEN 1.
              IT_COSP2-TOTAL =  IT_COSP2-TOTAL + IT_COSP-WKG001.
            WHEN 2.
              IT_COSP2-TOTAL = IT_COSP2-TOTAL + IT_COSP-WKG002.
            WHEN 3.
              IT_COSP2-TOTAL = IT_COSP2-TOTAL + IT_COSP-WKG003.
            WHEN 4.
              IT_COSP2-TOTAL = IT_COSP2-TOTAL + IT_COSP-WKG004.
            WHEN 5.
              IT_COSP2-TOTAL = IT_COSP2-TOTAL + IT_COSP-WKG005.
            WHEN 6.
              IT_COSP2-TOTAL = IT_COSP2-TOTAL + IT_COSP-WKG006.
            WHEN 7.
              IT_COSP2-TOTAL = IT_COSP2-TOTAL + IT_COSP-WKG007.
            WHEN 8.
              IT_COSP2-TOTAL = IT_COSP2-TOTAL + IT_COSP-WKG008.
            WHEN 9.
              IT_COSP2-TOTAL = IT_COSP2-TOTAL + IT_COSP-WKG009.
            WHEN 10.
              IT_COSP2-TOTAL = IT_COSP2-TOTAL + IT_COSP-WKG010.
            WHEN 11.
              IT_COSP2-TOTAL = IT_COSP2-TOTAL + IT_COSP-WKG011.
            WHEN 12.
              IT_COSP2-TOTAL = IT_COSP2-TOTAL + IT_COSP-WKG012.
          ENDCASE.
          IF PERIOD2 >= PERIOD1.
            PERIOD1 = PERIOD1 + 1.
          ENDIF.
        ENDDO.
        IT_COSP2-OBJNR1 = IT_COSP2-OBJNR+10(6).
        CALL FUNCTION 'CONVERSION_EXIT_ALPHA_OUTPUT'
          EXPORTING
            INPUT  = IT_COSP2-OBJNR1
          IMPORTING
            OUTPUT = IT_COSP2-OBJNR1.
        CONCATENATE 'FSNFFM' IT_COSP2-OBJNR1 INTO IT_COSP2-OBJNR1.
        IT_COSP2-FIPEX = IT_COSP2-KSTAR.
        CALL FUNCTION 'CONVERSION_EXIT_ALPHA_OUTPUT'
          EXPORTING
            INPUT  = IT_COSP2-FIPEX
          IMPORTING
            OUTPUT = IT_COSP2-FIPEX.
        CALL FUNCTION 'FM_POSIT_GET_FROM_FIPEX'
          EXPORTING
          I_FIKRS                = 'NFFM'
          I_FIPEX                = IT_COSP2-FIPEX
      I_FLG_BUFFER_ALL       =
       IMPORTING
       E_POSIT                = IT_COSP2-POSIT
    TABLES
      T_FMPOSIT              =
        EXCEPTIONS
          INPUT_ERROR            = 1
          DATA_NOT_FOUND         = 2
          OTHERS                 = 3
        IF SY-SUBRC <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
            WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
        ENDIF.
        CONDENSE IT_COSP2-OBJNR1.
        CONDENSE IT_COSP2-POSIT.
        COLLECT IT_COSP2.
        CLEAR PERIOD1.
        CLEAR IT_COSP2.
      ENDLOOP.
      SORT IT_COSP2 BY OBJNR KSTAR.
      SELECT OBJNR
             POSIT
             GJAHR
             WLP01
             WLP02
             WLP03
             WLP04
             WLP05
             WLP06
             WLP07
             WLP08
             WLP09
             WLP10
             WLP11
             WLP12
             INTO TABLE IT_BPPE
             FROM BPPE
             FOR ALL ENTRIES IN IT_COSP2
             WHERE OBJNR EQ IT_COSP2-OBJNR1
             AND   POSIT EQ IT_COSP2-POSIT
             AND   GJAHR EQ RYEAR
             AND   VORGA IN ('KBFR','KBUE','KBUS').
      LOOP AT IT_BPPE.
        MOVE-CORRESPONDING IT_BPPE TO IT_BPPE1.
        PERIOD1 = PERIO.
        DO PERIOD3 TIMES.
          CASE PERIOD1.
            WHEN 1.
              IT_BPPE1-TOTAL2 =  IT_BPPE1-TOTAL2 + IT_BPPE-WLP01.
            WHEN 2.
              IT_BPPE1-TOTAL2 = IT_BPPE1-TOTAL2 + IT_BPPE-WLP02.
            WHEN 3.
              IT_BPPE1-TOTAL2 = IT_BPPE1-TOTAL2 + IT_BPPE-WLP03.
            WHEN 4.
              IT_BPPE1-TOTAL2 = IT_BPPE1-TOTAL2 + IT_BPPE-WLP04.
            WHEN 5.
              IT_BPPE1-TOTAL2 = IT_BPPE1-TOTAL2 + IT_BPPE-WLP05.
            WHEN 6.
              IT_BPPE1-TOTAL2 = IT_BPPE1-TOTAL2 + IT_BPPE-WLP06.
            WHEN 7.
              IT_BPPE1-TOTAL2 = IT_BPPE1-TOTAL2 + IT_BPPE-WLP07.
            WHEN 8.
              IT_BPPE1-TOTAL2 = IT_BPPE1-TOTAL2 + IT_BPPE-WLP08.
            WHEN 9.
              IT_BPPE1-TOTAL2 = IT_BPPE1-TOTAL2 + IT_BPPE-WLP09.
            WHEN 10.
              IT_BPPE1-TOTAL2 = IT_BPPE1-TOTAL2 + IT_BPPE-WLP10.
            WHEN 11.
              IT_BPPE1-TOTAL2 = IT_BPPE1-TOTAL2 + IT_BPPE-WLP11.
            WHEN 12.
              IT_BPPE1-TOTAL2 = IT_BPPE1-TOTAL2 + IT_BPPE-WLP12.
          ENDCASE.
          IF PERIOD2 >= PERIOD1.
            PERIOD1 = PERIOD1 + 1.
          ENDIF.
        ENDDO.
        COLLECT IT_BPPE1.
        CLEAR PERIOD1.
        CLEAR IT_BPPE1.
      ENDLOOP.
    ENDFORM.                                                    " GET_DATA1
    *&      Form  PROCESS_DATA1
          text
    -->  p1        text
    <--  p2        text
    FORM PROCESS_DATA1 .
      LOOP AT IT_COSP2.
        IT_FINAL1-GJAHR = IT_COSP2-GJAHR.
        IT_FINAL1-KSTAR = IT_COSP2-KSTAR.
        IT_FINAL1-TOTAL1 = IT_COSP2-TOTAL.
        SELECT SINGLE KOSTL FROM CSKS INTO IT_FINAL1-KOSTL WHERE KOKRS = '1000'
                                                            AND BUKRS EQ 'NFCL'
                                                            AND OBJNR = IT_COSP2-OBJNR.
        READ TABLE IT_BPPE1 WITH KEY OBJNR = IT_COSP2-OBJNR1 POSIT = IT_COSP2-POSIT.
        IF SY-SUBRC EQ 0.
          IT_FINAL1-TOTAL3 = IT_BPPE1-TOTAL2.
        ENDIF.
        SELECT SINGLE KTEXT INTO IT_FINAL1-TEXT FROM CSKU WHERE SPRAS EQ 'EN'
                                                          AND  KSTAR EQ  IT_COSP2-KSTAR.
        CALL FUNCTION 'CONVERSION_EXIT_ALPHA_OUTPUT'
          EXPORTING
            INPUT  = IT_FINAL1-KOSTL
          IMPORTING
            OUTPUT = IT_FINAL1-KOSTL.
        CALL FUNCTION 'CONVERSION_EXIT_ALPHA_OUTPUT'
          EXPORTING
            INPUT  = IT_FINAL1-KSTAR
          IMPORTING
            OUTPUT = IT_FINAL1-KSTAR.
        SELECT SINGLE BEZEICH INTO IT_FINAL1-BEZEICH FROM FMFCTRT
                                                    WHERE SPRAS EQ 'EN'
                                                    AND   FICTR EQ IT_FINAL1-KOSTL.
        IT_FINAL1-VARIANCE = IT_FINAL1-TOTAL3 - IT_FINAL1-TOTAL1.
        APPEND IT_FINAL1.
        CLEAR IT_FINAL1.
      ENDLOOP.
      SORT IT_FINAL1 BY KOSTL KSTAR.
      DELETE IT_FINAL1 WHERE KOSTL IS INITIAL.
    ENDFORM.                    " PROCESS_DATA1
    *&      Form  BUILD_FIELDCATALOG
          text
    -->  p1        text
    <--  p2        text
    FORM BUILD_FIELDCATALOG .
      FIELDCATALOG-FIELDNAME   = 'RFISTL'.
      FIELDCATALOG-SELTEXT_M   = 'Funds Center'.
      APPEND FIELDCATALOG TO FIELDCATALOG.
      CLEAR  FIELDCATALOG.
      FIELDCATALOG-FIELDNAME   = 'BEZEICH'.
      FIELDCATALOG-SELTEXT_M   = 'Fund Center Description'.
      APPEND FIELDCATALOG TO FIELDCATALOG.
      CLEAR  FIELDCATALOG.
      FIELDCATALOG-FIELDNAME   = 'RFIPEX'.
      FIELDCATALOG-SELTEXT_M   = 'Commitment Item'.
      APPEND FIELDCATALOG TO FIELDCATALOG.
      CLEAR  FIELDCATALOG.
      FIELDCATALOG-FIELDNAME   = 'TEXT'.
      FIELDCATALOG-SELTEXT_M   = 'Commitment Item Description'.
      APPEND FIELDCATALOG TO FIELDCATALOG.
      CLEAR  FIELDCATALOG.
      FIELDCATALOG-FIELDNAME   = 'ALLOC'.
      FIELDCATALOG-SELTEXT_M   = 'Allocated Budget'.
      FIELDCATALOG-DO_SUM      = 'X'.
      APPEND FIELDCATALOG TO FIELDCATALOG.
      CLEAR  FIELDCATALOG.
      FIELDCATALOG-FIELDNAME   = 'USED'.
      FIELDCATALOG-SELTEXT_M   = 'Used Budget'.
      FIELDCATALOG-DO_SUM      = 'X'.
      APPEND FIELDCATALOG TO FIELDCATALOG.
      CLEAR  FIELDCATALOG.
      FIELDCATALOG-FIELDNAME   = 'REMAIN'.
      FIELDCATALOG-SELTEXT_M   = 'Remaining Budget'.
      FIELDCATALOG-DO_SUM      = 'X'.
      APPEND FIELDCATALOG TO FIELDCATALOG.
      CLEAR  FIELDCATALOG.
    ENDFORM.                    " BUILD_FIELDCATALOG
    *&      Form  BUILD_FIELDCATALOG1
          text
    -->  p1        text
    <--  p2        text
    FORM BUILD_FIELDCATALOG1 .
      FIELDCATALOG-FIELDNAME   = 'KOSTL'.
      FIELDCATALOG-SELTEXT_M   = 'Cost Center'.
      APPEND FIELDCATALOG TO FIELDCATALOG.
      CLEAR  FIELDCATALOG.
      FIELDCATALOG-FIELDNAME   = 'BEZEICH'.
      FIELDCATALOG-SELTEXT_M   = 'Cost Center Description'.
      APPEND FIELDCATALOG TO FIELDCATALOG.
      CLEAR  FIELDCATALOG.
      FIELDCATALOG-FIELDNAME   = 'KSTAR'.
      FIELDCATALOG-SELTEXT_M   = 'G/L Account'.
      APPEND FIELDCATALOG TO FIELDCATALOG.
      CLEAR  FIELDCATALOG.
      FIELDCATALOG-FIELDNAME   = 'TEXT'.
      FIELDCATALOG-SELTEXT_M   = 'G/L Account Description'.
      APPEND FIELDCATALOG TO FIELDCATALOG.
      CLEAR  FIELDCATALOG.
      FIELDCATALOG-FIELDNAME   = 'TOTAL3'.
      FIELDCATALOG-SELTEXT_M   = 'Planned amount'.
      FIELDCATALOG-DO_SUM      = 'X'.
      APPEND FIELDCATALOG TO FIELDCATALOG.
      CLEAR  FIELDCATALOG.
      FIELDCATALOG-FIELDNAME   = 'TOTAL1'.
      FIELDCATALOG-SELTEXT_M   = 'Actuals'.
      FIELDCATALOG-DO_SUM      = 'X'.
      APPEND FIELDCATALOG TO FIELDCATALOG.
      CLEAR  FIELDCATALOG.
      FIELDCATALOG-FIELDNAME   = 'VARIANCE'.
      FIELDCATALOG-SELTEXT_M   = 'Variance'.
      FIELDCATALOG-DO_SUM      = 'X'.
      APPEND FIELDCATALOG TO FIELDCATALOG.
      CLEAR  FIELDCATALOG.
    ENDFORM.                    " BUILD_FIELDCATALOG1
    *&      Form  BUILD_LAYOUT
          text
    -->  p1        text
    <--  p2        text
    FORM BUILD_LAYOUT .
      GD_LAYOUT-NO_INPUT          = 'X'.
      GD_LAYOUT-COLWIDTH_OPTIMIZE = 'X'.
    ENDFORM.                    " BUILD_LAYOUT
    *&      Form  BUILD_SORT
          text
    -->  p1        text
    <--  p2        text
    FORM BUILD_SORT .
      DATA: GT_SORT TYPE SLIS_SORTINFO_ALV.
      GT_SORT-UP = 'X'.
      GT_SORT-FIELDNAME = 'RFISTL'.
      GT_SORT-TABNAME  = 'IT_FINAL'.
      GT_SORT-SUBTOT  = 'X'.
      APPEND GT_SORT TO GD_SORT.
      CLEAR GT_SORT.
      GT_SORT-UP = 'X'.
      GT_SORT-FIELDNAME = 'BEZEICH'.
      GT_SORT-TABNAME  = 'IT_FINAL'.
      APPEND GT_SORT TO GD_SORT.
      CLEAR GT_SORT.
    ENDFORM.                    " BUILD_SORT
    *&      Form  BUILD_SORT1
          text
    -->  p1        text
    <--  p2        text
    FORM BUILD_SORT1 .
      DATA: GT_SORT TYPE SLIS_SORTINFO_ALV.
      GT_SORT-UP = 'X'.
      GT_SORT-FIELDNAME = 'KOSTL'.
      GT_SORT-TABNAME  = 'IT_FINAL'.
      GT_SORT-SUBTOT  = 'X'.
      APPEND GT_SORT TO GD_SORT.
      CLEAR GT_SORT.
      GT_SORT-UP = 'X'.
      GT_SORT-FIELDNAME = 'BEZEICH'.
      GT_SORT-TABNAME  = 'IT_FINAL'.
      APPEND GT_SORT TO GD_SORT.
      CLEAR GT_SORT.
    ENDFORM.                    " BUILD_SORT1
    *&      Form  BUILD_EVENTS
          text
    -->  p1        text
    <--  p2        text
    FORM BUILD_EVENTS .
      IT_EVENT-NAME = 'TOP_OF_PAGE'.
      IT_EVENT-FORM = 'TOP_OF_PAGE'.
      APPEND IT_EVENT TO IT_EVENT1.
    CLEAR IT_EVENT.
    ENDFORM.                    " BUILD_EVENTS
    *&      Form TOP_OF_PAGE
          ALV TOP-OF-PAGE
    FORM TOP_OF_PAGE.                                           "#EC CALLED
      REFRESH : IT_LIST_TOP_OF_PAGE.
      CLEAR : IT_LINE.
      IT_LINE-TYP  = 'H'.
      IT_LINE-INFO = TEXT-001.
      APPEND IT_LINE TO IT_LIST_TOP_OF_PAGE.
      CLEAR IT_LINE.
      IF RADIO EQ 'X'.
        IT_LINE-TYP  = 'S'.
        IT_LINE-INFO  = TEXT-101.
        IF NOT FIPEX-LOW IS INITIAL.
          CONCATENATE TEXT-101 '-' FIPEX-LOW INTO IT_LINE-INFO SEPARATED BY SPACE.
          IF NOT FIPEX-HIGH IS INITIAL.
            CONCATENATE TEXT-101 '-' FIPEX-LOW 'to' FIPEX-HIGH INTO IT_LINE-INFO SEPARATED BY SPACE.
          ENDIF.
        ENDIF.
        APPEND IT_LINE TO IT_LIST_TOP_OF_PAGE.
        CLEAR IT_LINE-INFO.
        IT_LINE-INFO = TEXT-102.
        IF NOT RFISTL-LOW IS INITIAL.
          CONCATENATE TEXT-102 '-' RFISTL-LOW INTO IT_LINE-INFO SEPARATED BY SPACE.
          IF NOT RFISTL-HIGH IS INITIAL.
            CONCATENATE TEXT-102 '-' RFISTL-LOW 'to' RFISTL-HIGH INTO IT_LINE-INFO SEPARATED BY SPACE.
          ENDIF.
        ENDIF.
        APPEND IT_LINE TO IT_LIST_TOP_OF_PAGE.
      ENDIF.
      IF RADIO1 EQ 'X'.
        CLEAR IT_LINE-INFO.
        IT_LINE-INFO = TEXT-105.
        IF NOT KOSTL-LOW IS INITIAL.
          CONCATENATE TEXT-105 '-' KOSTL-LOW INTO IT_LINE-INFO SEPARATED BY SPACE.
          IF NOT KOSTL-HIGH IS INITIAL.
            CONCATENATE TEXT-105 '-' KOSTL-LOW 'to' KOSTL-HIGH INTO IT_LINE-INFO SEPARATED BY SPACE.
          ENDIF.
        ENDIF.
        APPEND IT_LINE TO IT_LIST_TOP_OF_PAGE.
        CLEAR IT_LINE-INFO.
        IT_LINE-INFO = TEXT-106.
        IF NOT HKONT-LOW IS INITIAL.
          CONCATENATE TEXT-106 '-' HKONT-LOW INTO IT_LINE-INFO SEPARATED BY SPACE.
          IF NOT HKONT-HIGH IS INITIAL.
            CONCATENATE TEXT-106 '-' HKONT-LOW 'to' HKONT-HIGH INTO IT_LINE-INFO SEPARATED BY SPACE.
          ENDIF.
        ENDIF.
        APPEND IT_LINE TO IT_LIST_TOP_OF_PAGE.
      ENDIF.
      CLEAR IT_LINE-INFO.
      IT_LINE-INFO = TEXT-103.
      IF NOT PERDE-LOW IS INITIAL.
        CONCATENATE TEXT-103 '-' PERDE-LOW INTO IT_LINE-INFO SEPARATED BY SPACE.
        IF NOT PERDE-HIGH IS INITIAL.
          CONCATENATE TEXT-103 '-' PERDE-LOW 'to' PERDE-HIGH INTO IT_LINE-INFO SEPARATED BY SPACE.
        ENDIF.
      ENDIF.
      APPEND IT_LINE TO IT_LIST_TOP_OF_PAGE.
      CLEAR IT_LINE-INFO.
      IT_LINE-INFO = TEXT-104.
      IF NOT RYEAR IS INITIAL.
        CONCATENATE TEXT-104 '-' RYEAR INTO IT_LINE-INFO SEPARATED BY SPACE.
      ENDIF.
      APPEND IT_LINE TO IT_LIST_TOP_OF_PAGE.
      CALL FUNCTION 'REUSE_ALV_COMMENTARY_WRITE'
        EXPORTING
          IT_LIST_COMMENTARY = IT_LIST_TOP_OF_PAGE.
    ENDFORM.                               "TOP_OF_PAGE
    *&      Form  DISPLAY_ALV_REPORT
          text
    -->  p1        text
    <--  p2        text
    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'
          IS_LAYOUT              = GD_LAYOUT
          IT_EVENTS              = IT_EVENT1[]
          IT_FIELDCAT            = FIELDCATALOG[]
          IT_SORT                = GD_SORT[]
        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.                    "DISPLAY_ALV_REPORT
    *&      Form  DISPLAY_ALV_REPORT1
          text
    -->  p1        text
    <--  p2        text
    FORM DISPLAY_ALV_REPORT1 .
      GD_REPID = SY-REPID.
      CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
        EXPORTING
          I_CALLBACK_PROGRAM     = GD_REPID
          I_CALLBACK_TOP_OF_PAGE = 'TOP_OF_PAGE'
          IS_LAYOUT              = GD_LAYOUT
          IT_EVENTS              = IT_EVENT1[]
          IT_FIELDCAT            = FIELDCATALOG[]
          IT_SORT                = GD_SORT[]
        TABLES
          T_OUTTAB               = IT_FINAL1
        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-MSG

  • Urgent: regarding ALV  report display problem

    hi,
    There are 3 problems:-
    1.) I had made a ALV report in which i have to display 'POSTING DATE' (iseg-budat) when we execute the report i.e. it should be displayed as  PERIOD :- _______  to _______ on alv report ..
    2.)the 2nd problem is dat when i use the '  wa_fieldcat-no_zero = 'X'.  It eliminates all the leading zeros which are present which is okay when i it displays material no.. but the problem is dat it also deletes the other fields where the values are to be zeros.
    i had used this FM:-
    CALL FUNCTION 'CONVERSION_EXIT_ALPHA_OUTPUT'
      EXPORTING
       INPUT = ITS1-MATNR
       IMPORTING
       OUTPUT = ITS1-MATNR.
    so that only matnr field are to be 0's.
    3.) I want to delete the rows which use to contain the values 0's as there are no calculations are performing as these are displayed .
    ANYbody having solution of this problem ,plzzzz provide the soluion of it as it is most urgent to me and dat person will definately rewarded.
    regards,
    ric.s

    hi kiran,
    thanks for ur response. here is d code which i am using it and plzz help me to figure out where i have to make changes:-
    REPORT  ZTEST03.
    TABLES: ISEG,MARA.
    TYPE-POOLS : SLIS.
    INTERNAL TABLE FOR INVENTORY STOCK *****************
    DATA: BEGIN OF ITS1 OCCURS 0,
          MATNR LIKE ISEG-MATNR,
          MEINS LIKE ISEG-MEINS,
          MENGE LIKE ISEG-MENGE,
          WRTZL LIKE ISEG-WRTZL,
          BUCHM LIKE ISEG-BUCHM,
          WRTBM LIKE ISEG-WRTBM,
          WERKS LIKE ISEG-WERKS,
          BUDAT LIKE ISEG-BUDAT,
          MTART LIKE MARA-MTART,
          ITEMDESC LIKE MAKT-MAKTX,
          DIFFQTY LIKE ISEG-BUCHM,
          DIFFVALUE LIKE ISEG-WRTBM,
          END OF ITS1.
    data: t_heading type slis_t_listheader.
    SELECTION-SCREEN BEGIN OF BLOCK PAR1 WITH FRAME TITLE TEXT-001.
    *********PARAMETERS*********
    PARAMETERS : PLANT LIKE ISEG-WERKS OBLIGATORY.
    *********SELECTION SCREEN OPTIONS*********
    SELECT-OPTIONS : R_DATE FOR ISEG-BUDAT,
                     M_TYPE  FOR MARA-MTART,
                     IT_M FOR MARA-MATNR.
    *********DEFINING VARIABLES*********
      SELECTION-SCREEN END OF BLOCK par1.
    TOP-OF-PAGE.
         PERFORM PG_HEADER.
    START-OF-SELECTION.
    SELECT DISTINCT A~MATNR A~MEINS A~MENGE A~WRTZL A~BUCHM A~WRTBM A~WERKS A~BUDAT B~MTART
       FROM ISEG AS A INNER JOIN MARA AS B ON B~MATNR = A~MATNR
         INTO CORRESPONDING FIELDS OF TABLE ITS1 WHERE B~MATNR = A~MATNR  AND B~MEINS = A~MEINS AND A~WERKS = PLANT AND A~BUDAT IN R_DATE AND B~MTART IN M_TYPE AND B~MATNR IN IT_M.
    CALL FUNCTION 'CONVERSION_EXIT_ALPHA_OUTPUT'
      EXPORTING
       INPUT = ITS1-MATNR
       IMPORTING
       OUTPUT = ITS1-MATNR.
      SORT ITS1 BY MATNR.
      DELETE ADJACENT DUPLICATES  FROM  ITS1 WHERE MENGE = 0 AND BUCHM = 0.
    LOOP AT ITS1.
         ITS1-DIFFQTY = ITS1-MENGE - ITS1-BUCHM.
         ITS1-DIFFVALUE = ITS1-WRTZL - ITS1-WRTBM.
         SELECT SINGLE MAKTX FROM MAKT INTO ITS1-ITEMDESC WHERE MATNR = ITS1-MATNR.
         MODIFY ITS1.
    ENDLOOP.
    PERFORM PRN_SMSTOCK_ALV.
    WRITING DATA FROM D TABLES**********
    FORM PG_HEADER.
    WRITE : 'PHYSICAL INVENTORY AUDIT REPORT             PLANT : ', PLANT.
    ENDFORM.
    *&      Form  PRN_SMSTOCK_ALV
          text
    -->  p1        text
    <--  p2        text
    form PRN_SMSTOCK_ALV .
    data: w_title   type lvc_title,
          w_repid   type syrepid,
          w_comm    type slis_formname,
          w_status  type slis_formname,
          x_layout  type slis_layout_alv,
          t_event    type slis_t_event,
          t_fieldcat type slis_t_fieldcat_alv,
          t_sort     type slis_t_sortinfo_alv.
    refresh t_fieldcat.
    refresh t_event.
    refresh t_sort.
    clear x_layout.
    clear w_title.
      perform set_fieldcat2 using:
    1  'MTART'     'MTART'     'MARA'  '15'  space 'MATERIAL TYPE'        space  space  space space space space space space SPACE t_fieldcat 'L' 'C',
    2  'MATNR'     'MATNR'     'MARA'  '13'  space 'MATERIAL NO. '        space  space  space space space space space space SPACE t_fieldcat 'R' 'C',
    3  'ITEMDESC'  'MAKTX'     'MAKT'  '25'  space 'MATERIAL DESCRIPTION' space  space  space space space space space space SPACE t_fieldcat 'L' 'C',
    4  'MEINS'     'MEINS'     'MARA'  '5'   space 'UOM'                  space  space  space space space space space space SPACE t_fieldcat 'C' 'C',
    5  'MENGE'     'MENGE'     'ISEG'  '13'  space 'ORG.INV.QTY'          space  space  space space space space space space SPACE t_fieldcat 'R' 'C',
    6  'WRTZL'     'WRTZL'     'ISEG'  '13'  space 'ORG.INV.VALUE'        space  space  space space space space space space SPACE t_fieldcat 'R' 'C',
    7  'BUCHM'     'BUCHM'     'ISEG'  '13'  space 'PHY.INV.QTY'          space  space  space space space space space space SPACE t_fieldcat 'R' 'C',
    8  'WRTBM'     'WRTBM'     'ISEG'  '13'  space 'PHY.INV.VALUE'        space  space  space space space space space space SPACE t_fieldcat 'R' 'C',
    9  'DIFFQTY'   'MENGE'     'ISEG'  '13'  space 'DIFF.INV.QTY'         space  space  space space space space space space SPACE t_fieldcat 'R' 'C',
    10 'DIFFVALUE' 'WRTZL'     'ISEG'  '13'  space 'DIFF.INV.VALUE'       space  space  space space space space space space SPACE t_fieldcat SPACE 'P'.
    x_layout-zebra = 'X'.
    perform set_top_page_heading using t_heading t_event.
    perform set_events using t_event.
      w_status = ''.
      w_repid = sy-repid.
      w_comm   = 'USER_COMMAND'.
      call function 'REUSE_ALV_GRID_DISPLAY'
        exporting
          i_callback_program       = w_repid
          it_fieldcat              = t_fieldcat
          i_Callback_top_of_page   = 'Top-of-page'
          is_layout                = x_layout
          it_sort                  = t_sort
          i_callback_pf_status_set = w_status
          i_callback_user_command  = w_comm
          i_save                   = 'X'
          it_events                = t_event
          i_grid_title             = w_title
          tables
          t_outtab                 = ITS1
        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.
    FORM set_fieldcat2 USING
          p_colpos p_fieldname p_ref_fieldname p_ref_tabname
          p_outputlen p_noout
          p_seltext_m p_seltext_l p_seltext_s p_reptext_ddic p_ddictxt
          p_hotspot p_showasicon p_checkbox p_edit
          p_dosum
          t_fieldcat TYPE slis_t_fieldcat_alv
          P_JUST
          P_FTYPE.
      DATA: wa_fieldcat TYPE slis_fieldcat_alv.
      CLEAR wa_fieldcat.
    General settings
      wa_fieldcat-fieldname = p_fieldname.
    wa_fieldcat-no_zero = 'X'.
      wa_fieldcat-col_pos = p_colpos.
      wa_fieldcat-no_out = p_noout.
      wa_fieldcat-hotspot = p_hotspot.
      wa_fieldcat-checkbox = p_checkbox.
      wa_fieldcat-icon = p_showasicon.
      wa_fieldcat-do_sum = p_dosum.
    Set output length.
      IF NOT p_outputlen IS INITIAL.
        wa_fieldcat-outputlen = p_outputlen.
      ENDIF.
    Set text headers.
    IF NOT p_seltext_m IS INITIAL.
        wa_fieldcat-seltext_m = p_seltext_m.
    ENDIF.
    IF NOT p_seltext_l IS INITIAL.
        wa_fieldcat-seltext_l = p_seltext_l.
    ENDIF.
    IF NOT p_seltext_s IS INITIAL.
        wa_fieldcat-seltext_s = p_seltext_s.
    ENDIF.
      IF NOT p_reptext_ddic IS INITIAL.
        wa_fieldcat-reptext_ddic = p_reptext_ddic.
      ENDIF.
    IF NOT p_ddictxt IS INITIAL.
        wa_fieldcat-ddictxt = p_ddictxt.
    ENDIF.
      IF NOT P_JUST IS INITIAL.
        WA_FIELDCAT-JUST = P_JUST.
      ENDIF.
    Set as editable or not.
      IF NOT p_edit IS INITIAL.
        wa_fieldcat-input     = 'X'.
        wa_fieldcat-edit     = 'X'.
      ENDIF.
      APPEND wa_fieldcat TO t_fieldcat.
    ENDFORM.                   "set_fieldcat2
    ======================== Subroutines called by ALV ================
    *&      Form  top_of_page
          Called on top_of_page ALV event.
          Prints the heading.
    form top_of_page.
      call function 'REUSE_ALV_COMMENTARY_WRITE'
         exporting
              it_list_commentary = t_heading.
    ENDFORM.
    form set_top_page_heading using t_heading type slis_t_listheader
                                    t_events  type slis_t_event.
    data: x_heading type slis_listheader,
          x_event   type line of slis_t_event.
    Report title
      clear t_heading[].
      clear x_heading.
      x_heading-typ = 'H'.
      x_heading-info = 'PHYSICAL INVENTORY AUDIT REPORT'.
      append x_heading to t_heading.
    Plant Name
    clear x_heading.
      x_heading-typ = 'S'.
      x_heading-key = 'PLANT: '.
      x_heading-info = its1-werks.
      append x_heading to t_heading.
    Posting Date
    *clear x_heading.
    x_heading-typ = 'S'.
    x_heading-key = 'POSTING DATE: '.
    x_heading-info = ITS1-BUDAT.
    append x_heading to t_heading.
    Control Date
    clear x_heading.
    x_heading-typ = 'S'.
    x_heading-key = 'CONTROL No: '.
    x_heading-info = its1-werks.
    append x_heading to t_heading.
    Control date
    clear x_heading.
    x_heading-typ = 'S'.
    x_heading-key = 'CONTROL DATE: '.
    x_heading-info = its1-werks.
    append x_heading to t_heading.
    User who is running the report
    clear x_heading.
    x_heading-typ = 'S'.
    x_heading-key = 'User: '.
    x_heading-info = sy-uname.
    append x_heading to t_heading.
    Date of execution
      clear x_heading.
      x_heading-typ = 'S'.
      x_heading-key = 'Date: '.
      write sy-datum to x_heading-info.
      append x_heading to t_heading.
    Time of execution
      clear x_heading.
      x_heading-typ = 'S'.
      x_heading-key = 'Time: '.
      write sy-uzeit to x_heading-info.
      append x_heading to t_heading.
    Top of page event
      x_event-name = slis_ev_top_of_page.
      x_event-form = 'TOP_OF_PAGE'.
      append x_event to t_events.
    endform.
    form set_events using t_events type slis_t_event.
    data: x_event   type line of slis_t_event.
    endform.
    plzzz help me out as it is most urgent to me.
    regards,
    ric.s

  • Regarding the simple ALV report

    Hi All,
    I created the simple code for disply of the alv report the code is provided below,but the output is showing only the column heading not the data in the grid, i won't came to know where the problem is please find the problem in the code.
    Regards
    Sai
    ********sample code**********
    type-pools : slis.
    data : b_display type slis_t_fieldcat_alv,
           w_display type slis_fieldcat_alv.
    data : begin of itab_display occurs 0,
            kunnr type kna1-kunnr,
            name1 type kna1-name1,
            end of itab_display.
    data : gd_repid like sy-repid.
          itab_display-name1 = 'ram'.
          itab_display-kunnr = '10000033242'.
          append itab_display.
          clear itab_display.
          itab_display-name1 = 'sai'.
          itab_display-kunnr = '10000033243'.
          append itab_display.
          clear itab_display.
       w_display-col_pos = 0.
       w_display-fieldname = 'name1'.
       w_display-seltext_m = 'name'.
       append w_display to b_display.
       clear w_display.
       w_display-col_pos = 1.
       w_display-fieldname = 'kunnr'.
       w_display-seltext_m = 'cus.no'.
       append w_display to b_display.
       clear w_display.
    gd_repid  = sy-repid.
    CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
    EXPORTING
      I_CALLBACK_PROGRAM  = gd_repid
      IT_FIELDCAT       = b_display[]
      I_SAVE            = 'X'
      TABLES
        t_outtab       =  itab_display.

    Hi,
    Please use the following code.
    type-pools : slis.
    data : b_display type slis_t_fieldcat_alv,
    w_display type slis_fieldcat_alv.
    data : begin of itab_display occurs 0,
    kunnr type kna1-kunnr,
    name1 type kna1-name1,
    end of itab_display.
    data : gd_repid like sy-repid.
    itab_display-name1 = 'ram'.
    itab_display-kunnr = '10000033242'.
    append itab_display.
    clear itab_display.
    itab_display-name1 = 'sai'.
    itab_display-kunnr = '10000033243'.
    append itab_display.
    clear itab_display.
    w_display-col_pos = 0.
    w_display-fieldname = 'NAME1'.
    w_display-tabname = ITAB_DISPLAY.
    w_display-seltext_m = 'Name'.
    w_display-ddictxt   = 'M'.
    append w_display to B_DISPLAY.
    w_display-col_pos = 1.
    w_display-fieldname = 'KUNNR'.
    w_display-tabname = ITAB_DISPLAY.
    w_display-seltext_m = 'cus.no'.
    w_display-ddictxt   = 'M'.
    append w_display to B_DISPLAY.
    gd_repid = sy-repid.
    CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
    EXPORTING
    I_CALLBACK_PROGRAM = gd_repid
    IT_FIELDCAT = b_display[]
    I_SAVE = 'X'
    TABLES
    t_outtab = itab_display[].
    Regards,
    Sankar.

Maybe you are looking for

  • Issue while loading data from DSO to Cube

    Gurus, I'm facing a typical problem while loading Cube from a DSO. The load is based upon certain conditions. Though the data in DSO satisfies those condition, but the Cube is still not being loaded. All the loads are managed through Process Chains.

  • How do i transfer music from pc to macbook?

    Need to transfer my iTunes library from PC to Macbook. Help?

  • How can i create a native procedure??

    Hi all, How can i create a native procedure in Oracle 8.1.7??? P.S.: Without using OCI. thanx.

  • 'is between' used in Dashboard Prompt

    I have two columns used in the Dashboard prompt: 1. Department Description: Based on Department ID (In the BMM Layer, the descriptor column is Department ID) 2. Employee Name: Based on Employee ID (In the BMM Layer, the descriptor column is Employee

  • Web Dynpro table row selection

    All, I have a table that I have built from a Bapi return after a search method within my application.  However, I display the table but when I select a row in the table all the results disappear.  The table skeleton is still there however. Also I kno