Collect AT END

Hello experts!
I have the following issue at the code bellow: when is executed the concatenate command, the program ignores the quantity summarized by COLLECT and gets the last quantity of the record.
   loop at it_lips.
      it_reg03-cant = it_lips-lgmng.
      collect it_reg03.
      write it_reg03-cant to vl_cant_lips.
      at end of matnr.
        write it_reg03-cant to vl_cant_lips.
        concatenate it_reg03-tipo_reg it_reg03-rent_cod_pr
        it_reg03-rent_cod_um vl_cant_lips
        it_reg03-pr_cod_prod it_reg03-pr_des_prod
        it_reg03-pr_des_um it_reg03-cant_adj
        '/n'
        into it_linha-linha separated by '|'.
        append it_linha.
      endat.
endloop.
How can I get the summarized value to add in it_linha it?
Thanks a lot!
Michel Khouri

>>However, when I append in another internal table, the value is from the last record.
that is b'coz of whats  in the header.. you will have to either READ it_reg03 or LOOP at it.. to append the right value..
~Suresh

Similar Messages

  • Data from Front end to Back end of ALV Grid

    Hi Experts,
    I developed interactive ALV for maintaining master data for some BW Objects. I also included custom F4 for all fields.
    Problem:
    When entered new record or modified a record by using F4 help of fields, it doesn't work properly. For collecting front end data i wrote below specified code.
    for new record insert.
    METHOD handle_data_changed.
        DATA: mod_cell        TYPE lvc_s_modi,
              del_row TYPE lvc_s_moce,
              del_index TYPE i,
              new_index TYPE sy-tabix.
        DATA:   l_assum TYPE /bic/pzassum-/bic/zassum,
                l_assum_modl TYPE /bic/pzassum-/bic/zass_mdl,
                l_assum_typ TYPE /bic/pzassum-/bic/zass_typ,
                l_drv_assum TYPE /bic/pzassum-/bic/zdriver,
                l_infl_assum TYPE /bic/pzassum-/bic/zinflate,
                l_sht_text TYPE /bic/tzassum-txtsh,
                l_mdm_text TYPE /bic/tzassum-txtmd.
        CLEAR error_record.
      IF e_onf4 IS INITIAL.
    ******Get Inserted Data from Frontend
       CALL FUNCTION 'MESSAGES_INITIALIZE'.
        IF er_data_changed->mt_inserted_rows IS NOT INITIAL.
          IF er_data_changed->mt_mod_cells IS NOT INITIAL.
           REFRESH : gt_inserted_data,gt_inserted_text.
            LOOP AT er_data_changed->mt_mod_cells INTO mod_cell.
              CALL METHOD er_data_changed->get_cell_value
                EXPORTING
                  i_row_id    = mod_cell-row_id
                  i_fieldname = '/BIC/ZASSUM'
                IMPORTING
                  e_value     = l_assum.
              wa_changed_data-/bic/zassum = l_assum.
              CALL METHOD er_data_changed->get_cell_value
                EXPORTING
                  i_row_id    = mod_cell-row_id
                  i_fieldname = '/BIC/ZASS_MDL'
                IMPORTING
                  e_value     = l_assum_modl.
              wa_changed_data-/bic/zass_mdl = l_assum_modl.
              CALL METHOD er_data_changed->get_cell_value
                EXPORTING
                  i_row_id    = mod_cell-row_id
                  i_fieldname = '/BIC/ZASS_TYP'
                IMPORTING
                  e_value     = l_assum_typ.
              wa_changed_data-/bic/zass_typ = l_assum_typ.
              CALL METHOD er_data_changed->get_cell_value
                EXPORTING
                  i_row_id    = mod_cell-row_id
                  i_fieldname = '/BIC/ZDRIVER'
                IMPORTING
                  e_value     = l_drv_assum.
              IF sy-subrc = 0.
                wa_changed_data-/bic/zdriver = l_drv_assum.
              ENDIF.
              CALL METHOD er_data_changed->get_cell_value
                EXPORTING
                  i_row_id    = mod_cell-row_id
                  i_fieldname = '/BIC/ZINFLATE'
                IMPORTING
                  e_value     = l_infl_assum.
              IF sy-subrc = 0.
                wa_changed_data-/bic/zinflate = l_infl_assum.
              ENDIF.
              CALL METHOD er_data_changed->get_cell_value
                EXPORTING
                  i_row_id    = mod_cell-row_id
                  i_fieldname = 'TXTSH'
                IMPORTING
                  e_value     = l_sht_text.
              IF sy-subrc = 0.
                wa_changed_text-txtsh = l_sht_text.
              ENDIF.
              CALL METHOD er_data_changed->get_cell_value
                EXPORTING
                  i_row_id    = mod_cell-row_id
                  i_fieldname = 'TXTMD'
                IMPORTING
                  e_value     = l_mdm_text.
              wa_changed_text-txtmd = l_mdm_text.
              APPEND wa_changed_data TO gt_inserted_data.
              wa_changed_text-/bic/zassum = wa_changed_data-/bic/zassum.
              APPEND wa_changed_text TO gt_inserted_text.
            ENDLOOP.
            DELETE ADJACENT DUPLICATES FROM gt_inserted_data.
            DELETE ADJACENT DUPLICATES FROM gt_inserted_text.
          ENDIF.
    For Modified Record
    IF er_data_changed->mt_mod_cells IS NOT INITIAL AND
                  er_data_changed->mt_inserted_rows IS INITIAL.
         REFRESH : gt_modified_text,gt_modified_data.
         REFRESH : gt_valid_text,gt_modified_text.
          LOOP AT er_data_changed->mt_mod_cells INTO mod_cell.
            row_index = mod_cell-row_id.
            CALL METHOD er_data_changed->get_cell_value
              EXPORTING
                i_row_id    = mod_cell-row_id
                i_fieldname = '/BIC/ZASSUM'
              IMPORTING
                e_value     = l_assum.
            wa_changed_data-/bic/zassum = l_assum.
            CALL METHOD er_data_changed->get_cell_value
              EXPORTING
                i_row_id    = mod_cell-row_id
                i_fieldname = '/BIC/ZASS_MDL'
              IMPORTING
                e_value     = l_assum_modl.
            wa_changed_data-/bic/zass_mdl = l_assum_modl.
            CALL METHOD er_data_changed->get_cell_value
              EXPORTING
                i_row_id    = mod_cell-row_id
                i_fieldname = '/BIC/ZASS_TYP'
              IMPORTING
                e_value     = l_assum_typ.
            wa_changed_data-/bic/zass_typ = l_assum_typ.
            CALL METHOD er_data_changed->get_cell_value
              EXPORTING
                i_row_id    = mod_cell-row_id
                i_fieldname = '/BIC/ZDRIVER'
              IMPORTING
                e_value     = l_drv_assum.
            IF sy-subrc = 0.
              wa_changed_data-/bic/zdriver = l_drv_assum.
            ENDIF.
            CALL METHOD er_data_changed->get_cell_value
              EXPORTING
                i_row_id    = mod_cell-row_id
                i_fieldname = '/BIC/ZINFLATE'
              IMPORTING
                e_value     = l_infl_assum.
            IF sy-subrc = 0.
              wa_changed_data-/bic/zinflate = l_infl_assum.
            ENDIF.
            CALL METHOD er_data_changed->get_cell_value
              EXPORTING
                i_row_id    = mod_cell-row_id
                i_fieldname = 'TXTSH'
              IMPORTING
                e_value     = l_sht_text.
            IF sy-subrc = 0.
              wa_changed_text-txtsh = l_sht_text.
            ENDIF.
            CALL METHOD er_data_changed->get_cell_value
              EXPORTING
                i_row_id    = mod_cell-row_id
                i_fieldname = 'TXTMD'
              IMPORTING
                e_value     = l_mdm_text.
            wa_changed_text-txtmd = l_mdm_text..
            APPEND wa_changed_data TO gt_modified_data.
            wa_changed_text-/bic/zassum = wa_changed_data-/bic/zassum.
            APPEND wa_changed_text TO gt_modified_text.
          ENDLOOP.
          DELETE ADJACENT DUPLICATES FROM gt_modified_data.
          DELETE ADJACENT DUPLICATES FROM gt_modified_text.
        ENDIF.
    Custom F4 is working properly.
    Below i am specifing one test case which is my program failed.
    i entered  2 new records by choosing F4 help. The 2nd record only inserted in data base.
    Please help me....
    Thanks in Advance

    Hello Siva
    Some people like to do extensive coding in the event handler method for DATA_CHANGED.
    I do NOT belong to these people.
    My recommendation is (almost) always the same:
    - If required store values in (static) attributes of your event handler class / instance
    - Trigger PAI (using method CL_GUI_CFW=>SET_NEW_OK_CODE)
    At PAI of your screen you can now easily work with your OUTTAB itab used for the ALV list.
    Regards
      Uwe

  • ASCP Data Collection Fails

    Dear Members :
    For sake of learning, ATP in R12.1.1 Vision instance, I created a simple ATP rule with Demand as Sales Order and Supply as PO, On-hand Available.
    I followed all the steps as below:
    1) After creating ATP rule and attaching it to the order mgmt tab in item master, enabled ATP at the org level.
    2) created sourcing rule for that item and assigned it to an assignment set(Supplier Scheduling).
    3) This assignment set appears by default to MRP:ATP assignment set profile option
    4) Set INV : Capable to Promise to ATP/CTP based on collected data, at responsibility level
    5) Include organizations to instance TST(default)
    6) Run ATP Data collection Program.
    RCS is errored out with User-Defined Exception (Source Setup Objects Creation Requests did not complete Successfully) along with Collection Triggers/Views errored out with
    Error with creating Source Triggers/Views
    Is it my setup problem or patch I need to apply, if you could please guide ?
    Thanks in advance.
    Atanu

    Following are in log for them:
    **Starts**03-JAN-2011 20:00:52
    **Ends**03-JAN-2011 20:12:22
    Error in creating Source Triggers
    Start of log messages from FND_FILE
    03-JAN 20:00:52 : Request : 5807365 :Creates Item Triggers used by Collections Process
    03-JAN 20:00:52 : Request : 5807366 :Creates BOM Triggers used by Collections Process
    03-JAN 20:00:52 : Request : 5807367 :Creates Routing Triggers used by Collections Process
    03-JAN 20:00:52 : Request : 5807368 :Creates WIP Triggers used by Collections Process
    03-JAN 20:00:52 : Request : 5807369 :Creates Demand Triggers used by Collections Process
    03-JAN 20:00:52 : Request : 5807370 :Creates Supply Triggers used by Collections Process
    03-JAN 20:00:52 : Request : 5807371 :Creates Other Triggers used by Collections Process
    03-JAN 20:00:52 : Request : 5807372 :Creates Repair Order Triggers used by Collections Process
    End of log messages from FND_FILE
    ***********************************AND that of Source Views details :**************************************************************
    **Starts**03-JAN-2011 20:00:47
    **Ends**03-JAN-2011 20:12:18
    Error in creating Source Views
    Start of log messages from FND_FILE
    03-JAN 20:00:47 : Request : 5807356 :Creates Setup Views used by Collections Process
    03-JAN 20:00:47 : Request : 5807357 :Creates Item Views used by Collections Process
    03-JAN 20:00:47 : Request : 5807358 :Creates BOM Views used by Collections Process
    03-JAN 20:00:47 : Request : 5807359 :Creates Routing Views used by Collections Process
    03-JAN 20:00:47 : Request : 5807360 :Creates WIP Views used by Collections Process
    03-JAN 20:00:47 : Request : 5807361 :Creates Demand Views used by Collections Process
    03-JAN 20:00:48 : Request : 5807362 :Creates Supply Views used by Collections Process
    03-JAN 20:00:48 : Request : 5807363 :Creates Other Views used by Collections Process
    03-JAN 20:00:48 : Request : 5807364 :Creates Repair Order Views used by Collections Process
    End of log messages from FND_FILE
    Executing request completion options...
    Output is not being printed because:
    The print option has been disabled for this report.
    Finished executing request completion options.
    Concurrent request completed
    Current system time is 03-JAN-2011 20:12:18
    ======================================================================
    Thanks
    Atanu

  • Strange memory behaviour using the System.Collections.Hashtable in object reference

    Dear all,
    Recently I came across a strange memory behaviour when comparing the system.collections.hashtable versus de scripting.dictionary object and thought to analyse it a bit in depth. First I thought I incorrectly destroyed references to the class and
    child classes but even when properly destroying them (and even implemented a "SafeObject" with deallocate method) I kept seeing strange memory behaviour.
    Hope this will help others when facing strange memory usage BUT I dont have a solution to the problem (yet) suggestions are welcome.
    Setting:
    I have a parent class that stores data in child classes through the use of a dictionary object. I want to store many differenct items in memory and fetching or alteging them must be as efficient as possible using the dictionary ability of retrieving key
    / value pairs. When the child class (which I store in the dictionary as value) contains another dictionary object memory handeling is as expected where all used memory is release upon the objects leaving scope (or destroyed via code). When I use a system.collection.hashtable
    no memory is released at all though apears to have some internal flag that marks it as useable for another system.collection.hashtable object.
    I created a small test snippet of code to test this behaviour with (running excel from the Office Plus 2010 version) The snippet contains a module to instantiate the parent class and child classes that will contain the data. One sub will test the Hash functionality
    and the other sub will test the dictionary functionality.
    Module1
    Option Explicit
    Sub testHash()
    Dim Parent As parent_class
    Dim d_Count As Double
    'Instantiate parent class
    Set Parent = New parent_class
    'Create a child using the hash collection object
    Parent.AddChildHash "TEST_hash"
    Dim d_CycleCount As Double
    d_CycleCount = 50000
    'Add dummy data records to the child container with x amount of data For d_Count = 0 To d_CycleCount
    Parent.ChildContainer("TEST_hash").InsertDataToHash CStr(d_Count), "dummy data"
    Next
    'Killing the parent when it goes out of scope should kill the childs. (Try it out and watch for the termination debug messages)
    'According to documentation and debug messages not really required!
    Set Parent.ChildContainer("TEST_hash") = Nothing
    'According to documentation not really as we are leaving scope but just to be consistent.. kill the parent!
    Set Parent = Nothing
    End Sub
    Sub testDict()
    Dim Parent As parent_class
    Dim d_Count As Double
    'Instantiate parent class
    Set Parent = New parent_class
    'Create a child using the dictionary object
    Parent.AddChildDict "TEST_dict"
    Dim d_CycleCount As Double
    d_CycleCount = 50000
    'Blow up the memory with x amount of records
    Dim s_SheetCycleCount As String
    s_SheetCycleCount = ThisWorkbook.Worksheets("ButtonSheet").Range("K2").Value
    If IsNumeric(s_SheetCycleCount) Then d_CycleCount = CDbl(s_SheetCycleCount)
    'Add dummy data records to the child container
    For d_Count = 0 To d_CycleCount
    Parent.ChildContainer("TEST_dict").InsertDataToDict CStr(d_Count), "dummy data"
    Next
    'Killing the parent when it goes out of scope should kill the childs. (Try it out and watch for the termination debug messages)
    'According to documentation and debug messages not really required!
    Set Parent.ChildContainer("TEST_dict") = Nothing
    'According to documentation not really as we are leaving scope but just to be consistent.. kill the parent!
    Set Parent = Nothing
    End Sub
    parent_class:
    Option Explicit
    Public ChildContainer As Object
    Private Counter As Double
    Private Sub Class_Initialize()
    Debug.Print "Parent initialized"
    Set ChildContainer = CreateObject("Scripting.dictionary")
    End Sub
    Public Sub AddChildHash(ByRef ChildKey As String)
    If Not ChildContainer.Exists(ChildKey) Then
    Dim TmpChild As child_class_hashtable
    Set TmpChild = New child_class_hashtable
    ChildContainer.Add ChildKey, TmpChild
    Counter = Counter + 1
    Set TmpChild = Nothing
    End If
    End Sub
    Public Sub AddChildDict(ByRef ChildKey As String)
    If Not ChildContainer.Exists(ChildKey) Then
    Dim TmpChild As child_class_dict
    Set TmpChild = New child_class_dict
    ChildContainer.Add ChildKey, TmpChild
    Counter = Counter + 1
    Set TmpChild = Nothing
    End If
    End Sub
    Private Sub Class_Terminate()
    Debug.Print "Parent being killed, first kill all childs (if there are any left!) - muahaha"
    Set ChildContainer = Nothing
    Debug.Print "Parent killed"
    End Sub
    child_class_dict
    Option Explicit
    Public MemmoryLeakObject As Object
    Private Sub Class_Initialize()
    Debug.Print "Child using Scripting.Dictionary initialized"
    Set MemmoryLeakObject = CreateObject("Scripting.Dictionary")
    End Sub
    Public Sub InsertDataToDict(ByRef KeyValue As String, ByRef DataValue As String)
    If Not MemmoryLeakObject.Exists(KeyValue) Then MemmoryLeakObject.Add KeyValue, DataValue
    End Sub
    Private Sub Class_Terminate()
    Debug.Print "Child using Scripting.Dictionary terminated"
    Set MemmoryLeakObject = Nothing
    End Sub
    child_class_hash:
    Option Explicit
    Public MemmoryLeakObject As Object
    Private Sub Class_Initialize()
    Debug.Print "Child using System.Collections.Hashtable initialized"
    Set MemmoryLeakObject = CreateObject("System.Collections.Hashtable")
    End Sub
    Public Sub InsertDataToHash(ByRef KeyValue As String, ByRef DataValue As String)
    If Not MemmoryLeakObject.ContainsKey(KeyValue) Then MemmoryLeakObject.Add KeyValue, DataValue
    End Sub
    Private Sub Class_Terminate()
    Debug.Print "Child using System.Collections.Hashtable terminated"
    Set MemmoryLeakObject = Nothing
    End Sub
    Statistics:
    TEST: (Chronologically ordered)
    1.1 Excel starting memory: 25.324 kb approximately
    Max memory usage after hash (500.000 records) 84.352 kb approximately
    Memory released: 0 %
    1.2 max memory usages after 2nd consequtive hash usage 81.616 kb approximately
    "observation:
    - memory is released then reused
    - less max memory consumed"
    1.3 max memory usages after 3rd consequtive hash usage 80.000 kb approximately
    "observation:
    - memory is released then reused
    - less max memory consumed"
    1.4 Running the dictionary procedure after any of the hash runs will start from the already allocated memory
    In this case from 80000 kb to 147000 kb
    Close excel, free up memory and restart excel
    2.1 Excel starting memory: 25.324 kb approximately
    Max memory usage after dict (500.000 records) 90.000 kb approximately
    Memory released: 91,9%
    2.2 Excel starting memory 2nd consequtive dict run: 27.552 kb approximately
    Max memory usage after dict (500.000 records) 90.000 kb approximately
    Memory released: 99,4%
    2.3 Excel starting memory 3rd consequtive dict run: 27.712 kb approximately
    Max memory usage after dict (500.000 records) 90.000 kb approximately
    Memory released:

    Hi Cor,
    Thank you for going through my post and took the time to reply :) Most apreciated. The issue I am facing is that the memory is not reallocated when using mixed object types and is not behaving the same. I not understand that .net versus the older methods
    use memory allocation differently and perhaps using the .net dictionary object (in stead of the scripting.dictionary) may lead to similar behaviour. {Curious to find that out -> put to the to do list of interesting thingies to explore}
    I agree that allocated memory is not a bad thing as the blocks are already assigned to the program and therefore should be reallocated with more performance. However the dictionary object versus hashtable perform almost identical (and sometimes even favor
    the dictionary object)
    The hashtable is clearly the winner when dealing with small sets of data.
    The issue arises when I am using the hash table in conjunction with another type, for example a dictionary, I see that the dictionary object's memory is stacked on top of the claimed memory space of the hashtable. It appears that .net memory allocation and
    reuse is for .net references only. :) (Or so it seems)
    In another example I got with the similar setup, I see that the total used memory is never released or reclaimed and leakage of around 20% allocated memory remains to eventually crash the system with the out of memory message. (This is when another class
    calls the parent class that instantiates the child class but thats not the point of the question at hand)
    This leakage drove me to investigate and create the example of this post in the first place. For the solution with the class -> parent class -> child class memory leak I switched all to dictionaries and no leakage occurs anymore but nevertheless thought
    it may be good to share / ask if anyone else knows more :D (Never to old to learn something new)

  • Referencing values in Array Collection?

    I'm using a Remote Object to pass an argument to a CFC. I
    then query a table according to the value of the argument passed in
    ('where' clause). I return a single record result as a query in
    Flex (event.result) and set it as an Array Collection, example:
    myAC = new ArrayCollection;
    myAC.source = event.result as Array;
    I can take this AC and set it as a dataprovider for a data
    grid or list without problem. What I'd like to do is pull specific
    data from the AC and use it in my Flex app. For example, the
    results of my query will return 1 record only, but contains many
    columns from my table. It might contain an ID, a username, a first
    and last name, maybe a phone number, etc. All this info for that
    single record will be stored in the array collection. What I want
    to do is be able to reference this data in Flex.
    For instance, if I need to display the phone number (stored
    as phoneNumber from my query) in the array collection, how can I do
    this? myAC.phoneNumber? myAC.getItemAt(0).phoneNumber?
    Any guidance is appreciated

    I'm not sure about dealing with a Remote Object / CFC
    configuration, but if your collection essentially ends up like:
    var myAC:ArrayCollection = new ArrayCollection([{name:
    'First', phoneNumber: '555'}]);
    Then yes you should be able to access it with:
    myAC.getItemAt(0).phoneNumber
    I take this has not worked?

  • How to generate Inventory Report to display all details at end of mon/yr?

    Hi Guys..
    I would like to know how we can generate a
    Inventory report to display all inventory details at the end of every
    month or year?
    Also, another question.How can we create a PO past delivery date report?
    Any help is appreciated.
    Thanks,
    Sri Harsha;

    Hi,
    Pls the code here-
    TYPES :
            BEGIN OF ty_mard,
              matnr TYPE matnr,
              werks TYPE werks_d,
              lgort TYPE lgort_d,
              labst TYPE labst,
              retme TYPE retme,
              umlme TYPE umlme,
            END OF ty_mard.
    TYPES :
           BEGIN OF ty_mska,
              matnr TYPE matnr,
              kalab TYPE labst,
              vbeln TYPE vbeln,
              posnr TYPE posnr,
            END OF ty_mska.
    TYPES :
            BEGIN OF ty_vbap,
              matnr TYPE matnr,
              kwmeng TYPE kwmeng,
              pstyv TYPE pstyv,
            END OF ty_vbap.
    TYPES :
            BEGIN OF ty_mbew,
              matnr TYPE matnr,
              salk3 TYPE salk3,
              stprs TYPE stprs,
            END OF ty_mbew.
    TYPES :
            BEGIN OF ty_mchb,
              matnr TYPE matnr,
              charg TYPE charg_d,
            END OF ty_mchb.
    TYPES :
            BEGIN OF ty_mara,
              matnr TYPE matnr,
              mfrpn TYPE mfrpn,
            END OF ty_mara.
    TYPES :
           BEGIN OF ty_makt,
             matnr TYPE matnr,
             maktx TYPE maktx,
           END OF ty_makt.
    TYPES :
            BEGIN OF ty_ekpo,
             matnr TYPE matnr,
             netpr TYPE bprei,
             meins TYPE bstme,
            END OF ty_ekpo.
    DATA :
           BEGIN OF final OCCURS 0,
            matnr LIKE mard-matnr,
            maktx LIKE makt-maktx,
            werks LIKE mard-werks,
            lgort LIKE mard-lgort,
            mfrpn LIKE mara-mfrpn,
            usp LIKE mbew-stprs,
            labst LIKE mard-labst,
            salk3 LIKE mbew-salk3,
            kalab LIKE mska-kalab,
            vbeln LIKE mska-vbeln,
            sov LIKE ekpo-netpr,
            uom LIKE ekpo-meins,
            posnr LIKE mska-posnr,
            pstyv LIKE vbap-pstyv,
            kwmeng LIKE vbap-kwmeng,
            retme LIKE mard-retme,
            umlme LIKE mard-umlme,
           END OF final.
    DATA :
          BEGIN OF itab OCCURS 0,
            matnr LIKE mard-matnr,
            werks LIKE mard-werks,
            lgort LIKE mard-lgort,
            labst LIKE mard-labst,
            retme LIKE mard-retme,
            umlme LIKE mard-umlme,
            charg LIKE mchb-charg,
          END OF itab.
    DATA :
           i_mard TYPE STANDARD TABLE OF ty_mard,
           i_mbew TYPE STANDARD TABLE OF ty_mbew,
           i_mchb TYPE STANDARD TABLE OF ty_mchb,
           i_mara TYPE STANDARD TABLE OF ty_mara,
           i_vbap TYPE STANDARD TABLE OF ty_vbap,
           i_mska TYPE STANDARD TABLE OF ty_mska,
           i_makt TYPE STANDARD TABLE OF ty_makt,
           i_ekpo TYPE STANDARD TABLE OF ty_ekpo.
    DATA :
           wa_mard TYPE ty_mard,
           wa_mbew TYPE ty_mbew,
           wa_mchb TYPE ty_mchb,
           wa_mara TYPE ty_mara,
           wa_vbap TYPE ty_vbap,
           wa_mska TYPE ty_mska,
           wa_makt TYPE ty_makt,
           wa_ekpo TYPE ty_ekpo.
    DATA :
           sov_total TYPE currency,
           urestrict_total type currency.
    *Select options:
    SELECTION-SCREEN BEGIN OF BLOCK a WITH FRAME TITLE text-001.
    SELECT-OPTIONS : s_matnr FOR gf_matnr, " Material No.
                     s_werks FOR gf_werks, " Plant
                     s_lgort FOR gf_lgort, " Storage Location
                     s_charg FOR gf_charg. " Batch No.
    SELECTION-SCREEN END OF BLOCK a.
    *Validation of Selection Fields
    AT SELECTION-SCREEN.
      IF     s_matnr IS INITIAL
         AND s_werks IS INITIAL
         AND s_lgort IS INITIAL
         AND s_charg IS INITIAL.
        MESSAGE e001(zcir).
      ENDIF.
    *Function Module for Checking the inputs
      CALL FUNCTION 'MMIM_ENTRYCHECK_MAIN'
        TABLES
          it_matnr = s_matnr
          it_werks = s_werks
          it_lgort = s_lgort.
    *Checking of input values for S_CHARG
      IF NOT s_charg-low IS INITIAL OR NOT s_charg-high IS INITIAL.
        SELECT charg FROM mchb into table LT_charg WHERE charg IN s_charg.
        IF sy-subrc NE 0.
          MESSAGE e002(zcir).
        ENDIF.
        clear wa_mchb.
      ENDIF.
    *TOP OF PAGE
    TOP-OF-PAGE.
      FORMAT COLOR COL_HEADING.
      WRITE sy-uline(105).
      WRITE :/ '|',2 text-101, "MATERIAL NO:
             16 text-102,    "MATERIAL DESCRIPTION
             52 text-103,    "PLANT
             60 text-104,    "STORAGE LOCATION.
             74 text-105,    "MANUFACTURE PARTNER NO.
             88 text-106,    "VALUATED STOCK.
             95 text-107.    "STANDARD PRICE.
            105 '|'.
      FORMAT COLOR COL_GROUP.
      WRITE :/ '|',2 text-108, " UNRESTRCTED STOCK
              16 text-109,     " SALES DOCUMENT NO:
              20 text-110,     " ITEM NO:
              27 text-111,     " UNIT
              32 text-112,     " NET VALUE
              39 text-113,     " ITEM CATEGRY
              50 text-114,     " QUANTITY
              60 text-115,     " BLOCKED STOCK
              79 text-116,     " TOTAL STOCK
              95 text-117.     " STOCK TRANSFER
             87 '|'.
      FORMAT COLOR OFF.
      WRITE sy-uline(105).
    *START OF SELECTION
    START-OF-SELECTION.
      IF NOT s_matnr IS INITIAL
        OR NOT s_werks IS INITIAL
        OR NOT s_lgort IS INITIAL.
        PERFORM select1.
      ELSEIF NOT s_charg IS INITIAL.
        PERFORM select2.
      ELSEIF NOT s_matnr IS INITIAL
        OR NOT s_werks IS INITIAL
        OR NOT s_lgort IS INITIAL
        AND NOT s_charg IS INITIAL.
        PERFORM select3.
      ENDIF.
      PERFORM final1.
      PERFORM collect.
    *END OF SELECTION
    END-OF-SELECTION.
      LOOP AT LT_FINAL.
        FORMAT COLOR COL_KEY.
        WRITE :/2 LT_FINAL-matnr,
               14 LT_FINAL-maktx,
               52 LT_FINAL-werks,
               58 LT_FINAL-lgort,
               69 LT_FINAL-mfrpn,
               73 LT_FINAL-labst,
               87 LT_FINAL-usp.
        FORMAT COLOR OFF.
        FORMAT COLOR COL_NORMAL.
        WRITE :/2 LT_FINAL-kalab,
                14 LT_FINAL-vbeln,
                17 LT_FINAL-posnr,
                24 LT_FINAL-uom,
                28 LT_FINAL-sov,
                36 LT_FINAL-pstyv,
                46 LT_FINAL-kwmeng,
                57 LT_FINAL-retme,
                65 LT_FINAL-salk3,
                75 LT_FINAL-umlme.
      ENDLOOP.
      FORMAT COLOR COL_TOTAL.
      WRITE :/2 text-119,     " TOTAL VALUE
              28 V_sov_total,
              87 V_urestrict_total.
      FORMAT COLOR OFF.
    Form Name: select1
    text: Population of internal table LT_MARD and using LT_MARD populating
          the internal table LT_MCHB
    FORM select1.
      SELECT matnr
             werks
             lgort
             labst
             retme
             umlme
             FROM mard
             INTO TABLE LT_mard
             WHERE matnr IN s_matnr
             AND werks IN s_werks
             AND lgort IN s_lgort.
      SELECT matnr
             charg
             FROM mchb
             INTO TABLE LT_mchb
             FOR ALL ENTRIES IN LT_mard
             WHERE matnr EQ LT_mard-matnr.
    ENDFORM.                                                    "select1
    Form Name: select2
    text:Population of internal table LT_MCHB and using LT_MCHB populating
         LT_MARD
    FORM select2.
      SELECT matnr
             charg
             FROM mchb
             INTO TABLE LT_mchb
             WHERE charg IN s_charg.
      SELECT matnr
             werks
             lgort
             labst
             retme
             umlme
             FROM mard
             INTO TABLE LT_mard
             FOR ALL ENTRIES IN LT_mchb
             WHERE matnr EQ LT_mchb-matnr.
    ENDFORM.                                                    "select2
    Form Name: select3
    text: Population of internal table LT_TAB using inner join and then
          populating internal tables LT_MARD and LT_MCHB
    FORM select3.
      SELECT a~matnr
             a~werks
             a~lgort
             a~labst
             a~retme
             a~umlme
             b~charg
             INTO CORRESPONDING FIELDS OF TABLE LT_TAB
             FROM mard AS a
             INNER JOIN mchb AS b ON bmatnr = amatnr
             WHERE a~matnr IN s_matnr
             OR a~werks IN s_werks
             OR a~lgort IN s_lgort
             AND b~charg IN s_charg.
      LOOP AT LT_TAB.
        MOVE: LT_TAB-matnr TO wa_mard-matnr,
              LT_TAB-werks TO wa_mard-werks,
              LT_TAB-lgort TO wa_mard-lgort,
              LT_TAB-labst TO wa_mard-labst,
              LT_TAB-retme TO wa_mard-retme,
              LT_TAB-umlme TO wa_mard-umlme,
              LT_TAB-matnr TO wa_mchb-matnr,
              LT_TAB-charg TO wa_mchb-charg.
        APPEND wa_mard TO LT_mard.
        APPEND wa_mchb TO LT_mchb.
      ENDLOOP.
    ENDFORM.                                                    "select3
    Form Name:collect
    text:population of LT_FINAL internal table-LT_FINAL using other internal
          tables
    FORM collect.
      LOOP AT LT_mard INTO wa_mard.
        MOVE : wa_mard-matnr TO LT_FINAL-matnr,
               wa_mard-werks TO LT_FINAL-werks,
               wa_mard-lgort TO LT_FINAL-lgort,
               wa_mard-labst TO LT_FINAL-labst,
               wa_mard-retme TO LT_FINAL-retme,
               wa_mard-umlme TO LT_FINAL-umlme.
        READ TABLE LT_makt INTO wa_makt WITH KEY matnr = wa_mard-matnr.
        MOVE wa_makt-maktx TO LT_FINAL-maktx.
        READ TABLE LT_mska INTO wa_mska WITH KEY matnr = wa_mard-matnr.
        MOVE: wa_mska-kalab TO LT_FINAL-kalab,
              wa_mska-vbeln TO LT_FINAL-vbeln,
              wa_mska-posnr TO LT_FINAL-posnr.
        READ TABLE LT_vbap INTO wa_vbap WITH KEY matnr = wa_mard-matnr.
        MOVE: wa_vbap-kwmeng TO LT_FINAL-kwmeng.
        READ TABLE LT_mara INTO wa_mara WITH KEY matnr = wa_mard-matnr.
        MOVE : wa_mara-mfrpn TO LT_FINAL-mfrpn.
        READ TABLE LT_mbew INTO wa_mbew WITH KEY matnr = wa_mard-matnr.
      Calculation of Unrestricted value
        LT_FINAL-usp = wa_mard-labst * wa_mbew-stprs.
        V_urestrict_total = V_urestrict_total + ( wa_mard-labst * wa_mbew-stprs ).
       CALL FUNCTION 'CONVERSION_EXIT_ALPHA_OUTPUT'
         EXPORTING
           input         = V_urestrict_total
        IMPORTING
          OUTPUT        = V_urestrict_total
        MOVE wa_mbew-salk3 TO LT_FINAL-salk3.
        READ TABLE LT_ekpo INTO wa_ekpo WITH KEY matnr = wa_mard-matnr.
        MOVE wa_ekpo-meins TO LT_FINAL-uom.
      Calculation of Sales Order Value
        LT_FINAL-sov = wa_mska-kalab * wa_ekpo-netpr.
        V_sov_total = V_sov_total + ( wa_mska-kalab * wa_ekpo-netpr ).
        APPEND LT_FINAL.
      ENDLOOP.
    ENDFORM.                    "collect
    *Form Name:FINAL1
    *Population of all the internal tables
    FORM FINAL1.
      SELECT matnr
             kalab
             vbeln
             posnr
             FROM mska
             INTO TABLE LT_mska
             FOR ALL ENTRIES IN LT_mard
             WHERE matnr EQ LT_mard-matnr.
      SELECT matnr
             kwmeng
             pstyv
             FROM vbap
             INTO TABLE LT_vbap
             FOR ALL ENTRIES IN LT_mard
             WHERE matnr EQ LT_mard-matnr.
      SELECT matnr
             salk3
             stprs
             FROM mbew
             INTO TABLE LT_mbew
             FOR ALL ENTRIES IN LT_mard
             WHERE matnr EQ LT_mard-matnr.
      SELECT matnr
             mfrpn
             FROM mara
             INTO TABLE LT_mara
             FOR ALL ENTRIES IN LT_mard
             WHERE matnr EQ LT_mard-matnr.
      SELECT matnr
             maktx
             FROM makt
             INTO TABLE LT_makt
             FOR ALL ENTRIES IN LT_mard
             WHERE matnr EQ LT_mard-matnr.
      SELECT matnr
             netpr
             FROM ekpo
             INTO TABLE LT_ekpo
             FOR ALL ENTRIES IN LT_mard
             WHERE matnr EQ LT_mard-matnr.
    ENDFORM.                                                    "final1
    Reward if helpful.
    Chandralekha

  • SLD Data Supplier Collected information incomplete.

    Dear All
    My technical system is EP7.0 and SLD based on SOLMAN (EhP1).
    I am getting error while trying to access SLD Data Supplier on
    VA 'Server -> Services -> SLD Data Supplier'.
    SLD_Collector_Task
    2009.12.09@17:49:45: Data collection process started.
    2009.12.09@17:49:45: Created list of data collecting classes.
    2009.12.09@17:49:45: Processing class:
    com.sap.sldserv.data.GetDatabaseSystem
    2009.12.09@17:49:45: Processing class:
    com.sap.sldserv.data.GetInstalledSoftwareComponent
    2009.12.09@17:49:45: Processing class:
    com.sap.sldserv.data.GetJ2EEEngineCluster
    2009.12.09@17:49:45: Processing class:
    com.sap.sldserv.data.GetJ2EEEngineInstance
    2009.12.09@17:49:45: Processing class:
    com.sap.sldserv.data.GetJavaDebugPort
    2009.12.09@17:49:45: Processing class:
    com.sap.sldserv.data.GetSAPBCCentralServiceInstance
    2009.12.09@17:49:45: Processing class:
    com.sap.sldserv.data.GetSAPComputerSystem
    2009.12.09@17:49:45: Processing class:
    com.sap.sldserv.data.GetSAPIPServicePort
    2009.12.09@17:49:45: Processing class:
    com.sap.sldserv.data.GetSAPJ2EEDeployedObject
    2009.12.09@17:49:46: Processing class:
    com.sap.sldserv.data.GetSAPJ2EEEngineClusterNode
    2009.12.09@17:49:46: Collected information incomplete. Please check
    trace file.
    2009.12.09@17:49:46: Sending data via HTTP.
    2009.12.09@17:49:47: Data has been sent successfully. You can check
    correct data processing in the target SLD.
    2009.12.09@17:49:47: Collecting process ended.
    So I guess that full system data didnu2019t send to SLD therefor system
    number and install number didnu2019t exist in SMSY.
    Thanks & Best Regards.

    I can't  find message about SLD in default trace file.
    But I found below messages in dev_jrfc.trc.
    16.12.2009 15:30:50.384 ALL      Error> occured  >Wed Dec 16 14:10:16,880<
    16.12.2009 15:30:50.384 ALL      RfcException:
    16.12.2009 15:30:50.384 ALL          message: Parameter gateway service ('gwserv') needs to be of format #### or sapgw## (# is a di
    git)
    16.12.2009 15:30:50.384 ALL      Connection parameters: TPNAME=SLD_NUC GWHOST=localhost GWSERV=sapgw
    16.12.2009 15:30:50.384 ALL          Return code: RFC_INVALID_PARAMETER(19)
    16.12.2009 15:30:50.384 ALL          error group: 101
    16.12.2009 15:30:50.384 ALL          key: RFC_ERROR_PROGRAM
    16.12.2009 15:30:50.384 ALL            at com.sap.mw.rfc.api.RfcRegisterInfo.checkParameters(RfcRegisterInfo.java:114)
    16.12.2009 15:30:50.384 ALL            at com.sap.mw.rfc.api.RfcApi.RfcAccept(RfcApi.java:651)
    16.12.2009 15:30:50.384 ALL            at com.sap.mw.jco.MiddlewareJRfc$Server.accept(MiddlewareJRfc.java:1563)
    16.12.2009 15:30:50.384 ALL            at com.sap.mw.jco.JCO$Server.accept(JCO.java:7989)
    16.12.2009 15:30:50.384 ALL            at com.sap.mw.jco.RequestListenerGroup.openConnection(RequestListenerGroup.java:531)
    16.12.2009 15:30:50.384 ALL            at com.sap.mw.jco.RequestListenerGroup.adjustConnectionCount(RequestListenerGroup.java:424)

  • Accessing Query ColumnList in Array Collection

    I want to get the Column names in a query object returned
    from a WebService as an Array Collection.
    I have a WebService that is returning the following SOAP
    data:
    <?xml version="1.0"
    encoding="utf-8"?><soapenv:Envelope xmlns:soapenv="
    http://schemas.xmlsoap.org/soap/envelope/"
    xmlns:xsd="
    http://www.w3.org/2001/XMLSchema"
    xmlns:xsi="
    http://www.w3.org/2001/XMLSchema-instance">
    <soapenv:Body>
    <ns1:sStockQuotesResponse soapenv:encodingStyle="
    http://schemas.xmlsoap.org/soap/encoding/"
    xmlns:ns1="
    http://cfc.private">
    <sStockQuotesReturn xsi:type="ns2:QueryBean" xmlns:ns2="
    http://rpc.xml.coldfusion">
    <columnList soapenc:arrayType="xsd:string[4]"
    xsi:type="soapenc:Array" xmlns:soapenc="
    http://schemas.xmlsoap.org/soap/encoding/">
    <columnList
    xsi:type="xsd:string">name</columnList>
    <columnList
    xsi:type="xsd:string">symbol</columnList>
    <columnList
    xsi:type="xsd:string">lastprice</columnList>
    <columnList
    xsi:type="xsd:string">lastpricedate</columnList>
    </columnList>
    <data soapenc:arrayType="xsd:anyType[][7]"
    xsi:type="soapenc:Array" xmlns:soapenc="
    http://schemas.xmlsoap.org/soap/encoding/">
    <data soapenc:arrayType="xsd:anyType[4]"
    xsi:type="soapenc:Array">
    <data xsi:type="soapenc:string">ALCOA INC</data>
    <data xsi:type="soapenc:string">AA</data>
    <data xsi:type="soapenc:string">35.87</data>
    <data xsi:type="soapenc:string">11/12/2007
    4:00pm</data>
    </data>
    </data>
    </sStockQuotesReturn>
    </ns1:sStockQuotesResponse>
    </soapenv:Body>
    </soapenv:Envelope>
    I have no problem converting the data to a Flex Array
    Collection, and populating a DataGrid with this data.
    However, I want to grab the Column Names, so that I can
    create the DataGrid columns dynamically. I have searched the FB3
    documentation, but cannot find an answer. Please help.
    Thank you.
    Eric.

    I'm not sure about dealing with a Remote Object / CFC
    configuration, but if your collection essentially ends up like:
    var myAC:ArrayCollection = new ArrayCollection([{name:
    'First', phoneNumber: '555'}]);
    Then yes you should be able to access it with:
    myAC.getItemAt(0).phoneNumber
    I take this has not worked?

  • Catch-all or default collection?

    I currently organize photos by folder, I would like to start organizing by collection/smart collection instead.  (Folders will be organized chronologically only).  I would like to know if there is a catch-all collection, that is, if the photo is not in any other collection, it ends up in this default one.  I think this is necessary so that I don't loss track of any photo. 

    yiplong wrote:
    Thanks for your reply, but I am not sure what you were talking about.  Can you elaborate?
    Set up a smart collection with the following content:
    This smart collection will then automatically contain all the images which do not belong to a (non-smart) collection.
    Beat

  • Two New Membership Questions

    I am coming to Photoshop from another editing program and face a bit of a learning curve.
    Two questions.
    Because of the learning curve, I am interested in starting with just a subscription to photoshop . Is the single subscription for Photoshop ($19.99 per month version with a contract), for Photoshop or Photshop Extended?
    Second, will it be possible to upgrade mid contract from just photoshop to the full Master Collection, either ending or converting the original contract without having to pay both at once (similar to the way you can with cell phones)?
    Thanks for your time

    Your best bet would be to contact Adobe Customer Service with your questions.  There are several FAQs online which may help you.  In this one http://www.adobe.com/products/creativesuite/faq.html  I found the following:
    If I decide I would like to upgrade to Adobe Creative Cloud rather than continue to subscribe to an individual CS6 application, how do I do that?
    You can upgrade your subscription to a Creative Cloud membership by logging in to www.creativecloud.com, going to the My Account page, and simply walking through the steps to upgrade. You will be given a partial refund on the remaining amount due on your existing subscription.
    Good luck!

  • Forum FAQ: How do I achieve column break in a matrix?

    Symptom
    Although you can set page break for column group in Reporting Services 2008, page breaks are ignored on column groups. Reference:
    http://msdn.microsoft.com/en-us/library/ms156434.aspx
    Solution
    Here are some workarounds, available forboth Reporting Services 2005 and2008:
    Workaround 1
    Spread the columns from one matrix into several matrixes. You can first copy one matrix and then paste it into several ones you want. Then set the filter for each column group to make sure that the total columns’ length in one matrix just fit a page’s width.
    Workaround 2
    The other method is to use a custom code.
    a.     Please copy the following code to the custom code area:
    Dim FlagTable As System.Collections.Hashtable
    Dim Flag AS Integer
     Function MyFunc(ByVal NewValue As Object) As Integer
    If (FlagTable Is Nothing) Then
    FlagTable = New System.Collections.Hashtable
    End If
    If (NewValue Is Nothing) Then
    NewValue = "-"
    End If
    If (Not FlagTable .Contains(NewValue )) Then
    Flag =Flag + 1
    FlagTable.Add(NewValue, nothing)
    End If
    MyFunc = Flag
    End Function
    b.     Create a list in your report.
    Imagine thatthe column group of a matrix is grouped bythe field ‘Column_Group’, then set the detail group of list withthe expression like this:
    =Ceiling(Code.MyFunc(Fields!Column_Group.Value)/5)
    Note: This means the Max number of column in matrix will be five after you follow step C.
    c.      Sort the dataset by column group field, and then drag the matrix into the list. Click Preview.
    Workaround 3
    Similar to the second method, you need to modify the dataset.
    a.     Create an ID column for the column group in your dataset.
    For example,there isa datasetwith the following query:
    SELECT * FROM Table
    The column group is grouped on the field “Group1”.Then, modify the query like this:
    SELECT *, Dense_Rank()OVER(order by Group1) AS ID FROM Table 
    b.     Create a list in your report, set the detail group of the list with the Expression like this:
    =Ceiling(Fields!ID.Value/5)
    Note: This meansthat the Max number of column in matrix will be five after you followthe step C.
    c.      Sort the dataset bythe column group and then drag the matrix into the list. Click Preview.

    I have near about 30 matrics. so I need a paging. I did every thing as per this post and it really works for me.
    I have total four columns. On one page it should show three and the remaining one will be moved to next page.
    Problem occurs when in my first row i have 3 columns and in next page if I have one columns then it show proper on first page but on second page also it gives me three columns insted of one. the first column data is exactly what I have but in remaining two
    columns it shows some garbage data.
    I have data like below.
    Metric ColumnNo RowNo
    1 1
    1
    2 2
    1
    3 3
    1
    4 1
    2
    so while grouping i have a row parent group on RowNo and Column group on ColumnNo.
    can anyone please advice on this.

  • Problem with xs:integer (I think)

    Hi,
    Firstly, I'm using Oracle database version 11.2.0.1.0
    The overall task is to absorb data from an XML file and create records in a single destination table.
    I've studied the excellent thread at Load xml data in Oracle table
    and copied and hacked Odie's examples.
    I've got something to work, but there's just that one final problem, explained so.
    To test out my code, I wrapped the "select" that gets the data from the XML file into a cursor For loop, and inside
    the loop body I just use dbms_output so I can see that the values are being processed okay. This works a treat, so my
    final task was to abandon the cursor For loop and instead make the select statement the source of data for an Insert
    statement. This is where my plans become unstuck.
    In order to cater for duplicate rows, I'm using the "at" bit of the "for" loop as so: "for $i at $bibnum in /collection/record".
    That bit of data (available through the variable "$bibnum") when printed out via the older dbms_output code did show
    a pleasing consecutive sequence of digits. But try and insert this into a plain database table and all I get is nulls. Yuk.
    Trying to read around this, I've managed through dubious means to glean that the variable is of type "xs:integer". It seems converting
    this to a oracle "number" type is problematic. There is mention on the web page http://docs.oracle.com/cd/E14571_01/doc.1111/e15867/app_xquery_sql_reference.htm
    about conversion from "number" to "xs:integer", hence I am presuming that the converse also holds.
    But the blooming thing still doesn't work.
    Other numbers from the select statement populate into my destination table fine. It's just the xs:integer that's the issue.
    I've tried changing the "columns" part of the xmltable call and used "number", "number(8)", "number(8,0)" and other variants. No joy.
    I've also tried changing the column type of the target table. Still no joy.
    I've tried converting the xs:integer to a xs:decimal, and then use that. Still nothing.
    Time to throw myself on the mercy of the forum. Any easy way to convert the xs:integer into a plain string?
    If there is no obvious answer, I will throw together a small self-contained piece of example code and come back here.
    Any help appreciated; thanks in advance.
    Mungo (newbie with xmltables - probably going round the "long" way on this task :-)

    That's a funny one, SELECT is working but INSERT is not...
    I guess it's an issue with the CBO and XQuery optimization.
    If you're always using a variable as your XML source, you can disable it by adding the NO_XML_QUERY_REWRITE hint. It should solve the problem :
    SQL> create table raw_bib (
      2    recordID    number
      3  , datafieldID number
      4  , tag         number
      5  , subfield    varchar2(10)
      6  , val         varchar2(4000)
      7  )
      8  ;
    Table created
    SQL> var xml_data varchar2(4000)
    SQL>
    SQL> begin
      2   :xml_data := '<collection>
      3   <record>
      4    <datafield tag="1">
      5     <subfield code="1d1s1">ABC</subfield>
      6     <subfield code="1d1s2">DEF</subfield>
      7     <subfield code="1d1s3">GHI</subfield>
      8    </datafield>
      9    <datafield tag="2">
    10     <subfield code="1d2s1">ABC</subfield>
    11     <subfield code="1d2s2">DEF</subfield>
    12     <subfield code="1d2s3">GHI</subfield>
    13    </datafield>
    14   </record>
    15   <record>
    16    <datafield tag="1">
    17     <subfield code="2d1s1">ABC</subfield>
    18     <subfield code="2d1s2">DEF</subfield>
    19     <subfield code="2d1s3">GHI</subfield>
    20    </datafield>
    21   </record>
    22  </collection>';
    23  end;
    24  /
    PL/SQL procedure successfully completed
    SQL>
    SQL> insert into raw_bib(recordID, datafieldID, tag, subfield, val)
      2  select /*+ no_xml_query_rewrite */
      3         recordID, datafieldID, tag, subfield, val
      4  from xmltable(
      5   'for $i at $bibnum in /collection/record
      6   return
      7   for $j at $dfnum in  $i/datafield
      8   return
      9   for $k in $j/subfield
    10     return element r {
    11      element finalData {data($k)}
    12      , element datafieldtag {data($j/@tag) }
    13      , element subfieldcode { data($k/@code) }
    14      , element whichdatafield {data($dfnum)}
    15      , element bibnumber { $bibnum }
    16      }
    17    '
    18  passing xmltype(:xml_data)
    19  columns recordID    number         path 'bibnumber'
    20        , datafieldID number         path 'whichdatafield'
    21        , tag         number         path 'datafieldtag'
    22        , subfield    varchar2(10)   path 'subfieldcode'
    23        , val         varchar2(4000) path 'finalData'
    24  )
    25  ;
    9 rows inserted
    SQL> select * from raw_bib;
      RECORDID DATAFIELDID        TAG SUBFIELD   VAL
             1           1          1 1d1s1      ABC
             1           1          1 1d1s2      DEF
             1           1          1 1d1s3      GHI
             1           2          2 1d2s1      ABC
             1           2          2 1d2s2      DEF
             1           2          2 1d2s3      GHI
             2           1          1 2d1s1      ABC
             2           1          1 2d1s2      DEF
             2           1          1 2d1s3      GHI
    9 rows selected

  • Problem in project system report ZPS_PROJSUMMARY

    i am working with a report ZPS_PROJSUMMARY which extracts all project summary report.now problem is it is extracting las financila years (2006 ) closed WBS element also with this years WBS elements. this problem happening in production only. this is not coming in pre production.in pre production it is deleting all the previous years WBS using this subroutine perform process_delete_child using it_report-pspnr which is based on condition  if l_status_fyear lt s_fyear-low.  
    i am giving the full code below:-
    report zps_projsummary line-size 623
                      line-count 65
                      no standard page heading
                      message-id zfiwip.
    Report Name: ZPS_PROJSUMMARY
    Author:      Rey Salvador  (for NDC)
    Date:        14.09.2001
    Purpose:     Project Summary Report (with Commitments)
    Modifications Log
    Mod Id   Author      Date      References  Purpose
    M001     R.Salvador  19.10.01  THOR 2845   Add YTD Rev.Recognised
    M002     R.Salvador  19.11.01  THOR 2978   Fix YTD Rev.Rec. Level 1
    M003     R.Salvador  19.11.01  THOR 3050   Fix YTD Rev.Rec. Level 1
    M004     R.Salvador  08.03.02  THOR 3222   Fix Include Closed WBS
    M005     R.Salvador  17.05.02  THOR 3342   Fix issue with Profile
    M006     C.Kontkanen 22.05.02  LOB         Add ProjManager sel
    M007     R.Salvador  19.06.02  LOB         Incl. WIP/COGS Adjustments
    M008     R.Salvador  26.07.02  THOR xxxx   Add ProjOfficer
    M009     R.Salvador  06.08.02  THOR 3508   Revenue Recognition Changes
    M010     R.Salvador  29.11.02  THOR 3704   New Billing Reports
    M011     R.Salvador  17.12.02  THOR 3646   Fix problem with statuses
    M012     R.Salvador  20.01.03  THOR 3930   Add CP/SP/WO number
    M013     R.Salvador  07.03.03  THOR 3953   Incorrect Status
    M014     R.Salvador  15.04.03  THOR 4056   Fix Level 1 Calculation
    M015     R.Salvador  01.05.03  THOR 4070   Fix Level 1 Calculation
    M016     R.Salvador  17.06.03  THOR 4125   Fix Level 2 Calculation
    M017     R.Salvador  03.09.03  THOR 4220   Change RevRec Calculation
    M018     R.Salvador  25.09.03  THOR 4237   Fix WBS Selection
    M019     R.Salvador  11.11.03  THOR 4297   Add SP number
    M020     R.Salvador  16.01.04  THOR 4342   Fix Revenue Recognition
    M021     R.Salvador  28.01.04  THOR 4344   Fix Revenue Recognition
    M022     R.Salvador  11.02.04  THOR 4340   Fix Selection Criteria
             Ta Tran     10.06.04  DI4K900626  Copied from NDC
    M023     Maccha      29.08.05  DI2K921397  Honing the selection
             Srinivas                          process for Director and
                                               Manager criteria.
    M024     M.Srinivas  20.09.05  DI2K921599  Rectifying the order level
                                               - Partner profile
                                               selections. Ref.
                                               docket:203680869
    M025     M.Srinivas  01.05.06  DI2K922837  Order level - Status
                                               profile selections
                                               rectification. PD:203960491
    M026     Gaurav Dixit18.09.06  DI2K923361  Not to select the deleted
                                               partners from IHPA table.
    M027    SaiKiran Reddy07.06.07 DI2K923793  To Exclude Deleted partner
                                               from IHPA table.
    include zps_projsummcomd.
    types: begin of ty_wbs_report2,                      "Reporting Table
             Pdir(20),                                   "Prog Dir
             posid         like prps-posid,              "WBS Element
             post1         like prps-post1,              "Short Text
             fkstl         like prps-fkstl,              "resp const centre
             prart         like prps-prart,              "Proj Type
             ZZORDERLEVEL(2),                            "order level
             ZZACTTYP(6),                                "Activity type
             sstatus       like bsvx-sttxt,              "system status
             ustatus       like bsvx-sttxt,              "user status
             ZZIMCINITIATIVE(24),                        "IMC initiative
             ZZIMCPROGRAM(02),                           "IMC Program
             ZZWORKCATEGORY(02),                         "Work Cat
             ZZWPMANLOB(01),                             "LOB
             ZZSOURCE(02),                               "Source
             ZZPRIN(02),                                 "Principal
             ZZIMPLEMENTREG(01),                         "IMP Reg
             ZZCONTRACTID(10),                           "Contract
             ZZWPNUM(08),                                "WP No
             ZZsPNUM(08),                                "SP No
             ZZORDERNUM(04),                             "Order No
             lead(20),                                   "Prog Lead
             Pmgr(20),                                   "Prog Mgr
             Poff(20),                                   "Prog Officer
           acthours      type megxxx, "megXXX: 3decimal"Actual Hours
             acthours      type wkgxxx, "wkgXXX: 2decimal"Actual Hours
             planhours     type wkgxxx,                  "Planned Hours
             PLANLABOUR    type wkgxxx,                  "PLAN LABOUR
             ACTLABOUR     type wkgxxx,                  "ACTUAL LABOUR
             planmatcosts  type wkgxxx,               "plan material costs
             actmatcosts   type wkgxxx,               "actual material costs
             plancosts     type wkgxxx,                   "Planned COsts
             actcosts      type wkgxxx,                   "Actual Costs
             prcommitment  type wkgxxx,                   "PR Commitment
             pocommitment  type wkgxxx,                   "PO Commitment
             totcommitment type wkgxxx,                   "Total Commitment
             zzwip         like prps-zzwip,               "rev rec process
             planrev       type wkgxxx,                   "Planned Revenues
             actrev        type wkgxxx,                   "Actual Revenues
             pcnt_comp(8)   type p decimals 2,            "% complete
             acttotrevrec  type wkgxxx,                   "Act.Rev.Rec m009
             actytdrevrec  type wkgxxx,                   "Act.Rev Rec m009
             revrec        type wkgxxx,                   "revenue Recognise
             revrecytd     type wkgxxx,                   "RevRec YTD M001
             rev_collected like vbrp-netwr,               "Collected Rev
           end of ty_wbs_report2.
    types: begin of ty_wbs_report,                        "Reporting Table
             Pdir(20),                                    "Prog Dir
             posid         like prps-posid,               "WBS Element
             post1         like prps-post1,               "Short Text
             fkstl         like prps-fkstl,               "resp const centre
             prart         like prps-prart,               "Proj Type
             ZZORDERLEVEL(2),
             ZZACTTYP(6),                                 "Activity type
             sstatus       like bsvx-sttxt,               "system status
             ustatus       like bsvx-sttxt,               "user status
             ZZIMCINITIATIVE(24),                         "IMC initiative
             ZZIMCPROGRAM(02),                            "IMC Program
             ZZWORKCATEGORY(02),                          "Work Cat
             ZZWPMANLOB(01),                              "LOB
             ZZSOURCE(02),                                "Source
             ZZPRIN(02),                                  "Principal
             ZZIMPLEMENTREG(01),                          "IMP Reg
             ZZCONTRACTID(10),                            "Contract
             ZZWPNUM(08),                                 "WP No
             ZZSPNUM(08),                                 "SP No
             ZZORDERNUM(04),                              "Order No
             lead(20),                                    "Prog Lead
             Pmgr(20),                                    "Prog Mgr
             poff(20),                                    "Prog Officer
             acthours      type wkgxxx,                   "Actual Hours
             planhours     type wkgxxx,                   "Planned Hours
             PLANLABOUR    type wkgxxx,                   "PLAN LABOUR
             ACTLABOUR     type wkgxxx,                   "ACTUAL LABOUR
             planmatcosts  type wkgxxx,               "plan material costs
             actmatcosts   type wkgxxx,               "actual material costs
             plancosts     type wkgxxx,                   "Planned COsts
             actcosts      type wkgxxx,                   "Actual Costs
             prcommitment  type wkgxxx,                   "PR Commitment
             pocommitment  type wkgxxx,                   "PO Commitment
             totcommitment type wkgxxx,                   "Total Commitment
             zzwip         like prps-zzwip,               "rev rec process
             planrev       type wkgxxx,                   "Planned Revenues
             actrev        type wkgxxx,                   "Actual Revenues
             pcnt_comp(8)   type p decimals 2,            "% complete
             acttotrevrec  type wkgxxx,                   "Act.Rev.Rec m009
             actytdrevrec  type wkgxxx,                   "Act.Rev Rec m009
             revrec        type wkgxxx,                   "revenue Recognise
             revrecytd     type wkgxxx,                   "RevRec YTD M001
             pspnr         like prps-pspnr,               "WBS Internal Key
             postu         like prps-postu,               "Short Text
             fakkz         like prps-fakkz,
             psphi         like prps-psphi,               "proj def
             zzcust        like prps-zzcustNUM,           "Customer
             zzcustnum     like prps-zzcustnum,           "Customer
             kostl         like prps-kostl,               "Cost Centres
             prsumm(1)     type c,                        "Project Summary
             actcostscfy   type wkgxxx,                   "Current FY Costs
             actrevcfy     type wkgxxx,                   "Current FY Rev
             rev_billed    like vbrp-netwr,               "Billed Revenue
             gst_billed    like vbrp-mwsbp,               "Billed GST
             rev_collected like vbrp-netwr,               "Collected Rev
             gst_collected like vbrp-mwsbp,               "Collected GST
             totbudget     type wkgxxx,                   "Total Budget
             verna         like prps-verna,                     "PM m006
             astna         like prps-astna,                     "PO m006
             totcogs  type wkgxxx,                        "Total COGS m009
             ytdcogs  type wkgxxx,                        "YTD COGS m009
           end of ty_wbs_report.
    types: begin of ty_totals,              "Structure for Sub-totals
             actmatcosts type wkgxxx,          "Actual material Costs
             actcosts    type wkgxxx,          "Actual Costs Total
             actrev      type wkgxxx,          "Actual Revenues Total
             planmatcosts type wkgxxx,         "plan material Costs
             plancosts   type wkgxxx,          "Planned Costs
             planrev     type wkgxxx,          "Planned Revenues
             acthours    type wkgxxx,          "Actual Hours
             planhours   type wkgxxx,          "Planned Hours
             ACTLABOUR   type wkgxxx,          "ACTUAL LABOUR
             PLANLABOUR  type wkgxxx,          "Planned LABOUR
             revrec      type wkgxxx,          "Revenue Recognised
             revrecytd     type wkgxxx,        "RevRec YTD M001
             acttotrevrec  type wkgxxx,        "RevRec Actual M009
             profit        type wkgxxx,        "Planned Profit/Loss
             actcostscfy   type wkgxxx,        "Actual Costs Current FY
             actrevcfy     type wkgxxx,        "Actual Revenues Current FY
             rev_billed    type wkgxxx,        "Billed Revenue
             gst_billed    type wkgxxx,        "Billed GST
             rev_collected type wkgxxx,        "Collected Rev
             gst_collected type wkgxxx,        "Collected GST
             prcommitment  type wkgxxx,        "PR Commitment
             pocommitment  type wkgxxx,        "PO Commitment
             totcommitment type wkgxxx,        "Total Commitment
             totbudget     type wkgxxx,        "Total Budget
             actytdrevrec  TYPE wkgxxx,
           end of ty_totals.
    type-pools: gsetc.
    tables: cepct.
    data: it_wbs_report TYPE ty_wbs_report OCCURS 0 WITH HEADER LINE,
          it_wbs_report2 TYPE ty_wbs_report2 OCCURS 0 WITH HEADER LINE,
          wr_wbs_report type ty_wbs_report,
          it_prctr      type standard table of setlist,
          it_stat(72) occurs 0 with header line,
          et_stat(72) occurs 0 with header line,
          begin of it_tj49 occurs 0,
            stats like tj49-stats,
            incex like tj49-incex,
            verkz like tj49-verkz,
          end of it_tj49,
          begin of it_csla occurs 150,
          vksta like csla-vksta,
          end of it_csla,
          w_stat_flg,
          w_join(3),
          w_not(3),
          w_stat_val(7) value '''     ''',
          W_LEAD(40),
          W_PDIR(40),
          W_PMGR(40),
          w_poff(40),
          w_tab like sy-tabix,
          n like sy-index,
          w_reporting_level(2) type c,
          w_gtotal_text(500)   type c,
          w_other_level(1)     type c,
          w_budat              like bkpf-budat,                 "m002
          w_level like prps-stufe,
          w_record_count(8)    type n,
          w_pspid_ind(1)       type c,                          "m003
          begin of ziheader,
            w_strlen   type i,
            hdr_pos    type p,
            hold_name(30),
            conf_txt(54) value
            '* CONFIDENTIAL - PROPERTY OF BACCHUS *',
          end of ziheader,
          p_budat like bkpf-budat,
          w_sel_posid like prps-posid,
    Internal tables to hold set hierarchy, values, pointers and sorts
          set_hierarchy    like sethier     occurs 0 with header line,
          set_values       like setvalues   occurs 0 with header line,
          set_id like rgsbs-setnr,
          set_id2         like rgsbs-setnr,
          w_setnr(30)        type c,
          w_set_values like rgsb4 occurs 0 with header line,
          lt_objlst type standard table of onr00,
          lr_objlst type onr00,
          w_first   type c.
    Start of M011
    data: it_wbs1 like it_wbs occurs 0.
    data: it_wbs_tmpo  like it_wbs occurs 0 with header line.   "M024
    data: begin of loc_wbs occurs 0.
            include structure  zco_wip_wbslst.  "test '''
    data:         pdir(20),
                  zzacttyp(6),
                  ZZIMCINITIATIVE(24),
                  ZZIMCPROGRAM(02),
                  ZZWORKCATEGORY(02),
                  ZZWPMANLOB(01),
                  ZZSOURCE(02),
                 ZZPRIN(02),
                  ZZIMPLEMENTREG(01),
                  ZZCONTRACTID(10),
                  ZZWPNUM(08),
                  ZZSPNUM(08),
                  ZZORDERNUM(04),
                  PERNR(08),
                  PERNR2(08),
           end of loc_wbs.
    data: begin of it_report occurs 0,
            posid like prps-posid,
            pspnr like prps-pspnr,
          end of it_report.
    End of M011
    data: begin of it_deleted occurs 0,
            posid like prps-posid,
            pspnr like prps-pspnr,
          end of it_deleted.
    data: begin of l_deleted occurs 0,
            posid like prps-posid,
            pspnr like prps-pspnr,
          end of l_deleted.
    data: w_year like bkpf-gjahr.
    data: begin of t_date occurs 0,
          w_budat  like bkpf-budat,
          poper    like t_poper-poper,
    end of t_date.
    data: t_ihpa like ihpa occurs 0 with header line,
          t_ihpa1 like ihpa occurs 0 with header line,
          t_ihpa2 like ihpa occurs 0 with header line,
          t_ihpa3 like ihpa occurs 0 with header line,
          t_ihpa4 like ihpa occurs 0 with header line,
          l_status(3),
          w_PLANHOURS like it_wbs-PLANHOURS,
          w_PLANREV   like it_wbs-PLANREV,
          w_PLANCOSTS like it_wbs-PLANCOSTS,
          it_tmp_wbs3 type zco_proj_summary_v2 occurs 0 with header line,
          W_it_wbs5 like it_wbs .
    ranges: r_prctr for prps-prctr.
    ranges: r_stufe for prps-stufe.
    ranges: r_posid for prps-posid.
    constants: c_crtd like tj49-stats value 'I0001'.
    CONSTANTS: C_LEAD(2) VALUE '4A',
               C_PDIR(2) VALUE '4B',
               C_PMGR(2) VALUE 'A1',
               C_Poff(2) VALUE 'A2',
               c_pdn like ihpa-OBTYP value 'PDN',
               c_prn like ihpa-OBTYP value 'PRN'.               "M023
    tables : pa0002.
    ---------------------Organisational Units------------------------*
    selection-screen begin of block orgunit with frame title text-t06.
    *WP/CP Managing LOB
    select-options: S_ZWP for PRPS-ZZWPMANLOB MATCHCODE OBJECT  ZZWPMANLOB.
    *Implementing Region
    select-options: S_ZIMP for PRPS-ZZIMPLEMENTREG MATCHCODE OBJECT
    ZZIMPLEMENTREG.
    *Cost center group
    PARAMETERS: P_CTGRP  LIKE RKSB1-KSGRU no-display.
    *Responsible Cost Center
    select-options: s_fkstl  for prps-fkstl.
    select-options: s_src    for  proj-zzsource MATCHCODE OBJECT ZzSOURCE.
    select-options: s_prin   for  proj-zzprin MATCHCODE OBJECT ZzPRINCIPAL .
    select-options: s_wcat   for  proj-zzworkcategory MATCHCODE OBJECT
    ZZWORKCATEGORY.
    select-options: s_wpcpt  for  proj-ZZTYPE MATCHCODE OBJECT ZzTYPE.
    selection-screen end of block orgunit.
    selection-screen begin of block periods with frame title text-t05.
    selection-screen begin of line.
    selection-screen comment 1(20) text-c04 for field p_kokrs.
    selection-screen position pos_low.
    parameters: p_kokrs type kokrs obligatory default 'TELC'.
    selection-screen end of line.
    selection-screen begin of line.
    selection-screen comment 1(20) text-c01 for field s_fyear.
    selection-screen position pos_low.
    select-options: s_fyear for bkpf-gjahr obligatory no intervals
                    no-extension.
    selection-screen end of line.
    selection-screen begin of line.
    selection-screen comment 1(20) text-c02 for field s_poper.
    selection-screen position pos_low.
    select-options: s_poper for T009B-poper obligatory no intervals
                    no-extension.
    selection-screen end of line.
    selection-screen begin of line.
    selection-screen position pos_low.
    selection-screen end of line.
    data: p_incwip(1) type c value ' '.
    selection-screen begin of line.
    selection-screen comment 1(30) text-c25 for field p_calrev.
    selection-screen position pos_low.
    parameters:  p_calrev radiobutton group 0001 default 'X'.
    selection-screen end of line.
    selection-screen begin of line.
    selection-screen comment 1(30) text-c26 for field p_actrev.
    selection-screen position pos_low.
    parameters:  p_actrev radiobutton group 0001.
    selection-screen end of line.
    End of M007 Mods
    selection-screen end of block periods.
    selection-screen begin of block psjsel with frame title text-t01.
    *Program Leadhouse
    select-options: s_plead for pa0002-pernr matchcode object  ZPA0002.
    *Project Director
    select-options: s_pdir for pa0002-pernr  matchcode object  ZPA0002.
    *Project Manager
    select-options: s_pmgr for pa0002-pernr  matchcode object  ZPA0002.
    *Project Profile
    select-options: s_PROFL FOR PROJ-PROFL default 'EXTERN' obligatory.
    *Project Definition
    select-options: s_pspid  for proj-pspid.
    *WBS Element
    select-options: s_posid  for prps-posid.
    selection-screen end of block psjsel.
    selection-screen begin of block othersel with frame title text-t07.
    parameters: p_lvl1 radiobutton group rplv,
                p_lvl2 radiobutton group rplv,
                p_wip  radiobutton group rplv.
    selection-screen begin of line.
    selection-screen comment 1(20) text-c16 for field p_oth.
    selection-screen position pos_low.
    parameters:  p_oth  radiobutton group rplv.
    selection-screen comment 40(20) text-c17 for field p_level.
    parameters:  p_level like prps-stufe.
    selection-screen end of line.
    selection-screen begin of line.
    selection-screen comment 1(22) text-c22 for field p_incwbs.
    selection-screen position 42.
    parameters:  p_incwbs as checkbox.
    selection-screen end of line.
    Start of M006 Mods
    selection-screen begin of line.
    selection-screen comment 1(41) text-c23 for field p_clwbs.
    selection-screen position 42.
    parameters:  p_clwbs as checkbox default 'X'.
    selection-screen end of line.
    End of M006 Mods
    parameters:
      p_status like tj49-selid.
    select-options:
      s_prart for prps-prart.
    selection-screen end of block othersel.
    selection-screen begin of block outfile with frame title text-t11.
    selection-screen begin of line.
    selection-screen comment 1(20) text-c11 for field p_file.
    selection-screen position pos_low.
    parameters: p_file as checkbox.
    selection-screen end of line.
    selection-screen begin of line.
    selection-screen comment 1(20) text-c13 for field p_runid.
    selection-screen position pos_low.
    parameters: p_runid like zcnwip_log-zrunid.
    selection-screen end of line.
    selection-screen begin of line.
    selection-screen comment 1(20) text-c12 for field p_filenm.
    selection-screen position pos_low.
    parameters: p_filenm(40) type c default '/batch/int/send/ndcreports/'
                                    lower case.
    selection-screen end of line.
    selection-screen end of block outfile.
    initialization.
      perform ini_fiscal_year_current.
    Default year/period in the selection screen
      s_fyear-sign = 'I'.
      s_fyear-option = 'EQ'.
      APPEND s_fyear.
      s_poper-sign = 'I'.
      s_poper-option = 'EQ'.
      APPEND s_poper.
      perform ini_file_path.
    at selection-screen on block outfile.
      if not p_file is initial.
        if p_filenm is initial.
          message e017.
        endif.
        if p_runid is initial.
          message e017.
        endif.
      endif.
    at selection-screen on p_status.
      clear it_stat.
      refresh it_stat.
      if p_status is initial.
        w_stat_flg = 'N'.
      else.
        w_stat_flg = 'Y'.
      endif.
    at selection-screen.
      include ZCNWIPCOMF_V2.
      if not p_actrev is initial.
        move: w_curr_year   to w_curr_fperiod+0(4),
              w_curr_period to w_curr_fperiod+4(2),
              s_fyear-low       to w_sel_fperiod+0(4),
              s_poper-low       to w_sel_fperiod+4(2).
        if w_sel_fperiod le '200212'.  "temp
          message e025.
        endif.
        if w_sel_fperiod ge w_curr_fperiod.
          message e026.
        endif.
      endif.
    Check if Other level check, specify level from 3-4
      if not p_oth is initial and
         p_level is initial.
        message e021.
      endif.
    Validate File Information
      if not p_file is initial.
        if p_runid is initial or
           p_filenm is initial.
          message e014.
        endif.
        select count(*) from zcnwip_log
          where zrunid eq p_runid
          and   zrep   eq 'PROJCE'. " to be changed
        if sy-subrc eq 0.
          message w022 with p_runid.
        endif.
      endif.
      if not p_ctgrp is initial and not s_FKSTL is initial.
        message e087 with 'Cost Center Group' 'Responsible Cost Center'.
      endif.
      if not p_ctgrp is initial.
        clear w_setnr.
        move: '0101'     to w_setnr+0(4),
              P_KOKRS    to w_setnr+4(4),
              p_ctgrp    to w_setnr+8.
        call function 'G_SET_GET_ALL_VALUES'
             EXPORTING
                  setnr         = w_setnr
             TABLES
                  set_values    = w_set_values
             EXCEPTIONS
                  set_not_found = 1
                  others        = 2.
        if sy-subrc eq 0.
          loop at w_set_values.
            if w_set_values-from = w_set_values-to.
              S_FKSTL-low = w_set_values-from.
              S_FKSTL-option = 'EQ'.
            else.
              S_FKSTL-low  = w_set_values-from.
              S_FKSTL-high = w_set_values-to.
              S_FKSTL-option = 'BT'.
            endif.
            S_FKSTL-sign   = 'I'.
            append S_FKSTL.
          endloop.
        else.
          message e201 with p_ctgrp.
        endif.
      endif.
    start-of-selection.
      data: w_poper like s_poper-low,
            w_fyear like s_fyear-low.
      w_poper = s_poper-low.
      loop at s_poper.
        case s_poper-option.
          when 'EQ'.
            move s_poper-low to t_poper.
            append t_poper.
            clear t_poper.
          when 'BT'.
            move s_poper-low to t_poper.
            append t_poper.
            clear t_poper.
            while w_poper < s_poper-high.
              w_poper = w_poper + 1.
              move w_poper to t_poper.
              append t_poper.
              clear t_poper.
            endwhile.
        endcase.
      endloop.
      w_fyear = s_fyear-low.
      loop at s_fyear.
        case s_fyear-option.
          when 'EQ'.
            move s_fyear-low to t_fyear.
            append t_fyear.
            clear t_fyear.
          when 'BT'.
            move s_fyear-low to t_fyear.
            append t_fyear.
            clear t_fyear.
            while w_fyear < s_fyear-high.
              w_fyear = w_fyear + 1.
              move w_fyear to t_fyear-fyear.
              append t_fyear.
              clear t_fyear.
            endwhile.
        endcase.
      endloop.
      sort t_fyear by fyear .
    CALL FUNCTION 'DATE_TO_PERIOD_CONVERT'
       EXPORTING
         I_DATE               = sy-datum
         I_PERIV              = 'V6'
      IMPORTING
      E_BUPER              =
        E_GJAHR              =  w_fyear.
      w_fyear =   s_fyear-low.
    s_fyear-low = w_fyear.
    Reset Indicator
      if p_calrev is initial.
        move 'X' to p_incwip.
      else.
        clear p_incwip.
      endif.
      loop at t_poper.
    *get last day in each period of range
        t_date-poper = t_poper-poper.
    *------ Start of M002 modifications
    *------ Determine last day of the posting period
        call function 'LAST_DAY_IN_PERIOD_GET'
             EXPORTING
                  i_gjahr = s_fyear-low
                  i_periv = tka01-lmona
                  i_poper = t_poper-poper
             IMPORTING
                  e_date  = t_date-w_budat.
        append t_date.
        clear t_date.
      endloop.
    *get last day of last period in previous fiscal years chosen
    *016 = last period
      delete t_fyear where fyear = w_fyear. "remove current fyear
      loop at t_fyear.
        call function 'LAST_DAY_IN_PERIOD_GET'
             EXPORTING
                  i_gjahr = t_fyear-fyear
                  i_periv = 'V6'
                  i_poper = '016'
             IMPORTING
                  e_date  = t_date-w_budat.
        t_date-poper = '016'.
        append t_date.
        clear t_date.
      endloop.
    *Get the Proj Def from WBS selct option and refresh wbs select option.
      data: begin of l_psphi occurs 0,
              POSID like prps-POSID,
              pspid like prps-psphi,
            end of l_psphi.
      data: begin of l_pspid occurs 0,
              pspid like proj-pspid,
            end of l_pspid.
      data: begin of i_proj occurs 0,                           "M023
            pspnr like proj-pspnr,                              "M023
            end of i_proj.                                      "M023
      data: begin of i_prps occurs 0,                           "M023
            objnr like prps-objnr,                              "M023
            end of i_prps.                                      "M023
      data: begin of i_psphi1 occurs 0,                         "M023
            psphi like prps-psphi,                              "M023
            end of i_psphi1.                                    "M023
      data: len_posid type i.
      if not s_posid[] is initial.
        select posid psphi into table l_psphi
                           from prps
                           where posid in s_posid.
        if sy-subrc ne 0.
          message i100.
          exit.
        endif.
        if not l_psphi[] is initial.
          sort l_psphi.
          select  pspid into table l_pspid
                              from proj
                              for all entries in l_psphi
                              where pspnr = l_psphi-pspid and
                                    profl in s_profl.
          if sy-subrc = 0.
            delete adjacent duplicates from l_pspid.
            loop at l_pspid.
              s_pspid-sign = 'I'.
              s_pspid-option = 'EQ'.
              s_pspid-low = l_pspid-pspid.
              append s_pspid.
              clear s_pspid.
            endloop.
          else.
            message i100.
            exit.
          endif.
        endif.
        clear s_posid.
        refresh s_posid.
        loop at l_psphi.
          s_posid-sign = 'I'.
          s_posid-option = 'CP'.
          CALL FUNCTION 'CONVERSION_EXIT_ABPSN_OUTPUT'
               EXPORTING
                    INPUT  = l_psphi-posid
               IMPORTING
                    OUTPUT = l_psphi-posid.
          while l_psphi-posid ca '.'.
            replace '.' with space into l_psphi-posid.
          endwhile.
          condense l_psphi-posid no-gaps.
          concatenate l_psphi-posid '*' into s_posid-low.
          append s_posid.
        endloop.
      endif.
    *------ End of M002 modifications
    ----- Exclude the P. WBS elements, these are only used for
    *----- intermediate postings and are not relevant for WIP, COGS,...
      perform ini_posid_range.
      perform ini_pspid_range.
    if not s_pspid[] is initial.
    *----- If projects are selected, then make sure we have the internal
    *----- key to PROJ (ie, field PSPNR)
      perform get_partners.
      perform sos_prepare_proj_range.
      if r_psphi[] is initial.
        message i100.
        exit.
      endif.
    endif.
    *----- WBS ranges with "CP" (Contains Pattern) entries need
    *----- to be condensed, because the conversion exit for field POSID
    ----- causes an entry entered as "P." to be stored as "P    *". Hence
    *----- selection is flawed.
      perform sos_condense_range_wbs.
    *----- Activity Type Group is used to determine what Activity Types
    *----- to take into account for the computation of planned and actual
    *----- hours. The Activity Type Group must be exploded into its
    *----- individual Activity Types, so we can build a range of Activity
    *----- types.
      perform sos_build_act_type_range.
    *----- Selection of WBS as per selection criteria, but only Billing WBS
    *----- Elements or Level 2 WBS elements
    Get Level re-determined
      if not p_oth is initial.
        case p_level.
          when 1.
            move c_on to p_lvl1.
            clear p_oth.
          when 2.
            move c_on to p_lvl2.
            clear p_oth.
        endcase.
      endif.
      if not p_lvl1 is initial.
        w_reporting_level = 'L1'.
        w_level = 1.
      endif.
      if not p_lvl2 is initial.
        w_reporting_level = 'L2'.
        w_level = 2.
      endif.
      if not p_wip is initial.
        w_reporting_level = 'BE'.
        w_level = 0.
      endif.
      refresh r_stufe.
      if not p_lvl1 is initial.
        clear: r_stufe.
        move: '1'     to r_stufe-low,
              '2'     to r_stufe-high,
              'BT'    to r_stufe-option,
              'I'     to r_stufe-sign.
        append r_stufe.
      elseif not p_oth is initial.
        clear: r_stufe.
        move: p_level to r_stufe-low,
              'EQ'    to r_stufe-option,
              'I'     to r_stufe-sign.
        append r_stufe.
      elseif not p_wip is initial. "INS DI5K902370
        clear: r_stufe. "INS DI5K902370
       move: '1' to r_stufe-low, "INS DI5K902370
             '99' to r_stufe-HIGH, "INS DI5K902370
             'BT'    to r_stufe-option, "INS DI5K902370
             'I'     to r_stufe-sign. "INS DI5K902370
        move: '2'     to r_stufe-low,
              '99'    to r_stufe-HIGH,
              'BT'    to r_stufe-option,
              'I'     to r_stufe-sign.
        append r_stufe. "INS DI5K902370
      else.
        clear: r_stufe.
        move: '2'     to r_stufe-low,
              'EQ'    to r_stufe-option,
              'I'     to r_stufe-sign.
        append r_stufe.
      endif.
      perform select_wbs_new tables r_psphi.
      commit work.
    Process any WBS elements missed during initial selection
      if  not s_posid[] is initial.
        perform check_billing_elements.
        sort it_wbs by psphi
                       pspnr.
      endif.
      delete adjacent duplicates from it_wbs.
      append lines of it_wbs to it_wbs1.
      sort it_wbs1 by psphi
                     pspnr.
    Transfer to temporary table before calling function
      refresh loc_wbs.
      loop at it_wbs1 into wr_wbs.
        w_tabix = sy-tabix.
        if wr_wbs-psphi ne w_ref_psphi.
          if not loc_wbs[] is initial.
    *----- CAREFUL: THIS FUNCTION MODULE ASSUMES THAT THE WBS ELEMENTS
    *----- PASSED INTO TABLE I_WBS ALL BELONG TO THE SAME PROJECT
    *----- DEFINITION. FUNCTION MODULE WILL NOT GIVE PROPER RESULTS
    *----- IF CALLED FOR A TABLE I_WBS WITH WBS ELEMENTS BELONGING
    *----- TO VARIOUS PROJECT DEFINITIONS. BE WARNED!!!
            call function 'Z_CN_DETERMINE_REPORTS'
                 EXPORTING
                      i_fyear        = s_fyear-low
                      i_prsumm_level = w_level
                      i_closed       = 'X'
                 TABLES
                      i_wbs          = loc_wbs
                      i_deleted      = l_deleted.
            if not p_lvl2 is initial.
              loop at loc_wbs where stufe gt 2 and lvl2_posid is initial.
                do.
                  select single up into prhi-up
                                   from prhi
                                   where posnr = loc_wbs-pspnr.
                  select single * from prps
                  where pspnr = prhi-up.
                  if prps-stufe = 2.
                    loc_wbs-lvl2_pspnr = prps-pspnr.
                    loc_wbs-lvl2_posid = prps-posid.
                    exit.
                  else.
                    loc_wbs-pspnr = prhi-up.
                  endif.
                enddo.
                modify loc_wbs.
              endloop.
            endif.
            perform sos_append_wbs.
            refresh l_deleted.
          endif.
          w_ref_psphi = wr_wbs-psphi.
          refresh loc_wbs.
        endif.
        clear loc_wbs.
        move-corresponding wr_wbs to loc_wbs.
        append loc_wbs.
      endloop.
      if not loc_wbs[] is initial.
    *----- CAREFUL: THIS FUNCTION MODULE ASSUMES THAT THE WBS ELEMENTS
    *----- PASSED INTO TABLE I_WBS ALL BELONG TO THE SAME PROJECT
    *----- DEFINITION. FUNCTION MODULE WILL NOT GIVE PROPER RESULTS
    *----- IF CALLED FOR A TABLE I_WBS WITH WBS ELEMENTS BELONGING
    *----- TO VARIOUS PROJECT DEFINITIONS. BE WARNED!!!
        call function 'Z_CN_DETERMINE_REPORTS'
             EXPORTING
                  i_fyear        = s_fyear-low
                  i_prsumm_level = w_level
                  i_closed       = 'X'
             TABLES
                  i_wbs          = loc_wbs
                  i_deleted      = l_deleted.
        if not p_lvl2 is initial.
          loop at loc_wbs where stufe gt 2 and lvl2_posid is initial.
            do.
              select single up into prhi-up
                               from prhi
                               where posnr = loc_wbs-pspnr.
              select single * from prps
              where pspnr = prhi-up.
              if prps-stufe = 2.
                loc_wbs-lvl2_pspnr = prps-pspnr.
                loc_wbs-lvl2_posid = prps-posid.
                exit.
              else.
                loc_wbs-pspnr = prhi-up.
              endif.
            enddo.
            modify loc_wbs.
          endloop.
        endif.
        perform sos_append_wbs.
        refresh loc_wbs.
        refresh l_deleted.
      endif.
      perform process_report_table.
    End of M011
    Check Status Profile
      if not p_status is initial.
        perform process_check_status_profile.
        sort it_wbs by psphi
                     pspnr.
      endif.
    Start of M006 mods
      if p_clwbs is initial.
    Ignore projects/WBS closed based on the year
        perform process_closed_projects.
      endif.
    End of M006 mods
      describe table it_wbs lines w_lines.
      if w_lines eq 0.
        message i100.
        exit.
      endif.
      sort it_wbs by psphi
                     pspnr.
      loop at it_wbs
           into wr_wbs.
        w_tabix = sy-tabix.
    *----- We will extract costs and determine to which reports a WBS
    *----- by Project Hierarchy, ie, we will look at all the WBS Elements
    *----- in a given hierarchy in one hit. This simplifies the
    *----- process of determining the highest billing element or the
    *----- Level 2 WBS element for a selected WBS
    *----- It also had the advantage of allowing parallel processing
    *----- using CALL FUNCTION STARTING NEW TASK if required in
    *----- the future
        if wr_wbs-psphi ne w_ref_psphi.
          if not it_tmp_wbs[] is initial.
            loop at t_date.
              it_tmp_wbs2[] =  it_tmp_wbs[].
              call function 'Z_PS_WIP_GET_COSTS_COMMITMENT'
                   EXPORTING
                        i_fyear          = s_fyear-low
                        i_poper          = t_date-poper
                        i_billing        = 'X'
                        i_prsumm_level   = w_level
                        i_other_level    = w_other_level
                        i_budat          = t_date-w_budat
                        i_commitment     = 'X'
                        i_include_wipadj = p_incwip             "M007
                   TABLES
                        i_rsparams       = it_rsparams
                        i_wbs            = it_tmp_wbs2.
              loop at it_tmp_wbs2 into it_tmp_wbs3.
                collect it_tmp_wbs3.
              endloop.
              w_tab = sy-tabix.
              n = 1.
              while n <= w_tab .
                read table it_tmp_wbs2 index n.
                it_tmp_wbs3 = it_tmp_wbs2.
                modify table it_tmp_wbs3
             index n
                transporting
                PLANLABOUR PLANHOURS PLANREV PLANCOSTS stufe.
                n = n + 1.
              endwhile.
            endloop.
            it_tmp_wbs[] =  it_tmp_wbs2[].
            perform sos_process_tmp_table.
          endif.
          w_ref_psphi = wr_wbs-psphi.
          refresh it_tmp_wbs.
        endif.
        wr_wbs-tabix = w_tabix.
        append wr_wbs to it_tmp_wbs.
        if w_tabix eq w_lines.
    *----- Don't forget to process the last hierarchy!!
          if not it_tmp_wbs[] is initial.
            loop at t_date.
              it_tmp_wbs2[] =  it_tmp_wbs[].
              call function 'Z_PS_WIP_GET_COSTS_COMMITMENT'
                   EXPORTING
                        i_fyear          = s_fyear-low
                        i_poper          = t_date-poper
                        i_billing        = 'X'
                        i_prsumm_level   = w_level
                        i_other_level    = w_other_level
                        i_budat          = t_date-w_budat
                        i_commitment     = 'X'
                        i_include_wipadj = p_incwip             "M007
                   TABLES
                        i_rsparams       = it_rsparams
                        i_wbs            = it_tmp_wbs2.
                  exceptions
                       not_found        = 1.
              loop at it_tmp_wbs2 into it_tmp_wbs3.
                collect it_tmp_wbs3.
              endloop.
              w_tab = sy-tabix.
              n = 1.
              while n <= w_tab .
                read table it_tmp_wbs2 index n.
                it_tmp_wbs3 = it_tmp_wbs2.
                modify it_tmp_wbs3 index n transporting stufe
                PLANLABOUR PLANHOURS PLANREV PLANCOSTS .
                n = n + 1.
              endwhile.
            endloop.
            it_tmp_wbs[] =  it_tmp_wbs2[].
            perform sos_process_tmp_table.
          endif.
        endif.
      endloop.
    end-of-selection.
    Delete WBS with no financial information
      loop at it_wbs_report into wr_wbs_report.
        if wr_wbs_report-actcosts      eq 0 and
           wr_wbs_report-plancosts     eq 0 and
           wr_wbs_report-planrev       eq 0 and
           wr_wbs_report-acthours      eq 0 and
           wr_wbs_report-actrev        eq 0 and
           wr_wbs_report-revrec        eq 0 and
           wr_wbs_report-revrecytd     eq 0 and
           wr_wbs_report-acttotrevrec  eq 0 and
           wr_wbs_report-actytdrevrec  eq 0 and
           wr_wbs_report-pocommitment  eq 0 and
           wr_wbs_report-prcommitment  eq 0 and
           p_incwbs is initial.
          delete it_wbs_report index sy-tabix.
        endif.
      endloop.
      loop at it_wbs_report.
        select  single
                   objnr
                   psphi
                   zzacttyp
                   ZZIMCINITIATIVE
                   ZZIMCPROGRAM
                   ZZWPMANLOB
                   ZZIMPLEMENTREG
                   ZZCONTRACTID
                   ZZWPNUM
                   ZZSPNUM
                   ZZORDERNUM
                   ZZORDERLEVEL
                   ZZWIP
              from prps
              into corresponding fields of w_it_wbs5
              where posid eq it_wbs_report-posid.
        CLEAR: W_LEAD, W_PDIR, W_PMGR, w_poff.
        select single zztype ZZWORKCATEGORY ZZPRIN ZZSOURCE from proj into
        (w_it_wbs5-zztype, w_it_wbs5-ZZWORKCATEGORY, w_it_wbs5-ZZPRIN,
        w_it_wbs5-ZZSOURCE) where pspnr = w_it_wbs5-psphi.
        CLEAR w_it_wbs5-lead.
        select single parnr from ihpa into w_it_wbs5-lead
        where objnr = w_it_wbs5-objnr and
        parvw = C_LEAD and
        KZLOESCH NE 'X'.                                        " M026
        PERFORM READ_PA0002 USING w_it_wbs5-lead CHANGING W_LEAD.
        CLEAR w_it_wbs5-pdir.
        select single parnr from ihpa into w_it_wbs5-pdir
        where objnr = w_it_wbs5-objnr and
        parvw = C_PDIR and
        KZLOESCH NE 'X'.                                        " M026
        PERFORM READ_PA0002 USING w_it_wbs5-PDIR CHANGING W_PDIR.
        CLEAR w_it_wbs5-pmgr.
        select single parnr from ihpa into w_it_wbs5-pmgr
        where objnr = w_it_wbs5-objnr and
        parvw = C_PMGR and
        KZL

    hi,
    1.Capacity check takes place at plant level itself..
    2.Pooled capacity:- This is created separately in [u wil find in PP] and this capacity can be used by different work centers.
    regards
    pushpa

  • Median function in report builder 3.0

    I need to perform median calculation in MS Report Builder 3.0, could anyone explain how I could achieve it considering my original value are
    Region - Etab - Value
    Abc - Def - 10
    Abc - Def - 12
    Ged - Tae - 1
    I need to group by Region and Etab.
    I've already built a SQL query to get the Median, but I would like to be able to use Report Builder grouping for usability.

    I've managed to get the proper values using hashtable the following way :
    Dim theHashTable As New System.Collections.Hashtable
    Function AddValue(theRapport As String, theRegion As String, theEtab As String, theRow As String, theValue As String) As Integer
    Dim num As Integer
    num = 0
    If (theHashTable Is Nothing) Then
    theHashTable = New System.Collections.Hashtable
    End If
    If Integer.TryParse(theValue, num) Then
    If (num >= 0) Then
    If (theHashTable.ContainsKey(theRapport)) Then
    Dim regionHT As New System.Collections.Hashtable
    regionHT = theHashTable(theRapport)
    If (regionHT.ContainsKey(theRegion)) Then
    Dim etabHT As New System.Collections.Hashtable
    etabHT = regionHT(theRegion)
    If (etabHT.ContainsKey(theEtab)) Then
    Dim valueHT As New System.Collections.Hashtable
    valueHT = etabHT(theEtab)
    If (Not valueHT.ContainsKey(theRow)) Then
    valueHT.Add(theRow, theValue)
    End If
    etabHT(theEtab) = valueHT
    Else
    Dim valueHT As New System.Collections.Hashtable
    valueHT.Add(theRow, theValue)
    etabHT.Add(theEtab, valueHT)
    End If
    regionHT(theRegion) = etabHT
    Else
    Dim etabHT As New System.Collections.Hashtable
    Dim valueHT As New System.Collections.Hashtable
    valueHT.Add(theRow, theValue)
    etabHT.Add(theEtab, valueHT)
    regionHT.Add(theRegion, etabHT)
    End If
    theHashTable(theRapport) = regionHT
    Else
    Dim regionHT As New System.Collections.Hashtable
    Dim etabHT As New System.Collections.Hashtable
    Dim valueHT As New System.Collections.Hashtable
    valueHT.Add(theRow, theValue)
    etabHT.Add(theEtab, valueHT)
    regionHT.Add(theRegion, etabHT)
    theHashTable.Add(theRapport, regionHT)
    End If
    End If
    End If
    Return num
    End Function
    Function GetMedian(theRapport As String, theRegion As String, theEtab As String) As String
    Dim arrayInt As New System.Collections.ArrayList
    arrayInt = GetArray(theRapport, theRegion, theEtab)
    arrayInt.Sort()
    Dim mid As Double = (arrayInt.Count - 1) / 2.0
    Dim midInt As Integer = mid
    Dim mid2Int As Integer = mid + 0.5
    If arrayInt.Count >= 2 Then
    Return ((arrayInt(midInt) + arrayInt(mid2Int)) / 2).ToString()
    ElseIf arrayInt.Count = 1 Then
    Return arrayInt(0)
    Else
    Return ""
    End If
    End Function
    Function GetQ1(theRapport As String, theRegion As String, theEtab As String) As String
    Dim arrayInt As New System.Collections.ArrayList
    arrayInt = GetArray(theRapport, theRegion, theEtab)
    arrayInt.Sort()
    Dim taille As Integer = arrayInt.Count
    If (taille = 1) Then
    Return arrayInt(0)
    ElseIf ((taille Mod 2) = 0 And taille > 0) Then
    Dim mid1 As Integer = taille / 2
    Dim midmid As Integer = mid1 / 2
    If (mid1 Mod 2 = 0) Then
    Return ((arrayInt(midmid - 1) + arrayInt(midmid)) / 2).ToString()
    Else
    Return (arrayInt(midmid)).ToString()
    End If
    ElseIf (taille = 1) Then
    Return arrayInt(1)
    ElseIf ((taille - 1) Mod 4 = 0) Then
    Dim n As Integer = (taille - 1) / 4
    Return ((arrayInt(n - 1) * 0.25 + arrayInt(n) * 0.75)).ToString()
    ElseIf ((taille - 3) Mod 4 = 0) Then
    Dim n As Integer = (taille - 3) / 4
    Return ((arrayInt(n) * 0.75 + arrayInt(n + 1) * 0.25)).ToString()
    Else
    Return ""
    End If
    End Function
    Function GetQ3(theRapport As String, theRegion As String, theEtab As String) As String
    Dim arrayInt As New System.Collections.ArrayList
    arrayInt = GetArray(theRapport, theRegion, theEtab)
    arrayInt.Sort()
    Dim taille As Integer = arrayInt.Count
    If (taille = 1) Then
    Return arrayInt(0)
    ElseIf ((taille Mod 2) = 0 And taille > 0) Then
    Dim mid1 As Integer = taille / 2
    Dim midmid As Integer = mid1 / 2
    If (mid1 Mod 2 = 0) Then
    Return ((arrayInt(mid1 + midmid - 1) + arrayInt(mid1 + midmid)) / 2).ToString()
    Else
    Return (arrayInt(mid1 + midmid)).ToString()
    End If
    ElseIf (taille = 1) Then
    Return arrayInt(1)
    ElseIf ((taille - 1) Mod 4 = 0) Then
    Dim n As Integer = (taille - 1) / 4
    Return ((arrayInt(3 * n) * 0.75 + arrayInt(3 * n + 1) * 0.25)).ToString()
    ElseIf ((taille - 3) Mod 4 = 0) Then
    Dim n As Integer = (taille - 3) / 4
    Return ((arrayInt(3 * n + 1) * 0.25 + arrayInt(3 * n + 2) * 0.75)).ToString()
    Else
    Return ""
    End If
    End Function
    Function GetArray(theRapport As String, theRegion As String, theEtab As String) As System.Collections.ArrayList
    Dim arrayInt As New System.Collections.ArrayList
    If (theHashTable Is Nothing Or theHashTable.Count = 0) Then
    Return arrayInt
    Else
    If (theHashTable.ContainsKey(theRapport)) Then
    Dim regionHT As System.Collections.Hashtable
    regionHT = theHashTable(theRapport)
    If (theRegion = "" And theEtab = "") Then
    For Each value As System.Collections.Hashtable In regionHT.Values
    For Each value2 As System.Collections.Hashtable In value.Values
    For Each valeur As Integer In value2.Values
    arrayInt.Add(valeur)
    Next
    Next
    Next
    ElseIf (regionHT.ContainsKey(theRegion) And theEtab = "") Then
    Dim etabHT As System.Collections.Hashtable
    etabHT = regionHT(theRegion)
    For Each value As System.Collections.Hashtable In etabHT.Values
    For Each valeur As Integer In value.Values
    arrayInt.Add(valeur)
    Next
    Next
    ElseIf (regionHT.ContainsKey(theRegion) And theEtab <> "") Then
    Dim etabHT As System.Collections.Hashtable
    etabHT = regionHT(theRegion)
    If Not (etabHT Is Nothing Or etabHT.Count = 0) Then
    If (etabHT.ContainsKey(theEtab)) Then
    Dim valuesHT As System.Collections.Hashtable
    valuesHT = etabHT(theEtab)
    For Each value As Integer In valuesHT.Values
    arrayInt.Add(value)
    Next
    End If
    End If
    End If
    End If
    Return arrayInt
    End If
    End Function
    Function PrintArray(theRapport As String, theRegion As String, theEtab As String) As String
    Dim arrayInt As New System.Collections.ArrayList
    arrayInt = GetArray(theRapport, theRegion, theEtab)
    Dim str As String = ""
    If (arrayInt.Count > 0) Then
    str = String.Join(" | ", arrayInt.ToArray)
    Else
    str = " "
    End If
    Return str
    End Function
    The first hashtable is for different tables of the report needing the median.
    I then use the following command to add value
    Code.AddValue("3_2",Fields!Region.Value,Fields!Etablissement.Value,Fields!rowNumber.Value,Fields!Value.Value)
    Then I get the median using the expressions
    =Code.GetMedian("3_2", Fields!Region.Value,Fields!Etablissement.Value)
    =Code.GetMedian("3_2", Fields!Region.Value,"")
    =Code.GetMedian("3_2", "","")
    I've tried placing the AddValue fonction on a hidden table and in the summary row of the tables.
    I get the proper value but as soon as I expand or collapse a row everything is change to blank. How can I keep the value or where could I put the AddValue function to make sure it is called on every action, for every table in the report ?
    Thanks

  • Adding Parameters (Inspectable) to a Custom Component?

    Hi --
    I am attempting to build a custom component just to learn a
    little more
    about AS 3.0. I can not figure out where / how in my package
    declarations I
    can "expose" parameters that will be visible to the user in
    the Flash IDE
    when using my component.
    Thanks
    Rich

    Hi Richard ,
    there is a pretty cool livedoc about component creation in as
    3 :
    http://www.adobe.com/devnet/flash/articles/creating_as3_components.html
    setting up the inspectables is the same as it was in as2
    i am doing it in my controller :
    [as]
    package mat3d.yugopReel {
    import flash.display.*;
    import flash.text.TextField;
    import flash.events.Event;
    import flash.events.MouseEvent;
    import fl.core.InvalidationType;
    import fl.core.UIComponent;
    import fl.data.DataProvider;
    import fl.events.ComponentEvent;
    import fl.containers.UILoader;
    import mat3d.yugopReel.model.MainModel;
    public class ScrollReel extends UIComponent {
    public var dataProvider : DataProvider;
    public var RIG : Sprite;
    public var LeftBTN : Sprite;
    public var RightBTN : Sprite;
    public var myModel : mat3d.yugopReel.model.MainModel;
    private var _background : Sprite;
    private var _tf : TextField;
    public var _AutoScroll : Boolean;
    public var _StepControl : Boolean;
    private var _FileType : String;
    public var _File : String;
    private var _text : String;
    public var _ScrollInit : String;
    public var _StepBehaviour : String;
    public var _PictureSize : String;
    public var _ScrollTime : Number;
    public var abstand_x : Number = 90.3;
    public var abstand_y : Number = 125;
    public var ConfigData : Array;
    public function ScrollReel() {
    super();
    alpha = 0;
    myModel = new mat3d.yugopReel.model.MainModel(this);
    >> start get set INSPECTABLES
    AutoScroll start
    public function get AutoScroll() : Boolean {
    return _AutoScroll;
    myPropInit.AutoScroll = true;
    public function set AutoScroll(value : Boolean) : void {
    _AutoScroll = value;
    myPropInit.AutoScroll = true;
    [Inspectable(name="AutoScroll",defaultValue="false",type="Boolean")]
    AutoScroll end
    FileType start
    public function get FileType() : String {
    return _FileType;
    myPropInit.FileType = true;
    public function set FileType(value : String) : void {
    _FileType = value;
    myPropInit.FileType = true;
    [Inspectable(name="FileType",defaultValue="XML",type="String")]
    FileType end
    Filestart
    public function get File() : String {
    return _File;
    myPropInit.File = true;
    public function set File(value : String) : void {
    _File = value;
    myPropInit.File = true;
    init();
    [Inspectable(name="File",defaultValue="",type="String")]
    File end
    Width start
    public function get Width() : Number {
    return width;
    myPropInit.Width = true;
    public function set Width(value : Number) : void {
    width = value;
    //trace("setWidth >>>" + width);
    myPropInit.Width = true;
    [Inspectable(name="Width",defaultValue="250",type="Number")]
    Width end
    Height start
    public function get Height() : Number {
    return height;
    myPropInit.Height = true;
    public function set Height(value : Number) : void {
    height = value;
    trace("setHeight >>>" + height);
    myPropInit.Height = true;
    [Inspectable(name="Height",defaultValue="50",type="Number")]
    Height end
    ScrollTime start
    public function get ScrollTime() : Number {
    return _ScrollTime;
    myPropInit.ScrollTime = true;
    public function set ScrollTime(value : Number) : void {
    _ScrollTime = value;
    myPropInit.ScrollTime = true;
    [Inspectable(name="ScrollTime",defaultValue="0.2",type="Number")]
    ScrollTime end
    ScrollInit start
    public function get ScrollInit() : String {
    return _ScrollInit;
    myPropInit.ScrollInit = true;
    public function set ScrollInit(value : String) : void {
    _ScrollInit = value;
    myPropInit.ScrollInit = true;
    [Inspectable(name="ScrollInit",defaultValue="_x",type="String")]
    ScrollInit end
    PicSize start
    public function get PictureRatio() : String {
    return _PictureSize;
    myPropInit.PictureSize = true;
    public function set PictureRatio(value : String) : void {
    _PictureSize = value;
    myPropInit.PictureSize = true;
    [Inspectable(name="PictureSize",defaultValue="",type="String")]
    PictureSize end
    Step Controll start
    public function get StepControl() : Boolean {
    return _StepControl;
    myPropInit.StepControl = true;
    public function set StepControl(value : Boolean) : void {
    _StepControl = value;
    myPropInit.StepControl = true;
    [Inspectable(name="StepControl",defaultValue="false",type="Boolean")]
    Step Controll end
    Step Behaviour start
    public function get StepBehaviour() : String {
    return _StepBehaviour;
    myPropInit.StepBehaviour = true;
    public function set StepBehaviour(value : String) : void {
    _StepBehaviour = value;
    myPropInit.StepBehaviour = true;
    [Inspectable(name="StepBehaviour",defaultValue="easeInOutQuad",type="String")]
    Step Behaviour end
    DataProviderstart
    public function get DataProvider() : Object {
    return DataProvider;
    public function set DataProvider(value : Object) : void {
    DataProvider = value;
    myPropInit.StepBehaviour = true;
    [Inspectable(name="DataProvider",defaultValue="",type="Collection")]
    DataProvider end
    >> end get set INSPECTABLES
    private function init() : void {
    myModel .handleData();
    public override function toString() : String {
    return super.toString();
    [/as]
    bw
    matthias

Maybe you are looking for

  • A bug with flags and active view? Or is it a (bad) feature?..

    As I mark an image in a folder view as flagged and then switch to a collection view and look on the same image, it's not flagged. I expect, that information about marking the image as flagged remains on that image, not on a current active view.

  • OAI and Workflow - Setting Attributes to use in Notifications

    Does anyone know how I go about getting at attributes in a message that goes through the Workflow Adapter? What I am trying to do is to create a notification, which is more meaningful by adding some of the details I've passed through in the PARAMETER

  • Regarding File Download

    Hi Experts, I am downloading excel file from internal table using GUI_DOWNLOAD FM. but i want to add header and also want to set some properties of EXCEL file form ABAP program. for Ex. I want to lock some cells which should not be editable in Excel

  • Create Interactive PDF Form

    Hello, How can i create interactive PDF Form i.e. AcroForm Programmatically using Acrobat SDK

  • Where can I find a "dummy" macbook pro

    I work for a company who is looking to create some accessories for Macbook Pro 15" with retina display and 13" with retina display. I am looking to obtain either a "gutless" or "dummy" laptop to be able to send to Asia for sampling, etc. Or a broken