Refresh page with data from the Next Record in the Table through a Button

Scenario: Record of a table “prototype” is made up of 8 columns,
key_col,
text_col,
label1_col, label2_col, label3_col,
check1_col, check2_col, check3_col,
I have created the following items on a page:
a) A Display Only item that is populated through a SQL query
“SELECT text_col from prototype where rownum=key_seq.NEXTVAL “.
b) Hidden item for the database columns “label1_col, label2_col, label3_col”
Source type for the hidden items is of type SQL query, Source expression is:
Select label1_col from prototype where rownum=key_seq.NEXTVAL ;
Select label2_col from prototype where rownum=key_seq.NEXTVAL ;
Select label3_col from prototype where rownum=key_seq.NEXTVAL ;
(key_seq is a sequence).
c) Checkbox item for the database columns “ check1_col, check2_col,check3_col"
d) The labels for the above checkbox items are &label1_col. , &label2_col. , &label3_col.
I have created a Save button to save the state of the checkboxes; (STATIC:;1 )
I want the page to be refreshed with the data from the next record (Fields text_col, label1_col, label2_col, label3_col) through a “ Next” Button.
Can I please know how I can achieve this?
Thanks in advance

If you need the value that is entered in the textbox as the email body, then try this..
<html>
<HEAD>
<title>WebForm1</title>
<script language="javascript">
function mailHTML() {
var content=document.getElementById('textBox').value;
location.href="mailto:?body="+encodeURI(content);
</script>
</head>
<body>
<form name="theform" id="theform">
<div name="body1"/>
<input type="text" value="Test" id="textBox"/>
<input type="button" value="Send Email" onClick="mailHTML()"/>
</div>
</form>
</body>
</html>

Similar Messages

  • How to export some data from the tables of an owner with integrity?

    Hi to all,
    How to export some data from the tables of an owner with integrity?
    I want to bring some data from all tables in a single owner of the production database for development environment.
    My initial requirements are: seeking information on company code (emp), contract status (status) and / or effective date of contract settlement (dt_liq_efetiva) - a small amount of data to developers.
    These three fields are present in the main system table (the table of contracts). Then I thought about ...
    - create a temporary table from the query results table to contract;
    - and then use this temporary table as a reference to fetch the data in other tables of the owner while maintaining integrity. But how? I have not found the answer, because: what to do when not there is the possibility of a join between the contract and any other table?
    I am considering the possibility of consulting the names of tables, foreign keys and columns above, and create dynamic SQL. Conceptually, something like:
    select r.constraint_name "FK name",
    r.table_name "FK table",
    r.column_name "FK column",
    up.constraint_name "Referencing name",
    up.table_name "Referencing table",
    up.column_name "Referencing column"
    from all_cons_columns up
    join all_cons_columns r
    using (owner, position), (select r.owner,
    r.constraint_name fk,
    r.table_name table_fk,
    r.r_constraint_name r,
    up.table_name table_r
    from all_constraints up, all_constraints r
    where r.r_owner = up.owner
    and r.r_constraint_name = up.constraint_name
    and up.constraint_type in ('P', 'U')
    and r.constraint_type = 'R'
    and r.owner = 'OWNERNAME') aux
    where r.constraint_name = aux.fk
    and r.table_name = aux.table_fk
    and up.constraint_name = aux.r
    and up.table_name = aux.table_r;
    -- + Dynamic SQL
    If anyone has any suggestions and / or reuse code to me thank you very much!
    After resolving this standoff intend to mount the inserts in utl_file by a table and create another program to read and play in the development environment.
    Thinking...
    Let's Share!
    My thanks in advance,
    Philips

    Thanks, Peter.
    Well, I am working with release 9.2.0.8.0. But the planning is migrate to 10g this year. So my questions are:
    With Data Pump can export data just from tables owned for me (SCHEMAS = MYOWNER) parameterizing the volume of data (SAMPLE) and filters to table (QUERY), right? But parameterizing a contract table QUERY = "WHERE status NOT IN (2,6) ORDER BY contract ":
    1º- the Data Pump automatically searches for related data in other tables in the owner? ex. parcel table has X records related (fk) with Y contracts not in (2,6): X * SAMPLE records will be randomly exported?
    2º- for the tables without relation (fk) and which are within the owner (MYOWNER) the data is exported only based on the parameter SAMPLE?
    Once again, thank you,
    Philips
    Reading Oracle Docs...

  • Goto: How to export some data from the tables of an owner with integrity?

    Hi to all,
    Help please: How to export some data from the tables of an owner with integrity?
    My thanks in advance,
    Philips

    Thanks, Peter.
    Well, I am working with release 9.2.0.8.0. But the planning is migrate to 10g this year. So my questions are:
    With Data Pump can export data just from tables owned for me (SCHEMAS = MYOWNER) parameterizing the volume of data (SAMPLE) and filters to table (QUERY), right? But parameterizing a contract table QUERY = "WHERE status NOT IN (2,6) ORDER BY contract ":
    1º- the Data Pump automatically searches for related data in other tables in the owner? ex. parcel table has X records related (fk) with Y contracts not in (2,6): X * SAMPLE records will be randomly exported?
    2º- for the tables without relation (fk) and which are within the owner (MYOWNER) the data is exported only based on the parameter SAMPLE?
    Once again, thank you,
    Philips
    Reading Oracle Docs...

  • Table - populate one table with data from the list of another table

    Hello All,
    I am a newbie in Swing and am a book and few tutorials old.
    I am trying to achieve the following:
    (1) I populate Table1 (a JTable) with a list of data - each row consists of several columns. And I have a Table2 (also JTable) that is in the beginning empty.
    Both the tables (Table1 and Table2) are showed in the window.
    (2) Lets say, there's a button (JButton) in between the two tables.
    Now if I Select a row from Table1 and press the button, this row will be sent/copied to Table2.
    And this way I can choose different rows and pass the data to Table2.
    I have manages to make Table1 and put data in it ... but for the rest, I don't know where and how to begin.
    Would appreciate some ideas and tips.
    Thank you.

    Since you are using a button to start the copy process you don't need to worry about a ListSelectionListener or a MouseListener. You need to create a button with an ActionListener that does the following:
    a) Create an Array based on the size of the number of columns in the table
    b) get the index of the selected row
    c) populate the Array with data from the TableModel by using the table.getModel().getValueAt(...) method for each
    d) Now you can add the row of data to the other JTable by updating its model.
    DefaultTableModel model2 = (DefaultTableModel)table2.getMode();
    model.addRow( theArray );

  • I accidentally deleted the admin user and it wiped out everything, luckily it wasn't much, but is my computer going to be completely overloaded with data from the last user? for example, i had to redownload microsoft 2011 do i have little space now?

    i accidentally deleted the admin user and it wiped out everything, luckily it wasn't much, but is my computer going to be completely overloaded with data from the last user? for example, i had to redownload microsoft 2011 do i have little space now?

    i accidentally deleted the admin user and it wiped out everything, luckily it wasn't much, but is my computer going to be completely overloaded with data from the last user? for example, i had to redownload microsoft 2011 do i have little space now?

  • How to dispaly datas from the table, base on the selection screen

    hi there gurus,
    im currently developing a stock aging report,
    i have completed one program but it do not allow me to excutes the program althought the syntax is correct.
    i would to get some ideas from you, regarding how to extract the datas from the tables?
    my selction screen will be, mat number, date, and gl account.
    and the out put datas are, mbew-matnr, makt-maktx, mbew-lbkum, mara_meins, mbew-salk3,and the consumptions for the past 12months and the values for it.
    can u plz guide me with this,
    thank you,.
    this is kind of very urgent program that i need to finish , plz help me.

    here is the total code the i do
    REPORT  ZSTK_AGING_REP2.
    *TABLES
    TABLES: mseg,
            mara,
            makt,
            SKAT,
            SKA1,
            MARV,
            T001,
            T030,
            T149D,
            AM07M,
            MCMSEG,
            T001K,
            T001W,
            T134M,
            vbak,
            mbew,
    mcon, rmcb0, marc, t024w,  mvke, v134w, t438a, propf, maprf, t000, t024e
    , tvko.
    DATA: BEGIN OF ta_material OCCURS 2,
           werks LIKE mard-werks,
           lgort LIKE mard-lgort,
           matnr LIKE mard-matnr,
           labst LIKE mard-labst,
           umlme LIKE mard-umlme,
           insme LIKE mard-insme,
           einme LIKE mard-einme,
           speme LIKE mard-speme,
           retme LIKE mard-retme,
           verpr LIKE mbew-verpr,
           maktx LIKE makt-maktx,
           meins LIKE mara-meins,
          bukrs LIKE t001-bukrs,
          konto LIKE t030-konts,
          butxt LIKE t001-butxt,
          txt50 LIKE skat-txt50,
          MABTR LIKE MCMSEG-DMBTR,
          SKBTR LIKE MCMSEG-DMBTR,
          WAERS LIKE T001-WAERS,
          WAER2 LIKE T001-WAERS,
          BWKEY LIKE MBEW-BWKEY,
          LBKUM LIKE MBEW-LBKUM,
         MEINS LIKE MARA-MEINS,
             SALK3 LIKE MBEW-SALK3,
             WAERS1 LIKE T001-WAERS,
             BUKRS1 LIKE T001-BUKRS,
             KONTO1 LIKE T030-KONTS,
            lbkum LIKE mbew-lbkum,
              erdat LIKE vbak-erdat,
          END OF ta_material.
    DATA: BEGIN OF ta_mseg OCCURS 2,
            mblnr LIKE mseg-mblnr,
    *->Begin of KL02+ -
            mjahr like mseg-mjahr,
            zeile like mseg-zeile,
    *->End of KL02+ -
            meins LIKE mseg-meins,
            menge LIKE mseg-menge,
            werks LIKE mseg-werks,
            lgort LIKE mseg-lgort,
            matnr LIKE mseg-matnr,
            budat LIKE mkpf-budat,
            saknr LIKE SKA1-SAKNR,
          END OF ta_mseg.
    single recs based on MATNR
    DATA: BEGIN OF i_matnr OCCURS 0,
            werks LIKE mard-werks,
            lgort LIKE mard-lgort,
            matnr LIKE mard-matnr,
            maktx LIKE makt-maktx,
            mblnr LIKE mseg-mblnr,
            verpr LIKE mbew-verpr,
            labst LIKE mard-labst,                    "Valuated stock with
    *unrestricted use
            umlme LIKE mard-umlme,                    "Stock in transfer
    *(from one storage location to another)
            insme LIKE mard-insme,                    "Stock in quality
    *inspection
            einme LIKE mard-einme,                    "Total Stock of All
    *Restricted Batches
            speme LIKE mard-speme,                    "Blocked stock
            retme LIKE mard-retme,                    "Blocked Stock Returns
            meins LIKE mara-meins,                    "base unit
          bukrs LIKE t001-bukrs,
          konto LIKE t030-konts,
          butxt LIKE t001-butxt,
          txt50 LIKE skat-txt50,
          MABTR LIKE MCMSEG-DMBTR,
          SKBTR LIKE MCMSEG-DMBTR,
          WAERS LIKE T001-WAERS,
          WAER2 LIKE T001-WAERS,
          BWKEY LIKE MBEW-BWKEY,
          LBKUM LIKE MBEW-LBKUM,
         MEINS LIKE MARA-MEINS,
             SALK3 LIKE MBEW-SALK3,
             WAERS1 LIKE T001-WAERS,
             BUKRS1 LIKE T001-BUKRS,
             KONTO1 LIKE T030-KONTS,
            lbkum LIKE mbew-lbkum,
           END OF i_matnr.
    recs based on MBLNR
    DATA: BEGIN OF i_mblnr OCCURS 0,
            mblnr LIKE mseg-mblnr,
            werks LIKE mseg-werks,
            lgort LIKE mseg-lgort,
            matnr LIKE mseg-matnr,
            menge LIKE mseg-menge,
            meint LIKE mseg-meins,
            budat LIKE mkpf-budat,
         bukrs LIKE t001-bukrs,
         konts LIKE t030-konts,
         butxt LIKE t001-butxt,
         txt50 LIKE skat-txt50,
         MABTR LIKE MCMSEG-DMBTR,
         SKBTR LIKE MCMSEG-DMBTR,
         WAERS LIKE T001-WAERS,
         WAER2 LIKE T001-WAERS,
         BWKEY LIKE MBEW-BWKEY,
          LBKUM LIKE MBEW-LBKUM,
         MEINS LIKE MARA-MEINS,
             SALK3 LIKE MBEW-SALK3,
             WAERS1 LIKE T001-WAERS,
             BUKRS1 LIKE T001-BUKRS,
             KONTO1 LIKE T030-KONTS,
           END OF i_mblnr.
    TYPES: BEGIN OF t_mat,
            lgort LIKE mseg-lgort,
            werks LIKE mseg-werks,
            matnr LIKE mseg-matnr,
            mblnr LIKE mseg-mblnr,
            maktx LIKE makt-maktx,
            meins LIKE mara-meins,
    meng0 LIKE mbew-lbkum,
    value0 LIKE mbew-salk3,
           meng0  LIKE mard-labst,                   "0 to 10 days
           value0 LIKE mseg-dmbtr,
           meng1  LIKE mard-labst,                   "11 to 30 days
           value1 LIKE mseg-dmbtr,
           meng2 LIKE mard-labst,                   "31 to 60 days
           value2 LIKE mseg-dmbtr,
           meng3 LIKE mard-labst,                   "61-90
           value3 LIKE mseg-dmbtr,
           meng4 LIKE mard-labst,                   "90 days onwards
           value4 LIKE mseg-dmbtr,
           END OF t_mat.
    DATA: i_mat2 TYPE t_mat OCCURS 0 WITH HEADER LINE.
    TYPES: BEGIN OF t_mat2,
            lgort LIKE mard-lgort,                    " storage location
            cnt0(5),
            cnt1(5),
            cnt2(5),
            cnt3(5),
            cnt4(5),
       meng0 LIKE mbew-lbkum,
    value0 LIKE mbew-salk3,
           meng0  LIKE mard-labst,                   "0 to 10 days
           value0 LIKE mseg-dmbtr,
           meng1  LIKE mard-labst,                   "11 to 30 days
           value1 LIKE mseg-dmbtr,
           meng2 LIKE mard-labst,                   "31 to 60 days
           value2 LIKE mseg-dmbtr,
           meng3 LIKE mard-labst,                   "61-90
           value3 LIKE mseg-dmbtr,
           meng4 LIKE mard-labst,                   "90 days onwards
           value4 LIKE mseg-dmbtr,
           END OF t_mat2.
    DATA: i_matsum TYPE t_mat2 OCCURS 0 WITH HEADER LINE.
    DATA:  w_mengb TYPE mbew-lbkum,
           w_workqyt TYPE mbew-lbkum,
           w_index TYPE sy-tabix,
    *DATA: w_mengb TYPE mard-labst,     "tmp Balance qty
         w_workqty TYPE mard-labst,   "Work qty
         w_index TYPE sy-tabix,
          w_days(5)  TYPE n,           "duration difference (days)
          w_mths(5)  TYPE n,           "duration difference (mths)
          w_dat1 TYPE sy-datum,        "date
          w_dat2 TYPE sy-datum,        "today's date
          w_detl(1) TYPE c,
          w_summ(1) TYPE c,
          w_denom TYPE i,
          w_numer TYPE i,
          w_conv TYPE i,
          w_ttlcnt TYPE i,
          w_cnt TYPE i,
          v_topofpage(1),
         w_meng LIKE mard-labst,
           w_meng LIKE mbew-lbkum,
    *sapscript values
          w_title(20) TYPE c.              "Summary / Detail Report
    DATA: lv_peinh LIKE mbew-peinh,  "Price Unit
          lv_verpr LIKE mbew-verpr.  "Moving Price
    proram comes here
    SELECTION-SCREEN BEGIN OF BLOCK blk1 WITH FRAME TITLE text-001.
    SELECT-OPTIONS: s_werks FOR mseg-werks,
                    s_lgort FOR mseg-lgort,
                    s_matnr FOR mara-matnr,
                    s_saknr FOR ska1-saknr,
                    S_ERDAT FOR VBAK-ERDAT.
    PARAMETERS: pck_detl RADIOBUTTON GROUP rep1,
                pck_summ RADIOBUTTON GROUP rep1,
                pck_dtsm RADIOBUTTON GROUP rep1 DEFAULT 'X'.
    SELECTION-SCREEN END OF BLOCK blk1.
    top of the page
      TOP-OF-PAGE.
      PERFORM  f_top_of_page.
      FORM f_top_of_page .
      IF v_topofpage = 'D'.
    *-->Report header for detail report
        WRITE:/2 'Printed By :', sy-uname,
               80 'Stock Aging Report - Detail',
               180 'Printed on:', sy-datum, sy-timlo,
               220 'Page:', sy-pagno.
        WRITE:/,/,/.
        WRITE:/2 'Storage',
               10 'Matl ID',
               22 'Matl Description',
               61 'UOM',
               78 '<--=<QTY ON THIS DATE -->',
              78 '<-- =< 10 days -->',
              112 '<--11 to 30 days -->',
              148 '<--31 to 60 days -->',
              181 '<--61 to 90 days -->',
              216 '<-- > 90 days -->',
               /2 'Location',
               76 'Qty',
               92 'Value'.
              112 'Qty',
              128 'Value',
              148 'Qty',
              164 'Value',
              181 'Qty',
              195 'Value',
              216 'Qty',
              231 'Value'.
        WRITE:/2 sy-uline(235).
      ELSE.
    *-->Report header for Summary report
        WRITE:/2 'Printed By :', sy-uname,
               80 'Stock Aging Report - Summary',
               180 'Printed on:', sy-datum, sy-timlo,
               220 'Page:', sy-pagno.
        WRITE:/,/,/.
        WRITE:/2 'Storage',
               10 'Matl ID',
               22 'Matl Description',
               61 'UOM',
               78 '<--< QTY ON THIS DATE -->',
              78 '<-- < 10 days -->',
              112 '<--11 to 30 days -->',
              148 '<--31 to 60 days -->',
              181 '<--61 to 90 days -->',
              216 '<-- > 90 days -->',
               /2 'Location',
               76 'Qty',
               92 'Value'.
              112 'Qty',
              128 'Value',
              148 'Qty',
              164 'Value',
              181 'Qty',
              195 'Value',
              216 'Qty',
              231 'Value'.
        WRITE:/2 sy-uline(235).
      ENDIF.
    ENDFORM.                    " f_top_of_page
    *start-of-selection
    *PERFOM f_data_selection.
    FORM f_data_selection.
      SELECT a~werks
             a~lgort
             a~matnr
            a~saknr
            a~lbkum
            a~erdat
            a~labst
             a~umlme
             a~insme
             a~einme
             a~speme
             a~retme
           b~verpr    "this field no long been used
             c~maktx
             d~meins
             INTO CORRESPONDING FIELDS OF TABLE ta_material
             FROM mard AS a
             INNER JOIN makt AS c ON amatnr = cmatnr
             INNER JOIN mara AS d ON amatnr = dmatnr
             WHERE a~matnr IN s_matnr
               AND a~werks IN s_werks
               AND a~lgort IN s_lgort
              AND a~saknr IN s_saknr
              AND a~erdat IN s_erdat
               AND c~spras = 'EN'.
    *--> SC01 - End  of Insertion **
    *-->Select material documents
      SELECT a~mblnr
            a~mjahr
            a~zeile
            a~meins
            a~menge
            a~werks
            a~lgort
            a~matnr
            b~budat
            INTO CORRESPONDING FIELDS OF TABLE ta_mseg
      FROM mseg AS a INNER JOIN mkpf AS b
      ON amblnr = bmblnr
      AND amjahr = bmjahr
      FOR ALL ENTRIES IN ta_material
      WHERE matnr = ta_material-matnr
      AND a~werks = ta_material-werks
      AND a~lgort = ta_material-lgort
      AND algort NE aumlgo
      AND a~shkzg = 'S'
      AND a~smbln EQ space
      AND a~smblp EQ space.
    *--> SC03 - Start of Insertion **
    If MBLNR exist in MSEG-SMBLN and this
    record's SHKZG = 'H'. Remove it from the table.
    This is becuase this particular record has already been reverse.
      LOOP AT ta_mseg.
        SELECT SINGLE *
                 FROM mseg
                WHERE smbln = ta_mseg-mblnr
    *->Begin of KL02+ -
                  and SMBLP = ta_mseg-zeile.
                 AND shkzg = 'H'.  "return.           " KL02-
    *->End of KL02+ -
        IF sy-subrc = 0.
          DELETE ta_mseg.
        ENDIF.
      ENDLOOP.
    *--> SC03 - Enf   of Insertion **
    ENDFORM.                    " f_data_selection
    *IMPORTANT , NEED TO CHECK LATER
    FORM f_data_preparation.
    *-->Append data for report details
      LOOP AT ta_material.
        DATA: ta_msegtemp LIKE ta_mseg OCCURS 2 WITH HEADER LINE.
    *-->Loop at all material documents into a temp table
        REFRESH ta_msegtemp. CLEAR ta_msegtemp.
        LOOP AT ta_mseg WHERE matnr = ta_material-matnr AND
                              werks = ta_material-werks AND
                              lgort = ta_material-lgort.
          ta_msegtemp = ta_mseg. APPEND ta_msegtemp.
        ENDLOOP.
    *-->Add up all the stock for the material
        CLEAR w_mengb.
        w_mengb = ta_material-labst +
                        ta_material-umlme +
                        ta_material-insme +
                        ta_material-einme +
                        ta_material-speme +
                        ta_material-retme.
        IF w_mengb IS INITIAL.
          CONTINUE.
        ENDIF.
    *-->sort msegtemp by posting date
        SORT ta_msegtemp BY budat DESCENDING.
    *-->get the values from the material documents into the report output
        LOOP AT ta_msegtemp.
    *->Begin of KL02- -
         CALL FUNCTION 'HRCM_TIME_PERIOD_CALCULATE'
           EXPORTING
             begda               = ta_msegtemp-budat
             endda               = sy-datum
           IMPORTING
            NOYRS               =
             nomns               = w_mths
             nodys               = w_days
          EXCEPTIONS
            invalid_dates       = 1
            overflow            = 2
            OTHERS              = 3
    *->End of KL02- -
    *->Begin of KL02+ -
    *-->Get the days difference btw two dates
          clear w_days.
          w_days = sy-datum - ta_msegtemp-budat.
    *--> Include today's date into calculation
          w_days = w_days + 1.
    *->End of KL02+ -
    check base unit, do conversion
          IF ta_material-meins <> ta_msegtemp-meins.
            CALL FUNCTION 'MD_CONVERT_MATERIAL_UNIT'
              EXPORTING
                i_matnr              = ta_material-matnr
                i_in_me              = ta_msegtemp-meins
                i_out_me             = ta_material-meins
                i_menge              = ta_msegtemp-menge
              IMPORTING
                e_menge              = ta_msegtemp-menge
              EXCEPTIONS
                error_in_application = 1
                error                = 2
                OTHERS               = 3.
          ENDIF.
    *--> SC01 - Start of Insertion **
          SELECT SINGLE peinh
                        verpr
                   INTO (lv_peinh,
                         lv_verpr)
                   FROM mbew
                  WHERE matnr = ta_material-matnr
                    AND bwkey = ta_material-werks.
          IF sy-subrc = 0.
            ta_material-verpr = lv_verpr.
          ENDIF.
    *--> SC01 - End   of Insertion **
    *-->check whether the mseg value is LE than the stock value
          IF ta_msegtemp-menge LE w_mengb.
    *-->Days < 10 days
            IF w_days  LE 1 AND w_days EQ 366.
              i_mat2-meng0 = i_mat2-meng0 + ta_msegtemp-menge.
              IF NOT lv_peinh EQ 0.
                i_mat2-value0 = ( i_mat2-meng0 / lv_peinh ) *
    ta_material-verpr."+SC01
              ENDIF.
    **-->Days 11 - 30 days
           ELSEIF w_days >= 11 AND w_days =< 30.
             i_mat2-meng1 = i_mat2-meng1 + ta_msegtemp-menge.
             IF NOT lv_peinh EQ 0.
               i_mat2-value1 = ( i_mat2-meng1 / lv_peinh ) *
    *ta_material-verpr."+SC01
             ENDIF.
    **-->Days 31-60 days
           ELSEIF w_days >= 31 AND w_days =< 60.
             i_mat2-meng2 = i_mat2-meng2 + ta_msegtemp-menge.
             IF NOT lv_peinh EQ 0.
               i_mat2-value2 = ( i_mat2-meng2 / lv_peinh ) *
    *ta_material-verpr."+SC01
             ENDIF.
    **-->Days 61-90 days
           ELSEIF w_days >= 61 AND w_days =< 90.
             i_mat2-meng3 = i_mat2-meng3 + ta_msegtemp-menge.
             IF NOT lv_peinh EQ 0.
               i_mat2-value3 = ( i_mat2-meng3 / lv_peinh ) *
    *ta_material-verpr.
             ENDIF.
    **-->Days > 90 days
           ELSEIF w_days > 90.
             i_mat2-meng4 = i_mat2-meng4 + ta_msegtemp-menge.
             IF NOT lv_peinh EQ 0.
               i_mat2-value4 = ( i_mat2-meng4 / lv_peinh ) *
    *ta_material-verpr.
             ENDIF.
           ENDIF.
    *->End of KL002+
            w_mengb = w_mengb - ta_msegtemp-menge.
          ELSE.
            IF NOT w_mengb LE 0 .
                 IF NOT lv_peinh EQ 0.
    **->End of KL001+
                   i_mat2-value0 = ( i_mat2-meng0 / lv_peinh )
    *ta_material-verpr."+SC01
    **->Begin of KL001+
                 ENDIF.
               ELSEIF w_days GE 22.
                 i_mat2-meng3 = i_mat2-meng3 + w_mengb.
                 IF NOT lv_peinh EQ 0.
                   i_mat2-value3 = ( i_mat2-meng3 / lv_peinh )
    *ta_material-verpr.
                 ENDIF.
    **->End of KL001+
               ENDIF.
    **--> SC02 - End  of Insertioin **
           ENDIF.
    *->End of KL002-
    *->Begin of KL002+
    *--> < 10 days
                     IF w_days EQ 1 AND w_days LE 366.
              i_mat2-meng0 = i_mat2-meng0 + ta_msegtemp-menge.
              IF NOT lv_peinh EQ 0.
                i_mat2-value0 = ( i_mat2-meng0 / lv_peinh ) *
    ta_material-verpr."+SC01
              ENDIF.
             ELSEIF w_days >= 11 AND w_days =< 30.
               i_mat2-meng1 = i_mat2-meng1 + w_mengb.
               IF NOT lv_peinh EQ 0.
                 i_mat2-value1 = ( i_mat2-meng1 / lv_peinh ) *
    *ta_material-verpr.
               ENDIF.
    **--> 31 - 60 days
             ELSEIF w_days >= 31 AND w_days =< 60.
               i_mat2-meng2 = i_mat2-meng2 + w_mengb.
               IF NOT lv_peinh EQ 0.
                 i_mat2-value2 = ( i_mat2-meng2 / lv_peinh ) *
    *ta_material-verpr.
               ENDIF.
    **--> 61 - 90 days
             ELSEIF w_days >= 61 AND w_days =< 90.
               i_mat2-meng3 = i_mat2-meng3 + w_mengb.
               IF NOT lv_peinh EQ 0.
                 i_mat2-value3 = ( i_mat2-meng3 / lv_peinh ) *
    *ta_material-verpr.
               ENDIF.
    **--> > 90 days
             ELSEIF w_days > 90.
               i_mat2-meng4 = i_mat2-meng4 + w_mengb.
               IF NOT lv_peinh EQ 0.
                 i_mat2-value4 = ( i_mat2-meng4 / lv_peinh ) *
    *ta_material-verpr.
               ENDIF.
              ENDIF.
    *->End of KL002+
              w_mengb = 0.
            ENDIF. " check stock value NE zero
          ENDIF.   "check Mat doc amount is LE than the stock value
    ENDIF.
        ENDLOOP. " msegtemp
    *-->append i_mat2 values
        i_mat2-werks = ta_material-werks.
        i_mat2-lgort = ta_material-lgort.
        i_mat2-matnr = ta_material-matnr.
        i_mat2-maktx = ta_material-maktx.
        i_mat2-meins = ta_material-meins.
        APPEND i_mat2. CLEAR i_mat2.
      ENDLOOP. " ta_material
    *-->Append data for summary data
      DATA: i_lgort LIKE i_mat2 OCCURS 2 WITH HEADER LINE.
      i_lgort[] = i_mat2[].
      SORT i_lgort BY werks lgort.
      DELETE ADJACENT DUPLICATES FROM i_lgort COMPARING werks lgort.
      DATA: v_cnt0(5), v_cnt1(5), v_cnt2(5), v_cnt3(5), v_cnt4(5),
            v_value0 LIKE i_matsum-value0.
           v_value1 LIKE i_matsum-value1,
           v_value2 LIKE i_matsum-value2,
           v_value3 LIKE i_matsum-value3,
           v_value4 LIKE i_matsum-value4.
      LOOP AT i_lgort.
        CLEAR v_cnt0. CLEAR v_value0.
      CLEAR v_cnt1. CLEAR v_value1.
       CLEAR v_cnt2. CLEAR v_value2.
       CLEAR v_cnt3. CLEAR v_value3.
       CLEAR v_cnt4. CLEAR v_value4.
        LOOP AT i_mat2 WHERE lgort = i_lgort-lgort AND
                             werks = i_lgort-werks.
          IF NOT i_mat2-meng0 IS INITIAL.
            v_cnt0 = v_cnt0 + 1.
            v_value0 = v_value0 + i_mat2-value0.
          ENDIF.
         IF NOT i_mat2-meng1 IS INITIAL.
           v_cnt1 = v_cnt1 + 1.
           v_value1 = v_value1 + i_mat2-value1.
         ENDIF.
         IF NOT i_mat2-meng2 IS INITIAL.
           v_cnt2 = v_cnt2 + 1.
           v_value2 = v_value2 + i_mat2-value2.
         ENDIF.
         IF NOT i_mat2-meng3 IS INITIAL.
           v_cnt3 = v_cnt3 + 1.
           v_value3 = v_value3 + i_mat2-value3.
         ENDIF.
         IF NOT i_mat2-meng4 IS INITIAL.
           v_cnt4 = v_cnt4 + 1.
           v_value4 = v_value4 + i_mat2-value4.
         ENDIF.
        ENDLOOP.
        CLEAR i_matsum.
        i_matsum-lgort = i_mat2-lgort.
        IF v_cnt0 NE space.
          i_matsum-cnt0 = v_cnt0.
          i_matsum-value0 = v_value0.
          APPEND i_matsum.
        ENDIF.
       CLEAR i_matsum.
       i_matsum-lgort = i_mat2-lgort.
       IF v_cnt1 NE space.
         i_matsum-cnt1 = v_cnt1.
         i_matsum-value1 = v_value1.
         APPEND i_matsum.
       ENDIF.
       CLEAR i_matsum.
       i_matsum-lgort = i_mat2-lgort.
       IF v_cnt2 NE space.
         i_matsum-cnt2 = v_cnt2.
         i_matsum-value2 = v_value2.
         APPEND i_matsum.
       ENDIF.
       CLEAR i_matsum.
       i_matsum-lgort = i_mat2-lgort.
       IF v_cnt3 NE space.
         i_matsum-cnt3 = v_cnt3.
         i_matsum-value3 = v_value3.
         APPEND i_matsum.
       ENDIF.
       CLEAR i_matsum.
       i_matsum-lgort = i_mat2-lgort.
       IF v_cnt4 NE space.
         i_matsum-cnt4 = v_cnt4.
         i_matsum-value4 = v_value4.
         APPEND i_matsum.
       ENDIF.
      ENDLOOP.
    ENDFORM.                    "f_data_preparation
    *IMPORTANT , NEED TO CHECK LATER
    FORM f_display_data .
      IF pck_dtsm = 'X'.
    *-->Display detail
        v_topofpage = 'D'.
        PERFORM f_display_detail.
    *-->display summary
        v_topofpage = 'S'.
        NEW-PAGE.
        PERFORM f_display_summary.
      ELSEIF pck_detl = 'X'.
    *-->Display detail
        v_topofpage = 'D'.
        PERFORM f_display_detail.
      ELSEIF pck_summ = 'X'.
    *-->display summary
        v_topofpage = 'S'.
        PERFORM f_display_summary.
      ENDIF.
    ENDFORM.                    " f_display_data
    FORM f_display_detail .
      v_topofpage = 'D'.
      SORT i_mat2 BY werks lgort.
    *DATA: v_count(5),
    DATA: v_count,
            v_va1 LIKE i_mat2-value0.
           v_va2 LIKE i_mat2-value0,
           v_va3 LIKE i_mat2-value0,
           v_va4 LIKE i_mat2-value0,
           v_va5 LIKE i_mat2-value0.
      LOOP AT i_mat2.
        WRITE:/2 i_mat2-lgort,
              10 i_mat2-matnr,
              22 i_mat2-maktx(38),
              61 i_mat2-meins,
              64 i_mat2-meng0,
              82 i_mat2-value0.
             100 i_mat2-meng1,
             118 i_mat2-value1,
             136 i_mat2-meng2,
             154 i_mat2-value2,
             169 i_mat2-meng3,
             186 i_mat2-value3,
             204 i_mat2-meng4,
             222 i_mat2-value4.
    *-->Set counter and add up all values by lgort
        v_count = v_count + 1.
         v_va1 = v_va1 + i_mat2-value0.
       v_va2 = v_va2 + i_mat2-value1.
       v_va3 = v_va3 + i_mat2-value2.
       v_va4 = v_va4 + i_mat2-value3.
       v_va5 = v_va5 + i_mat2-value4.
        AT END OF lgort.
          WRITE:/10 'Cnt:',
                 15 v_count,
                 55 'Subtotal',
                 82 v_va1.
                118 v_va2,
                154 v_va3,
                186 v_va4,
                222 v_va5.
          CLEAR v_count. CLEAR v_va1.
         CLEAR v_va2. CLEAR v_va3. CLEAR v_va4. clear v_va5.
        ENDAT.
      ENDLOOP.
    ENDFORM.                    " f_display_detail
    FORM f_display_summary .
      v_topofpage = 'S'.
      LOOP AT i_matsum.
        IF NOT i_matsum-cnt0 IS INITIAL.
          WRITE:/2  i_matsum-lgort,
                 10 'Cnt:',15 i_matsum-cnt0,
                 82 i_matsum-value0.
        ENDIF.
       IF NOT i_matsum-cnt1 IS INITIAL.
         WRITE:/2  i_matsum-lgort,
                10 'Cnt:',15 i_matsum-cnt1,
                118 i_matsum-value1.
       ENDIF.
       IF NOT i_matsum-cnt2 IS INITIAL.
         WRITE:/2  i_matsum-lgort,
                10 'Cnt:',15 i_matsum-cnt2,
                154 i_matsum-value2.
       ENDIF.
       IF NOT i_matsum-cnt3 IS INITIAL.
         WRITE:/2  i_matsum-lgort,
                10 'Cnt:', 15 i_matsum-cnt3,
                186 i_matsum-value3.
       ENDIF.
       IF NOT i_matsum-cnt4 IS INITIAL.
         WRITE:/2  i_matsum-lgort,
                10 'Cnt:', 15 i_matsum-cnt4,
                222 i_matsum-value4.
       ENDIF.
      ENDLOOP.
    ENDFORM.                    " f_display_summary

  • How to fetch the data from the table COEP for WBS element,cost center,,,,,?

    Hi,
    I would like to retrive the data from the table COEP ,based on KOKRS,BELNR fields.
    I need the output for Cost centre, cost element, wbs element,net work ,activity.
    These values are storing OBJNR ,OBJNAR_1,OBJNR_2,OBJNR_N3.
    But here always these field are not giving the correct values.
    for example : for one record COST CENTRE vlaue is storing in OBJNR_1 field,
                        for one record COST CENTRE vlaue is storing in OBJNR_2 field,
                       for one record  COST CENTRE vlaue is storing in OBJNR_3 field.
    Here SAP has used a generic approach for this.
    How can I dispaly the values in this case ?
    Thanks and Regards
    Srinivas.N

    Hi,
    I am asking, how can we say OBJNR_1 value alwyas belongs to cost center ?
    USPOB is not filling always.

  • To Delete the Entire Data from the Tables

    Requirement ::
    To use select Options for table name and based on the table names we want to delete the data from the tables...
    conditions :
    we have to first check if the tables having mandat and the configuration tables  if this tables then dnt delete the data from this tables. if the table other than mandat n config tables the data will be deleted from other tables.
    Input On Selection Screen :::
    Name of the tables  : :         we want to select multiple table names using select options.
    Type of Update       : :          Synchronous / Asynchronous
    Test Run                 : :          /* if test run is selected the tables will be validated based on the condition and the data is not 
                                                   deleted from the SAP tables or the status is not updated . untill u run Actual run. 
    Actual Run              : :         /* Here finally the data will be deleted from the SAP tables . the changes finally will be reflected in
                                                   Actual run...to the SAP Tables
    Output Required :::
    srno  |  Table name   |   No.of Records deleted   |    Date    |    Time     
    Please provide me the sample code for the above Requirement ...
    Thanks in Advance....
    Moderator message : Spec dumping is not allowed. Thread locked.
    Edited by: Vinod Kumar on Sep 30, 2011 4:54 PM

    Venkat,
    I belive in LBWQ you can only see one entry for an application. You'll see only one entry MC*18 for all your datasources.
    Do one thing. Do not delete from there. Run your "Job Control" job which moves all the data from LBWQ queue to RSA7 queue, making your LBWQ queue empty. Now go to RSA7 and delete your data for the specified datasource...
    Been a while since I looked at those screens, but I believe I am right.
    Good Luck
    Gova

  • Fetch the data from the tables in the SQL 2005 server to sap R/3.

    Hi Experts,
    We need to fetch the data from the tables in the SQL 2005 server to sap R/3.
    Please explain which will be the best approach to fetch the same and how to do it. Sample program can greatly help.
    << Please do not offer points >>
    Regards,
    Shobana K
    Edited by: Rob Burbank on Sep 21, 2010 2:36 PM

    Hi,
    Try NATIVE SQL statements in your abap code otherwise you can try to establish jdbc connection from ABAP program.
    search in SDN for samples!
    Suresh

  • Odd/Even pages with data from two tables

    Hi Forum,
    Can you please extend help/suggest with the following scenario:
    I have two data tables and one table records needs to be printed on odd pages (Front page) and the other table records need to be printed on even pages (Back page). I need alternating front and back pages based on data records in the tables. Also second table will be having lesser records when compared with first table.
    I'm able to get the alternating Odd/Even master pages. But the first table is being printed in both the odd/even pages first and then the second table is being printed in both the odd/even pages. How can I restrict the printing of the first table on odd page and second table on even page?
    Thanks for your help/suggestions.
    ~Madan

    You can play with pagination tab in your LCD tab, but I have never learnt enough to be able to use it effectively.
    If I were in your shoes, I would alter the DDIC structures in the backend so you will only display it in the form, without any suicidal actions through the pagination, scripting or similar stuff.
    How: If you need to alter pages, you can do that in your backend, right?
    Like you can have a structure page with attributes:
    - up/ front: data for the front page
    - down/back: data for the back page
    and you will alter the data in the table with this structure as a line in your ABAP program and will use to form to display the trnaformated data only.
    Well... I don´t tell it is clear/right/ proper solution and cannot tell if there are any obstacles which will not let you use this scenario in your case, but you could consider this as an option...
    Regards Otto

  • Reg: Getting the latest or last saved data from the table

    Hi,
    I'm having a table, which is getting updated whenever something is saved.
    Now i want to get the latest or last saved details to be displayed or the details of the row with greatest Id.( i.e, the Id. will be greatest for the last saved)
    please help me out with code to do this...
    Thanks & Regards,
    Suresh

    Hi Suresh,
    This could be done either through the webdynpro or the back end function module itself.
    If another field of type date/time is present in the table, u can save the current date and time along with the data in the table, and sort it in descending order of time. so that whenever u refresh the page the latest record is always in the first row,
    if u want to do it through webdynpro, u can also sort the table based on the date so that u get the latest record that was saved.
    Another solution is that u can maintain a serial number sort of thing the table which helps u identify the latest record
    Hope this helps u.
    Regards,
    Poojith M V

  • How can EBS 12.1.3 upgraded from 11.5.10 be refreshed with data from the live 11.5.10

    Hello Gurus,
    Early this year we upgraded an 11i EBS system to a 12.1.3 for testing and now accounting wants the data in the new 12i system to be refreshed with the most recent data from PROD (11i). Is this possible wihtout going through the entire upgrade process?
    Thanks
    Mathias

    Hi Mathias,
    For details about this concurrent program, please refer to:
    SLA: Upgrade Historical Subledger Transaction Accounting Program (XLAONDEUPG) (Doc ID 1376752.1)
    R12.0 and R12.1: FAQ for the SLA Upgrade: SLA Pre-Upgrade, Post-Upgrade, and Hot Patch (Doc ID 604893.1)
    New Functionality for SLA Upgrade Process for R12.1.2 (Doc ID 980112.1)
    What Do You Need To Know For A Successful Upgrade Of Oracle Payables? [VIDEO] (Doc ID 1471844.1)
    Thanks,
    Hussein

  • How do I populate a popup window with data from the parent window

    I am brand new to JSF so please help me. I have a JSF page where users enter some search criteria and it displays the results in a matrix table. I need to have a PRINT button or link on this page that pops up a new window that displays the same data but in a printer-friendly format.
    The parent page is already created and works fine. Now, what is the best way to populate the same data in the popup? The data is stored in a hashmap and retrived by a managed bean with session scope. Below is the XHTML code for displaying the table in the parent page.
    <tbody>
                             <c:forEach items="#{inventoryManagedBean.inventoryColors}" var="row">
                                  <tr id="matrixColor">
                                       <c:forEach items="#{inventoryManagedBean.sizeList}" var="column" varStatus="cellStatus">
                                            <c:if test="#{cellStatus.index == 0}">
                                                 <th width="70px"><h:graphicImage value="../graphics/styles/#{row.color}.jpg"
                                                      alt="#{row.color}" width="70" height="40"></h:graphicImage></th>
                                                 <th width="100px"><h:outputText value="#{row.colorDescription}" />
                                                 <h:outputText value="#{row.color}" /></th>
                                            </c:if>
                                            <td width="70px"><c:if
                                                 test="#{inventoryManagedBean.inventoryMap[row.color][column.size] != null}">
                                                 <c:if test="#{inventoryManagedBean.inventoryMap[row.color][column.size].label != '-1'}">
                                                      <span class="matrixText"><h:outputText
                                                           value="#{inventoryManagedBean.inventoryMap[row.color][column.size].label}"
                                                           title="#{inventoryManagedBean.inventoryMap[row.color][column.size].title}" /> </span>
                                                      <t:htmlTag value="br" rendered="#{userManageBean.user.loggedIn}" />
                                                      <a4j:region renderRegionOnly="false">
                                                           <h:inputText
                                                                value="#{inventoryManagedBean.inventoryMap[row.color][column.size].quantityOrdered}"
                                                                rendered="#{userManageBean.user.loggedIn}" maxlength="6" size="6">
                                                           </h:inputText>
                                                      </a4j:region>
                                                 </c:if>
                                                 <h:outputText value="Call"
                                                      rendered="#{inventoryManagedBean.inventoryMap[row.color][column.size].label == '-1'}" />
                                            </c:if> <h:outputText value="N/A"
                                                 rendered="#{inventoryManagedBean.inventoryMap[row.color][column.size] == null}" /></td>
                                       </c:forEach>
                                  </tr>
                             </c:forEach>

    call javascript window.open("pagename"); & add some printer button there,
    and put rendered attribute to button & in backing bean generate boolean getter setter for variable use same variable in jsp printer button in rendered attribute, in bean constructor pass some parameter throuh jsp page,
    if parameter is match then it rendered attribute to true for button else not,
    it means that in parent window you can not see printer button, but in same window in popup you will see printer button,
    good luck
    <h:commandButton rendered="#{bean.renderedButton}"/>
    bean
    private boolean renderedButton= false;(generate getter setter)
    also pass parameter from UI to bean constructor

  • Update multiple rows with datas from the same table

    i have a table like
    name version value1 value2
    2 A 4,31 3,5
    3 A 3,45 10
    2 B 6,97 12
    4 B 12 16
    so name + version is unique
    i have to update the datas value1 and value2 ( version A) with the datas from version B where the name ( VersionA) = name version B
    i.e the result should be
    name version value1 value2
    2 A 6,97 12
    3 A 3,45 10
    2 B 6,97 12
    4 B 12 16
    is it possible to do this in sql? ( sql. 8.1)

    ... if your table does not contain exactly what you expect you could get:
    'single row sub-query returns more than one row'
    To prevent that, put a unique index on (name, version). If this combination is not always unique, you will need to cater for the possibility in the update statement.

  • Start with dates from the past in the planning book

    I want to maintain some figures from the last 14 days in the past.
    And I want the planning book to show these 14 days, when I open the planning book.
    (I do not want to scroll back).
    In my Data view i have to define a Time Bucket profile for the future. (system demand)
    This profile I has defined with one day.
    The Time Bucket profile for the past are 21 days.
    When I start the planning book with the view, I see only one column with todays date.
    I want to see the past 14 days, and therefore I have to scroll back.
    Is it possible to start with the last 14 days?
    - By setting the Period information in the Data view tab?
    - By other settings?
    - By macro?

    Hi Per,
    You need to go for a developing an ABAP report. The development calls for updating the planning start date in the data view design mode.
    You can use function modules /SAPAPO/MSDP_PB_READ_DVIEW and /SAPAPO/MSDP_PB_SAVE_DVIEW_TAB.
    So the logic could be as follows:
    1. First develop a FM which will determine the planning start date as per your requirements. This has to be with respect to the system date. So this Function module should in effect subtract 14 days from system date and store in a date field.
    2. Using the FM  /SAPAPO/MSDP_PB_READ_DVIEW, this date can be updated in the data view / PLanning start date field.
    3. Using FM /SAPAPO/MSDP_PB_SAVE_DVIEW_TAB, you can save and generate the data view.
    After developing the program you need to schedule this in background so that the planning start date is calculated and stored automatically.
    You need to take care of one thing though. In case there are any macros developed in the data view/macro book, the start dates for macro execution will be changed as well. You need to tweak those as per your requirements.
    Hope this helps.
    Regards,
    Ashutosh

Maybe you are looking for

  • All of a sudden my itunes tv/movie purchases are not playing on my air?

    Hi all, I used to be able to watch show/movies I purchased from itunes on my MacBook Air but all of sudden I have started to have issues. When I download something and press play all I get is a green screen. I have tried different shows and nothing s

  • Video truncates on import

    I have an MPEG that was converted from an MPG4 using AVS Video Converter. The MPEG plays all the way through in a viewer like Microsoft's Windows Media Player. However, whenever I bring the MPEG into Adobe Premiere Elements 3 to edit, I get only the

  • Selecting Multiple columns in Sub-query

    Hi All, I've been using three co-related queries to fetch data as shown below in the pseudo code. All these sub-queries are same, except the column name. I want to avoid the same query to be executed thrice for three columns. Is there any way to avoi

  • Validating Checkbox

    Hi all,        I need to add  two checkboxes as parameters , these two checkboxes refer to the fields in prps table . These fields in PRPS table  are as well checkboxes.   Therez  a Tcode CJ20n ,   i enter a project  number  and i go to  1st level WB

  • Pacman-i18n

    Hi! Pacman-i18n is stable right now, I wrote a PKGBUILD for it. Supported Languages: Chez, German, Spanish, Dutch, Portuguese, Russian and Swedish Special Thanks to: Carl-Adam Brengesjo (Rewrote Pacman & Swedish Translation) Lukas Konarovsky (Chez Tr