Checkbox in classic report

I have question about checkbox in classic report.
I need to choose only one checkbox in every row, hot to ensure that only one checkbox can be checked at same time?
Checkboxes are defined in SQL query as:
apex_item.checkbox(1,msisdn,'UNCHECKED') as clear,
apex_item.checkbox(2,msisdn,'UNCHECKED') as to_analysis,
apex_item.checkbox(3,msisdn,'UNCHECKED') as to_barring
here is the picture:
http://www.deviantpics.com/images/mNgGR.jpg
Tnx!

amend your api calls to add onclick event to every checkbox column
   apex_item.checkbox(1,msisdn,'UNCHECKED onclick="chkckbox(1,this);"' ) as clear,
   apex_item.checkbox(2,msisdn,'UNCHECKED  onclick="chkckbox(2,this);"') as to_analysis,
   apex_item.checkbox(3,msisdn,'UNCHECKED  onclick="chkckbox(3,this);"') as to_barringCreate a javascript function in your page header > Javascript
function chkckbox(pId, pThis) {
//get current row index
    var currIndex = $('input[name="f0'+pId+'"]').index(pThis);
     if (pThis.checked) {
   //simply uncheck other check boxes
          if (pId == 1) {
               $('select[name="f02"]')[currIndex].checked = false;
               $('select[name="f03"]')[currIndex].checked = false;
          } else if (pId == 2) {
               $('select[name="f01"]')[currIndex].checked = false;
               $('select[name="f03"]')[currIndex].checked = false;
          } else if (pId == 3) {
               $('select[name="f02"]')[currIndex].checked = false;
               $('select[name="f03"]')[currIndex].checked = false;
}Please note that I have not tested this code but it should work, if you have any problem just try debugging using console.log

Similar Messages

  • How to put checkbox into classical report header row?

    Hi,
    I have a classical report that has a check item as a first column. I would like to put a check box item into the header row too, When checked it is supposed to set the check box item in all report rows. Something like in APEX Shared components / Links / Grid Edit.
    Is this possible to do? TIA.
    Tamas

    Hi,
    See e.g. this post
    Re: Tabular form check all checkbox header
    Regards,
    Jari

  • Checkbox in classical report

    Hi all,
          I have create an internal table it_tab
    data: begin of it_tab occurs 0,
                chq(1) type C,
                matnr like mara-matnr,
             endof it_tab.
    Thus while displaying I have written as
    loop at it_tab.
    Write:/ it_tab-chq as checkbox, it_tab-matnr.
    endloop.
    There is a button on the Menu which I have created. When I click on the button
    I want to fetch all the material no whose checkbox is selected by me.
    For this I have used
    at user-command, However in the internal table it_tab the (chq) field is blank even after I have selected all the checkboxes on the output screen . Is there any way that could pass on the data from the screen into the internal table and then we could process the selected lines?.
    Thanks in Adv

    Have a look at the code...
    You can have a look at this code :
    REPORT ZRAVI_CHECKBOXES_IN_REPORT .
    *Creating checkboxes in report
    tables : ZRAVI_DEPT.
    data : counter type i,
    pick,
    it_dept like ZRAVI_DEPT occurs 0 with header line.
    top-of-page.
    format color col_heading.
    write at 5 'Dept code'.
    write at 35 'Department'.
    format color off.
    start-of-selection.
    set pf-status 'BASIC'.
    perform write_report.
    top-of-page during line-selection.
    case sy-pfkey.
    when 'SELECT'.
    write 'Selected department list'.
    uline.
    format color 6 inverse on.
    write at 5 'Dept code'.
    write at 35 'Department'.
    format color off inverse off.
    endcase.
    at user-command.
    case sy-ucomm.
    when 'EXIT'.
    leave program.
    when 'SHOW'.
    set pf-status 'SELECT'.
    SY-LSIND = 1.
    window starting at 15 2 ending at 80 15.
    do counter times.
    read line sy-index.
    if sy-lisel(1) = 'X'.
    Sy-lisel contains contents of the selected line
    select single * from ZRAVI_DEPT where dept_code =
    it_dept-dept_code.
    write : /5 zravi_dept-dept_code,
    35 zravi_dept-department.
    endif.
    enddo.
    when 'BACK'.
    sy-lsind = 0.
    perform write_report.
    endcase.
    *& Form WRITE_REPORT
    text
    --> p1 text
    <-- p2 text
    FORM WRITE_REPORT.
    SELECT * FROM zravi_dept into it_dept.
    write : / pick as checkbox,
    5 it_dept-dept_code,
    35 it_dept-department.
    hide it_dept-dept_code.
    endselect.
    counter = sy-dbcnt + 1. "For header data.
    ENDFORM. " WRITE_REPORT
    Gopi Narendra  
    Posts: 735
    Questions: 10
    Registered: 5/22/06
    Forum points: 944 
       Re: checkbox on interactie list  
    Posted: 25.09.2006 11:42 ?????????    in response to: maui bayog       Reply      E-mail this post 
    Hi
    Check if this is included or not
    Calling of the Function Module should be given the user command
    call function 'REUSE_ALV_LIST_DISPLAY'
    exporting
    I_CALLBACK_PROGRAM = SY-REPID
    IS_LAYOUT = IS_LAYOUT
    IT_FIELDCAT = IT_FIELDCAT
    I_CALLBACK_USER_COMMAND = 'USER_COMMAND' IT_EVENTS = IT_EVENTS
    I_SAVE = C_ISAVE
    tables
    T_OUTTAB = IT_OUTPUT
    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.
    Check............
    checkbox on interactie list

  • Adding the Checkbox for each row in classic report

    Hello,
    I have created classic report with checkboxes in each row and added the On-Submit process, BUTTON CONDITIONAL, to determine the behavior of the checkboxes. The PL/SQL process is suppose to delete the selected row from database.
    I am getting the Success message, but When I check the database, the row still persist in the database.
    PLSQL CODE:
    FOR i IN 1..apex_application.g_f01.count LOOP
    DELETE 
    FROM
      registry 
    WHERE
      reg_id = apex_application.g_f01(i);END LOOP;
    ORACLE APEX: 4.2
    Thank you

    Hi ApexNewLearner,
    Try this
    DECLARE
    j number;
    BEGIN
    FOR i IN 1..apex_application.g_f01.count LOOP
      j := apex_application.g_f01(i);
      DELETE FROM  registry
      WHERE  reg_id = apex_application.g_f01(j);
    END LOOP;
    END;
    or better try to replicate your issue on apex.oracle.com , that is easy for users to investigate the issue and give you appropriate solution.
    Hope this helps you,
    Regards,
    Jitendra

  • How to Get checkbox value when List value changed in classic report

    hi ,
    i worked with apex 4.2 and i create normal classic report with one checkbox column and one column change it to select list(named loved) now i want when user change list
    take value of checkbox item and show it in message .
    SQL for report
    SELECT
    '<INPUT TYPE="checkbox" NAME="f01" VALUE="'
    ||SEQ
    ||'">' SEQ,
    ID,
    DEPT_NO,
    EMP_NAME} i change the column attributes of Dept_NO to Display as Select list of department name (named lov).
    now i want when user change name of department the value of SEQ SHOW IN ALERT MESSAGE
    i create JavaScript on the page
    function test(pThis) {
    var f01_value = $('select[name="f01"]').value;
    alert('#SEQ : '+ f01_value);
    </script>
    I call this javascript function when list change but the value undefined..
    My Question :
    How can get this value Or any value of item in reports
    regards
    Ahmed

    Hi Ahmed,
    >
    i worked with apex 4.2 and i create normal classic report with one checkbox column and one column change it to select list(named loved) now i want when user change list
    take value of checkbox item and show it in message .
    SQL for report
    SELECT
    '<INPUT TYPE="checkbox" NAME="f01" VALUE="'
    ||SEQ
    ||'">' SEQ,
    ID,
    DEPT_NO,
    EMP_NAME} i change the column attributes of Dept_NO to Display as Select list of department name (named lov).
    >
    You should not create checkboxes like this. Either use the APEX_ITEM.CHECKBOX2 API or change the Column Type to Simple Checkbox.
    >
    now i want when user change name of department the value of SEQ SHOW IN ALERT MESSAGE
    i create JavaScript on the page
    function test(pThis) {
    var f01_value = $('select[name="f01"]').value;
    alert('#SEQ : '+ f01_value);
    </script>
    >
    name="f01" returns an array, what you need is single element value.
    Try
    <script type="text/javascript>
    function test(pThis) {
      var f01_value = $v(pThis);
       alert('#SEQ : '+ f01_value);
    </script>
    {code}
    {quote}
    I call this javascript function when list change but the value undefined..
    My Question :
    How can get this value Or any value of item in reports
    {quote}
    Depends in how you are invoking/triggering the change event. Are you using DA or have you written an "onchange" event on the element?
    Cheers,                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   

  • In classical report list output  checkbox is value is not changed

    Hi Abapers,
      I am developing one classical  report program, out put list hast one check box.
      I need to read wheather checkbox is checked or not dynamically .
      but the check box value is not changed  if I check or uncheck How can I  
      solve this problem.
      Regards.
       Shashikumar.G

    Hi Abapers,
    I codded as.
    DATA: CHKBOX TYPE C.
    WRITE: CHKBOX AS CHECKBOX INPUT ON.
    it will be displayd on output list  if click on it It will be ticked or unticked it is fine.
    but the value of chkbox is not changed.
    but I need to change the value of chkbox regarding to clicking on it(check, uncheck).
    Regards,
    Shashikumar.G

  • Getting selected row values of a classic report

    Hi Guys,
    i'm using Apex 4.1,
    I have a classic report on my apex page. First column of this report is check box for row selection. and its binded to primary key of a table. i know that i can get the selected row's primary key (Check box value) using APPLICATION_ITEM.G_FO1() function. What i need is how can i get the other cell values of the selected row ?
    Appreciate if someone can help on this,
    Thanks.

    Apex-Ape wrote:
    i'm using Apex 4.1,
    I have a classic report on my apex page. First column of this report is check box for row selection. and its binded to primary key of a table. i know that i can get the selected row's primary key (Check box value) using APPLICATION_ITEM.G_FO1() function. What i need is how can i get the other cell values of the selected row ?If you really have a report with just one checkbox column and the rest of the data standard read-only report columns then it's not clear exactly what the requirement is. What do you want to do with them when you get them?
    I can think of 2 possible approaches:
    <li>Stick with the current report. On page submit you get an array of zero or more PKs. Create a collection with a row containing each PK. Whatever it is that you want to do next can then use a query that is a clone of the original report query plus a join to the PK values in the collection.
    <li>Recreate the report with shadow <tt>apex_item.hidden</tt> columns in the query for each value. In the report column attributes, do not display the <tt>apex_item.hidden</tt> columns, but include them with each displayed column (or stuff them all into one column for convenience) using HTML Expressions. The values will then be available in <tt>apex_application.g_fxx</tt> arrays like the row selector checkbox.
    I prefer the first one, but really it depends on what the next step is...
    (If it's actually a tabular form then the values will be in other <tt>apex_application.g_fxx</tt> arrays.)

  • How to delete multiple row in classic report.

    Dear Friends,
    i am using 4.1 ve.
    i have created classic report.i want to delete row .
    How can i do it.
    i need check box in classic report and if i select multiple check box then row should delete and before delete pop up should be pop up to confirmation to delete.
    How can i do it.
    Thanks

    Hi Vedant,
    here you have one advanced example:
    http://www.talkapex.com/2009/01/apex-report-with-checkboxes-advanced.html
    But you can do it easier using only apex_item.checkbox (creating one column in report query with this function).
    After you submit this page the value will be stored to apex_application.g_f0X variable where X is equal to p_idx param of function apex_item.checkbox.
    Note: only checked values will be stored.
    Br,
    Marko Goricki
    http://apexbyg.blogspot.com

  • Apex 4.0.1 classic report export

    Hello once again all you Application Express experts.
    I am having some difficulty getting an apex classic report to export the results of the report grid.
    This is a classic report being run, not interactive.
    It is also as an SQL Query (PL/SQL function body returning sql query) for the report identification type.
    The function body is of decent size, maybe 200 lines at most, but i have narrowed it down a couple of problematic lines.
    The report runs perfectly when I take out the follow line from the function...
    v_return := v_return || 'AND instr('':'' || ''' || :p3_status || ''' || '':'','':'' || xel.employment_status || '':'') > 0 ';
    So :p3_status is a checkbox item on the page, with three options: Active, Terminated, Retired.
    In the repeatable failure scenario :p3_status = 'Active'.
    One of the interesting parts is the report grid always returns the right results to the screen, it is just the report export that fails.
    It never errors, it just returns a no data response to the file being exported.
    This is Application Express v 4.0.1 running on Oracle Database 10g Enterprise Edition Release 10.2.0.3.0 - 64bit.
    Any thoughts or any troubleshooting hints anyone can provide?
    Thanks,
    Hayden

    Hayden,
    Why do u need to append the item value in the PLSQL function body when apex will take of that(using its bind value).
    Your predicate is actually a static one since only the item value changes (and that can be handled by its bind value). So avoid concatenating it in the function body to build the clause(which has the additional problem of passing in the item value to the function)
    Change it to
    v_return := v_return || q'!AND INSTR(':'||:p3_status||':',xel.employment_status) > 0!';
    Notice that the :p3_status item evaluation happens only in the apex page
    Also making use of the q function to escape quotes, it makes life much more easier in these cases.

  • Enter command in Classical Report

    Hi ,
      I have a classical report with one of the fields editable , when the user modifed  one of the rows and presses enter i want to do some processing , how can this be implemeted. i.e. how can i handle ENTER command in a classical report.
    Regards,
    Arun

    Hi Arun,
              You have to set your own GUI staus and then set the function code for enter key in Function key of the GUI STATUS  .After that write the code in At user-command event to handle the user-input in the list.
    The following code change the color of the list line in which user has entered the telephone no for vendor.
    START-OF-SELECTION.
      SET PF-STATUS 'GUI_LIST1'.
      SELECT * FROM lfa1 INTO TABLE it_lfa1 WHERE lifnr IN s_lifnr.
       FORMAT COLOR 2 ON.
      LOOP AT it_lfa1 INTO x_lfa1.
        val = sy-tabix MOD 2.
        IF val = 0.
          FORMAT INTENSIFIED ON.
        ELSE.
          FORMAT INTENSIFIED OFF.
        ENDIF.
        WRITE :/2 x_lfa1-sel AS CHECKBOX,6 x_lfa1-lifnr,17 x_lfa1-name1,
         46 x_lfa1-telf1 INPUT.
        HIDE: x_lfa1-sel,x_lfa1-lifnr.
      ENDLOOP.
    AT USER-COMMAND.
    CASE sy-ucomm .
        WHEN 'ENTER'.
          CLEAR cnt.
          DO.
            READ LINE sy-index FIELD VALUE x_lfa1-sel x_lfa1-lifnr x_lfa1-telf1.
            IF sy-subrc = 0 .
        MODIFY LINE sy-index FIELD VALUE x_lfa1-sel LINE FORMAT COLOR 4   INTENSIFIED ON.     
            ELSE.
              EXIT.
            ENDIF.
        ENDDO. 
      ENDCASE.

  • Problem in getting previous screen in Classic report.

    Hello everyone,
                          I am facing a serious problem in getting the previous screen in classical report.
    let me tell you in detail.
    When i run the report, i will have a selection screen with some checkboxes and select-options. Now in the report i have functionality to get some more select-options from user selection. Here i am calling the pop-up screen, wherein if user selects checkboxes, then those fields will be visible on the default selection screen.
    To display them i am using Modif-id concept. Depending on the checkbox values, i am setting up the variables. Using those variables i am modifying screen.
    Now suppose user has got some extra fields and run the report. It will get the output in the desired format.
    Now the problem is when i am pressing 'BACK' button on the report output. The fields which are appended using modif-id are getting cleared. After that what i have is only the default selection-screen.
    I want those fields to be restored. How do i go for it. Please help me out.
    thanks in advance.

    Hi thanks for reply.
                               Actually code is too big to post. But have you understood my problem. Some part of code ia am sending.
    AT SELECTION-SCREEN OUTPUT.
    IF SY-UCOMM <> 'ONLI' AND SY-UCOMM <> 'FLDS' AND SY-UCOMM <> 'OK' AND
    SY-DYNNR <> '0100' AND SY-UCOMM = ' '.
      LEAVE TO SCREEN 1000.
    ENDIF.
    Now i want to know, whether i could get bcak those fields which which are appended using Modif-id,
    how do i get the information about screen fiedls which was there after leaving the screen.
    Thanks.

  • Reading check boxi n a multiline classical report...

    hi,
    in my report, i have multiline data displayed...like for e.g.
    first line displays shipment data, second line is a continuation of shipment data. third line is a header line to show deliveries under that shipment, fourth line shows the deliveries , one per line and then next shipment and so on.
    now the first line of every shipment has a checkbox displayed.
    when the user finally chooses to print this report, i need to read only those shipments that are selecte by user and process only them.
    this is a simple classical report. please tell me how to write the code to capture the checkbox selection.
    thks

    Please don't duplicate the Post: handling check box in a report...
    Logic for Reading Checkbox values will remain same as per my reply in your previous post.
    The only thing you have to make sure is, don't write anything under the Checkbox field... Generally, in this type of requirement you should write your Checkbox in 1st or 2nd place and than start all your data from 5th place onwards.
    Regards,
    Naimesh Patel

  • Refresh Classical report/basic list

    Hi,
    I have created a classical report/basic list where user can select check boxes and adjacent rows should be deleted. But after the action, I wish to refresh the report and remove the selected lines from displaying.
    Please let me know how to achieve this.
    Thanks in advance.
    Nitin

    Hi Nitin,
    Check the following program.
    Here on pressing the delete push button(FCODE: DELETE) it will delete all
    rows which has adjacent checkboxes checked.
    REPORT ztest_list_processing NO STANDARD PAGE HEADING .
    TYPES: BEGIN OF ty_tab,
           delete,
           f1(3) TYPE c,
           f2(3) TYPE c,
           f3(3) TYPE c,
           END OF ty_tab.
    DATA: it_tab TYPE TABLE OF ty_tab,
          wa_tab TYPE ty_tab.
    DATA: w_delete TYPE c,
          w_lines TYPE i,
          w_ind TYPE i.
    wa_tab-f1 = '111'.
    wa_tab-f2 = 'ABC'.
    wa_tab-f3 = '123'.
    APPEND wa_tab TO it_tab.
    wa_tab-f1 = '222'.
    wa_tab-f2 = 'DEF'.
    wa_tab-f3 = '456'.
    APPEND wa_tab TO it_tab.
    wa_tab-f1 = '333'.
    wa_tab-f2 = 'GHI'.
    wa_tab-f3 = '789'.
    APPEND wa_tab TO it_tab.
    wa_tab-f1 = '444'.
    wa_tab-f2 = 'JKL'.
    wa_tab-f3 = '987'.
    APPEND wa_tab TO it_tab.
    wa_tab-f1 = '555'.
    wa_tab-f2 = 'MNO'.
    wa_tab-f3 = '654'.
    APPEND wa_tab TO it_tab.
    SET PF-STATUS '100'. "Contains Delete button
    PERFORM print_output.
    "Logic which you can implement
    AT USER-COMMAND.
      CASE sy-ucomm.
        WHEN 'DELETE'.
          DESCRIBE TABLE it_tab LINES w_lines.
          DO w_lines TIMES. "To read all rows
            CLEAR: wa_tab.
            READ LINE w_ind FIELD VALUE wa_tab-delete
                                           wa_tab-f1. "Getting the values
            IF wa_tab-delete EQ 'X'. "Delete when check box is 'X'
              DELETE it_tab WHERE f1 = wa_tab-f1.
            ENDIF.
            ADD 1 TO w_ind."Index for next line
          ENDDO.
          IF it_tab IS INITIAL.
            WRITE: / 'There are no data in the table'.
          ELSE.
            PERFORM print_output. "Reprint the updated data(like refreshing)
          ENDIF.
          "Modified the existing Back button in standard Toolbar so that on
          "pressin the back button it will come to program and not to
          "previous displayed list
        WHEN '&BACK'.
          LEAVE SCREEN.
      ENDCASE.
    *&      Form  print_output
    *       text
    *  -->  p1        text
    *  <--  p2        text
    FORM print_output.
      LOOP AT it_tab INTO wa_tab.
        WRITE:/ wa_tab-delete AS CHECKBOX INPUT ON, "Display as checkbox
              wa_tab-f1,
              wa_tab-f2,
              wa_tab-f3.
        IF sy-tabix EQ 1.
          w_ind = sy-linno. "Get the line position of first row
        ENDIF.
      ENDLOOP.
    Hope this helps you.
    Regards,
    Manoj Kumar P

  • How to set the field non-editable in the classical report..

    Hi..
              How to set the field non-editable in the classical report..

    Hi experts,
    For the component 'ICCMP_EMP_SRCH' there is a view 'BUPAEMPSEARCH' , which has 2 context nodes 'CUSTOMER' AND 'SEARCHEMPLOYEE' , i need to add the field 'NICKNAME' which is part of the 'CUSTOMER' context node on the search screen. Currrently all the fields on the screen screen are from the 'SEARCHEMPLOYEE' context node. when i did the configuration , the 'NICKNAME' field is greyed out . I have already generated the Getter ,Setter , GET_I, GET_M methods for the 'NICKNAME' field and the context node and controller class and context class are all active .
    on debugging the GET_I method, i see that rv_disabled = 'TRUE' and the current = collection_wrapper->get_current( ) is returning empty value .
    for this rv_disabled to be set false , the code below is not triggered since there is no value in current.
    IF current->is_property_readonly(
    'NICKNAME' ) = abap_false. "#EC NOTEXT
    rv_disabled = 'FALSE'.
    ENDIF.
    when i check for other search fields of context node 'SEARCHEMPLOYEE' , all the fields are set to rv_disabled = 'FALSE'.
    can anyone suggest how to approch this. iam i missing any binding between context nodes or any activations ?
    The field properties are set as Input field and the display checkbox is not checked.

  • Totals in classical report

    Hi,
    Please tell how to get totals of a field in classical report.
    please help with sample code.
    thanks in advance.

    HI,
    refer the code:
    reward fi help ful
    Umakanth
    *& Report  ZSD_SALES_INTER_REPORT1
    REPORT  ZSD_SALES_INTER_REPORT1  NO STANDARD PAGE HEADING MESSAGE-ID ZMSG44
                                        LINE-SIZE 230 LINE-COUNT 65(3).
                                Tables
    TABLES : VBKD,VEPVG.  "Sales document business data
                          "Delivery Index
                             Internal table
    DATA : BEGIN OF I_SALES OCCURS 0,
              CH TYPE CHECKBOX,
              VBELN LIKE VBAK-VBELN,                                                               "Sales document no
              NETWR LIKE VBAK-NETWR,                                                        "Net value of the sales order in Document currency
              WAERK LIKE VBAK-WAERK,                                                               "SD Document currency
              MATNR LIKE VBAP-MATNR,                                                               "Material no
              AUDAT LIKE VAPMA-AUDAT,                                                              "DOCUMENT DATE
           END OF I_SALES .
    data : NEWSALES LIKE I_SALES OCCURS 0 WITH HEADER LINE.
    DATA : AMOUNT LIKE VBAK-NETWR.
    DATA : V_LIN TYPE I .                                                                    "Screens vertical cursor position at PAI
    DATA : CHECKBOX TYPE C.
    DATA : DATE LIKE VAPMA-AUDAT.
    DATA : V_SEL LIKE SY-LISEL.
                             SELECTION-SCREEN
    SELECTION-SCREEN BEGIN OF BLOCK B1 WITH FRAME TITLE TEXT-001.
        PARAMETERS : P_VKORG LIKE VEPVG-VKORG. "value check .                                        "Sales organization
        PARAMETERS : P_VTWEG LIKE VEPVG-VTWEG ."value check.                                         "Distribution channel
        PARAMETERS : P_SPART LIKE VEPVG-SPART ."Value check.                                         "Division
       SELECT-OPTIONS : S_DATE FOR VBKD-BSTDK DEFAULT SY-DATUM TO SY-DATUM  OBLIGATORY.
    SELECTION-SCREEN END OF BLOCK B1.
    SELECTION-SCREEN BEGIN OF BLOCK B2 WITH FRAME TITLE TEXT-002.
      SELECTION-SCREEN BEGIN OF LINE.
        PARAMETERS : CHK AS CHECKBOX .
        selection-screen comment 5(20) text-003 for field chk.
      SELECTION-SCREEN END OF LINE.
      PARAMETERS : P_KUNNR LIKE VBPA-KUNNR MODIF ID S2.                                               "Customer
    SELECTION-SCREEN END OF BLOCK B2.
    START-OF-SELECTION.
    set pf-status 'UKG9'.
      IF CHK <>  'X'.
         IF P_VKORG  <> ''.
           PERFORM ORGANIZATION.
         ELSE.
           PERFORM ORGANIZATION_ELSE.
         ENDIF.
      ELSE.
        IF P_VKORG  <> ''.
           PERFORM CUST_ORGA.
         ELSE.
           PERFORM CUST_ORGA_ELSE.
         ENDIF.
    ENDIF.
    Displaying the contents with some alterations
    sort i_sales by AUDAT.
    LOOP AT I_SALES.
        WRITE : / I_SALES-CH,I_SALES-VBELN,I_SALES-NETWR,I_SALES-WAERK,I_SALES-MATNR,I_SALES-AUDAT.
    ENDLOOP.
    WRITE : / '******************************************************************************************'.
    LOOP AT I_SALES.
       ON CHANGE OF I_SALES-AUDAT.
          IF SY-TABIX = 1.
             WRITE :  / SY-VLINE,I_SALES-CH AS CHECKBOX,I_SALES-AUDAT.
             CLEAR AMOUNT.
          ELSE.
             WRITE : SY-VLINE,AMOUNT,60 sy-vline,/ SY-VLINE,I_SALES-CH AS CHECKBOX,I_SALES-AUDAT.
             CLEAR AMOUNT.
          ENDIF.
       ENDON.
       AMOUNT = AMOUNT + I_SALES-NETWR.
       AT LAST.
          WRITE : SY-VLINE,AMOUNT,60 sy-vline.
          uline at /2(60).
         ULINE.
          SUM.
          FORMAT COLOR  = 3.
          WRITE : /'TOTAL AMOUNT: ' ,I_SALES-NETWR UNDER AMOUNT .
       ENDAT.
    ENDLOOP.
         top-of-page
    top-of-page.
       uline at /2(60).
        write : / sy-vline,3 'Document date' ,16 sy-vline ,17 'Amount(net value of the sales document )' ,60 sy-vline .
       uline at /2(60).
    at user-command.
    if sy-ucomm = 'DISP'.
      LOOP AT I_SALES.
      REFRESH NEWSALES.
      V_LIN = SY-TABIX + 3.
      READ LINE V_LIN FIELD VALUE I_SALES-CH INTO CHECKBOX.
      IF CHECKBOX = 'X'.
        newsales-ch = 'X'.
        NEWSALES-VBELN = I_SALES-VBELN.
        NEWSALES-NETWR = I_SALES-NETWR.
        NEWSALES-WAERK = I_SALES-WAERK.
        NEWSALES-MATNR = I_SALES-MATNR.
        NEWSALES-AUDAT = I_SALES-AUDAT.
        APPEND NEWSALES.
        CLEAR NEWSALES.
        LOOP AT NEWSALES where audat = i_sales-audat .
         WRITE : / NEWSALES-CH as checkbox,NEWSALES-VBELN,NEWSALES-NETWR,NEWSALES-WAERK,NEWSALES-MATNR,NEWSALES-AUDAT.
        ENDLOOP.
       perform selection.
      ENDIF.
    ENDLOOP.
    ENDIF.
    *&      Form  ORGANIZATION
          text
    -->  p1        text
    <--  p2        text
    FORM ORGANIZATION .
      SELECT F~VBELN
             C~NETWR
             C~WAERK
             P~MATNR
             P~AUDAT
        INTO CORRESPONDING FIELDS OF TABLE I_SALES
        FROM ( VAKPA AS F INNER JOIN VBAK AS C ON FVBELN = CVBELN )
                 INNER JOIN VAPMA AS P ON FVBELN = PVBELN
        WHERE P~AUDAT IN S_DATE
         AND P~VKORG = P_VKORG.
    ENDFORM.                    " ORGANIZATION
    *&      Form  ORGANIZATION_ELSE
          text
    -->  p1        text
    <--  p2        text
    FORM ORGANIZATION_ELSE .
      SELECT F~VBELN
             C~NETWR
             C~WAERK
             P~MATNR
             P~AUDAT
        INTO CORRESPONDING FIELDS OF TABLE I_SALES
        FROM ( VAKPA AS F INNER JOIN VBAK AS C ON FVBELN = CVBELN )
                 INNER JOIN VAPMA AS P ON FVBELN = PVBELN
        WHERE P~AUDAT IN S_DATE.
    ENDFORM.                    " ORGANIZATION_ELSE
    *&      Form  CUST_ORGA
          text
    -->  p1        text
    <--  p2        text
    FORM CUST_ORGA .
    SELECT   F~VBELN
             C~NETWR
             C~WAERK
             P~MATNR
             P~AUDAT
        INTO CORRESPONDING FIELDS OF TABLE I_SALES
        FROM ( VAKPA AS F INNER JOIN VBAK AS C ON FVBELN = CVBELN )
                 INNER JOIN VAPMA AS P ON FVBELN = PVBELN
        WHERE P~AUDAT IN S_DATE
         AND P~VKORG = P_VKORG
         and P~KUNNR = P_KUNNR.
    ENDFORM.                    " CUST_ORGA
    *&      Form  CUST_ORGA_ELSE
          text
    -->  p1        text
    <--  p2        text
    FORM CUST_ORGA_ELSE .
    SELECT   F~VBELN
             C~NETWR
             C~WAERK
             P~MATNR
             P~AUDAT
        INTO CORRESPONDING FIELDS OF TABLE I_SALES
        FROM ( VAKPA AS F INNER JOIN VBAK AS C ON FVBELN = CVBELN )
                 INNER JOIN VAPMA AS P ON FVBELN = PVBELN
        WHERE P~AUDAT IN S_DATE
         AND P~KUNNR = P_KUNNR .
    ENDFORM.                    " CUST_ORGA_ELSE
    *&      Form  selection
          text
    -->  p1        text
    <--  p2        text
    FORM selection .
      LOOP AT NEWSALES.
         ON CHANGE OF NEWSALES-AUDAT.
           IF SY-TABIX <> 1.
              WRITE : / SY-VLINE,NEWSALES-AUDAT,SY-VLINE,27 SY-VLINE,48 SY-VLINE.
           ELSE.
             WRITE : / SY-VLINE,NEWSALES-AUDAT,SY-VLINE,27 SY-VLINE,48 SY-VLINE.
           ENDIF.
         ENDON.
         WRITE : / SY-VLINE,2 NEWSALES-VBELN,13 SY-VLINE,14 NEWSALES-NETWR,30 SY-VLINE,31 NEWSALES-WAERK,37 SY-VLINE ,38 NEWSALES-MATNR,57 SY-VLINE,58 NEWSALES-AUDAT.
         at last.
          sum .
          uline.
          format color = 3.
          write : /  sy-vline, 15 'Total amount:', newsales-netwr under newsales-netwr.
          format color off.
          uline.
         endat.
    ENDLOOP.
       v_lin = 1.
       free newsales.
    ENDFORM.                    " SELECTION

Maybe you are looking for

  • How do I stop Launchd from opening so many other processes?

    My computer has been running slow for some time even with without any applications open. On a whim, I created a new login account and it runs lickety split. I compared the Activity Monitor of both accounts and the old account is running 40 other proc

  • Displaying images in pdf reports

    a question please.. can one display only .gif type images or can they also be .jpgs? also, is there a limit to the size of the image one displays? also, can one control the size of these images in the reports. sorry about the above. I have looked aro

  • CMS exports problem - urgent

    Hi, Issue: CMS transport option is not displaying in the context menu drop down list for the Integration Repository (IR) Export CMS transport for the all SWCVs. My question is: 1. Do we really need the CMS track to display  CMS TRANSPORT in the conte

  • Error in Personal addre/Family---Country/Structure do not match application

    Hi Experts I am on Ecc 6.0 and using ESS webdynpro applications for molga 28 and 42. While using Personnel address/ Family member, I am getting the following error: Critical Error A critical error has occured. Processing of the service had to be term

  • FAQ: Why is playback stuttering when I preview within Premiere Pro?

    Stuttering or jerky playback is very often caused by the inability of your computer system and/or Premiere Pro to render and play frames as quickly as necessary for realtime playback. Causes vary, including such factors as inadequate hard disk speed,