Textview with totals based on dynamic ALV selections

Hi all, it´s me again, suffering like a mother with my first WDA serious application
I have this ALV with a prices column, with an editable checkbox field, and what my client wants is a field on the screen (I think it must be a Textview) that displays the total sum of all selected rows in the ALV. Of course, this sum must be dynamic, according with the actual selection.
Could anyone tell what should I do?
Thanks a lot, best regards.
Federico Alvarez

Hi Fedrico,
Seeing your problem, You hv to write the logic on the ON_DATA_CHECK event of the alv grid.
I am giving you a sample code that might helps you.
METHOD on_data_check .
Data declaration for assigning the contract,total and balance(remaining) amount
  DATA : lo_nd_contract_payment TYPE REF TO if_wd_context_node,
         lo_el_contract_payment TYPE REF TO if_wd_context_element,
         ls_contract_payment    TYPE wd_this->element_contract_payment,
         lv_contract_amount     LIKE ls_contract_payment-contract_amount,
         lv_value_date          LIKE ls_contract_payment-value_date.
   Data Declaration
  DATA : lo_nd_payment_table    TYPE REF TO if_wd_context_node,
         lo_el_payment_table    TYPE REF TO if_wd_context_element,
         ls_payment_table       TYPE wd_this->element_payment_table,
         lt_payment_table       LIKE TABLE OF ls_payment_table,
         lv_total_amount        LIKE ls_payment_table-amount,
         lv_balance_amount      LIKE ls_payment_table-amount,
         lv_paymeth             LIKE ls_payment_table-payment_method,
         lt_paycreate           TYPE TABLE OF /dmpui/db_str_paycreate,
         ls_paycreate           TYPE /dmpui/db_str_paycreate.
  Data declartion for message manager
  DATA : lo_api_controller     TYPE REF TO if_wd_controller,
         lo_message_manager    TYPE REF TO if_wd_message_manager.
  get message manager
  lo_api_controller ?= wd_this->wd_get_api( ).
  CALL METHOD lo_api_controller->get_message_manager
    RECEIVING
      message_manager = lo_message_manager.
  navigate from <CONTEXT> to <PAYMENT_TABLE> via lead selection
  lo_nd_payment_table = wd_context->get_child_node( name = wd_this->wdctx_payment_table ).
check for data error in the grid
  CHECK r_param->t_error_cells IS INITIAL.
  IF lo_nd_payment_table IS NOT INITIAL.
  get all declared attrigbutes
    lo_nd_payment_table->get_static_attributes_table(
      IMPORTING
        table = lt_payment_table ).
  ENDIF.
  lo_el_payment_table = lo_nd_payment_table->get_element( ).
  lo_el_payment_table->get_attribute(
  EXPORTING
      name =  `PAYMENT_METHOD`
   IMPORTING
      value = lv_paymeth ).
  lv_total_amount = 0.
  wd_assist->gc_total_amount = 0.
  IF lt_payment_table[] IS NOT INITIAL.
Looping at the payment internal table*
    LOOP AT lt_payment_table INTO ls_payment_table.
        lv_total_amount = lv_total_amount + ls_payment_table-amount.
      ENDIF.
      CLEAR ls_payment_table.
    ENDLOOP.
  ENDIF.
Passing the Total Amount Value to the Assistance class variable
  wd_assist->gc_total_amount = lv_total_amount.
navigate from <CONTEXT> to <CONTRACT_PAYMENT> via lead selection
  lo_nd_contract_payment = wd_context->get_child_node( name = wd_this->wdctx_contract_payment ).
get element via lead selection
  lo_el_contract_payment = lo_nd_contract_payment->get_element(  ).
  lo_el_contract_payment->get_attribute(
    EXPORTING
      name =  `CONTRACT_AMOUNT`
   IMPORTING
      value = lv_contract_amount ).
Calculating the balance amount
  lv_balance_amount = lv_contract_amount -  wd_assist->gc_total_amount.
get single attribute
  lo_el_contract_payment->set_attribute(
    EXPORTING
      name =  `TOTAL_AMOUNT`
      value = wd_assist->gc_total_amount ).
  lo_el_contract_payment->set_attribute(
      EXPORTING
        name =  `BALANCE_AMOUNT`
        value = lv_balance_amount ).
Binding the data to the context node
  lo_nd_payment_table->bind_table(
    EXPORTING
      new_items            = lt_payment_table   " List of Elements or Model Data
      set_initial_elements = abap_true          " If TRUE, Set Initial Elements Otherwise Add
ENDMETHOD.
Regards
Manoj Kumar
Edited by: Manoj Kumar on Feb 27, 2009 10:25 AM

Similar Messages

  • How to create a dynamic RTF report which creates dynamic columns based on dynamic column selection from a table?

    Hi All,
    Suppose I have table, whose structure changes frequently on daily basis.
    For eg. desc my_table gives you following column name on Day 1
    SQL > desc my_table;
    Output
    Name
    Age
    Phone
    On Day 2, two more columns are added, viz, Address and Salary.
    SQL > desc my_table;
    Output
    Name
    Age
    Phone
    Address
    Salary
    Now I want to create an Dynnamic RTF report which would fetch data from ALL columns from my_table on daily basis. For that I have defined a concurrent program with XML as output type and have attached a data template/data definition to it which takes in XML as input and gives final output of conc program in EXCEL layout. I am able to do this for constant number of columns, but dont know how to do it when the number of columns to be displayed changes dynamically.
    For Day 1 my XML file should be like this.
    <?xml version="1.0" encoding="UTF-8"?>
    <dataTemplate name="XYZ" description="iExpenses Report" Version="1.0">
    <dataQuery>
    <sqlStatement name="Q2">
    <![CDATA[
    SELECT Name
    ,Age
    ,Phone
    FROM my_table
    ]]>
    </sqlStatement>
    </dataQuery>
    <dataStructure>
    <group name="G_my_table" source="Q2">
      <element name="Name" value="Name" />
      <element name="Age" value="Age" />
      <element name="Phone" value="Phone" />
    </group>
    </dataStructure>
    </dataTemplate>
    And my Day 1, EXCEL output from RTF template should be like this.
    Name     Age     Phone
    Swapnill     23     12345
    For Day 2 my XML file should be like this. With 2 new columns selected in SELECT clause.
    <?xml version="1.0" encoding="UTF-8"?>
    <dataTemplate name="XYZ" description="iExpenses Report" Version="1.0">
    <dataQuery>
    <sqlStatement name="Q2">
    <![CDATA[
    SELECT Name
    ,Age
    ,Phone
    ,Address
    ,Salary
    FROM my_table
    ]]>
    </sqlStatement>
    </dataQuery>
    <dataStructure>
    <group name="G_my_table" source="Q2">
      <element name="Name" value="Name" />
      <element name="Age" value="Age" />
      <element name="Phone" value="Phone" />
      <element name="Address" value="Address" />
      <element name="Salary" value="Salary" />
    </group>
    </dataStructure>
    </dataTemplate>
    And my Day 2, EXCEL output from RTF template should be like this.
    Name     Age     Phone     Address     Salary
    Swapnill     23     12345         Madrid     100000
    Now, I dont know below things.
    Make the XML dynamic as in on Day 1 there must be 3 columns in the SELECT statement and on Day 2, 5 columns. I want to create one dynamic XML which should not be required to be changed if new columns are added in my_table. I dont know how to create this query and also create their corresponding elements below.
    Make the RTF template dyanamic as in Day1 there must 3 columns in EXCEL output and on Day 2, 5 columns. I want to create a Dynamic RTF template which would show all the columns selected in Dynamic XML.I dont know how the RTF will create new XML tags and how it will know where to place it in the report. Means, I can create RTF template on Day 1, by loading XML data for 3 columns and placing 3 XML tags in template. But how will it create and place tags for new columns on Day 2?
    Hope, you got my requirement, its a challenging one. Please let me know how I can implement the required solution using RTF dynamically without any manual intervention.
    Regards,
    Swapnil K.
    Message was edited by: SwapnilK

    Hi All,
    I am able to fulfil above requirement. Now I am stuck at below point. Need your help!
    Is there any way to UPDATE the XML file attached to a Data Definition (XML Publisher > Data Definition) using a standard package or procedure call or may be an API from backend? I am creating an XML dynamically and I want to attach it to its Data Definition programmatically using SQL.
    Please let me know if there is any oracle functionality to do this.
    If not, please let me know the standard directories on application/database server where the XML files attached to Data Definitions are stored.
    For eg, /$APPL_TOP/ar/1.0/sql or something.
    Regards,
    Swapnil K.

  • Re-Rendering the entire panel with components based on list value selection

    Hi,
    I am new to swing.Wondering how to refresh the panel with modified data on selection from list.
    Here's the code I am trying .
    the function below is called withdifferent set of value s being passed in based on add,remove conditions.
    public void initGroupPanelComponents(Vector GroupListData,Object[] sourceItemsArray,Object[] sinkItemsArray)
    groupsPanel = new JPanel();
    groupsPanel.setLayout(null);
    botPanel = new JPanel(new BorderLayout());
    botPanel.setSize(500,600);
    if(sourceItemsArray.length!=0){
    sourceLabel = "New Members:";
    sinkLabel = "New Available";
    System.out.print("color change now!");
    groupsPanel.setBackground(Color.YELLOW);
    botPanel.setBackground(Color.GRAY);
    //revalidate();
    else{
    groupsPanel.setBackground(Color.BLUE);
    botPanel.setBackground(Color.WHITE);
    groupsPanel.setSize( 500, 300 );
    groupsList = new JList(groupNameListData);
    groupsList.setBorder(BorderFactory.createLineBorder(Color.gray));
    groupsList.setBounds(10,10,350,230);
    groupsPanel.add(groupsList);
    groupsList.addListSelectionListener(new groupNameListAction());
    groupsList.setListData(groupNameListData);
    addButton = new JButton("Add");
    addButton.setBounds(385,35,80, 20);
    addButton.addActionListener(new addNewGroupAction());
    removeButton = new JButton("Remove");
    removeButton.setBounds(385, 70, 80, 20);
    groupsPanel.add(addButton);
    groupsPanel.add(removeButton);
    duellist= new DualListPanel(sourceItemsArray, sinkItemsArray, sourceLabel,sinkLabel);
    botPanel.add(duellist);
    botPanel.setBounds(0, 270, 500,600);
    botPanel.setOpaque(true);
    getContentPane().add(groupsPanel);
    groupsPanel.add(botPanel,BorderLayout.SOUTH);
    getContentPane().invalidate();
    getContentPane().validate();
    setResizable(false);
    setVisible(true);
    Relevant suggestions are most welcome.
    Thanks in Advance!

    Thanks much our help.
    But,apperars to me that I have added the groupsList to the panel in the method.
    What I am trying to acheive here is, when a value is selected from the groupsList, accrodingly,in the ListActionListener, Iam trying to repaint the whole Panel with the list component above and duellist panel (a panel with 2 list components by side and buttons at the centre)obtained from dualListPanel Class .
    Appears to work fine the first time when DualListPanel is nstantiated with certain data passed in.But when a particular list value on top is selected, i would require this dualListPanel to be instantiated with a new set of data passed in.This,for some reasons fails to come up.
    Would Appreciate if you could suggest accordingly for this.
    Thanks much again!

  • How to show/hide total based on selected column in column selector

    Hello,
    Is there a way to show/hide the total based on what column is selected in the column selector? Or alternatively to hide the total based on the column selected? I'm using OBIEE 10g.
    Basically, I have a pivot table with a handful of row variables and one measure. Then I allow the user to select the column variable. The default is to have nothing, which I have achieved using the hidden/dummy column trick (Re: How to add new columns by using Multiselect However, if my pivot table is set to have a total, I now get 2 columns that are the same. When the user selects any other choice (e.g. gender), I would want to see Male, Female and the total. Something like this:
    Default:
    Count
    East 10
    West 20
    Total 30
    Gender:
    Male Female Total
    Count Count Count
    East 6 4 10
    West 14 6 20
    Total 20 10 30
    Any thoughts?
    Thanks!

    I recommend using view selector instead of column selector

  • DimensionmemberList with value-based dimension

    Hi,
    I'm unable to use a DimensionMemberList with a value-based dimension. It works fine with level-based, however when I select a value-based dimension and hierarchy in the wizard and click on "Next" an Error pop-up appears with no message and I have to click on "Cancel" to get out of the wizard.
    Has anyone encountered this behavior?

    Hi Ankita,
    As per my Understanding the VP column did't map to any LTS .
    When ever u have multiple LTS in Dim Admin tool won't create Dimension Hierarchy manually we need to create that.
    Follow these steps to resolve your Problem...
    1) give the simple join in physical layer for that two tables.
    2) Create one Dim table in to BMM layer drag all columns in 2 tables in to BMM Dim table so u can able to see all the columns is mapped in to their respective LTS.
    3) Now u can create hierarchy manually step by step.Like Grand total Parent ----> Child level .
    4) If u have any fact table joined with these dimension in physical layer give the logical joins in BMM layer and set the content levels properly.
    Let me know need any detail clarification.
    Thanks,
    Satya

  • Editing values within Dynamic ALV

    Hello All,
    I am currently working on dynamic ALV and want the columns to be editible.
    I have gone through the tutorial
    Link : [https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/docs/library/uuid/4c70444a-0801-0010-7688-9e4bd844b783]
    and have created a dynamic Context and a corresponding ALV LIST display. Everything is fine except that i want to be able to edit values within the list and i want this to get populated back into the context.
    I have gone through the tutorial.
    Link : [https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/docs/library/uuid/3133474a-0801-0010-d692-81827814a5a1]
    But i couldn't relate that with the tutorial for dynamic ALV.
    Please help.
    Best Regards,
    Mz

    Hello Lekha,
    I am sorry to say that  the code which you have provided is not working.
    Maybe i am doing something wrong.
    This is the entire code below.
    data lo_interfacecontroller type ref to iwci_salv_wd_table .
    data lo_cmp_usage type ref to if_wd_component_usage.
    data : L_VIEW_CONTROLLER_API type ref to IF_WD_VIEW_CONTROLLER.
    lo_cmp_usage =   wd_this->wd_cpuse_alv( ).
    if lo_cmp_usage->has_active_component( ) is initial.
      lo_cmp_usage->create_component( ).
    endif.
    lo_interfacecontroller =   wd_this->wd_cpifc_alv( ).
      lo_interfacecontroller->set_data(
    *   only_if_new_descr =                 " wdy_boolean
        "r_node_data =
        dyn_node                    " ref to if_wd_context_node
    DATA:
       lo_value type ref to cl_salv_wd_config_table,
         lr_column      TYPE REF TO cl_salv_wd_column,            " Table fo rcolumn ref
         ls_columns     TYPE salv_wd_s_column_ref,                " Structure for column ref
        lt_columns     TYPE salv_wd_t_column_ref,                " Structure for column ref
       lr_input       TYPE REF TO cl_salv_wd_uie_input_field.
    lo_value = lo_interfacecontroller->get_model( ).
    * Get the column ref
      CALL METHOD lo_value->if_salv_wd_column_settings~get_columns
        RECEIVING
          value = lt_columns.
      LOOP AT lt_columns INTO ls_columns.
        lr_column = ls_columns-r_column.
    case ls_columns-id.
    when 'JAN2007'.
            CREATE OBJECT lr_input
              EXPORTING
                value_fieldname = ls_columns-id.
            CALL METHOD lr_column->set_cell_editor
              EXPORTING
                value = lr_input.
    *     Set the read only attribute
            lr_input->set_read_only_fieldname( value = 'FALSE' ).
    endcase.
    endloop.
    L_VIEW_CONTROLLER_API = WD_THIS->WD_GET_API( ).
    L_VIEW_CONTROLLER_API->PREPARE_DYNAMIC_NAVIGATION(
    source_window_name = 'WINDOW1'
    source_vusage_name = 'MAIN_USAGE_0'
    source_plug_name = 'TO_V1'
    target_component_name = 'SALV_WD_TABLE'
    target_component_usage = 'ALV'
    target_view_name = 'TABLE'
    target_plug_name = 'DEFAULT'
    target_embedding_position = 'MAIN/VIEW_CONTAINER'
    WD_THIS->FIRE_TO_V1_PLG( ).
    The part which is entered as per your instructions are given between the asterisk lines.
    Sorry if there are any silly mistakes on my part.
    I have one small doubt regarding the value to be passed for the method lr_input->set_read_only_fieldname. This is a string value. I think that this could be the cause of the error. When i checked the class interface, CL_SALV_WD_UIE_INPUT_FIELD i found that the method set_read_only_fieldname is calling another attribute if_salv_wd_c_table_evt_editor=>set_read_only_fieldname.
    Hope this was useful
    Best Regards,
    Mz

  • Subtotal Text in Dynamic ALV

    I have faced the problem with Subtotal Text in Dynamic ALV.
    I don't know why it is not get into "FORM subtotal_text " .
    CALL FUNCTION 'REUSE_ALV_LIST_DISPLAY'
       EXPORTING
         i_callback_program             = sy-repid
       IS_LAYOUT                        = gw_layout
         it_fieldcat                    = gi_fieldcat[]
         it_sort                        = gi_sort[]
         it_events                      = gi_events
        TABLES
          t_outtab                       = <gi_dyntable>
       EXCEPTIONS
         program_error                  = 1
         OTHERS                         = 2
      IF sy-subrc <> 0.
    * MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
    *         WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
      ENDIF.
    and
    *&      Form  subtotal_text
    *       text
    *  -->  p1        text
    *  <--  p2        text
    FORM subtotal_text USING  p_total type ref to data
                             p_subtottxt_info TYPE slis_subtot_text.
      break-point.
    ENDFORM.                    " alv_subtotal
    Thanks in advance

    I put the form name to gi_events
    *&      Form  event_build
    *       text
    *  -->  p1        text
    *  <--  p2        text
    FORM event_build .
      CALL FUNCTION 'REUSE_ALV_EVENTS_GET'
        EXPORTING
          i_list_type = 0
        IMPORTING
          et_events   = gi_events.
      READ TABLE gi_events WITH KEY name = 'SUBTOTAL_TEXT' INTO gw_events.
      IF sy-subrc = 0.
        MOVE 'SUBTOTAL_TEXT' TO gw_events-form.
        MODIFY gi_events FROM gw_events INDEX sy-tabix.
      ENDIF.
    ENDFORM.                    " event_build

  • Policy-based Tunnel Selection and PBTS with Dynamic Tunnel Selection option

    Unfortunately I can't test this feature on GSR 12k platform.
    RP/0/0/CPU0:ios(config)#show config failed
    !! SEMANTIC ERRORS: This configuration was rejected by
    !! the system due to semantic errors. The individual
    !! errors with each failed configuration command can be
    !! found below.
    interface tunnel-te1
    policy-class 1
    !!% The requested operation is not supported: Feature not supported on this platform
    end
    What is the difference between Dynamic Tunnel Selection and ordinary PBTS? It would be nice to see some real-world example.

    PBTS with DTS is supported only on the Cisco XR 12000 Series Router... you should rather test it on 12K platform.

  • Dynamic ALV with Static and Dynamic attributes

    Hi All,
    In my requirement we have some 5 static attributes and rest attributes needs needs to be dynamically created based upon the input selections. for eg my input for start date and end date is between 201023 to 201152 then weeks between this range should apear as dynamic columns.
    i am able to create a dummy alv table display with out populating data into it but unable to set the data to it . Kindly help me in solving this issue.
    Regards,
    Sana.

    You might have created a dynamic node, bind the data to this node and after that use the SET_DATA method of ALV interface controller to set the data by passing the dynamically created node.

  • Dynamic ALV as per the periods on the selection screen

    Hello Experts
    I am new to dynamic ALV , Please help me to sought out my confusion.
    I want to create a dynamic ALV , based on the period mentioned at selection screen.
    for example I want to display the movement type  ( sum of the quantity ) for materials for the full month.
    I want the ALV output as below.
    Material  .........qty 01.04.2011..... qty 02.04.2011... qty 03.04.2011 ........ qty 30.04.2011
    AB1........................... 30.................... 20............................. 50......................... 200
    AB2.................................................... 50 ............................. 80 ..........................10
    I create an internal table itab with there fields to selact the data
    MATNR
    date
    qty
    select MATNR
           date
           qty
    into itab
    from mseg
    where based on the selection screen.
    then collect the data to other table date wise , now i have summrise data of material quantity
    now the results after collection data into table itab2 is as follows
    Material  ................... date ................................   qty
    AB1  ....................    01.04.2011.......................  30
    AB1  ...................     02.04.2011 ....................... 20
    AB1  ...................   03.04.2011.......................  50
    AB1  ...................   .30.04.2011.......................  200
    AB2 ....................   02.04.2011.......................   50
    AB2 .......................   03.04.2011.......................   80
    AB2 .......................   30.04.2011 .......................   10
    How can I display these fields horizontally instead of vertically ,
    and to the exact column as per the field catalog column header belongs to date.
    it would be so helpful if somebody explain with code by taking the above example.
    Thanks in Advance

    Hello Both Experts ,
    I write the below code and it is working for the requirement.
    Can you please check
    REPORT  z_test_dynamic                          .
    TABLES : mkpf , mseg .
    TYPES : BEGIN OF t_mseg ,
          mblnr TYPE mblnr ,
          bwart TYPE bwart ,
          matnr TYPE matnr ,
          werks TYPE werks_d ,
          menge TYPE menge_d ,
          budat TYPE budat ,
      END OF t_mseg.
    TYPES : BEGIN OF t_mseg_1 ,
          matnr TYPE matnr ,
          menge TYPE menge_d ,
          budat TYPE budat ,
      END OF t_mseg_1.
    DATA : gt_mseg TYPE STANDARD TABLE OF t_mseg ,
           gs_mseg TYPE t_mseg,
           gt_mseg_1 TYPE STANDARD TABLE OF t_mseg_1 ,
           gs_mseg_1 TYPE t_mseg_1,
           gt_mseg_2 TYPE STANDARD TABLE OF t_mseg_1 ,
           gs_mseg_2 TYPE t_mseg_1..
    DATA : gt_date TYPE STANDARD TABLE OF sy-datum ,
          gs_date TYPE sy-datum..
    DATA: ok_code LIKE sy-ucomm,
          g_container TYPE scrfname VALUE 'CONTAINER_01',
          grid1  TYPE REF TO cl_gui_alv_grid,
          g_custom_container TYPE REF TO cl_gui_custom_container.
    DATA: gt_fieldcat TYPE lvc_t_fcat.
    DATA: gp_table TYPE REF TO data.
    FIELD-SYMBOLS: <gt_table> TYPE table.
    SELECTION-SCREEN : BEGIN OF BLOCK b1 WITH FRAME TITLE text-001.
    SELECT-OPTIONS : s_matnr FOR mseg-matnr ,
                     s_bwart FOR mseg-bwart NO INTERVALS,
                     s_werks FOR mseg-werks ,
                     s_budat FOR mkpf-budat .
    PARAMETERS   : p_mjahr TYPE mjahr OBLIGATORY.
    SELECTION-SCREEN : END OF BLOCK b1.
    PERFORM field_catalog.
    CALL METHOD cl_alv_table_create=>create_dynamic_table
      EXPORTING
        it_fieldcatalog = gt_fieldcat
      IMPORTING
        ep_table        = gp_table.
    ASSIGN gp_table->* TO <gt_table>.
    PERFORM select_main_data.
    PERFORM move_data.
    *&      Form  select_main_data
    *       text
    *  -->  p1        text
    *  <--  p2        text
    FORM select_main_data .
      SELECT      mseg~mblnr
          mseg~bwart
          mseg~matnr
          mseg~werks
          mseg~menge
          mkpf~budat
        INTO TABLE gt_mseg
        FROM mseg AS mseg INNER JOIN mkpf AS mkpf
        ON mseg~mblnr = mkpf~mblnr AND
           mseg~mjahr = mkpf~mjahr
        WHERE matnr IN s_matnr AND
             budat IN s_budat AND
             werks IN s_werks AND
             bwart IN s_bwart AND
             mseg~mjahr EQ p_mjahr .
      IF  gt_mseg IS NOT INITIAL.
        LOOP AT gt_mseg INTO gs_mseg.
          gs_mseg_1-matnr = gs_mseg-matnr.
          gs_mseg_1-budat = gs_mseg-budat.
          gs_mseg_1-menge = gs_mseg-menge.
          COLLECT gs_mseg_1 INTO gt_mseg_1.
        ENDLOOP.
      ENDIF.
      gt_mseg_2 = gt_mseg_1.
      DELETE ADJACENT DUPLICATES FROM gt_mseg_2  COMPARING matnr.
    ENDFORM.                    " select_main_data
    *&      Form  field_catalog
    *       text
    *  -->  p1        text
    *  <--  p2        text
    FORM field_catalog .
      DATA : lt_day_attributes TYPE STANDARD TABLE OF casdayattr ,
             ls_day_attributes TYPE casdayattr .
      DATA: ls_fieldcat TYPE lvc_s_fcat ,
            lv_fieldname TYPE lvc_fname.
      IF s_budat-high IS INITIAL.
        s_budat-high = s_budat-low.
      ENDIF.
      CALL FUNCTION 'DAY_ATTRIBUTES_GET'
       EXPORTING
    *   FACTORY_CALENDAR                 = ' '
    *   HOLIDAY_CALENDAR                 = ' '
         date_from                        = s_budat-low
         date_to                          = s_budat-high
         language                         = sy-langu
    * IMPORTING
    *   YEAR_OF_VALID_FROM               =
    *   YEAR_OF_VALID_TO                 =
    *   RETURNCODE                       =
        TABLES
          day_attributes                   = lt_day_attributes
    * EXCEPTIONS
    *   FACTORY_CALENDAR_NOT_FOUND       = 1
    *   HOLIDAY_CALENDAR_NOT_FOUND       = 2
    *   DATE_HAS_INVALID_FORMAT          = 3
    *   DATE_INCONSISTENCY               = 4
    *   OTHERS                           = 5
      IF sy-subrc <> 0.
    * MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
    *         WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
      ENDIF.
      LOOP AT lt_day_attributes INTO ls_day_attributes.
        gs_date = ls_day_attributes-date.
        APPEND gs_date TO gt_date.
      ENDLOOP.
      ls_fieldcat-fieldname = 'MATNR'.
      ls_fieldcat-inttype    = 'CHAR18'.
      ls_fieldcat-coltext    = 'MATERIAL'.
    *   ls_fieldcat-decimals_o   = '2'.
      ls_fieldcat-outputlen = 18.
      APPEND ls_fieldcat TO gt_fieldcat.
      LOOP AT gt_date INTO gs_date.
        CONCATENATE 'QTY_' gs_date INTO lv_fieldname.
        ls_fieldcat-fieldname = lv_fieldname.
        ls_fieldcat-inttype    = 'QUAN'.
        ls_fieldcat-coltext    = gs_date.
        ls_fieldcat-decimals_o   = '2'.
    *    ls_fieldcat-outputlen = 18.
        APPEND ls_fieldcat TO gt_fieldcat.
      ENDLOOP.
    ENDFORM.                    " field_catalog
    *&      Form  move_data
    *       text
    *  -->  p1        text
    *  <--  p2        text
    FORM move_data .
      DATA: l_row TYPE sy-index.
      FIELD-SYMBOLS: <ls_table>.
      FIELD-SYMBOLS: <l_field> ,
                     <l_mseg_1> TYPE t_mseg_1.
      DATA: ls_fieldcat TYPE lvc_s_fcat .
      ASSIGN LOCAL COPY OF INITIAL LINE OF <gt_table> TO <ls_table>.
      SORT gt_mseg_1 BY matnr.
      LOOP AT gt_mseg_1 ASSIGNING <l_mseg_1> .
        IF <l_field> IS ASSIGNED.
          UNASSIGN <l_field>.
        ENDIF.
        MOVE-CORRESPONDING <l_mseg_1> TO <ls_table>.
          READ TABLE gt_fieldcat INTO ls_fieldcat WITH KEY coltext = <l_mseg_1>-budat.
          IF sy-subrc EQ 0.
            ASSIGN COMPONENT ls_fieldcat-fieldname OF STRUCTURE <ls_table> TO <l_field>.
            <l_field> = <l_mseg_1>-menge.
          ELSE.
            <l_field> =  0.
          ENDIF.
        AT end of matnr.
          APPEND <ls_table> TO <gt_table>.
    clear <ls_table>.
        ENDAT.
      ENDLOOP.
    ENDFORM.                    " move_data
    your answers help me lot . I am awarding the points.
    Very Very Thanks
    Edited by: Dilraj Singh on Apr 13, 2011 3:58 PM
    Edited by: Dilraj Singh on Apr 13, 2011 4:09 PM
    Edited by: Dilraj Singh on Apr 13, 2011 4:23 PM

  • Plot a chart dynamically based on the values selected

    Hi All,
    I have some requirement like this i want to plot a chart . The chart should change dynamically based on target_name and date. What type of UI should I use ? I tried using multiselect or shuttle for choosing the target_name and date picker tool for date once i choose all this the chart should appear. Can I have a custom button called submit so once all the values are entered it plots chart ? Please help me out with our ideas.
    Thanks in Advance

    Hi,
    Using the dependent value sets you can govern the values which can be selected based on a specific value selected in a particular segment. Example if Country name is selected in segment 1 then specific states names as per the country selected can be displayed in segment 2.
    As per the requirement described you want to enable different fields based on the value selected in segment1, currently there is no standard mechanism available to enable/disable fields based on a value and you will have to do an extension/customization to meet this requirement.
    Thanks,
    Sanjay

  • How to add Select event in dynamic ALV

    Hi,
    I have created dynamic ALV and now i want to checked the selected row value.
    If in the selected row contain 'A' value then i have to disable the Button given on the screen.
    If in the selected row contain B' value then i have to enable the Button given on the screen.
    How to add the event once I select the row.
    I have done like this . but it is not
    lw_api_2->do_dynamic_navigation(
              source_window_name          = 'ZWDCHHR_EX_TASK_DELE'
              source_vusage_name          = 'ZWDVHHR_EX_TASK_DELE_USAGE_1'
              source_plug_name            = 'TO_ALV'
              target_component_name       = 'SALV_WD_TABLE'
              target_component_usage      = 'ALV_USAGE1'
              target_view_name            = 'TABLE'
              target_plug_name            = 'DEFAULT'
              target_embedding_position   = 'ZWDVHHR_EX_TASK_DELE/VIEW_DELEG_MY_TASKS' ).
      register event handler
        lw_cmp_usage_2->add_event_handler(
           listener        =  lw_api_2
           handler_name    = 'ONSELECT_TAB1'
           controller_name = 'INTERFACECONTROLLER'
           event_name      = 'ON_SELECT' ).
    Thanks and regards
    Amita Gandhi

    Hi Amita,
    You can try fetch the number of the row which was leadselected through R_PARAM->INDEX. (This would be just a normal integer variable. You can try check this out in debugging mode. ) Now you can just read the data of this row from the context node by saying as GET_ATTRIBUTE up on the nodes reference with the index as R_PARAM->INDEX.
    Regards,
    Uday

  • Dynamic row selection based on Page member selection in Planning web-form

    Hello experts
    I have requirement where, user dont want 10 webforms to enter 2 accounts line for various sparse members. Below is the dimension detail and web-form current design
    Account - Dense
    Period - Dense
    Year - Sparse
    Scenario - Sparse
    Version - Sparse
    Entity - Sparse
    Product - Sparse (600 level 0 members)
    Product dim has family1 as parent and 40 level 0 mem like that there are 10 family level 1 members, now to enter account member (only 2 member) for 6 years projection ( it means 12 periods and 6 years in column ) , i can build 10 web-forms with one web-form has one family level-0 mem in rows,
    however my question, is how can i achieve this in one web-form, instead of 10 web-forms for 400 products ?
    your help is greatly appreciated.
    Edited by: 859874 on Jul 18, 2012 8:58 PM

    Im not sure there is any simple way to get dynamic row selection based on what is selected in the page.
    If I were designing the form based on what you have stated, I would probably stick both Account and Year in the page, and the 400 products in rows. This would require the user to select the different combinations of Year / Account, but would mean only 12 columns (instead of 72).
    Alternatively you could stick Account in rows too - meaning 800 rows, but less combinations to select in Page....all depends what is deemed acceptable to the user.
    Probably other approaches that may be better than above (put Product in the Page for fun!!)
    Thanks
    JB

  • Total based on selected rows

    Hi,
    I have a column called record type and I would like to sub-total based on
    selected rows from the record type at the bottom. how do I do it ?
    for ex:
    rtype load
    s - 100
    b - 150
    r - 200
    z - 10
    total load1 b+r - 350
    total load2 b+z - 160
    ------------------------------------------

    You can use calculations in pivot tables to operate with distinct values of a column. You can create a new column (or row) as 'b' + 'r' record types. You can select wether to see original and total columns or only totals.
    See 'Examples of Calculations in Oracle BI Pivot Tables' section in "Oracle® Business Intelligence Answers, Delivers, and Interactive Dashboards User Guide" document.

  • Printing only one line record with total of all items through alv

    hi experts,
    i am facing a problem while printing a list through alv.
    requirement is, suppose i have 3 line items under one document no.
    i have to print only one record with total amount of all items.more clearly...
    1001  10  1000/-
    1001  20    234/-
    1001  30   540/- these records in internal table then i am passing it to reuse_alv_grid_display.
    i need to display only 1001  1774/-(means sum of all the items)
    please tell me how to do this.
    thanks in advance,
    manasi

    hi ansari,
    contains in itab
         3000000004     02.11.2000     5550     27.95     27.95     0
         3000000004     02.11.2000     5550     10.95     10.95     0
         3000000005     02.11.2000     5550     27.95     27.95     0
         3000000005     02.11.2000     5550     10.95     10.95     0
         3000000006     02.11.2000     3020     52.99     52.99     0
         3000000006     02.11.2000     3020     64.99     64.99     0
         3000000006     02.11.2000     3020     49.5     49.5     0
         3000000007     02.11.2000     3730     2,228.00     2,228.00     0
         3000000007     02.11.2000     3730     1,698.00     1,698.00     0
         3000000007     02.11.2000     3730     532     532     0
    now please tell me how to print the data
    output will be
    3000000004     02.11.2000     5550     38.90     38.90       0
    3000000005     02.11.2000     5550     38.90     38.90       0
    3000000006     02.11.2000     3020     117.19     117.19     0
    like that
    please help me out
    manasi

Maybe you are looking for

  • Feature Request UI builder: More use of Ctrl + ... similar to LabVIEW

    Would like to see more use of the Control + Key for common features that are in LabVIEW. Run for example is Ctrl + R

  • One screw left over

    I just completed replacing the bottom case, and upgrading the hard drive on my 12" G4. I used the instructions from iFixIt.com and found them very useful. Everything is working, Leopard is installing on the new hard drive. But... I have one little 2.

  • My click sounds and ringer sounds on my iphone4 just stopped working....what can i do to fix it?

    my click sounds and ringer sounds on my iphone4 just stopped working....what can i do to fix it?

  • Image overlapping and aligning

    Hi, I'm trying to add 2 white lines ontop of my #header picture. I've managed to make them overlap, but I can't seem to move them where I want them to be. I'll post my code below, but since I don't have a website, you wont be able to see the picture

  • Portal Dynamic Pages

    Help! I am very new at PL/SQL and need some help understanding why this cusror declare won't work in PORTAL: deptno_p number; cursor emp_cur is select ENAME from SCOTT.EMP where DEPTNO = deptno_p; when I try and save this in portal the following mess