Dynamically Changing Number of Channels in Chart

Hi,
I have a simple question about a labview programming issue. I am
trying to modify an NI Example program for demonstrational purposes.
I am using the Multi-plot real-time chart example program (link below)
from the NI website. I have changed your example for the chart to
display the data in the stacked plot mode. How could I modify it to
vary the number of traces dynamically. Is this possible? My goal
would be to use a series or radio buttons to control viewing 4, 8 or
16 channels, in real time. All of the code and programs I have seen
have channel display statically in the begining setup. Is there a
property node of the chart that controls this?
Thanks
John
http://zone.ni.com/devzone/explprog.nsf/6c163603
265406328625682a006ed37d/5ac3fd88cb3815f086256657007542ee?OpenDocument

To accomplish your goal, the example VI needs to be modified a little bit. I've made one such modification and attached the modified file. I hope it helps. Please note that nothing shows on the Front Panel Until you press one of the control buttons.
Attachments:
Modified_Multi-plot_real-time_chart.vi ‏138 KB

Similar Messages

  • Dynamicall​y Changing Number of Channels in Chart

    Hi,
    I have a simple question about a labview programming issue. I am
    trying to modify an NI Example program for demonstrational purposes.
    I am using the Multi-plot real-time chart example program (link below)
    from the NI website. I have changed your example for the chart to
    display the data in the stacked plot mode. How could I modify it to
    vary the number of traces dynamically. Is this possible? My goal
    would be to use a series or radio buttons to control viewing 4, 8 or
    16 channels, in real time. All of the code and programs I have seen
    have channel display statically in the begining setup. Is there a
    property node of the chart that controls this?
    Thanks
    John
    http://zone.ni.com/devzone/explprog.nsf/6c163
    603265406328625682a006ed37d/5ac3fd88cb3815f0862566​57007542ee?OpenDocument

    Mark,
    I would appreciate if i could see some code. Would you please email
    it to my hotmail address.
    Thanks
    John
    On Mon, 4 Feb 2002 07:40:27 -0800 (PST), markwysong
    wrote:
    >There's not really a property node. I've done this before, but it's
    >not exactly straight forward. If you stretch the window that shows
    >the trace names and colors, you can show more trace names and colors.
    >Make sure that this is big enough to handle the max number of traces
    >that you'll need.
    >
    >Next, in your code, make a property node for the chart. You'll need
    >to set all the trace colors to transparent to begin with, then change
    >them to a predefined color depending on how many traces you have. You
    >do this by using the property node, setting the active plot, then
    >
    changing the color (and name, too). Then you just wire the plots to
    >the chart, and it should display it. I can show you some of my code
    >that performs these functions if need be.
    >
    >Mark

  • Dynamically Change Ni HSDIO Channels

    I am currently using a PXI-6552 to generate and acquire I2C waveforms simultaneous.  I would like to know if it is possible (and how I would go about it) to dynamically change channels.  My goal is to just pass the two NI-HSDIO references (the purple variables) to a new subVI that I will create to change from 5 channels to a different set of 5 channels.  For instance:
    Pseudo-Code:
    initalize PXI sessions;
    for(i = 0; i < 10; i++)
    Set channels 0-5;
    Run generate and acquire;
    Stop acquisition;
    Set channels to 6-10;
    Run generate and acquire;
    Stop acquisition;
    Set channels to 11-15;
    Run generate and acquire;
    Stop acquisition;
    close PXI sessions;
    Basically I need the quickest way to switch acquisition channels without having to initalize and close the sessions every time. 
    I am currently using the HWC functions downloaded in the .zip example from here: http://www.ni.com/example/31200/en/. (I also attached the two that are necessary for my problem).
    Init HWC Device.vi:  (also attached)
    Run HWC Device.vi:  (also attached)
    I believe the VIs I may need are Assign Dynamic Channels, Configure Idle State, and Configure Initial State.  However I am not sure if those are the only ones.  If it is possible, do I have to close the original channels and then assign more?  Or does re-calling "Assign Dynamic Channels" automatically disable all non-assigned channels?  Etc.
    The important things to note:  I am setting 5 channels at a time -- for both acquisition AND generation.   I need to close the channels and switch to 5 different channels -- for both acquisition AND generation.  All channels should be set to "z" state for high-impedance at all times.
    If you need any other information, please let me know!  Thank you in advance for any suggestions/assistance.
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    If someone helped you out, please select their post as the solution and/or give them Kudos!
    Solved!
    Go to Solution.
    Attachments:
    Init HWC Device.vi ‏24 KB
    Run HWC Device.vi ‏30 KB

    Through trial and error I was able to come up with a way to do this:
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    If someone helped you out, please select their post as the solution and/or give them Kudos!

  • Generic calculations with changing number of channels

    Hello,
    I would like to make some basic calculations with a flexible number of channels. The point is that I get an error if I specify channels which are not existing in my calculations. For example :
    CCh("[1]/CNV",2)-CCh("[2]/CNV",2)+CCh("[3]/CNV",2)-...
    I think it should be possible to do it by using a script, but do you have any idea how to do it only with the calculator?
    Thank you in advance
    Jérémy
    Solved!
    Go to Solution.

    You can do easily by using Recoding mode for VBScript described in the following KB:
    http://digital.ni.com/public.nsf/allkb/B769AE10EDB656D28625692D00583166?OpenDocument
    Paolo_P
    National Instruments France
    #adMrkt{text-align: center;font-size:11px; font-weight: bold;} #adMrkt a {text-decoration: none;} #adMrkt a:hover{font-size: 9px;} #adMrkt a span{display: none;} #adMrkt a:hover span{display: block;}
    Travaux Pratiques d'initiation à LabVIEW et à la mesure
    Du 2 au 23 octobre, partout en France

  • Dynamically change number of columns in report

    all,
    I am trying to change the number of columns in a report dynamically as in this sample(http://actionet.homelinux.net/htmldb/f?p=LSPDEMO:60:11041263091189::NO:::) , can somebody who has this code kindly send it to me or make reference...i'll appreciate

    But Howards solution is easier to follow and works perfectly with a shuttle.
    Define a function like this:
    create or replace FUNCTION item_in_list(p_num IN NUMBER, p_shuttle_name in VARCHAR2)
    RETURN NUMBER
    IS
        l_vc_arr2   APEX_APPLICATION_GLOBAL.VC_ARR2;
        TYPE number_list is TABLE OF NUMBER;
        num_list number_list := number_list();
        x_ret NUMBER;
    BEGIN
        /* checks if p_num exists in the colon delimited list p_shuttle_name */
            l_vc_arr2 := APEX_UTIL.STRING_TO_TABLE(p_shuttle_name);
            FOR i IN 1..l_vc_arr2.COUNT LOOP
                num_list.EXTEND;
                num_list(i):= CAST(l_vc_arr2(i) AS NUMBER);
            END LOOP;
            IF p_num MEMBER OF num_list then
                return 1;
            else
                return 0;
            end if;
    END;
    And then for every column put a condition (Function returning boolean) like this:
    begin
    if item_in_list(1, : p10_shuttle) = 1 then
    return true;
    else
    return false;
    end if;
    end;
    where 1 in my case is the return lov value.
    This is if your shuttle's return value is numeric and display value is varchar2. If both are varchar2 use instr as Howard suggested.
    Its probably not as fancy as the Jquery one but gets the job done.

  • Read number of channels dynamically

    Hi ,
    I have a test file in .dat format.  Normally we will have 4 channels. Time, Accleration1 and Accleration2, Upper Limit and Lower limit.
    Where I plot Time v/s Accleration1 and Accleration2.
    In future, test file may contain Accleration 3, Accleration 4, .. Accleration 10. So, how can I make a script to dynamically read the number of channels that are loaded to a data portal and plot all of them on report.   (whichever is existing. )
    I read in help to use globusedchn. How can i use it in script.
    Should I have to use ny looping statements? please help.

    Hello RSH,
    There is a function in DIAdem REPORT to do exactly what you are asking for, which is to dynamically plot n number of channels in a file based on however many channels are contained in a file.
    First of all, we need to make sure you data is stored as Waveforms, not channels which is done by using the "Numeric Channels <-> Waveform Channels" function in DIAdem ANALYSIS (this can be done in a Script too):
    Once all your channels are Waveforms, we can move on to REPORT.
    Go to the Settings menu in "REPORT" and switch on the "Curve Expansion" mode:
    I have thre Waveforms loaded called "Noise", Noise1" and "Noise2" in my DataPortal
    In your Axis Layout, delete the group reference and add a "*" to the end of the channel name:
    Here is the result, which will dynamically add channels based on how many "Noise*" channels are in the DataPortal:
    Hope that helps,
         Otmar
    Otmar D. Foehner
    Business Development Manager
    DIAdem and Test Data Management
    National Instruments
    Austin, TX - USA
    "For an optimist the glass is half full, for a pessimist it's half empty, and for an engineer is twice bigger than necessary."

  • Dynamic change color of series in line chart

    Hi
    I would like to be able to dynamically change the color of the individual series in a line chart, based on user preference. It works excellent having dynamic labels on the series using the &item. syntax and a before header computation.
    The same approach for the color does not seem to work. I get errors like undefined entity....
    Any ideas?
    Best regards Jesper

    Very surprisingly the following code (also generated by the macro recording) works ok.
    (I selected the serie inside the chart instead of selecting the serie in the legend)
        ActiveChart.FullSeriesCollection(1).Select
        With Selection.Format.Fill
            .Visible = msoTrue
            .ForeColor.ObjectThemeColor = msoThemeColorAccent3
            .ForeColor.TintAndShade = 0
            .ForeColor.Brightness = -0.25
            .Transparency = 0.3000000119
            .Solid
        End With
    If an MVP or Microsoft official come accross this, I suggest further testing as it is very likely a bug (with the first set of code generated by Excel)

  • How do I get the number of channels available in DIAdem using VBScript?

    I want to know the last number of the available channels in DIAdem-DATA using VBScript. If there are not enough channels, I'll allocate new ones using ChnAlloc.
    For the first run of the script, I do know there're 60 channels, but in a second run I might have created the additional channels already (if the script didn't fail) and I don't want to do the allocation a second time. So I need to know the number of the last channel. Unfortunatly I didn't find any function in the help providing this number.
    Thanks,
    Carsten

    Hi Carsten,
    I have a few thoughts for you plus some useful code. Bear in mind that you can change the number of static DIAdem channels (by default 60 of length 8192) as well as the number of available dynamic channels (by default 1000) to whatever you want. These memory matrix settings get stored in your Desktop.DDD file (DIAdem's ini file), so that each time you launch DIAdem it will create the channels according to your specifications. The maximum number of channels of all types that DIAdem can have is 65536 (2^16).
    Secondly, don't forget that you can address channels by name or by number. If the channels are named distinctly, addressing channels by name is the most reliable method. If you use ChnAlloc() to allocate new channels, and you want to address those new channels by channel number, you MUST use CNo() immediately after creating the new channel in order to find out that channel's number. It will not always be the next available channel number, because the next available channel may not be long enough. ChnAlloc() will latch on to an existing channel if it can find one long enough, and it will create new channels only if it finds none of the existing channels suitable.
    In the VBScript I attached to this email you will find all the DIAdem variables which contain information about the maximum available channels and the maximum length of each channel (not its currently set length). Note that DIAdem's data matrix is divided into 8 submatrices, each with 2 GBytes of addressable memory (2^31 Bytes). Each submatrix can have multiple static channels assigned to it. DIAdem's dynamic channels come first from DIAdem's application RAM (Windows allocates no more than 2 GBytes per application) then from the Windows swap file for its virtual memory
    Now, in addition to the variables which tell you the maximum possible channel count and lengths, another very useful variable is "GlobUsedChn", which returns the highest channel number currently filled with some amount of data.
    Ask if you have additional questions,
    Brad Turpin
    NI
    Attachments:
    View_DataMatrix.VBS ‏2 KB

  • Best Practice: Dynamically changing Item-Level permissions?

    Hi all,
    Can you share your opinion on the best practice for Dynamically changing item permissions?
    For example, given this scenario:
    Item Creator can create an initial item.
    After item creator creates, the item becomes read-only for him. Other users can create, but they can only see their own entries (Created by).
    At any point in time, other users can be given Read access (or any other access) by an Administrator to a specific item.
    The item is then given edit permission to a Reviewer and Approver. Reviewers can only edit, and Approvers can only approve.
    After the item has been reviewed, the item becomes read-only to everyone.
    I read that there is only a specific number of unique permissions for a List / Library before performance issues start to set in. Given the requirements above, it looks like item-level permission is unavoidable.
    Do you have certain ideas how best to go with this?
    Thank you!

    Hi,
    According to your post, my understanding is that you wanted to change item level permission.
    There is no out of the box way to accomplish this with SharePoint.               
    You can create a custom permission level using Visual Studio to allow users to add & view items, but not edit permission.   
    Then create a group with the custom permission level. The users in this group would have the permission of create & add permission, but they could no edit the item.
    In the CodePlex, there is a custom workflow activities, but by default it only have four permission level:
    Full Control , Design ,Contribute and Read.
    You should also customize some permission levels for your scenario. 
    What’s more, when use the SharePoint 2013 designer, you should only use the 2010 platform to create the workflow using this activities,
    https://spdactivities.codeplex.com/wikipage?title=Grant%20Permission%20on%20Item
    Thanks & Regards,
    Jason
    Jason Guo
    TechNet Community Support

  • How to change number of records displayed in Web service: Query_view_data

    Hi experts
    I´m using webservice Query_view_data to fill a Xcelsius model with data.
    The Bex Query contains appr. 300 records but the webservice returns only 50 records. When I test it it says "displaying 50 of 312 records".
    When I tried ABAP FM RRW3_GET_QUERY_VIEW_DATA it gave all 312 records.
    Does anyone know how I can change this setting so that all 312 records are displayed in the webservice?
    Best Regards
    Kenneth

    Mani,
    I have changed the properties of the chart as you said and gave 4 decimal places. If my actual data value is 0.787989, i would expect it to result 0.7879 but the outcome is 0.7800. It is replacing the other two decimal places with 0's rather than the actual number. Is this a bug in OBIEE or am i doing anything wrong?? Is there any other way to do this. Please let e know...
    Thanks,
    vnk
    Edited by: user8708843 on Aug 18, 2010 8:03 AM

  • Can't make a selection of my pathes even if i have set a program change number for each one.Why is that happening?

    Hi everybody!
    I send program change messages from my midi controller and the messages are accepted by mainstage 3 as shown in the midi message window,but i can't make a selection of my pathes even if i have set a program change number for each patch.Why is that happening?
    I use a novation SL mki or a KORG Triton Le or a m-audio axiom 49 as midi controllers.The program change messages are transmitted by all the devices i mentioned above and shown as received in the midi messages window of mainstage 3.
    Has anyone the same experience?

    Hi
    Have you selected the correct device as the Program Change device and MIDI channel in the Concert Inspector?
    CCT

  • How to generate report with dynamic variable number of columns?

    How to generate report with dynamic variable number of columns?
    I need to generate a report with varying column names (state names) as follows:
    SELECT AK, AL, AR,... FROM States ;
    I get these column names from the result of another query.
    In order to clarify my question, Please consider following table:
    CREATE TABLE TIME_PERIODS (
    PERIOD     VARCHAR2 (50) PRIMARY KEY
    CREATE TABLE STATE_INCOME (
         NAME     VARCHAR2 (2),
         PERIOD     VARCHAR2 (50)     REFERENCES TIME_PERIODS (PERIOD) ,
         INCOME     NUMBER (12, 2)
    I like to generate a report as follows:
    AK CA DE FL ...
    PERIOD1 1222.23 2423.20 232.33 345.21
    PERIOD2
    PERIOD3
    Total 433242.23 56744.34 8872.21 2324.23 ...
    The TIME_PERIODS.Period and State.Name could change dynamically.
    So I can't specify the state name in Select query like
    SELECT AK, AL, AR,... FROM
    What is the best way to generate this report?

    SQL> -- test tables and test data:
    SQL> CREATE TABLE states
      2    (state VARCHAR2 (2))
      3  /
    Table created.
    SQL> INSERT INTO states
      2  VALUES ('AK')
      3  /
    1 row created.
    SQL> INSERT INTO states
      2  VALUES ('AL')
      3  /
    1 row created.
    SQL> INSERT INTO states
      2  VALUES ('AR')
      3  /
    1 row created.
    SQL> INSERT INTO states
      2  VALUES ('CA')
      3  /
    1 row created.
    SQL> INSERT INTO states
      2  VALUES ('DE')
      3  /
    1 row created.
    SQL> INSERT INTO states
      2  VALUES ('FL')
      3  /
    1 row created.
    SQL> CREATE TABLE TIME_PERIODS
      2    (PERIOD VARCHAR2 (50) PRIMARY KEY)
      3  /
    Table created.
    SQL> INSERT INTO time_periods
      2  VALUES ('PERIOD1')
      3  /
    1 row created.
    SQL> INSERT INTO time_periods
      2  VALUES ('PERIOD2')
      3  /
    1 row created.
    SQL> INSERT INTO time_periods
      2  VALUES ('PERIOD3')
      3  /
    1 row created.
    SQL> INSERT INTO time_periods
      2  VALUES ('PERIOD4')
      3  /
    1 row created.
    SQL> CREATE TABLE STATE_INCOME
      2    (NAME   VARCHAR2 (2),
      3       PERIOD VARCHAR2 (50) REFERENCES TIME_PERIODS (PERIOD),
      4       INCOME NUMBER (12, 2))
      5  /
    Table created.
    SQL> INSERT INTO state_income
      2  VALUES ('AK', 'PERIOD1', 1222.23)
      3  /
    1 row created.
    SQL> INSERT INTO state_income
      2  VALUES ('CA', 'PERIOD1', 2423.20)
      3  /
    1 row created.
    SQL> INSERT INTO state_income
      2  VALUES ('DE', 'PERIOD1', 232.33)
      3  /
    1 row created.
    SQL> INSERT INTO state_income
      2  VALUES ('FL', 'PERIOD1', 345.21)
      3  /
    1 row created.
    SQL> -- the basic query:
    SQL> SELECT   SUBSTR (time_periods.period, 1, 10) period,
      2             SUM (DECODE (name, 'AK', income)) "AK",
      3             SUM (DECODE (name, 'CA', income)) "CA",
      4             SUM (DECODE (name, 'DE', income)) "DE",
      5             SUM (DECODE (name, 'FL', income)) "FL"
      6  FROM     state_income, time_periods
      7  WHERE    time_periods.period = state_income.period (+)
      8  AND      time_periods.period IN ('PERIOD1','PERIOD2','PERIOD3')
      9  GROUP BY ROLLUP (time_periods.period)
    10  /
    PERIOD             AK         CA         DE         FL                                             
    PERIOD1       1222.23     2423.2     232.33     345.21                                             
    PERIOD2                                                                                            
    PERIOD3                                                                                            
                  1222.23     2423.2     232.33     345.21                                             
    SQL> -- package that dynamically executes the query
    SQL> -- given variable numbers and values
    SQL> -- of states and periods:
    SQL> CREATE OR REPLACE PACKAGE package_name
      2  AS
      3    TYPE cursor_type IS REF CURSOR;
      4    PROCEDURE procedure_name
      5        (p_periods   IN     VARCHAR2,
      6         p_states    IN     VARCHAR2,
      7         cursor_name IN OUT cursor_type);
      8  END package_name;
      9  /
    Package created.
    SQL> CREATE OR REPLACE PACKAGE BODY package_name
      2  AS
      3    PROCEDURE procedure_name
      4        (p_periods   IN     VARCHAR2,
      5         p_states    IN     VARCHAR2,
      6         cursor_name IN OUT cursor_type)
      7    IS
      8        v_periods          VARCHAR2 (1000);
      9        v_sql               VARCHAR2 (4000);
    10        v_states          VARCHAR2 (1000) := p_states;
    11    BEGIN
    12        v_periods := REPLACE (p_periods, ',', ''',''');
    13        v_sql := 'SELECT SUBSTR(time_periods.period,1,10) period';
    14        WHILE LENGTH (v_states) > 1
    15        LOOP
    16          v_sql := v_sql
    17          || ',SUM(DECODE(name,'''
    18          || SUBSTR (v_states,1,2) || ''',income)) "' || SUBSTR (v_states,1,2)
    19          || '"';
    20          v_states := LTRIM (SUBSTR (v_states, 3), ',');
    21        END LOOP;
    22        v_sql := v_sql
    23        || 'FROM     state_income, time_periods
    24            WHERE    time_periods.period = state_income.period (+)
    25            AND      time_periods.period IN (''' || v_periods || ''')
    26            GROUP BY ROLLUP (time_periods.period)';
    27        OPEN cursor_name FOR v_sql;
    28    END procedure_name;
    29  END package_name;
    30  /
    Package body created.
    SQL> -- sample executions from SQL:
    SQL> VARIABLE g_ref REFCURSOR
    SQL> EXEC package_name.procedure_name ('PERIOD1,PERIOD2,PERIOD3','AK,CA,DE,FL', :g_ref)
    PL/SQL procedure successfully completed.
    SQL> PRINT g_ref
    PERIOD             AK         CA         DE         FL                                             
    PERIOD1       1222.23     2423.2     232.33     345.21                                             
    PERIOD2                                                                                            
    PERIOD3                                                                                            
                  1222.23     2423.2     232.33     345.21                                             
    SQL> EXEC package_name.procedure_name ('PERIOD1,PERIOD2','AK,AL,AR', :g_ref)
    PL/SQL procedure successfully completed.
    SQL> PRINT g_ref
    PERIOD             AK         AL         AR                                                        
    PERIOD1       1222.23                                                                              
    PERIOD2                                                                                            
                  1222.23                                                                              
    SQL> -- sample execution from PL/SQL block
    SQL> -- using parameters derived from processing
    SQL> -- cursors containing results of other queries:
    SQL> DECLARE
      2    CURSOR c_period
      3    IS
      4    SELECT period
      5    FROM   time_periods;
      6    v_periods   VARCHAR2 (1000);
      7    v_delimiter VARCHAR2 (1) := NULL;
      8    CURSOR c_states
      9    IS
    10    SELECT state
    11    FROM   states;
    12    v_states    VARCHAR2 (1000);
    13  BEGIN
    14    FOR r_period IN c_period
    15    LOOP
    16        v_periods := v_periods || v_delimiter || r_period.period;
    17        v_delimiter := ',';
    18    END LOOP;
    19    v_delimiter := NULL;
    20    FOR r_states IN c_states
    21    LOOP
    22        v_states := v_states || v_delimiter || r_states.state;
    23        v_delimiter := ',';
    24    END LOOP;
    25    package_name.procedure_name (v_periods, v_states, :g_ref);
    26  END;
    27  /
    PL/SQL procedure successfully completed.
    SQL> PRINT g_ref
    PERIOD             AK         AL         AR         CA         DE         FL                       
    PERIOD1       1222.23                           2423.2     232.33     345.21                       
    PERIOD2                                                                                            
    PERIOD3                                                                                            
    PERIOD4                                                                                            
                  1222.23                           2423.2     232.33     345.21                       

  • Dynamic change the ALV layout

    Alle experts:
    In ALV layout report, how to dynamic change the layout int ABAP porgram?
    e.g. I have save 5 layout, I need to change them base the my selection in ABAP program? How to do this?
    Thanks in advance!

    Try to call fieldcatlog dymnamically. Refer tofollowing code. Reward if helpful.
    REPORT  zfir0001 MESSAGE-ID ztax.
                               Tables
    TABLES : glt0, t001, skat.
                          Internal Tables
    DATA: BEGIN OF itab OCCURS 0,
            racct               LIKE   glt0-racct,    "Account number
            txt20               LIKE   skat-txt20,    "G/L account short text
            co_1000          LIKE     glt0-hslvt,     "Balance carried forward for company code 1000
            co_1100          LIKE     glt0-hslvt,     "Balance carried forward for company code 1100
            co_1200          LIKE     glt0-hslvt,     "Balance carried forward for company code 1200
    DATA : BEGIN OF itab1 OCCURS 0,
             bukrs LIKE glt0-bukrs,
             waers LIKE t001-waers,
           END OF itab1.
    DATA : BEGIN OF it_itab1 OCCURS 0.
            INCLUDE STRUCTURE glt0.
    DATA : END OF it_itab1.
                          Data Declarations
    DATA : w_total   LIKE glt0-hslvt,
           w_count   LIKE glt0-bukrs,
           w_flg     TYPE c,
           lv_count  TYPE i.
          w_slash   TYPE c VALUE ' '.
                          Selection screen
    SELECTION-SCREEN BEGIN OF BLOCK b1 WITH FRAME TITLE tit1.
    SELECT-OPTIONS : s_bukrs FOR glt0-bukrs OBLIGATORY,
                     s_racct FOR glt0-racct OBLIGATORY,
                     s_ryear FOR glt0-ryear OBLIGATORY,
                     s_rldnr FOR glt0-rldnr OBLIGATORY.
    SELECTION-SCREEN END OF BLOCK b1.
    INITIALIZATION.
      tit1 = 'Please select:'(004).
      TYPE-POOLS: slis.                                 "ALV Declarations
      DATA: i_fieldcat TYPE slis_t_fieldcat_alv WITH HEADER LINE,
            gd_tab_group TYPE slis_t_sp_group_alv,
            gd_layout    TYPE slis_layout_alv,
            gd_repid     LIKE sy-repid.
    ********Geting the selected company code in table itab1****
    START-OF-SELECTION.
      IF NOT s_bukrs-high IS INITIAL.
        itab1-bukrs = s_bukrs-low.
        APPEND itab1.
        w_count = s_bukrs-low.
        DO.
          IF s_bukrs-high = w_count.
            EXIT.
          ELSE.
            w_count =  w_count + 1.
          ENDIF.
          SELECT SINGLE * FROM t001
              WHERE bukrs = w_count.
          IF sy-subrc = 0.
            itab1-bukrs = w_count.
            APPEND itab1.
            CLEAR itab1.
          ENDIF.
        ENDDO.
      ELSE.
        itab1-bukrs = s_bukrs-low.
        APPEND itab1.
      ENDIF.
      SELECT * FROM glt0 INTO CORRESPONDING FIELDS OF TABLE it_itab1
              WHERE rldnr   IN s_rldnr
              AND   bukrs   IN s_bukrs
              AND   ryear   IN s_ryear
              AND   racct   IN s_racct.
      SORT it_itab1 BY bukrs.
      LOOP AT it_itab1.
        AT END OF racct.
          w_flg = 'X'.
        ENDAT.
        SELECT SINGLE txt20 INTO (itab-txt20) FROM skat
                  WHERE spras = sy-langu
                  AND   saknr = it_itab1-racct.
        PACK it_itab1-racct TO it_itab1-racct.
        itab-racct = it_itab1-racct.
        w_total = it_itab1-hsl01 + it_itab1-hsl02 + it_itab1-hsl03 + it_itab1-hsl04 +
                  it_itab1-hsl05 + it_itab1-hsl06 + it_itab1-hsl07 + it_itab1-hsl08 +
                  it_itab1-hsl09 + it_itab1-hsl10 + it_itab1-hsl11 + it_itab1-hsl12 +
                  w_total        + it_itab1-hslvt.
        IF w_flg = 'X'.
          READ TABLE itab1 WITH KEY bukrs = it_itab1-bukrs.
          IF sy-subrc = 0.
            SELECT SINGLE * FROM t001
                WHERE bukrs = itab1-bukrs.
            IF t001-waers = 'JPY' OR
               t001-waers = 'HUF'.
              w_total =  w_total * 100.
            ENDIF.
            CASE it_itab1-bukrs.
              WHEN '1000'.
                itab-co_1000 = w_total.
              WHEN '1100'.
                itab-co_1100 = w_total.
              WHEN '1200'.
                itab-co_1200 = w_total.
            ENDCASE.
            COLLECT itab.
            CLEAR: itab, w_flg, w_total.
          ENDIF.
        ENDIF.
      ENDLOOP.
      SORT itab BY racct.
      IF NOT itab[] IS INITIAL.
        PERFORM field_cat1.
        lv_count = 1.
        LOOP AT itab1.
          PERFORM field_cat USING itab1-bukrs.
        ENDLOOP.
        PERFORM display_alv_report .
      ELSE.
        MESSAGE s000 WITH 'No records Found'(003).
      ENDIF.
    *&      Form  display_alv_report
          text
    FORM display_alv_report .
      gd_repid = sy-repid.
      CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
        EXPORTING
          i_callback_program = gd_repid
          is_layout          = gd_layout
          it_fieldcat        = i_fieldcat[]
          i_save             = 'X'
        TABLES
          t_outtab           = itab
        EXCEPTIONS
          program_error      = 1
          OTHERS             = 2.
    ENDFORM.                    "display_alv_report
    *&      Form  field_cat1
          text
    FORM field_cat1 .
      i_fieldcat-col_pos     =  0.
      i_fieldcat-fieldname   = 'RACCT'.
      i_fieldcat-seltext_m    = 'Account'(001).
      i_fieldcat-fix_column = 'X'.
    i_fieldcat-emphasize   = 'X'.
      APPEND  i_fieldcat TO i_fieldcat.
      CLEAR  i_fieldcat.
      i_fieldcat-col_pos     =  1.
      i_fieldcat-fieldname   = 'TXT20'.
      i_fieldcat-seltext_m    = 'Description'(002).
      APPEND  i_fieldcat TO i_fieldcat.
      CLEAR  i_fieldcat.
    ENDFORM.                                                    "field_cat1
    *&      Form  field_cat
          text
         -->XV_BURKS   text
    FORM field_cat USING xv_burks TYPE char4.
      lv_count = lv_count + 1.
      i_fieldcat-col_pos     = lv_count.
      CONCATENATE 'CO_' xv_burks INTO i_fieldcat-fieldname.
      i_fieldcat-seltext_m    = xv_burks.
    i_fieldcat-just = 'C'.
    i_fieldcat-no_zero = 'X'.
    i_fieldcat-do_sum = 'X'.
      APPEND  i_fieldcat TO i_fieldcat.
      CLEAR  i_fieldcat.
    ENDFORM.   "field_cat
    Edited by: dhanashree wadkar on Apr 30, 2008 6:00 AM

  • Dynamic changes on axis limits

    hi, for each charts, we can set the "Axis Limits" (under "Axis Scaling" property")
    by chosing "Specify manually", we can set "Minimum value" and "Maximum value" manually.
    but it is "hardcoded".
    is it possible to have:
    the minimum value or maximun value are dynamically changed by the exact minimum value and the exact maximum value from the column (data source) ??
    therefore , if the data changes, user dont need to set again
    (although "Zoom to data range" is an alternative but the result is not very good)

    I think it is impossible , so I close this thread, thanks

  • Dynamic page number

    dynamic page number
    I am trying to print multiple documents in one report, the requirement is to reset page numbers for every document(to start counting from 1)
    I don't have control over the size of the document because it is a flow table
    I am using page conditional break to finish the document and start a new one but I couldn't change the page number.
    Plz help I am really trying to solve this for a week now.
    I am using 7.1 ADL
    thanks
    Edited by: Sami Japr on May 26, 2009 1:59 PM
    Edited by: Sami Japr on May 27, 2009 1:35 PM

    I figured it out thanks any way
    If anyone looking for a solution for the same issue
    he solution is as follows
    create 3 numeric fields in the header of the table
    total
    counter 1
    counter 2
    the total is to count the number of pages of each document
    in initialization event
    total = total + 1 ;
    the counter 1 is to make the counter of the pages from 0 to total (invisible)
    in calculate event
    if ( counter 1 < total ) then
    counter 1 = counter 1 + 1 .
    elseif( counter 1 >= total ) then
    counter 1 = 1
    counter 2 to show the page number of the document
    in layout ready
    counter 2 = 1
    in calculate event
    counter 2 = counter 1 + 1
    Note: this is the logic with little modification create the code
    Regards
    Sam or Muneer

Maybe you are looking for

  • 10.3.9 and 9.2.1

    I have an ibook that shipped with 9.2.1, that now has 10.3.9 and the classic system that was installed with 10.3. But the classic system is corrupted and needs re-install. is there any problem with re-installing the original 9.2.1 (i.e. will it cause

  • "No Topics Found" RoboHelp8 (CHM File)

    Using the "Search" feature in my .CHM file has begun to return a "No Topics Found" error. For a little history, we have been using this same project for several years, long before I took over. Until this latest build, searching worked fine. Beginning

  • How do i get the date off the photo?

    On my iPad the photos look great (no date appears), but when I email them or upload them to Facebook they get a date stamped on them.  Is this a setting I can change?  I don't want the date printed on the image- it ruins the whole picture:

  • Table link for material and characterstics values

    Hi all, I want link between the material and characteristic values . please help me regarding this. Regards, T srinivas.

  • A COACH NEEDS HELP - Quickest way to burn DVD from SD card (iFrame format)

    Just purchased new SANYO FH1A video recorder to film our basketball team's games. It records on a SD Card in iFrame format (designed for Apple). I want to quickly burn a DVD direct from the SD Card after games. I tried the "ONE STEP FROM MOVIE" but a