Get the master table value based on multiple fact tables

I have an master table which has to filter data based on multiple fact tables
In the below sample, i need to get the list of MasterTable SId in an single query for fetching data from all the fact tables with an criteria.
Can u let me know the single query to handle the below situation
Select count(1) from dbo.DimMaster where sid in
(Select Master_sid from dbo.factsales where SalesDate < '20141231')
Select count(1) from dbo.DimMaster where sid in
(Select Master_sid from dbo.factPurchase where PurchaseDate < '20141231')
Select count(1) from dbo.DimMaster where sid in
(Select Master_sid from dbo.factSalary where SalaryDate < '20141231')
Select count(1) from dbo.DimMaster where sid in
(Select Master_sid from dbo.factMarket where MarketDate < '20141231')
ShanmugaRaj

Please try below:
SELECT
(SELECT count(1)
FROM dbo.DimMaster
WHERE sid IN (
SELECT Master_sid
FROM dbo.factsales
WHERE SalesDate < '20141231'
)) as C1,
(SELECT count(1)
FROM dbo.DimMaster
WHERE sid IN (
SELECT Master_sid
FROM dbo.factPurchase
WHERE PurchaseDate < '20141231'
)) as C2,
(SELECT count(1)
FROM dbo.DimMaster
WHERE sid IN (
SELECT Master_sid
FROM dbo.factSalary
WHERE SalaryDate < '20141231'
)) as C3 ,
(SELECT count(1)
FROM dbo.DimMaster
WHERE sid IN (
SELECT Master_sid
FROM dbo.factMarket
WHERE MarketDate < '20141231'
)) as C4
-Vaibhav Chaudhari

Similar Messages

  • How can build BMM with multiple fact tables

    HI Gurus,
    I have 4 fact tables and 18 Dimension table. Dimension tables have links with multiple fact tables. i have created physical joins in Physical layer. Now my questions is how can i create Business Model with multiple fact tables.
    i mean should i create 4 fact tables as logical tables and logical keys ? Then i have to move all dimension tables in to Business model?
    i am new to OBIEE. i gone through tutorial it is showing with one fact and multi dimension table. Should i do follow same style with multi fact tables.
    Please help me. Thanks in advance for your support.

    Thanks for your response.
    I had drag all tables from the phisical layer to Business Model. then i have deleted all links and recreated complex joins with default values.
    now i have some revenue amont columns in fact tables.
    my question is should i should i create aggregation ( like Sum..) for those columns? is it must ?
    please let me know thank you very much

  • How to get the latest procured value of a spare updated in material master

    How to get the latest procured value of a spare updated in material master

    J S S PRASAD
    See table MBEW via transaction SE16.
    However, you may need to look at the last PO created for that material.
    PeteA

  • How to get the link between mara, ausp, cawn and cawnt tables

    hello ABAPERS
    i have got a requiremet in that i have to get the relation .
    how to get the link between mara, ausp, cawn and cawnt tables and also type how can we get link between  char value and char description in cawn and cawnt tables through ausp and mara tables.
    I would be very thankful  for ur help in advance.
    Thanks & Regards.
    soni

    Hi,
    Sample report using the linkage between tables;
    report batch_char no standard page heading
                              line-size  132
                              line-count 58(1)
                              message-id mm.
           Report by Batch Characteristic                                *
    Description          : Report by Batch Characteristic                *
    Declaration for Tables
    tables: mara,    " Material Master
            mard,    " Storage Location Data for Material
            t001w,   " Plants/Branches
            t001l,   " Storage Locations
            cabn,    " Characteristics
            inob.    " Link between Internal Number and Object
    Declaration for Constants
    constants : c_klart like ausp-klart value '023',     " Class Type
                c_obtab like inob-obtab value 'MCH1',    " Database Table
                c_flag  type c          value 'X',       " Flag
                c_c23   type i          value '23',      " Ratio
    Constants for Ratio Categories
                c_13    type p decimals 2 value '13.00', " For Ratio 13
                c_1499  type p decimals 2 value '14.99', " For Ratio 14.99
                c_15    type p decimals 2 value '15.00', " For Ratio 15
                c_1699  type p decimals 2 value '16.99', " For Ratio  16.99
                c_17    type p decimals 2 value '17.00', " For Ratio 17
                c_1899  type p decimals 2 value '18.99', " For Ratio 18.99
                c_19    type p decimals 2 value '19.00', " For Ratio 19
                c_2099  type p decimals 2 value '20.99', " For Ratio 20.99
                c_21    type p decimals 2 value '21.00', " For Ratio 21
                c_2299  type p decimals 2 value '22.99', " For Ratio 22.99
                c_23    type p decimals 2 value '23.00', " For Ratio 23
                c_g23(4) type c value '>=23',            " For Ratio >=23
                c_ratio(5) value 'RATIO',                  " For Ratio
    Constants for Storing Selected item field information
                c_cursor1(15) value 'I_OUTPUT1-MEINS',   " For Selected Base
                                                         " Unit of Measure
                c_cursor2(15) value 'I_OUTPUT1-MATNR',   " For Selected Base
                                                         " Material Number
                c_cursor3(15) value 'I_OUTPUT1-MAKTX',   " For Selected Base
                                                         " Material Des.
                c_cursor4(15) value 'I_OUTPUT1-CLABS',   "For Selected Base
                                                         " Stock Value
                c_cursor5(15) value 'I_OUTPUT1-ATFLV',   " For Selected Base
                                                        " Char.Value (Ratio)
                c_cursor6(5) value 'C_G23'.
    Declaration for Global Variables
    data : g_exit  type c,                            " Flag
           g_clabs1(16) type c,                       " Quantity
           g_clabs(18)  type c,                       " Quantity
           g_cursor(15) type c,                       " Cursor field name
           g_matnr     type mara-matnr,               " Material Number
           g_werks     type mchb-werks,               " Plant
           g_atinn(30) type c.                        " Character.
    Declaration for Internal tables
    Internal table to hold Batch Stock data
    data : begin of i_mchb occurs 0,
             matnr like mchb-matnr,      " Material Number
             werks like mchb-werks,      " Plant
             lgort like mchb-lgort,      " Storage Location
             charg like mchb-charg,      " Batch Number
             clabs like mchb-clabs,      " Stock Value
             meins like mara-meins,      " Unit of measure
             atflo like ausp-atflv,      " Char.Value (Ratio)
             atflv like ausp-atflv,      " Char.Value (Ratio)
           end of i_mchb.
    Internal table to hold Secondary List data
    data : begin of i_mchb1 occurs 0,
             werks like mchb-werks,      " Plant
             matnr like mchb-matnr,      " Material Number
             lgort like mchb-lgort,      " Storage Location
             charg like mchb-charg,      " Batch Number
             atinn like ausp-atinn,      " Char.Value
             clabs like mchb-clabs,      " Stock Value
             atflo like ausp-atflv,      " Char.Value (Ratio)
             atflv like ausp-atflv,      " Char.Value (Ratio)
           end of i_mchb1.
    Internal table to get the Plant Name
    data : begin of i_plant occurs 0,
             werks like t001w-werks,     " Plant
             name1 like t001w-name1,     " Name
           end of i_plant.
    Internal table to get the Material Description
    data : begin of i_makt occurs 0,
             matnr like makt-matnr,      " Material
             maktx like makt-maktx,     " Description
           end of i_makt.
    Internal table to hold AUSP data
    data : begin of i_ausp occurs 0,
             objek like ausp-objek,      " Object No
             atinn like cabn-atinn,      " Characteric value
             atflv like ausp-atflv,      " Characteristic Value
           end of i_ausp.
    Internal table to hold output data
    data : begin of i_output occurs 0,
             atinn like cabn-atinn,      " Characteric value
             werks like mchb-werks,      " Plant
             matnr like mchb-matnr,      " Material Number
             atnam like cabn-atnam,      " Characteristic
             atflv like ausp-atflv,      " Char.Value (Ratio)
             name1 like t001w-name1,     " Plant Description
             maktx like makt-maktx,      " Material Description
             clabs like mchb-clabs,      " Stock Value
             meins like mara-meins,      " Base Unit of Measure
           end of i_output.
    Internal table to hold final Output data
    data : begin of i_output1 occurs 0,
             atinn like cabn-atinn,      " Characteric value
             werks like mchb-werks,      " Plant
             matnr like mchb-matnr,      " Material Number
             atnam like cabn-atnam,      " Characteristic
             atflv(32) type c,           " Char.Value (Ratio)
             name1 like t001w-name1,     " Plant Description
             maktx like makt-maktx,      " Material Description
             clabs like mchb-clabs,      " Stock Value
             meins like mara-meins,      " Base Unit of Measure
           end of i_output1.
           Selection screen
    selection-screen begin of block b1 with frame title text-001.
    select-options: s_werks for t001w-werks obligatory,  " Plant
                    s_lgort for t001l-lgort,             " Stor.Location
                    s_matnr for mara-matnr  obligatory,  " Material No
                    s_atinn for cabn-atinn.              " Character.
    selection-screen end of block b1.
    At selection screen
    at selection-screen.
    Validation of Selection Screen Fields
      perform validate_screen.
    Start of selection
    start-of-selection.
    Get the Material and Batch Stock data from MARA and MCHB Tables
      perform get_mat_stock_data.
    Get the Material Group Text and Plant Name from T023T and T001W Tables
      perform get_plant_grp_data.
    Append the data into final Output Internal Table after getting the
    Characteristic Values data from INOB and AUSP Tables
      perform append_final_data.
    Processing if the Characteristics contain 'RATIO'
      perform collect_ratio.
    End-of-Page
    end-of-page.
      write /1(125) sy-uline.
    End of selection
    end-of-selection.
      if g_exit <> c_flag.
    Display the Report Output data
        perform display_report.
      endif.
    Top-of-Page
    top-of-page.
    Write the Report and Column Headings
      perform get_headings.
    at line-selection
    at line-selection.
      if sy-lsind = 1.
        perform display_batch.
      endif.
    Top of page during line-selection
    top-of-page during line-selection.
      perform heading_seclist.
          Form validate_screen
    Validation of Selection Screen fields
    form validate_screen.
    Validation of Plant
      clear t001w.
      if not s_werks[] is initial.
        select werks
          into t001w-werks
          from t001w
          up to 1 rows
          where werks in s_werks.
        endselect.
        if sy-subrc <> 0.
          message e899 with 'Enter Valid Plant'(002).
        endif.
      endif.
    Validation of Material Number
      clear mara.
      if not s_matnr[] is initial.
        select matnr
          into mara-matnr
          from mara
          up to 1 rows
          where matnr in s_matnr.
        endselect.
        if sy-subrc <> 0.
          message e899 with 'Enter Valid Material'(003).
        endif.
      endif.
    Validation of Storage Location
      clear t001l.
      if not s_lgort[] is initial.
        select lgort
          into t001l-lgort
          from t001l
          up to 1 rows
          where lgort in s_lgort.
        endselect.
        if sy-subrc <> 0.
          message e899 with 'Enter Valid Storage Location'(004).
        endif.
      endif.
    Validation of Characteristic Value
      clear cabn.
      if not s_atinn[] is initial.
        select atinn
          into cabn-atinn
          from cabn
          up to 1 rows
          where atinn in s_atinn.
        endselect.
        if sy-subrc <> 0.
          message e899 with 'Enter Valid Characteristic Value'(005).
        endif.
      endif.
    Validation of Plant, Material and Storage Location
      clear mard.
      select matnr werks lgort
        into (mard-matnr, mard-werks, mard-lgort)
        from mard
        up to 1 rows
        where matnr in s_matnr and
              werks in s_werks and
              lgort in s_lgort.
      endselect.
      if sy-subrc <> 0.
        message e899 with 'No Data found for the Selection Criteria'(006).
      endif.
    endform.                          "validate_screen
    *&      Form  get_headings
    Write the Report and Column Headings
    form get_headings.
      data: l_repid type sy-repid.
      l_repid =  sy-repid.
      call function 'Y_STANDARD_HEADING'
           exporting
                repid    = l_repid
                heading1 = sy-title.
      write:/1(125) sy-uline.
      format color col_heading on.
      write : /1  sy-vline,  2(18)   'Material Number'(008) centered,
              20  sy-vline,  21(40)  'Material Description'(011) centered,
              61  sy-vline,  62(22)  'Ratio'(009) centered,
              84  sy-vline,  85(18)  'Quantity'(010) centered,
             103  sy-vline, 104(20)  'Base Unit of Measure'(015) centered,
             125  sy-vline.
      write:/1(125) sy-uline.
      format color off.
    endform.                    "get_headings
    *&      Form  get_mat_stock_data
    Get the Material and Batch Stock data from MARA and MCHB Tables
    form get_mat_stock_data.
      clear: i_mchb,i_output, i_output1.
      refresh: i_mchb,i_output, i_output1.
      select a~matnr       " Material Number
             b~werks       " Plant
             b~lgort       " Storage Location
             b~charg       " Batch Number
             b~clabs       " Stock Value
             a~meins       " Base Unit of Measure
          into table i_mchb
          from mara as a inner join mchb as b
          on amatnr eq bmatnr
          where b~matnr in s_matnr and
                b~werks in s_werks and
                b~lgort in s_lgort.
      if sy-subrc <> 0.
        g_exit = c_flag.
        message s899 with 'No Data found for the Selection Criteria'(006).
        stop.
      endif.
      sort i_mchb by matnr werks lgort charg.
    endform.                    " get_mat_stock_data
    *&      Form  get_plant_grp_data
    Get the Material Group Text and Plant Name from T023T and T001W
    form get_plant_grp_data.
      if not i_mchb[] is initial.
    Get the Plant Description from t001w Table
        clear i_plant.
        refresh i_plant.
        select werks      " Plant
               name1      " Name
          into table i_plant
          from t001w
          for all entries in i_mchb
          where werks = i_mchb-werks.
    Get the Material Description from MAKT Table
        clear i_makt.
        refresh i_makt.
        select matnr      " Material number
               maktx      " Material Description
          into table i_makt
          from makt
          for all entries in i_mchb
          where matnr = i_mchb-matnr and
                spras = sy-langu.
        sort i_plant by werks.
        delete adjacent duplicates from i_plant comparing werks.
        sort i_makt by matnr.
        delete adjacent duplicates from i_makt comparing matnr.
      endif.
    endform.                   "form get_plant_grp_data.
    *&      Form  append_final_data
    Append the data into final Internal Table
    form append_final_data.
      data : l_matbatch(28),
             l_tabix like sy-tabix.
      if not i_mchb[] is initial.
        loop at i_mchb.
          l_tabix = sy-tabix.
          clear l_matbatch.
          concatenate i_mchb-matnr i_mchb-charg into l_matbatch.
          move-corresponding i_mchb to i_output.
    Get the Plant Description from i_plant Table
            read table i_plant with key werks = i_mchb-werks binary search.
            if sy-subrc = 0.
              i_output-name1 = i_plant-name1.
            endif.
    Get the Material Description from i_makt Table
          read table i_makt with key matnr = i_mchb-matnr binary search.
          if sy-subrc = 0.
            i_output-maktx = i_makt-maktx.
          endif.
    Get the Characteristic Values data from INOB and AUSP Tables
          clear inob.
          select single cuobj from inob
              into inob-cuobj
              where klart = c_klart and
                    obtab = c_obtab and
                    objek = l_matbatch.
          if sy-subrc = 0.
            select objek
                   atinn
                   atflv
               from ausp
               into table i_ausp
               where objek = inob-cuobj and
                     atinn in s_atinn   and
                     klart = c_klart.
            sort i_ausp by objek atinn.
            loop at i_ausp.
              clear cabn.
              select single atinn atnam from cabn
                         into (cabn-atinn,cabn-atnam)
                         where atinn = i_ausp-atinn.
              if sy-subrc = 0.
    If the ratio value is between 13-14.99, display 13
                if cabn-atnam cs c_ratio.
                  if i_ausp-atflv between c_13 and c_1499.
                    i_mchb-atflo = i_ausp-atflv.
                    i_mchb-atflv = c_13.
    If the ratio value is between 15-16.99, display 15
                  elseif i_ausp-atflv between c_15 and c_1699.
                    i_mchb-atflo = i_ausp-atflv.
                    i_mchb-atflv = c_15.
    If the ratio value is between 17-18.99, display 17
                  elseif i_ausp-atflv between c_17 and c_1899.
                    i_mchb-atflo = i_ausp-atflv.
                    i_mchb-atflv = c_17.
    If the ratio value is between 19-20.99, display 19
                  elseif i_ausp-atflv between c_19 and c_2099.
                    i_mchb-atflo = i_ausp-atflv.
                    i_mchb-atflv = c_19.
    If the ratio value is between 21-22.99, display 21
                  elseif i_ausp-atflv between c_21 and c_2299.
                    i_mchb-atflo = i_ausp-atflv.
                    i_mchb-atflv = c_21.
    If the ratio value is greater than or equal to 23, display 23
                  elseif i_ausp-atflv >= c_23.
                    i_mchb-atflo = i_ausp-atflv.
                    i_mchb-atflv = c_23.
                  endif.           " Condition for RATIO values
                else.              " If characteristic does contain RATIO
                  i_mchb-atflv = i_ausp-atflv.
                endif.
                i_output-atinn = cabn-atinn.
                i_output-atnam = cabn-atnam.
                i_output-atflv = i_ausp-atflv.
                i_mchb1-matnr = i_mchb-matnr.
                i_mchb1-werks = i_mchb-werks.
                i_mchb1-lgort = i_mchb-lgort.
                i_mchb1-charg = i_mchb-charg.
                i_mchb1-clabs = i_mchb-clabs.
                i_mchb1-atinn = i_ausp-atinn.
                i_mchb1-atflo = i_mchb-atflv.
                i_mchb1-atflv = i_ausp-atflv.
                append : i_output, i_mchb1.
                clear i_mchb1.
                modify i_mchb index l_tabix transporting atflo atflv .
              endif.
            endloop.
          endif.
        endloop.
      endif.
    Checking whether the table is filled or not
      if not i_output[] is initial.
        sort i_output by atinn werks matnr atflv.
      else.
        g_exit = c_flag.
        message s899 with 'No Data found for the Selection Criteria'(006).
      endif.
    Delete the records where RATIO is less than 13.
      delete i_output where atnam cs c_ratio and atflv lt c_13.
    endform.                    "append_final_data
    *&      Form  display_report
    Display the Report Output data
    form display_report.
    data: l_tabix like sy-tabix.
      loop at i_output1.
        l_tabix = sy-tabix.
    At new Characteristic
         at new atinn.
          read table i_output1 index l_tabix.
          format color 1 intensified on.
          write: /1 sy-vline, 2(20) 'Characteristic Name:'(007),
                 23(40) i_output1-atnam,
                 125 sy-vline.
          format color off.
          format color 4 intensified on.
          write: /1 sy-vline, 2(20) 'Plant Name         :'(022),
                 23(4) i_output1-werks, 29(30) i_output1-name1,
                 125 sy-vline.
          format color off.
          write /1(125) sy-uline.
        endat.
        clear: g_clabs, g_clabs1.
        format color col_normal.
        write :/1 sy-vline,  2(18)   i_output1-matnr,
               20 sy-vline,  21(40)  i_output1-maktx,
               61 sy-vline.
        if i_output1-atflv = c_c23.
          write: 62(22)  c_g23 centered.
        else.
          shift i_output1-atflv left deleting leading space.
          write: 62(22)  i_output1-atflv centered.
        endif.
        write:  84     sy-vline,
               103     sy-vline,
               110(5)  i_output1-meins.
    If the quantity value is negative
        if i_output1-clabs ge 0.
          write: 85(18) i_output1-clabs unit i_mchb-meins,
                125     sy-vline.
        else.
          i_output1-clabs = - i_output1-clabs.
          write i_output1-clabs unit i_mchb-meins to g_clabs1.
          condense g_clabs1.
          concatenate '(' g_clabs1 ')' into g_clabs separated by space.
          write: 85(18) g_clabs right-justified,
               125 sy-vline.
        endif.
        format color off.
        hide : i_output1.
        new-line.
    At end of material
        at end of matnr.
          sum.
          move : i_output1-matnr to g_matnr.
          format color 3 intensified on.
          write /1(125) sy-uline.
          write :/1 sy-vline,  2(25) 'Total for Material      :'(012),
                 28(18) g_matnr.
          if i_output1-clabs ge 0.
            write: 85(18) i_output1-clabs  unit i_mchb-meins,
            125 sy-vline.
          else.
            i_output1-clabs = - i_output1-clabs.
            write i_output1-clabs unit i_mchb-meins to g_clabs1.
            condense g_clabs1.
            concatenate '(' g_clabs1 ')' into g_clabs separated by space.
            write: 85(18) g_clabs right-justified,
                 125 sy-vline.
          endif.
          write: 125 sy-vline.
          format color off.
          write /1(125) sy-uline.
        endat.
    At end of plant
        at end of werks.
          sum.
          move : i_output1-werks to g_werks.
          format color 3 intensified off.
          write :/1 sy-vline,  2(25) 'Total for Plant          :'(013),
                 28(4) g_werks.
          if i_output1-clabs ge 0.
            write:  85(18) i_output1-clabs  unit i_mchb-meins,
            125 sy-vline.
          else.
            i_output1-clabs = - i_output1-clabs.
            write i_output1-clabs unit i_mchb-meins to g_clabs1.
            condense g_clabs1.
            concatenate '(' g_clabs1 ')' into g_clabs separated by space.
            write: 85(18) g_clabs right-justified,
                 125 sy-vline.
          endif.
          format color off.
          write /1(125) sy-uline.
        endat.
    At end of  characteristic
        at end of atinn.
          read table i_output1 index l_tabix.
          sum.
          format color 3 intensified on.
          write :/1 sy-vline,  2(25) 'Total for Characteristic:'(014),
                 28(25) i_output1-atnam.
          if i_output1-clabs ge 0.
            write:  85(18) i_output1-clabs  unit i_mchb-meins,
            125 sy-vline.
          else.
            i_output1-clabs = - i_output1-clabs.
            write i_output1-clabs unit i_mchb-meins to g_clabs1.
            condense g_clabs1.
            concatenate '(' g_clabs1 ')' into g_clabs separated by space.
            write: 85(18) g_clabs right-justified,
                 125 sy-vline.
          endif.
          format color off.
          write /1(125) sy-uline.
        endat.
      endloop.
    endform.                    " display_report
    *&      Form  DISPLAY_BATCH
         Display the batch details for the seclected material            *
    form display_batch.
    Get the batch details for the selected material
      get cursor field g_cursor.
      if g_cursor = c_cursor1 or
         g_cursor = c_cursor2 or
         g_cursor = c_cursor3 or
         g_cursor = c_cursor4 or
         g_cursor = c_cursor5 or
         g_cursor = c_cursor6.
        format color 3.
        write: /1 sy-vline,
                2(17) 'Material Number :'(020),
               20(17) i_output1-matnr,
               94 sy-vline.
        format color off.
        write /1(94) sy-uline.
        loop at i_mchb1 where matnr = i_output1-matnr and
                              atinn = i_output1-atinn and
                              atflo = i_output1-atflv.
          format color col_normal.
          shift i_mchb1-charg left deleting leading '0'.
          write :/1 sy-vline,  2(16) i_mchb1-lgort centered,
                 18 sy-vline, 19(17) i_mchb1-charg centered,
                 36 sy-vline.
          if i_output1-atnam cs c_ratio.
            write: 37(29) i_mchb1-atflv
                           exponent 0 decimals 2 centered.
          else.
            write : 37(29) i_mchb1-atflv
                          exponent 0 decimals 0 centered.
          endif.
          write : 66 sy-vline, 67(27) i_mchb1-clabs unit i_mchb-meins,
                  94 sy-vline.
          format color off.
        endloop.
        write /1(94) sy-uline.
      else.
        message s899 with 'Invalid cursor position'(016).
        exit.
      endif.
    endform.                    " DISPLAY_BATCH
    *&      Form  HEADING_SECLIST
          Write the Column Headings for Interactive Report
    form heading_seclist.
      write /1(94) sy-uline.
      format color col_heading on.
      write :/1 sy-vline,  2(16) 'Storage Location'(021),
             18 sy-vline, 19(17) 'Batch Number'(017) centered,
             36 sy-vline, 37(29) 'Characteristic Value'(018) centered,
             66 sy-vline, 67(27) 'Quantity'(019) centered,
             94 sy-vline.
      write /1(94) sy-uline.
      format color off.
    endform.                    " HEADING_SECLIST
    *&      Form  COLLECT_RATIO
          Display the Characteristic ratio data
    form collect_ratio.
      loop at i_output.
        clear g_atinn.
        i_output1-atinn = i_output-atinn.
        i_output1-atnam = i_output-atnam .
        i_output1-werks = i_output-werks.
        i_output1-name1 = i_output-name1.
        i_output1-matnr = i_output-matnr.
        i_output1-maktx = i_output-maktx.
        i_output1-clabs = i_output-clabs.
        i_output1-meins = i_output-meins.
        call function 'CONVERSION_EXIT_ATINN_OUTPUT'
             exporting
                  input  = i_output-atinn
             importing
                  output = g_atinn.
        if g_atinn cs c_ratio.
    If the ratio value is between 13-14.99, display 13
          if i_output-atflv between c_13 and c_1499.
            i_output1-atflv = c_13.
    If the ratio value is between 15-16.99, display 15
          elseif i_output-atflv between c_15 and c_1699.
            i_output1-atflv = c_15.
    If the ratio value is between 17-18.99, display 17
          elseif i_output-atflv between c_17 and c_1899.
            i_output1-atflv = c_17.
    If the ratio value is between 19-20.99, display 19
          elseif i_output-atflv between c_19 and c_2099.
            i_output1-atflv = c_19.
    If the ratio value is between 21-22.99, display 21
          elseif i_output-atflv between c_21 and c_2299.
            i_output1-atflv = c_21.
    If the ratio value is greater than or equal to 23, display 23
          elseif i_output-atflv >= c_23.
            i_output1-atflv = c_23.
          endif.
          write i_output1-atflv to i_output1-atflv .
        else.
          write i_output-atflv to i_output1-atflv exponent 0 decimals 0.
        endif.
        collect i_output1.
        clear   i_output1.
      endloop.
      sort i_output1 by atinn werks matnr atflv.
    endform.                    " COLLECT_RATIO
    Reward if useful..
    Regards,
    Anji

  • Getting the dashboard prompt value

    Hello,
    I there a way on how can i get the dashboard prompt value when using other operators beside equal/is in. It seems that you can only set a presentation variable using the equal/is in operator.
    Also how can i get prompt value when using multi-select control?

    Hi. Yes, presentation variable is only for is equal to/is in.
    But no need to use other operators ( is less than or equal to, etc) if you want to write data in presentation variable, use equal/is in if you want to show data that is for example less and set presentation variable and in the report instead if IS PROMPTED write advanced SQL filter like:
    TABLE.COLUMN <= '@{pv}'
    You asked also how can to get prompt value when using multi-select control?
    No way to do that. But what do you need that information for. Lets say that you are able to do that and you put multiple values from multi-select into variable, where do you need to present that data? In the report? No need for that because the report is already filtered by it.
    Also check this one:
    Using multiple values row wise session variables in dashboard prompts and requests
    http://108obiee.blogspot.com/2009/10/using-multiple-values-row-wise-session.html
    Regards
    Goran
    http://108obiee.blogspot.com

  • How to get the most current file based on date and time stamp using SSIS?

    Hello,
    Let us assume that files get copied in a specific directory. We need to pick up a file and load data. Can you guys let me know how to get the most current file based on date and time stamp using SSIS?
    Thanks
    thx regards dinesh vv

    hi simon
    i excuted this script it is giving error..
       Microsoft SQL Server Integration Services Script Task
       Write scripts using Microsoft Visual C# 2008.
       The ScriptMain is the entry point class of the script.
    using System;
    using System.Data;
    using Microsoft.SqlServer.Dts.Runtime;
    using System.Windows.Forms;
    namespace ST_9a6d985a04b249c2addd766b58fee890.csproj
        [System.AddIn.AddIn("ScriptMain", Version = "1.0", Publisher = "", Description = "")]
        public partial class ScriptMain : Microsoft.SqlServer.Dts.Tasks.ScriptTask.VSTARTScriptObjectModelBase
            #region VSTA generated code
            enum ScriptResults
                Success = Microsoft.SqlServer.Dts.Runtime.DTSExecResult.Success,
                Failure = Microsoft.SqlServer.Dts.Runtime.DTSExecResult.Failure
            #endregion
            The execution engine calls this method when the task executes.
            To access the object model, use the Dts property. Connections, variables, events,
            and logging features are available as members of the Dts property as shown in the following examples.
            To reference a variable, call Dts.Variables["MyCaseSensitiveVariableName"].Value;
            To post a log entry, call Dts.Log("This is my log text", 999, null);
            To fire an event, call Dts.Events.FireInformation(99, "test", "hit the help message", "", 0, true);
            To use the connections collection use something like the following:
            ConnectionManager cm = Dts.Connections.Add("OLEDB");
            cm.ConnectionString = "Data Source=localhost;Initial Catalog=AdventureWorks;Provider=SQLNCLI10;Integrated Security=SSPI;Auto Translate=False;";
            Before returning from this method, set the value of Dts.TaskResult to indicate success or failure.
            To open Help, press F1.
            public void Main()
                string file = Dts.Variables["User::FolderName"].Value.ToString();
                string[] files = System.IO.Directory.GetFiles(Dts.Variables["User::FolderName"].Value.ToString());
                System.IO.FileInfo finf;
                DateTime currentDate = new DateTime();
                string lastFile = string.Empty;
                foreach (string f in files)
                    finf = new System.IO.FileInfo(f);
                    if (finf.CreationTime >= currentDate)
                        currentDate = finf.CreationTime;
                        lastFile = f;
                Dts.Variables["User::LastFile"].Value = lastFile;
                Dts.TaskResult = (int)ScriptResults.Success;
    thx regards dinesh vv

  • How to get the User entered value in the Submit request form for a parameter of a concurrent program in Oracle applications.

    Hi All,
    I have a requirement where i need to get the user entered value in the Parameter of a concurrent program while submitting it. i tried to query the FND_CONCURRENT_REQUESTS table but in that it stores the ID values from the value set of the Parameter.
    After submitting the Concurrent request when we click on the view Details button it opens a form where it displays the arguments in the parameter field .  i want to get that string.
    Thanks a lot in advance for your time and help.
    - Vijay

    Hi All,
    I have a requirement where i need to get the user entered value in the Parameter of a concurrent program while submitting it. i tried to query the FND_CONCURRENT_REQUESTS table but in that it stores the ID values from the value set of the Parameter.
    After submitting the Concurrent request when we click on the view Details button it opens a form where it displays the arguments in the parameter field .  i want to get that string.
    Thanks a lot in advance for your time and help.
    - Vijay

  • How to get the previous record value in the current record plz help me...

    In my sql how to get the previous record value...
    in table i m having the field called Date i want find the difference b/w 2nd record date value with first record date... plz any one help me to know this i m waiting for ur reply....
    Thanx in Advance
    with regards
    kotresh

    First of this not hte mysql or database forum so don;t repeate again.
    to get diff between two date in mysql use date_format() to convert them to date if they r not date type
    then use - (minus)to get diff.

  • Getting the last selected value of the combo  - very very urgent...........

    On my panel i have a jcombobox in upper half(which displays say the address type.) and few text fields on the lower half(which displays the add details). when the user selects a value in the combo box the text fields are populated based on the selection. The user can change the values displayed in the text fields. So before setting the new values in the text fields the last displayed values need to be saved.
    I have an ActionListener for my combo which gives me the currently selected value by calling getSelecetdItem()
    How can i get the last selcted value of the combobox without using any variable of my own.

    To update the last displayed details(the address details say) i need to check what type of address the combo had previousely.....
    when i display the panel first time the home address is set by default and i have a variable to hold this value..as the user changes the selection i update the variable...I don't want to use this variable..instead if i can get the last selcted value from the event that would be great...
    thanks

  • Reg: How to get the trip activity values in user exit.

    HI Experts,
    I have scenario like I need calculate the trip advance amount for an employee.
    Based on the employee travel days and employee’s activity type.
    Activity types means:  types of employee trips like
    1. Domestic
    2. International
    Here my problem is not getting trip activity values into my user exit.
    I am getting the all selection values in trip header except this TRIP ACTIVITY values.
    Please give me idea how I can read this trip activity value in to my user exit.
    I have written the below code for user exit.
    CHECK SY-TCODE EQ 'PR01'.
    MOVE TRIP_HEADER TO IT_PTRV_HEAD.
    APPEND IT_PTRV_HEAD.
    CHECK SY-TCODE EQ 'PR01'.
    MOVE TRIP_HEADER TO IT_PTRV_HEAD.
    APPEND IT_PTRV_HEAD.
    Thanks & Regards
    Sameera

    Hi,
    Try to use Enhancement  FITR0003.
    REWARD IF USEFUL

  • Get the sales order number based on customer number

    HI all,
    how can i get the sales order numbers based on the customer number?
    plz tell me the table names.
    thanks,
    Srini

    hiiiii..
    go to database table VBAK
    where you can find customer id and sales order
    use a select statement in your report program
    and key as kunnr ...
    i hope it does ...the job

  • Not able to get the taxonomy field value of meta data field type

    Hi Everyone,
    Not able to get the taxonomy filed value from the metadata filed type.
    Any one can help me on this.
    Label, TermGuid, ValidatedString are showing empty when i debug the code.
    Below is the code which i used to get the taxonomy filed value

    Hi,
    Can you please try getting this way?
    var taxonomyField = listItem.Fields.GetFieldByInternalName(fieldName) as TaxonomyField;
    if (taxonomyField.AllowMultipleValues)
    var fieldValuesCollection = listItem[taxonomyField.Title] as TaxonomyFieldValueCollection;
    return fieldValuesCollection.Select(x => new Guid(x.TermGuid)).ToList();
    else
    var fieldValue = listItem[taxonomyField.Title] as TaxonomyFieldValue;
    return new List<Guid>() { new Guid(fieldValue.TermGuid) };
    Hope it helps!
    Thanks,
    Avni Bhatt
    If this helped you resolve your issue, please mark it Answered

  • Not able to get the profile option value

    Hi,
    Not able to get the profile option value after i changed the new value in the application.
    I am using fnd_global.apps_initialize to initialize the apps from PLSQL code to get the updated profile option value. But fnd_profile.value is not getting fetched the updated value. Still it is fetching the old one. I mean it is stored in database cache. Please any one let me know how to get the new value every time after i changed the value.
    Thanks

    What is the application release?
    Is this a custom or seeded profile option?
    Can you confirm that the value got changed from the application (query the profile option and verify the value)?
    Can you reproduce the issue if you use an API to update this profile option as per (How to Change Profile Option Value Without Forms? [ID 943710.1])?
    Thanks,
    Hussein

  • How to get the list of values for a dynamic parameter using Web Services SDK?

    <p>I am struggling to get the list of values for a dynamic parameter of a report.</p><p>I am using Java Web Services SDK ... I tried to use PromptInfo.getLOV().getValues() method but it does not work.</p><p>First of all ... is this possible (to get the list of values for a dynamic param) using Web Services?</p><p>Second of all, if this is possible, how should I do it ... it seems it works fine when running the report from CMC. It asks for DB logon info and after that it provides a list of values.</p><p>Thx </p>

    <p>Your assumption is correct. We are trying to get the LOVs from the Crystal Report. I was not aware that this is not supported by Web Services SDK.</p><p>We used Web Services SDK to integrated the Crystal Reports in our web application. We implemented some basic actions for reports: schedule, view instances, run ad-hoc reports.</p><p>We encountered this problem when trying to run/schedule reports with dynamic parameters (a list of values from DB). We were unable to get the LOVs.</p><p>Please let me know if you can think of an alternative to look at.</p><p>Thanks a lot,</p><p>Catalin </p>

  • How to get the selected node value of a tree which is build on java code

    Hi Experts,
    How can i get the selected node value if I build the tree programatically.
    I am using the following code in selectionListener but it is throwing error.
    RichTreeTable treeTable = (RichTreeTable)getQaReasontreeTable();
    CollectionModel _tableModel =
    (CollectionModel)treeTable.getValue();
    RowKeySet _selectedRowData = treeTable.getSelectedRowKeys();
    Iterator rksIterator = _selectedRowData.iterator();
    String selectedQaCode ="";
    while (rksIterator.hasNext()) {
    List key = (List)rksIterator.next();
    JUCtrlHierBinding treeTableBinding =
    (JUCtrlHierBinding)((CollectionModel)treeTable.getValue()).getWrappedData();
    JUCtrlHierNodeBinding nodeBinding =
    treeTableBinding.findNodeByKeyPath(key);
    String nodeStuctureDefname =
    nodeBinding.getHierTypeBinding().getStructureDefName();
    selectedQaCode = selectedQaCode + nodeBinding.getAttribute(0);
    where I am using following link to create a tree with java code.
    http://one-size-doesnt-fit-all.blogspot.com/2007/05/back-to-programming-programmatic-adf.html
    Please help me in resolving this issue.
    Regards
    Gayaz

    Hi,
    you should also move
    JUCtrlHierBinding treeTableBinding =
    (JUCtrlHierBinding)((CollectionModel)treeTable.getValue()).getWrappedData();
    out of the while loop as this is not necessary to be repeated for each key in the set
    Frank

Maybe you are looking for