Performing Calculations using Record Count

I am working on a form that calculates an employees vacation
time. THe employee starts with a static balance, say 120. The
employee can then enter their vacation time as they take it. They
can only enter it in increments of either 8 hours or 4 hours, so
each record in the database will reflect either 8 or 4 hours. I
want to be able to display a current balance for the employee. So
if the employee logs in and takes a week off, they will have to
enter 5 records with 8 hours each. How do I calculate this to get
the desired current balance of 80? I am not very fluent with
calculations in CF, but think it must involve the record set. THis
is probably very easy, but I am stumped.
Any help would be great! Also if I didnt explain this
correctly, let me know and I will try to offer more details.

Jatrix wrote:
>
> Any help would be great! Also if I didnt explain this
correctly, let me know
> and I will try to offer more details.
>
Well, you *could* just add up all the 'vactaionTime' fields
of each
record in the record set. I.E.
<cfset totalVac = 0>
<cfloop query="empVacQry">
<cfset totalVac = totalVac + empVacQry.vacTime>
</cfloop>
<cfoutput>#totalVac#</cfoutput>
But this really is much easier to do with some simple SQL.
SELECT empID, sum(vacTime) AS totalVacTime
FROM EmployeeTable
GROUP BY empID
<cfoutput query="empVacQry">
#empID# #totalVacTime#<br>
</cfoutput>

Similar Messages

  • How to perform calculations using column data in BI Publisher

    Hello guys
    I am very new to BIP, and recently I am learning to create new templates using XML files..
    I am trying to create a report that has Account Amount, Amount Net Amount, PM_Amount and a New field say "X"
    For Account Amount it is what it is, but for Net Amount it is "Account Amount/40%", for PM_Amount it is "Net Amount x (Account Amount/30)" and for field X it is "(Net Amount + PM_Amount)/column A" where column A is another data field in the XML file but it should not be included in the template report..
    Could anyone help me with how to perform such kind of calculations in BIP Template builder? In OBIEE, it is very easy that I can just use column formula, but in BIP I still haven't figure out the way yet..
    PLease advice
    Thanks

    Thanks for the reply..
    I looked at the link you provided already, what I wanna know is how to exactly apply the expression in my calculation. In other words, I know that Column C = "Column A div Column B", but in BIP form property, how do I actually substitue "column A" with the actual column..
    I wish I could post the XML, but it is huge, it contains 6 data sets and more than 100 columns. I only need 15 columns on my template.
    On the form property of each measures, in the "advance tab", I see codes like <?accountamount?>. Now I wanna have a new column said "PM_Amt" which should be "(accountamount div %40) x column B". So I just randomly select another column said "payment". I rename it to "PM_AMT" and on its "advanced tab" it is still <?payment?>. So right there, if I wanna replace that code with a new one that does "(accountamount div %40) x column B" calculation, how would I do it? What would be the syntax including how to propertly refer to the right column field as part of the expression?
    And do I have to always use xdofx between <>? how would I know?
    Please advice if you understood what I am trying to say
    Much thanks
    Edited by: user7276913 on Sep 14, 2009 11:24 PM

  • How to performing calculations at workbook level using using VB / macros et

    HI All,
    I want to know about how to perform calculations at the work book level using VB/Macros..
    Request provide me links related to this .
    Manyt hanks in advance.

    Hi,
    Open the Excel workbook and press ALT + F11. VB editor opens and you can write your piece of code and name it as Auto_open if you need that macro to automatically run when you open excel.
    Second option is record macro, which will record the calculation and then call this macro everytime you need.
    Thanks,
    Tintu

  • Using a Counter(PC-TIO-10) to Perform Quadrature Encoder Buffered Position Measurement in Visual C++

    I have Driver Ni-Daq 6.9 and Using a Counter to Perform Quadrature Encoder Buffered Position Measurement in Visual C++ 6.0
    (I think Ni-Daq not support PC-TIO-10 because card not support pulg&play, you can hint me driver for support this card. ) and i want example program for read counter. i use Visual C++ for run,i don't use Measurement Studio.

    NI-DAQ 6.9 supports the PC-TIO-10.
    I attached an example that will show you how to do it in CVI (ANSI C).
    Attachments:
    Cviencod.zip ‏19 KB

  • What event should I use to grab the record count of a DataGrid?

    I have a "Go" button on a search form.  It works correctly, fetching records from a CF data service into a data bound DataGrid.  However, using the code shown below, the record count always shows zero.  I've tried putting the "..Provider.length" line shown below, into various events on the grid, so that it will always update the count at the correct time, but I get "null" object errors at run time. There seems to be no event that fires "AfterDataLoad".
                protected function btnGo_clickHandler(event:MouseEvent):void
                     getSBJsResult.token = baa_data_svc.getSBJs(cmbSrch.text);
                     tabSbjs.label = 'Subjects: ' + grdSBJs.dataProvider.length;    //  This always returns zero.  Why?

    For example, this doesn't work.  The grid is told to loaded data on line 1, but this must just be only a message send to the Flash Player 10, because the processing doesn't stop and wait for the loading of data to complete, it just continues on to line 2, at which point '...Provider.length' is always zero the first time through.   So... the NEXT time the user clicks the Go button, line 2 is processed for the DataGrid which is holding data from the PREVIOUS search, so it updates the tabSbjs.label with the count from the previous search, not the current search.  The count of records is always for the previous data set.
                protected function btnGo_clickHandler(event:MouseEvent):void
    1               getSBJsResult.token = baa_data_svc.getSBJs(cmbSrch.text);  // edtSrch.text
    2               tabSbjs.label = 'Subjects: ' + grdSBJs.dataProvider.length;                                                                            
    All I'm trying to do is (which seems like a very difficult thing to do in FB4):
    -Display a DataGrid popluated with data records
    -Display a count of how many records are in the data grid
    If I rely on CF9 functions, which can only return a single value, then I have to make two CF9  functions, with the exact same SQL, one that returns data, and one that returns a count of the records.... which is non-sensicle.
    There must be a simple way to do this, but I'm going around in circles.

  • Getting a record count in a query using UNIQUE

    I need to know how to grab a record count for a query so I can pass it back into the recordset.
    This select query uses UNIQUE to rollup the 555 records to 125 unique rows.
    But how would I do a record count.
    Do I pass the query to a cursor and then count the records in the cursor?
    Please detail your help please.
    Thank you in advance.

    SELECT unique
         CE.DATE_OF_SERVICE AS DOS_FROM
         ,CE.SERVICE_END_DATE AS DOS_TO
         ,CE.EVENT_SERVICE AS SERVICE_TYPE
         ,CN.CREATE_DATE_TIME
         ,CN.CASE_NOTE_ID
         ,CN.CASE_ID
         ,CN.EVENT_ID
         ,CN.REASON
         ,CN.CREATOR_USER_ID AS CREATOR_ID_USED
         ,CN.ROWID AS ROW_ID
         ,(SELECT Retrieve_Note2(CN.CASE_ID,CN.CASE_NOTE_ID) from DUAL) AS NOTE
    FROM
         MEMBER_TO_PATIENT MTA,
         CARE_EVENT CE,
         CASE_NOTES CN
    WHERE
         MTA.SUBSCRIBER_LID = '1260016473015' AND
         MTA.CASE_ID = CN.CASE_ID AND
         CN.EVENT_ID = CE.EVENT_ID
    ORDER BY
         CN.CASE_NOTE_ID DESC

  • Restrictions in Oracle Server (table size, record count ...)

    Hello,
    can somebody tell me if there are any restrictions of table size, record count, file size (apart from operation system restrictions) in Oracle 8.1.7 and 7.3.4?
    Or where can i find information? I couldn4t find anything in the generic documentation.
    Thank you in advance,
    Hubert Gilch
    SEP Logistik AG
    Ziegelstra_e 2, D-83629 Weyarn
    Tel. +49 8020 905-214, Fax +49 8020 905-100
    EMail: [email protected]

    Hello,
    if you are executing a DBMS_AQ.DEQUEUE and then perform a rollback in your code the counter RETRY_COUNT will not go up by 1.
    You are only reversing your own AQ action. This counter will be used only internally to log unsuccessful dequeue actions.
    Kind regards,
    WoG

  • Give a simple example of BDC using Recording method

    give the various steps ...

    For a BDC upload you need to write a program which created BDC sessions.
    Steps:
    1. Work out the transaction you would use to create the data manually.
    2. Use transaction SHDB to record the creation of one material master data.
    Click the New recording button or the Menu - Recording - Create
    3. Save the recording, and then go back a screen and go to the overview.
    4. Select the recording and click on Edit - Create Program. Give the program a Z name, and select transfer from recording.
    5. Edit the program. You will see that all the data you entered is hard-coded into the program. You need to make the following changes:
    5.1 After the start-of-selection, Call ws_upload to upload the file (the excel file needs to be saved as TAB separated).
    5.2 After the open-group, Loop on the uploaded data. For each line, perform validation checks on the data, then modify the perform bdc_field commands to use the file data.
    5.3. After perform bdc_transaction, add the endloop.
    Execute the program. It will have options to create a batch session or to process directly.
    These are all my finds . Might be it will be useful to you.
    Direct call of transactions, session handling:
    /nxxxx This terminates the current transaction, and starts transaction xxxx
    /n This terminates the transaction. This generally corresponds to pressing F15 to go back.
    /nend This termiantes all separate sessions and logs off (corresponds to System - Logoff).
    /nex This terminates all separate sessions and logs off immediately (without any warning!).
    /oxxxx This opens a new session and starts transaction xxxx in This session.
    /o This lists existing sessions and allows deletion or opening of a new session.
    /i This terminates the current session (corresponds to System End
    /i1, /i2,... This terminates the session with the number given.
    .xyzw Fast path: 'xyzw' refers to the underlined letters in the menus. This type of navigation is uncommon and is provided more for emergencies (such as a defective mouse).
    Batch
    The following commands can be entered in correction mode ('Process in foreground' or 'Display errors only') when processing a batch input session:
    /n This terminates the current batch input transaction and characterizes it as
    /bdel This deletes the current batch input transaction.
    /bend This terminates batch input processing and sets the session to Failed
    /bda This switches from Display errors only to Process in foreground
    /bde This switches from Process in foreground to Display errors only
    ABAP/4
    /h This switches into debugging mode.
    /hs This switches into debugging mode and activates the debugging of system functions.
    Buffer
    WARNING: Resetting buffers can significantly change the performance of the entire system for a long time.
    It should therefore only be used where there is a good reason tdso. As of release 3.0B system administator authorization is required (authorization object (S_ADMI_FCD). The action is noted in the system log.
    /$SYNC This resets all buffers of the application server
    /$CUA This resets the CUA buffer of the application server
    /$TAB This resets the TABLE buffers of the application server
    /$NAM This resets the nametab buffer of the application server
    /$DYNP This resets the screen buffer of the application server
    SHDB recording helps you to identify the desired screen flow. It shows details like screen sequence, screen nos, screen element names and required user command keys. This all helps while designing / coding a BDC flow for a transaction in the custom program. If you have any more questions or if you are not clear about SHDB, please check this links -
    http://www.planetsap.com/Tips_and_Tricks.htm
    http://www.itcserver.com/blog/2006/07/12/shdb-the-transaction-recorder/
    Direct Input.
    Without calling the screens but all the validations should be done and only for master datas upload.
    Direct Input method:
    1. Only for error free datas and also master data
    updation.
    2. It will directly updates the database table. No
    screens involved.
    3. Transaction BMVO or Program RBMVSHOW has been
    used.
    BDC(Batch Input Session):
    1. Screens will be called programmatically.
    2. First sessions will be created then we'll run the seesions in SM35 transaction.
    3.Synchronous database update. After the processing the session only database update will occur.
    For BDC:
    http://myweb.dal.ca/hchinni/sap/bdc_home.htm
    https://www.sdn.sap.com/irj/sdn/wiki?path=/display/home/bdc&
    http://www.sap-img.com/abap/learning-bdc-programming.htm
    http://www.sapdevelopment.co.uk/bdc/bdchome.htm
    http://www.sap-img.com/abap/difference-between-batch-input-and-call-transaction-in-bdc.htm
    http://help.sap.com/saphelp_47x200/helpdata/en/69/c250684ba111d189750000e8322d00/frameset.htm
    http://www.sapbrain.com/TUTORIALS/TECHNICAL/BDC_tutorial.html
    Check these link:
    http://www.sap-img.com/abap/difference-between-batch-input-and-call-transaction-in-bdc.htm
    http://www.sap-img.com/abap/question-about-bdc-program.htm
    http://www.itcserver.com/blog/2006/06/30/batch-input-vs-call-transaction/
    http://www.planetsap.com/bdc_main_page.htm
    call Transaction or session method ?
    Check this sample one
    ******Internal Table for Header Data.
    TYPES : BEGIN OF type_header,
    kschl LIKE konv-kschl,
    vkorg LIKE vbak-vkorg,
    vtweg LIKE komg-spart,
    matnr LIKE mvke-matnr,
    kbetr(11) TYPE c,
    datab(10) TYPE c,
    datbi(10) TYPE c,
    END OF type_header.
    ****Internal Table for Item Level.
    TYPES : BEGIN OF type_item,
    kschl LIKE konv-kschl,
    vkorg LIKE vbak-vkorg,
    vtweg LIKE komg-spart,
    matnr LIKE mvke-matnr,
    kbetr(11) TYPE c,
    datab(10) TYPE c,
    datbi(10) TYPE c,
    END OF type_item.
    ******Error Table For not found in MVKE.
    TYPES : BEGIN OF type_error ,
    kschl LIKE konv-kschl,
    vkorg LIKE vbak-vkorg,
    vtweg LIKE komg-spart,
    matnr LIKE mvke-matnr,
    kbetr LIKE konp-kbetr,
    datab(10) TYPE c,
    datbi(10) TYPE c,
    text(100) TYPE c,
    END OF type_error.
    ****For error Messages
    TYPES : BEGIN OF type_mtab,
    matnr LIKE mara-matnr,
    msgtyp LIKE bdcmsgcoll-msgtyp,
    msgid LIKE bdcmsgcoll-msgid,
    msgnr LIKE bdcmsgcoll-msgnr,
    text(100) TYPE c,
    END OF type_mtab.
    ****Internal Table
    TYPES: BEGIN OF type_mvke,
    matnr LIKE mvke-matnr,
    vkorg LIKE mvke-vkorg,
    vtweg LIKE mvke-vtweg,
    END OF type_mvke.
    ****Internal Table
    TYPES : BEGIN OF type_tvkov,
    vkorg LIKE tvkov-vkorg,
    vtweg LIKE tvkov-vtweg,
    END OF type_tvkov.
    Declaring Internal Tables
    DATA : t_header TYPE STANDARD TABLE OF type_header,
    t_item TYPE STANDARD TABLE OF type_item,
    t_mvke TYPE STANDARD TABLE OF type_mvke,
    t_tvkov TYPE STANDARD TABLE OF type_tvkov,
    t_error TYPE STANDARD TABLE OF type_error,
    t_mtab TYPE STANDARD TABLE OF type_mtab.
    Work Area Declaration.
    DATA : wa_header LIKE LINE OF t_header,
    wa_item LIKE LINE OF t_item,
    wa_error LIKE LINE OF t_error,
    wa_mtab LIKE LINE OF t_mtab,
    wa_tvkov LIKE LINE OF t_tvkov,
    wa_mvke LIKE LINE OF t_mvke.
    *Rows for Table with Excel Data*******
    DATA: t_xls_file LIKE alsmex_tabline OCCURS 0 WITH HEADER LINE.
    ***Constant.
    DATA : c_params LIKE ctu_params.
    DATA : c_ans(1) TYPE c.
    DATA : v_count(4) TYPE c. " To show No.of records
    DATA : bdctab LIKE bdcdata OCCURS 10 WITH HEADER LINE. " BDCDATA
    DATA : tmess_mtab LIKE bdcmsgcoll OCCURS 10 WITH HEADER LINE.
    SELECTION SCREEN
    SELECTION-SCREEN : BEGIN OF BLOCK b1 WITH FRAME TITLE text-001.
    PARAMETERS : p_fname LIKE rlgrap-filename OBLIGATORY.
    SELECTION-SCREEN : END OF BLOCK b1.
    END OF SELECTION SCREEN.
    DATA : repid LIKE sy-repid.
    DATA : v_matnr(50) TYPE c, "used for line items
    v_kbetr(50) TYPE c, "used for line items
    v_dat1(50) TYPE c, "used for line items
    v_dat(50) TYPE c. "used for line items
    DATA : v_lindx(5) TYPE n ,"index counter for first 14 records.
    v_lindx1(5) TYPE n VALUE '01', "index counter for 13 records.
    v_item(5) TYPE c, "To increment the line index
    v_pgedwn2 TYPE i . "For Pagedown Counter
    DATA: v_currentrow TYPE i. "For Current Row
    DATA v_bdc(50) TYPE c." Text to apper in Confrim POPUP Window.
    ************AT SELECTION-SCREEN
    AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_fname.
    PERFORM get_filename USING p_fname.
    *************START-OF-SELECTION
    START-OF-SELECTION.
    ******Values for Ctu_params to Transaction
    c_params-defsize = 'X'.
    c_params-dismode = 'N'.
    c_params-updmode = 'S'.
    ******Refresh
    PERFORM f_refresh.
    *********To upload File.
    PERFORM upload_file.
    ****User Confrimation only BDC will Process
    IF c_ans = '1'.
    *** BDC Process.
    PERFORM read_data.
    ELSE.
    FORMAT COLOR 3 INTENSIFIED .
    WRITE:/ 'Selected not to Process the Upload'.
    EXIT.
    ENDIF.
    ******On completion of Process Refresh the Internal Table
    REFRESH : t_xls_file,
    t_header,
    t_item,
    t_mvke,
    t_tvkov.
    CLEAR : t_xls_file,
    wa_header,
    wa_item,
    wa_mvke,
    wa_tvkov.
    ***********Display Messages
    WRITE : /01 'Status',19 'Status Text'.
    WRITE AT 0(150) sy-uline.
    LOOP AT t_mtab INTO wa_mtab.
    WRITE :/01 wa_mtab-msgtyp,19 wa_mtab-text.
    ENDLOOP.
    SKIP 2.
    SORT t_error BY matnr.
    WRITE AT 0(150) sy-uline.
    WRITE 'ERROR MESSAGES'.
    WRITE AT 0(150) sy-uline.
    WRITE :/01 'Material.No',20 'Status Text'.
    WRITE AT 0(150) sy-uline.
    LOOP AT t_error INTO wa_error WHERE matnr NE ' '.
    WRITE:/01 wa_error-matnr,20 wa_error-text.
    ENDLOOP.
    *& Form get_filename
    text
    -->P_FILENAME text
    FORM get_filename USING p_fname.
    *****To read the file from Presentation Server
    CALL FUNCTION 'KD_GET_FILENAME_ON_F4'
    EXPORTING
    program_name = repid
    dynpro_number ! ; = syst-dynnr
    field_name = p_fname
    STATIC = ' '
    mask = '*.XLS'
    CHANGING
    file_name = p_fname
    EXCEPTIONS
    mask_too_long = 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. " get_filename
    *& Form upload_file
    text
    --> p1 text
    <-- p2 text
    FORM upload_file.
    DATA : frow VALUE 2 TYPE i,
    fcol VALUE 1 TYPE i,
    erow VALUE 10000 TYPE i,
    ecol VALUE 7 TYPE i,
    ecol1 VALUE 1 TYPE i,
    c_col1 TYPE i VALUE '0001',
    c_col2 TYPE i VALUE '0002',
    c_col3 TYPE i VALUE '0003',
    &nb! sp; c_col4 TYPE i VALUE '0004',
    c_col5 TYPE i VALUE '0005',
    c_col6 TYPE i VALUE '0006',
    c_col7 TYPE i VALUE '0007'.
    ***FM used to UPLOAD data from Flat file
    CALL FUNCTION 'ALSM_EXCEL_TO_INTERNAL_TABLE'
    EXPORTING
    filename = p_fname
    i_begin_col = fcol
    i_begin_row = frow
    i_end_col = ecol
    i_end_row = erow
    TABLES
    intern = t_xls_file
    EXCEPTIONS
    inconsistent_parameters = 1
    upload_ole = 2
    OTHERS = 3.
    IF sy-subrc <> 0.
    MESSAGE e000.
    ENDIF.
    ****T_XLS_FILE is initial, stop the process & throw message
    IF t_xls_file[] IS INITIAL.
    FORMAT COLOR 6 ON INTENSIFIED ON.
    WRITE:/ 'No Data Exists '.
    FORMAT COLOR OFF INTENSIFIED OFF.
    STOP.
    ELSE.
    Sort table by rows and colums
    SORT t_xls_file BY row col.
    Get first row retrieved
    READ TABLE t_xls_file INDEX 1.
    Set first row retrieved to current row
    v_currentrow = t_xls_file-row.
    **Loop to move data in internal Table
    LOOP AT t_xls_file .
    Reset values for next row
    IF t_xls_file-row NE v_currentrow.
    APPEND wa_header TO t_header.
    CLEAR wa_header.
    v_currentrow = t_xls_file-row.
    ENDIF.
    CASE t_xls_file-col.
    WHEN c_col1. "Kschl
    wa_header-kschl = t_xls_file-value.
    WHEN c_col2. "Vkorg
    wa_header-vkorg = t_xls_file-value.
    WHEN c_col3. "vtweg
    wa_header-vtweg = t_xls_file-value.
    WHEN c_col4. "Matnr
    wa_header-matnr = t_xls_file-value.
    WHEN c_col5. "Kbetr
    wa_header-kbetr = t_xls_file-value.
    WHEN c_col6. "FROm
    wa_header-datab = t_xls_file-value.
    WHEN c_col7. "TO
    wa_header-datbi = t_xls_file-value.
    ENDCASE.
    ENDLOOP.
    APPEND wa_header TO t_header.
    CLEAR wa_header.
    ENDIF.
    ****To process the data
    PERFORM f_process.
    ENDFORM. " upload_file
    *& Form READ_DATA
    text
    --> p1 text
    <-- p2 text
    FORM read_data.
    ****To make Uniq Records in Header Level
    SORT t_header BY kschl vkorg vtweg.
    DELETE ADJACENT DUPLICATES FROM t_header COMPARING
    kschl vkorg vtweg .
    SORT t_item BY vkorg vtweg matnr.
    DATA : wa1_item TYPE type_item.
    DATA : l_cnt TYPE i.
    DATA : flag(1) TYPE c. "to process the Line item.
    ***Looping Header Table.
    LOOP AT t_header INTO wa_header.
    PERFORM bdc_dynpro US! ING 'SAPMV13A' '0100'.
    PERFORM bdc_field USING 'BDC_CURSOR'
    'RV13A-KSCHL'.
    PERFORM bdc_field USING 'BDC_OKCODE'
    '=ANTA'.
    PERFORM bdc_field USING 'RV13A-KSCHL'
    wa_header-kschl.
    PERFORM bdc_dynpro USING 'SAPLV14A' '0100'.
    PERFORM bdc_field USING 'BDC_CURSOR'
    'RV130-SELKZ(03)'.
    PERFORM bdc_field USING 'BDC_OKCODE'
    '=WEIT'.
    PERFORM bdc_field USING 'RV130-SELKZ(03)'
    'X'.
    PERFORM bdc_dynpro USING 'SAPMV13A' '1004'.
    PERFORM bdc_field USING 'BDC_CURSOR'
    'KOMG-VKORG'.
    PERFORM bdc_field USING 'KOMG-VKORG'
    wa_header-vkorg.
    PERFORM bdc_field USING 'KOMG-VTWEG'
    wa_header-vtweg.
    ****To handle Line Items.
    LOOP AT t_item INTO wa1_item WHERE vkorg = wa_header-vkorg AND
    vtweg = wa_header-vtweg.
    wa_item = wa1_item.
    ******Flag Set only After processing first 14 records .
    IF flag = ' '.
    v_lindx = v_lindx + 01.
    SHIFT v_lindx LEFT DELETING LEADING '0'.
    v_item = v_lindx .
    CONCATENATE 'KOMG-MATNR(' v_item ')' INTO v_matnr.
    PERFORM bdc_field USING v_matnr
    wa_item-matnr.
    CONCATENATE 'KONP-KBETR(' v_item ')' INTO v_kbetr.
    PERFORM bdc_field USING v_kbetr
    wa_item-kbetr.
    CONCATENATE 'RV13A-DATAB(' v_item ')' INTO v_dat.
    PERFORM bdc_field USING v_dat
    wa_item-datab.
    CONCATENATE 'RV13A-DATBI(' v_item ')' INTO v_dat1.
    PERFORM bdc_field USING v_dat1
    wa_item-datbi.
    IF v_item = 14.
    flag = 'X'.
    PERFORM bdc_field USING 'BDC_OKCODE'
    '/00'.
    PERFORM bdc_field USING 'BDC_OKCODE'
    '=P+'.
    PERFORM bdc_dynpro USING 'SAPMV13A' '1004'.
    CLEAR v_lindx.
    CLEAR v_item.
    CONTINUE.
    ENDIF.
    ENDIF.
    ***Flag is Set after Processing of 14 records.
    TO process rest of Records
    IF flag = 'X'.
    v_pgedwn2 = v_pgedwn2 + 1.
    v_lindx1 = v_lindx1 + 01.
    SHIFT v_lindx1 LEFT DE! LETING LEADING '0'.
    v_item = v_lindx1 .
    CONCATENATE 'KOMG-MATNR(' v_it! em ')' INTO v_matnr.
    PERFORM bdc_field USING v_matnr
    wa_item-matnr.
    CONCATENATE 'KONP-KBETR(' v_item ')' INTO v_kbetr.
    PERFORM bdc_field USING v_kbetr
    wa_item-kbetr.
    CONCATENATE 'RV13A-DATAB(' v_item ')' INTO v_dat.
    PERFORM bdc_field USING v_dat
    wa_item-datab.
    CONCATENATE 'RV13A-DATBI(' v_item ')' INTO v_dat1.
    PERFORM bdc_field USING v_dat1
    wa_item-datbi.
    IF v_pgedwn2 = 13.
    PERFORM bdc_field USING 'BDC_OKCODE'
    '/00'.
    PERFORM bdc_field USING 'BDC_OKCODE'
    '=P+'.
    PERFORM bdc_dynpro USING 'SAPMV13A' '1004'.
    v_pgedwn2 = 0.
    v_lindx1 = 1.
    CLEAR v_item.
    CONTINUE.
    ENDIF.
    ENDIF.
    ENDLOOP.
    PERFORM bdc_field USING 'BDC_OKCODE'
    '=SICH'.
    Calling Transaction after Processing All items.
    CALL TRANSACTION 'VK11' USING bdctab
    OPTIONS FROM c_params MESSAGES INTO tmess_mtab.
    REFRESH bdctab.
    CLEAR : bdctab.
    CLEAR : wa_item.
    CLEAR : wa1_item.
    CLEAR : wa_header.
    CLEAR : l_cnt.
    CLEAR : v_lindx1.
    CLEAR: v_pgedwn2,v_lindx.
    LOOP AT tmess_mtab .
    l_cnt = l_cnt + 1.
    READ TABLE t_item INTO wa_item INDEX l_cnt .
    CALL FUNCTION 'MASS_MESSAGE_GET' "To get the Message Text
    EXPORTING
    arbgb = tmess_mtab-msgid
    msgnr = tmess_mtab-msgnr
    msgv1 = tmess_mtab-msgv1
    msgv2 = tmess_mtab-msgv2
    msgv3 = tmess_mtab-msgv3
    msgv4 ! = tmess_mtab-msgv4
    IMPORTING
    msgtext = wa_mtab-text
    EXCEPTIONS
    message_not_found = 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.
    wa_mtab-matnr = wa_item-matnr.
    wa_mtab-msgtyp = tmess_mtab-msgtyp.
    wa_mtab-msgid = tmess_mtab-msgid.
    wa_mtab-msgn! r = tmess_mtab-msgnr.
    APPEND wa_mtab TO t_mtab.
    CLEAR wa_mtab-text.
    CLEAR wa_item.
    ENDLOOP.
    ENDLOOP.
    ENDFORM. " READ_DATA
    *& Form BDC_DYNPRO
    text
    -->P_0300 text
    -->P_0301 text
    Start new screen *
    FORM bdc_dynpro USING program dynpro.
    CLEAR bdctab.
    bdctab-program = program.
    bdctab-dynpro = dynpro.
    bdctab-dynbegin = 'X'.
    APPEND bdctab.
    ENDFORM. " BDC_DYNPRO
    *& Form BDC_FIELD
    text
    -->P_0305 text
    -->P_WA_HEADER_KSCHL text
    Insert field *
    FORM bdc_field USING fnam fval.
    CLEAR bdctab.
    bdctab-fnam = fnam.
    bdctab-fval = fval.
    APPEND bdctab.
    ENDFORM. " BDC_FIELD
    *& Form bdc_trc_ansaction
    text
    -->P_0527 text
    *& Form f_Process
    text
    --> p1 text
    <-- p2 text
    FORM f_process.
    DATA : l_todate(12) TYPE c,
    l_frdate(12) TYPE c.
    ***Select for all entries of material in Header "Flat File Materials".
    IF NOT t_header[] IS INITIAL.
    SELECT matnr vkorg vtweg FROM mvke INTO TABLE t_mvke FOR ALL ENTRIES
    IN t_header WHERE matnr = t_header-matnr AND
    vkorg = t_header-vkorg AND
    vtweg = t_header-vtweg.
    ENDIF.
    *********select Sales.org & Dist.channel.
    IF NOT t_header[] IS INITIAL.
    SELECT vkorg vtweg FROM tvkov INTO TABLE t_tvkov FOR ALL ENTRIES IN
    t_header WHERE vkorg = t_header-vkorg
    AND vtweg = t_header-vtweg.
    ENDIF.
    ***Checking for material in Sales Master Table
    SORT t_mvke BY matnr vkorg vtweg.
    SORT t_tvkov BY vkorg vtweg.
    LOOP AT t_header INTO wa_header.
    READ TABLE t_mvke INTO wa_mvke WITH KEY matnr = wa_header-matnr
    vkorg = wa_header-vkorg
    ! ; vtweg = wa_header-vtweg BINARY SEARCH.
    IF sy-subrc <> 0.
    wa_error = wa_header.
    &nb! sp; MOVE text-011 TO wa_error-text.
    APPEND wa_error TO t_error.
    DELETE TABLE t_header FROM wa_header.
    ELSE.
    ********Date Validations
    IF ( wa_header-datab NE ' ! ; ' AND wa_header-datbi NE ' ' ) .
    l_todate = wa_header-datab.
    l_frdate = wa_header-datbi.
    REPLACE '.' INTO l_toda! te WITH ''.
    REPLACE '.' INTO l_todate WITH ''.
    CONDENSE l_todate NO-GAPS.
    REPLACE '.' INTO l_frdate WITH ''.
    REPLACE '.' INTO l_frdate WITH ''.
    CONDENSE l_frdate NO-GAPS.
    IF l_frdate < l_todate.
    wa_error = wa_header .
    MOVE text-012 TO wa_error-text.
    APPEND wa_error TO t_error.
    DELETE TABLE t_header FROM wa_header.
    ENDIF.
    ELSE.
    wa_error = wa_header .
    MOVE text-016 TO wa_error-text.
    APPEND wa_error TO t_error.
    DELETE TABLE t_header FROM wa_header.
    ENDIF.
    ENDIF.
    ********Rate Validation.
    IF wa_header-kbetr = ' '.
    wa_error = wa_header .
    MOVE text-017 TO wa_error-text.
    APPEND wa_error TO t_error.
    DELETE TABLE t_header FROM wa_header.
    ENDIF.
    READ TABLE t_tvkov INTO wa_tvkov WITH KEY vkorg = wa_header-vkorg
    BINARY SEARCH.
    IF sy-subrc = 0.
    READ TABLE t_tvkov INTO wa_tvkov WITH KEY vtweg = wa_header-vtweg
    BINARY SEARCH.
    IF sy-subrc <> 0.
    wa_error = wa_header.
    MOVE text-015 TO wa_error-text.
    WRITE wa_header-vtweg TO wa_error-text+13(4).
    APPEND wa_error TO t_error.
    ENDIF.
    ELSE.
    wa_error = wa_header.
    MOVE text-013 TO wa_error-text.
    WRITE wa_header-vkorg TO wa_error-text+9(4).
    APPEND wa_error TO t_error.
    ENDIF.
    CLEAR wa_header.
    ENDLOOP.
    *****Deleting Duplicate Material Form Header "Flat File Data".
    SORT t_header BY kschl vkorg vtweg matnr.
    DELETE ADJACENT DUPLICATES FROM t_header COMPARING
    kschl! vkorg vtweg matnr .
    ****Data Moving from Header to Item Level.
    t_item[] = t_header[].
    *To count No.of records in Item Table.
    DESCRIBE TABLE t_item LINES v_count.
    CONCATENATE text-014 ' ' v_count INTO v_bdc.
    ****Popup to get Confirmation from user to process BDC
    CALL FUNCTION 'POPUP_TO_CONFIRM'
    EXPORTING
    titlebar = 'Confirmation of File Data'
    text_question = v_bdc
    text_button_1 = 'Confirm'
    text_button_2 = 'Cancel Run'
    default_button = '1'
    IMPORTING
    answer = c_ans.
    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. " f_Process
    *& Form f_Refresh
    text
    --> p1 text
    <-- p2 text
    FORM f_refresh.
    REFRESH : t_xls_file,
    t_header,
    t_item,
    t_mvke,
    t_tvkov,
    t_error,
    t_mtab.
    CLEAR : t_xls_file,
    wa_header,
    wa_item,
    wa_mvke,
    wa_tvkov,
    wa_error,
    wa_mtab.
    ENDFORM. " f_Refresh
    ALSO PLEASE CHECK OUT
    sample code for call transaction method
    http://www.sapdevelopment.co.uk/bdc/bdc_ctcode.htm
    chk this for BDC recording with screen shots
    http://www.sapdevelopment.co.uk/bdc/bdc_recording.htm
    BDC
    http://www.sap-img.com/bdc.htm
    Table control in BDC
    http://www.sap-img.com/abap/bdc-example-using-table-control-in-bdc.htm
    best typical example is BDC for MM01
    check the below links for the same
    bdc for MM01.
    mm01
    bdc mm01
    BDC
    http://www.sap-img.com/bdc.htm
    http://www.guidancetech.com/people/holland/sap/abap/zzsni001.htm
    http://www.sappoint.com/abap/bdcconcept.pdf
    Difference between Genrate session& Call transaction
    Re: Steps in BDC

  • Leaf Record Count???

    Hi
    I've never had any probs with my powerbook g4 until last week when it started to operate at a very very very slow pace and sometimes not connecting to my desktop (grey screen only after the apple logo). After running the disk repair from disk utility everything repaired apart from the leaf record count - which said:
    "Invalid leaf record count
    (It should be 6 instead of 53)"
    Does anyone know what this means? My mac started working ok again after repairing it despite this,but on Friday my mac wouldn't connect to anything on my desktop and the mouse arrow just kept turning into the spinning disk as if it was loading something but to no avail. Today it's working ok again but at a slow pace and when running the repair disk again in disk utility it says everything is fine apart from this leaf record count again - is this whats causing the problems? And if so, how do I repair it?

    Keelyb24:
    Joeuu is correct. Here is documentaton: Mac OS X 10.3: Disk Utility reports inaccurate "Volume needs to be repaired" message when checking Mac OS X 10.4 volume. If you used a Panther install disk for running DU, i suggest you try it from the Tiger install disk.
    In terms of your slow computer, that is another issue. Take a look at Dr. Smoke's FAQ Tuning Mac OS X Performance and see if you find anything there that helps. If the problem persists, please post back with further questions or comments.
    Good luck.
    cornelius

  • How to get a total record count before grouping?

    I need to group a report on a formula that does roughly the following:
    [record count] / ( [total record count] / 20 )
    What this acheives is to label each record with a number of 1 - 20 which I want to group on. Getting this figure is the easy part, what is not working is the fact that I cannot group from a formula that is calculated after grouping. I overcame a portion of this by using "Whilereadingrecords" (rather than "count", running totals, or while printing records) to acheive a record count.
    I can't figure out how to get a total record count done before grouping. Is there a way to do this with "WhileReadingRecords"?? Is this even possible?
    Thanks
    John

    Hi John, 
    The order of how Crystal does things dictates the order of which features you can use.  Crystal has a two pass method.  In the first pass it does things like passing the query, grouping, summarizing.  In the second pass it does formulas, formatting, etc. 
    Unfortunately Crystal does the Grouping before summarizing so what you want to do can't be done in Crystal.  The best way to get around this to either create a SQL Command or view/stored procedure that will do the summarizing for you.  Then in the report you can use it. 
    Hope this helps,
    Brian

  • Find Record count in a file.

    Hi,
    Is it possible to find the total no. of records (lines) in a file?
    With External Table: and using select count(*) on that external table.
    But here, we will only get the rows which are valid. Non Valid records will go to the bad file.
    Another ways is: Reading the entire file using utl_file.get_line and then incrementing a counter.
    But, we need to read through the whole file just to get the count.
    Is there any better way of doing this?
    Any suggestions?
    ( I accept sql/plsql is for db related things and not to handle OS related tasks. But I don't like writing a seperate shell script for this small thing because, I just moved every thing like data load, emailing etc in to plsql from unix and proc :) )
    Version:
    Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - 64bi
    PL/SQL Release 10.2.0.1.0 - Production
    Unfortunately No Java is Installed
    Thanks in advance,
    Pradeep.

    pradeep.vupala wrote:
    Hi,
    Is it possible to find the total no. of records (lines) in a file?
    With External Table: and using select count(*) on that external table.
    But here, we will only get the rows which are valid. Non Valid records will go to the bad file.
    Another ways is: Reading the entire file using utl_file.get_line and then incrementing a counter.
    But, we need to read through the whole file just to get the count.
    Is there any better way of doing this?Not really, that's just about your two ways.
    1 alternative...
    You could set up a dummy external table pointing to the file that just has a single column of varchar2 with no delimiters so it reads a line at a time, and won't get any bad rows, then do a count(*) on that table.

  • Error when using record group type as param in a function in where clause

    Hi folks.
    I have a record type defined in a packages specification. I have to use this record as parameter to call a function. I am able to call the function if as return its value to a string variable. However, the function should be called into a query to compare the returned value and this code is not compiled.
    The code is below:
    DECLARE
    l_line_group_rec INL_CUSTOM_PUB.inl_ship_headers_rec;
    l_name VARCHAR2(100);
    l_count NUMBER;
    BEGIN
    l_name := INL_GET_PARTY_SITE_NAME(l_line_group_rec); -- Compiling successfully
    SELECT COUNT(1)
    INTO l_count
    FROM dual
    WHERE INL_GET_PARTY_SITE_NAME(l_line_group_rec) = 'Allied Manufacturing'; --- Error when compiling
    END;
    I got the error: PLS-00306: wrong number or types of arguments in call to 'INL_GET_PARTY_SITE_NAME'
    I would like to know if there is any restriction in using record type as parameter in where clauses or if there is another way to do it.
    Thanks in advance

    Hi.
    The definition of INL_GET_PARTY_SITE_NAME:
    FUNCTION INL_GET_PARTY_SITE_NAME(p_line_group_rec INL_CUSTOM_PUB.inl_ship_headers_rec) RETURN VARCHAR2 IS
    l_party_site_name VARCHAR2(100);
    BEGIN
    l_party_site_name := 'Allied Manufacturing';
    URN l_party_site_name;
    END INL_GET_PARTY_SITE_NAME;
    Thanks.

  • Record Count Issue in Search page ?

    Hi Friends
    I am trying to display record count on Search page and I have the following code in
    The table has total of 62 Rows
    AM : for testing purpose, i am printing in log
    public void getISAGRecordCount()
    OAViewObject vo = (OAViewObject)getXXG2_ELIM_ISAGSView1(); //getXXG2ISAGSearchVO1();
    int fetchedRowCount = 0;
    vo.setMaxFetchSize(-1);
    vo.executeQuery();
    fetchedRowCount = vo.getRowCount();
    System.out.println("RowCount: "+ fetchedRowCount);
    IN PFR of CO: I am calling by this way
    am.invokeMethod("getISAGRecordCount");
    the Issue is
    for the first time, when i search  Based on search criteria, I know it should dispaly 10 records  but in the Log file i see the total Record Count of the Table     Ex; 62
    When i do the serach for the second time, based on search criteria, I know it should display 20 records, but the log file has 10 records ( previous search results)
    If I do the search for 3rd time, I see 2nd search results in log
    Any help in this issue, how to fix this?
    Thanks
    Ravi

    Hi,
    Please donot use getRowCount(), use getFetchedRowCount() and remove setMaxFetchSize(-1).
    Hope it will resolve your issue.
    Just for understanding of the concept:
    getFetchedRowCount() returns the number of rows cached in the view object -- including programmatically inserted rows.
    The getRowCount() implicitly execute a query against the database (if a query has not been executed yet)
    Regards,
    Reetesh Sharma

  • Problem in getting update records count while executeBatch()

    hi,
    I have used "Select in Insert" queries for migrating data from one table to another.
    like
    INSERT INTO TABLE1 (COL1, COL2)
    SELECT COL1,COL2,... FROM TABLE2
    WHERE COL1 = ... AND COL2 = ...;
    Case 1:
    I added these statements as addBatch() & at the end i execute method " executeBatch()". It returned the array of integer having record count for each query respectively.
    But that count was always be -2 i.e. SUCCESS_NO_INFO.
    Case 2:
    If i run the same code with executeUpdate() method , it returned me the correct number of records counts that are inserted into the table.
    I cudn't able to understand that it is failing for case1.
    Can anybody tell the reason for this behaviour .......................
    Edited by: user11187328 on Mar 17, 2010 3:45 AM
    Edited by: user11187328 on Mar 17, 2010 3:46 AM

    hi,
    Thanks again for a correct reply but can u also tell me tht which jar i needs to included.
    There are so many jar files & should i remove old jar files or jvm auto picks the updated jar file.
    Following jar files are shown on the link:::
    ojdbc5.jar (1,996,228 bytes) - Classes for use with JDK 1.5. It contains the JDBC driver classes, except classes for NLS support in Oracle Object and Collection types.
    ojdbc5_g.jar (3,081,328 bytes) - Same as ojdbc5.jar, except that classes were compiled with "javac -g" and contain tracing code.
    ojdbc6.jar (2,111,220 bytes) - Classes for use with JDK 1.6. It contains the JDBC driver classes except classes for NLS support in Oracle Object and Collection types.
    ojdbc6_g.jar (3,401,519 bytes) - Same as ojdbc6.jar except compiled with "javac -g" and contains tracing code.
    ojdbc5dms.jar (2,429,777 bytes) - Same as ojdbc5.jar, except that it contains instrumentation to support DMS and limited java.util.logging calls.
    ojdbc5dms_g.jar (3,101,875 bytes) - Same as ojdbc5_g.jar, except that it contains instrumentation to support DMS.
    ojdbc6dms.jar (2,655,741 bytes) - Same as ojdbc6.jar, except that it contains instrumentation to support DMS and limited java.util.logging calls.
    ojdbc6dms_g.jar (3,423,263 bytes) - Same as ojdbc6_g.jar except that it contains instrumentation to support DMS.
    orai18n.jar (1,656,280 bytes) - NLS classes for use with JDK 1.5, and 1.6. It contains classes for NLS support in Oracle Object and Collection types. This jar file replaces the old nls_charset jar/zip files.
    demo.zip (603,363 bytes) - contains sample JDBC programs.

  • Problem in getting correct update records count while getUpdateCount()

    hi,
    I have used "Select in Insert" queries for migrating data from one table to another.
    like
    INSERT INTO TABLE1 (COL1, COL2)
    SELECT COL1,COL2,... FROM TABLE2
    WHERE COL1 = ... AND COL2 = ...;
    Case 1:
    I added these statements as addBatch() & at the end i execute method " executeBatch()".
    Then i execute
    getUpdateCount() method
    on that prepareStatement ,but that count was not correct all the time.
    Case 2:
    If i run the same code with executeUpdate() method , it returned me the correct number of records counts that are inserted into the table.
    I cudn't able to understand that it is failing for case1.
    Can anybody tell the reason for this behaviour .......................
    Edited by: user11187328 on Mar 18, 2010 4:52 AM

    hi,
    Thanks again for a correct reply but can u also tell me tht which jar i needs to included.
    There are so many jar files & should i remove old jar files or jvm auto picks the updated jar file.
    Following jar files are shown on the link:::
    ojdbc5.jar (1,996,228 bytes) - Classes for use with JDK 1.5. It contains the JDBC driver classes, except classes for NLS support in Oracle Object and Collection types.
    ojdbc5_g.jar (3,081,328 bytes) - Same as ojdbc5.jar, except that classes were compiled with "javac -g" and contain tracing code.
    ojdbc6.jar (2,111,220 bytes) - Classes for use with JDK 1.6. It contains the JDBC driver classes except classes for NLS support in Oracle Object and Collection types.
    ojdbc6_g.jar (3,401,519 bytes) - Same as ojdbc6.jar except compiled with "javac -g" and contains tracing code.
    ojdbc5dms.jar (2,429,777 bytes) - Same as ojdbc5.jar, except that it contains instrumentation to support DMS and limited java.util.logging calls.
    ojdbc5dms_g.jar (3,101,875 bytes) - Same as ojdbc5_g.jar, except that it contains instrumentation to support DMS.
    ojdbc6dms.jar (2,655,741 bytes) - Same as ojdbc6.jar, except that it contains instrumentation to support DMS and limited java.util.logging calls.
    ojdbc6dms_g.jar (3,423,263 bytes) - Same as ojdbc6_g.jar except that it contains instrumentation to support DMS.
    orai18n.jar (1,656,280 bytes) - NLS classes for use with JDK 1.5, and 1.6. It contains classes for NLS support in Oracle Object and Collection types. This jar file replaces the old nls_charset jar/zip files.
    demo.zip (603,363 bytes) - contains sample JDBC programs.

Maybe you are looking for

  • Apple built-in apps crashing

    I am having problems with my built-in iPhone apps.  None of these problems happen with my non-Apple apps.  My iPhone music app won't sync with my computer -- I make changes to playlists on my computer that won't sync with my iPhone.  When I try to ma

  • Personal domain and idisk

    Hi, my question is, can i use the idisk to host my own personal website that is currently being hosted at another site, and use my own domain name? I am not using iweb but i do have idisk. I simply want to move my current website thats being hosted e

  • Displaying "Revision Number" in a report

    We use Crystal's revision number as a means to help us track a problem one of our clients may be having with a report we have provided them for use by our application.  Revision number is found in the Crystal file document summary File > Summary Info

  • SharePoint 2010 DB moved to new SQL server

    Hi All,   Quick Question.. When we move SP 2010 DB to one SQL server to New One .. What are thing need to followed to make sure Sites are working fine  V Jean

  • How can I configure radius to allow a non-windows device to authenticate with a certificate?

    I currently have a 2008r2 server with NPS acting as a radius server for our wireless network.  The existing rules are setup to allow access based on windows group membership.  I need to get a wireless jetdirect connected to the wifi network.   If I c