Regarding calling arrays

hi
I have 4 column array which java application is sending as an IN parameter to my function. Fir handling that I have made a index by table in the specification with the sam estructure as the array and using it in the body of the function as
function xx ( array IN t_index table). Now how do I test this thing. How do I write a wrapper for this to test this. code snippets from my specification , body and test wrapper.
specification
CURSOR c_array
IS
SELECT be.booking_date booking_date, be.currencycd booking_currency,
le.line_item_amount amount, (SELECT sap_code
FROM rb_sap_account
WHERE sap_id = le.sap_id)
sap_code
FROM rb_line_item le, rb_booking_entry be
WHERE le.booking_entry_id = be.booking_entry_id;
TYPE t_util IS TABLE OF c_array%ROWTYPE
index by pls_integer;
FUNCTION fn_rb_con_local_tousd_arr (p_line_data IN t_util)
RETURN t_number_array;
Body
FUNCTION fn_rb_con_local_tousd_arr (p_line_data IN t_util)
RETURN t_number_array
AS
p_result t_number_array;
v_amt NUMBER;
BEGIN
FOR i IN 1 .. p_line_data.COUNT
LOOP
SELECT fn_rb_con_local_cur_tousd (p_line_data (i).amount,
p_line_data (i).booking_currency,
p_line_data (i).sap_code,
p_line_data (i).booking_date
INTO p_result (i)
FROM DUAL;
END LOOP;
RETURN p_result;
end;
Wrpapper to test this
DECLARE
retval pk_rb_util_array.t_util;
p_line_data pk_rb_util_array.t_util;
-- := pk_rb_util_array.t_util (TO_DATE ('3/5/2008', 'MM/DD/YYYY'),
-- 'EUR',
-- 100,
-- '2074'
BEGIN
-- P_LINE_DATA := NULL; Modify the code to initialize this parameter
SELECT pk_rb_util_array.fn_rb_con_local_tousd_arr (p_line_data)
INTO retval
FROM DUAL;
END;
How do I modify this wrapper to test this. I need to pass array of 4 columns and n rows.

Here's a quick sample for something similar:
1. Define some SQL datatypes or an associative array.
CREATE OR REPLACE TYPE president_id_ntable
AS TABLE OF NUMBER;
CREATE OR REPLACE TYPE president_name_ntable
AS TABLE OF VARCHAR2(60 CHAR);
CREATE OR REPLACE TYPE tenure_ntable
AS TABLE OF VARCHAR2(9 CHAR);
CREATE OR REPLACE TYPE party_ntable
AS TABLE OF VARCHAR2(24 CHAR);
2. Here's a procedure from a package:
PROCEDURE get_presidents
( term_start_in IN NUMBER
, term_end_in IN NUMBER
, country_in IN VARCHAR2
, president_ids IN OUT PRESIDENT_ID_NTABLE
, president_names IN OUT PRESIDENT_NAME_NTABLE
, tenures IN OUT TENURE_NTABLE
, parties IN OUT PARTY_NTABLE) AS
BEGIN
SELECT president_id pres_number
, first_name||' '||middle_name||' '||last_name pres_name
, term_start||'-'||term_end tenure
, party
BULK COLLECT
INTO president_ids
, president_names
, tenures
, parties
FROM president
WHERE country = country_in
AND term_start BETWEEN term_start_in AND term_end_in
OR term_end BETWEEN term_start_in AND term_end_in;
END get_presidents;
3. Here's the testing program:
DECLARE
-- Declare local variables.
t_start NUMBER := '1914';
t_end NUMBER := '1943';
t_country VARCHAR2(3 CHAR) := 'USA';
president_ids PRESIDENT_ID_NTABLE;
president_names PRESIDENT_NAME_NTABLE;
tenures TENURE_NTABLE;
parties PARTY_NTABLE;
BEGIN
-- Call the overloaded procedure.
world_leaders.get_presidents
( t_start
, t_end
, t_country
, president_ids
, president_names
, tenures
, parties);
-- Read the contents of one of the arrays.
FOR i IN 1..president_names.COUNT LOOP
dbms_output.put_line('Testing ['||president_names(i)||']');
END LOOP;
END;
Hope it helps, Michael

Similar Messages

  • How to call array dynamically???

    Hi i hv 3 arrays row1 row2 row3,
    I need to call array into a for loop one by one
    var rowno:int=1
    for(i:int=1;i<10;i++){
          this['row'+rowno].push(value)<<< showing error
         rowno++
         if(rowno>=4){    
              rowno=1
    what is the right way to use array dynamically???

    for(var rowno:int=1;rowno<4;rowno++){
    for(i:int=1;i<10;i++){
          this['row'+rowno].push(value);  // assuming value is defined

  • Regarding Call Transction 'FBL3N'

    Dear Friends,
                           i am calling  Transaction FBL3N from an ALV Report and I am able to do the same, but I am unable to call it for the specified date in selection-screen. And I want to display option All Items to be activated.
                        If i am entering date range from 01.04.2009 to 31.03.2010 then while calling transaction FBL3N , it will call All Items From the specified date for the specfic G/L Account.
                        Pls, Suggest any good solution.
    Thanks & Regards,
    Sandip Sonar.

    Hello
    FBL3N - it is report RFITEMGL. So try this:
    submit RFITEMGL
    with SD_SAKNR-LOW = '12341234' " <- pass GL account here
    with SD_BUKRS-LOW = 'AAAA' " <- pass company code here
    with X_OPSEL = ' ' " <- disable radiobutton Open items
    with X_CLSEL = ' ' " <- disable radiobutton Cleared items
    with X_AISEL = 'X' " <- enable radiobutton All items
    with SO_BUDAT BETWEEN '20090401' AND '20100331' " <- pass date range here
    and return.

  • Problem regarding calling a program from another program

    Hi,
    I have a requirement that i need to call a program from another program and in that case the called program should be executed with a value in the selection screen coming from the first program..i.e.
    a standard report to view the user Notes for annual leave is RPTARQDBVIEW. Can we create a report to display all the users under a manager as a hyperlink and run the report(RPTARQDBVIEW), with the pernr of the employee selected
    Regards,
    saumik

    Submitting a report using ranges for select-options
    * Define range for ltak-tanum
    RANGES: r_tanum FOR ltak-tanum.                                                                               
    * Read values from database tabel into the range
    * These values are later used for select-options in the report
    SELECT * FROM ltak                                                   
      WHERE lgnum =  w_lgnum AND           "Warehouse number/complex    
            vbeln = w_screen1000-io_vbeln.       "Transfer order number
      MOVE ltak-tanum TO r_tanum-low.                                    
      MOVE 'I' TO r_tanum-sign.                                          
      MOVE 'EQ' TO r_tanum-option.                                       
      APPEND r_tanum.                                                    
    ENDSELECT.                                                                               
    * Submit report with range                  
    SUBMIT zmm00100 WITH p_tanum IN r_tanum.   
    or
    Submitting a report from ABAP with selection criterias
      TYPES: tt_selection TYPE STANDARD TABLE OF rsparams.
      DATA: l_iblnr        TYPE st_iblnr,
    *     Define internal table and work area for select-options
            l_selection    TYPE rsparams,
            li_selection   TYPE tt_selection.
    * Create selectIon table
      LOOP AT gi_iblnr INTO l_iblnr.
        CLEAR l_selection.
        l_selection-selname  = 'IM_IBLNR'.    "Option name
        l_selection-kind     = 'S'.           "S= select options P=Parameters
        l_selection-sign     = 'I'.           "Sign
        l_selection-option   = 'EQ'.          "Option
        l_selection-low      = l_iblnr-iblnr. "Value
        APPEND l_selection TO li_selection.
      ENDLOOP.
    * Submit report
      SUBMIT rm07idif WITH SELECTION-TABLE li_selection AND RETURN.
    Regards,
    Prabhudas

  • Regarding calling 1 report from another

    Hello Friends,
       Can u plz tell me how to call one report from another report.
    Regards,
    Drashana

    hi,
    Use SUBMIT program statement
    SUBMIT ZFIR001
    chk this.
    *Code used to populate 'select-options' & execute report 
    DATA: seltab type table of rsparams,
          seltab_wa like line of seltab.
      seltab_wa-selname = 'PNPPERNR'.
      seltab_wa-sign    = 'I'.
      seltab_wa-option  = 'EQ'.
    load each personnel number accessed from the structure into
    parameters to be used in the report
      loop at pnppernr.
        seltab_wa-low = pnppernr-low.
        append seltab_wa to seltab.
      endloop.
      SUBMIT zreport with selection-table seltab
                                    via selection-screen.
    *Code used to populate 'parameters' & execute report 
    SUBMIT zreport with p_param1 = 'value'
                    with p_param2 = 'value'.
    Other additions for SUBMIT
    *Submit report and return to current program afterwards
    SUBMIT zreport AND RETURN.
    *Submit report via its own selection screen
    SUBMIT zreport VIA SELECTION-SCREEN.
    *Submit report using selection screen variant
    SUBMIT zreport USING SELECTION-SET 'VARIANT1'.
    *Submit report but export resultant list to memory, rather than
    *it being displayed on screen
    SUBMIT zreport EXPORTING LIST TO MEMORY.
    Once report has finished and control has returned to calling
    program, use function modules LIST_FROM_MEMORY, WRITE_LIST and
    DISPLAY_LIST to retrieve and display report.
    \[removed by moderator\]
    rEGARDS
    Edited by: Jan Stallkamp on Jul 29, 2008 5:25 PM

  • Query regarding Call errors in webview

    We are running on UCCE 8.x comprehensive setup. On an average in a week we get around 20 call errors in the webview report. Also, I had read a Cisco document stating different scenarios for call errors. I would like to know what will happen to a particular call if it is incomplete, etc and how to minimize the call error by providing high customer satisfaction
    Regards,
    Dass

    Hi Bhargav,
    Do one thing just check in tcode - SE01
    and enter your TR No. in first tab..
    Now in the TR expand and double click on the task no.
    Here you will get list of objects to be transported to with this TR..
    Just whether you TR includes entry for your screen
    <b> OR</b>
    Incldue R3T3 PROG <UR_PROG_NAME>
    If both the case is not application...then the screen has slipped from the TR and has to be transported  in separate request..
    Just check TR and let me known ...based on ur response we can move ahead..
    Enjoy SAP.
    Pankaj Singh

  • Regarding Calling a Report Program

    Hi Gurus,
    1. I have an Requirement in which i need to call Program CATSSHOW.
        I need to Pass the Selection screen values from calling program by skipping the Selection screen of   Called Program.
    or
    2. Can i call the Transaction CADO(which is T-CODE for CATSSHOW Program)
        by passing selection screen values from calling program to call program skipping selection screen.
    I used  a. SUBMIT catsshow
                            WITH so_pers  IN r_pernr
                            WITH so_datum IN r_datum
                            AND RETURN.
                  which goes to the called program and does not pass the values to the ranges in called program.
    a. SUBMIT catsshow VIA SELECTION-SCREEN
                            WITH so_pers  IN r_pernr
                            WITH so_datum IN r_datum
                            AND RETURN.
                  which goes to the called program and pass the values to the ranges in called program and displays the selection screen. (which i needs to skip).
    Please help regarding this.
    Thanks and Regards
    Sanath

    SUBMIT catsshow
    WITH so_pers IN r_pernr
    WITH so_datum IN r_datum
    AND RETURN.
    this should work.. make sure r_pernr and r_datum are filled properly the option and sign fields...
    MOVE wa_parameter-parva TO s_vkorg-low.
    MOVE 'I'  TO s_vkorg-sign.
    MOVE 'EQ' TO s_vkorg-option.   "<<<<< this varies
    APPEND s_vkorg.
    MOVE wa_parameter-parva TO s_vkorg-high.
    MOVE 'I'  TO s_vkorg-sign.
    MOVE 'EQ' TO s_vkorg-option.    "<<<<< this varies
    APPEND s_vkorg.
    look at the padded zeros or conversion exits available for the field...

  • Query regarding calling T-code MIGO from ALV report output

    Dear friends,
    I have to call MIGO transaction  from my ALV report output. Now problem is that I have to set the value 'display' In the first header field, 'Material Document' in 2nd header field when MIGO is called from the report output. Morever there is no parameter ID for these two fields. So how to set the values w/o using parameter ids.
    Regards,
    Rishi

    Hi,
    Try this coding,
    FORM DISPLAY.
    CALL FUNCTION 'REUSE_ALV_LIST_DISPLAY'
    EXPORTING
       I_CALLBACK_PROGRAM             = SY-REPID
       I_CALLBACK_USER_COMMAND        = 'USER_COMMAND'
       IS_LAYOUT                      = AK_LAYOUT
       IT_FIELDCAT                    = AK_FIELDCAT
      TABLES
       T_OUTTAB                       = ITAB.
    ENDFORM.                    " DISPLAY
    *&      Form  EVENT
    FORM EVENT USING P_AK_EVENT TYPE SLIS_T_EVENT.
      DATA : AK_EVENT1 TYPE SLIS_ALV_EVENT.
      AK_EVENT1-NAME = 'USER_COMMAND'.
      AK_EVENT1-FORM = 'USER_COMMAND'.
      APPEND AK_EVENT1 TO P_AK_EVENT.
    ENDFORM.                    " EVENT
    *&      Form  USER_COMMAND
    FORM USER_COMMAND USING R_UCOMM LIKE SY-UCOMM
                            RS_SELFIELD TYPE SLIS_SELFIELD.
      IF R_UCOMM = '&IC1'.
      " AND SY-LSIND = '1'.
        READ TABLE ITAB INDEX RS_SELFIELD-TABINDEX.
        SET PARAMETER ID 'AUN' FIELD ITAB-BUDAT.
        CALL TRANSACTION 'MIGO' AND SKIP FIRST SCREEN.
      ENDIF.
    ENDFORM.                    " USER_COMMAND
    Regards,
    Nikhil.

  • Regardding CAll Transaction  where i will get return value

    Dear Expert ,
    My Requirment is  i  am Passing parameter to call  transaction it is working fine , but
    i want to get data which is displayed  after calling that transation  .
    Such as
    sel_data-program = 'gp3umn8b57fzlorwxdm2y9lqq7e'.
        sel_data-dynpro = 1000.
        sel_data-dynbegin = 'X'.
        APPEND sel_data.
        CLEAR sel_data.
        sel_data-fnam = 'S_FICTR-LOW'.
        sel_data-fval = fund_cntr .
        APPEND sel_data.
        CLEAR sel_data.
        sel_data-fnam = 'FIPEX-LOW'.
        sel_data-fval = 'OS001' .
        APPEND sel_data.
        CLEAR sel_data.
        sel_data-fnam = 'PAR_01'.
        sel_data-fval = 'BFL'  .
        APPEND sel_data.
        CLEAR sel_data.
        sel_data-fnam = 'PAR_02'.
        sel_data-fval = '2010' .
        APPEND sel_data.
        CLEAR sel_data.
        CALL TRANSACTION 'FMRP_3FMB4004' USING sel_data . " AND SKIP FIRST SCREEN.
    After Executing this code it calls this code 'FMRP_3FMB4004'  with output  such as  Available budget and etc  ...
    this out put i want to return through call transaction which i am calling through RFC .
    I Dont want to use SUBmit Report  .
    Regards
    Deepak Dhamat .

    i have  included  that program  name   as a include program name 
    and  accessed that  table to get data  .
    Problem Solved  .

  • Help regarding calling BRFPLUS function through ABAP code

    Hi,
          I have  a situation where I have to input  data into a BRFPLUS function  as a table (i.e the data is input as select options where list or range of data can be provided).The corresponding output is also in the form a table .I've created this function in BRFPLUS and is working fine .Now I have to call it through ABAP code.Can someone kindly  provide me with the probable code for this scenario.
    E.g:
            ZT_MATNR  is the table in brfplus representing the list of MATNR values input along with other such inputs to function module Z_FM
            ZT_ATM   is the  resultant output table  of the function  which contains several fields.
    Now I have to call this BRFPLUS function with help of ABAP code.Could someone kindly help.

    Hello ,
    There should be a number of BRF+ tutorials available in SCN which discuss the FDT APIs. You can have a look at them to get an idea of the various APIs available and their uses.
    For your usecase, you should do the following.
            lo_fdt_function         TYPE REF TO if_fdt_function,
            lo_fdt_result           TYPE REF TO if_fdt_result,
    * Get function handle
          CALL METHOD lo_fdt_factory->get_function
            EXPORTING
              iv_id       = lv_function_id
            RECEIVING
              ro_function = lo_fdt_function.
    where lv_function_id is the GUID of the BRF+ function . You can either make it a constant , or you can use a FDT API to get the function GUID from the BRF+ application name and function name.
    *   Set function context
        TRY.
            CALL METHOD lo_fdt_context->set_value
              EXPORTING
                iv_id    =
                ia_value =
    This is one way to set the input context ( pass the input to the BRF+ function to process ). There are other ways to do this as well. Which one you use would depend on the kind of input you want to pass.
    * Execute BRFPLUS function
      TRY.
          CALL METHOD lo_fdt_function->process
            EXPORTING
              io_context = lo_fdt_context
            IMPORTING
              eo_result  = lo_fdt_result.
    * Get result output
      TRY.
          CALL METHOD lo_fdt_result->get_value
            IMPORTING
              ea_value =
    Another direct way of doing it would be to use the method PROCESS of the class CL_FDT_FUNCTION_PROCESS.
    I have not gone into much explaination here , but it should provide you an idea of how you can go about it.Read the SCN docs on the APIs to get a better idea , or better still if you can get hold of a copy of the BRF+ book by Carsten Ziegler , you will get an end to end explaination of all BRF+ APIs in it.
    Regards,
    Indranil.

  • Regarding Call Transaction and Session Method in BDC.

    Hi,
    If there are 50 records and 25th row data is having error.
    What will happen when we run it in Call Transaction and Session Method in both Foreground and Background methods ? Can anybody explain me in details ?

    Hi Naresh,
    If you are using call transaction,
    if executed in Foreground, 24 records will be posted and for 25th you will have option to correct data or skip.
    if executed in background,
    if mode is N,  24 records are processed 25th is skipped and 26th onwards is processed again.
    if mode is E, 24 records will be posted and for 25th you will have option to correct data or skip.
    For Session also it should be same the difference is that the error would be there in sessionlog and you can re-process it.
    Hope it helps.
    Regards,
    Komal.

  • A question regarding deallocating arrays

    hello. just to check if i learned arrays correct..
    for example i have an array 'anArray[ ]'
    public String[ ] anArray;
    -> to deallocate anArray, i simply used:
    anArray = null; instead of performing a for loop maybe..
    is this correct?
    it's quite confusing. does it apply to multidimensional arrays? for example anArray[ ] [ ] = null???

    A question regarding eclipse.
    No offence meant.People are not usually offended by Eclipse.
    I have added a jar file to the current project in its
    build path.
    This executes the concerned class file which is in
    the jar file.
    If I remove the jar file from the build path and run
    the project,
    it still executes that class file.
    I tried building a clean project and running it,but
    still executes the jar file and the class.
    Any idea why this is happening?You have that class file elsewhere
    or you have confused your problem statement.
    Why don't you create a new project and add everything except that class/jar (whichever yu mean)

  • Regarding Call Transformation

    Hi experts,
    Can any one tell what is call transformation used for and all also the use of  'id' given in the syntax below.
    CALL TRANSFORMATION id
    SOURCE (Internal table)
    RESULT (XML string )
    Thanks&regards,
    Karthik.

    Form SAP Help:
    Simple Transformations
    Simple Transformations (ST) is an SAP programming language for describing transformations between ABAP data and XML formats. ST is restricted to the two modes of serialization (ABAP to XML) and deserialization (XML to ABAP) of ABAP data, which are most important for data integration. Transformations from ABAP to ABAP and XML to XML, like in the more general XSLT are not possible in ST.
    In comparison with XSLT, the main advantages of ST programs are as follows:
    ST programs are declarative and thus easier to read
    ST programs only have serial access to the XML data and are therefore very efficient even with large data volumes
    ST programs describe serialization and deserialization simultaneously - that is, ABAP data serialized in XML with ST can also be deserialized with the same ST program.
    Simple transformations that can be called using CALL TRANSFORMATION must be in the repository. ST programs can be edited using the Transformation Editor. This is called up either with transaction STRANS or by choosing Edit Object u2192 More u2192 Transformation followed by Simple Transformation in the ABAP Workbench object navigator
    More information on Simple Transformations is available in the Knowledge Warehouse.
    Example (from help also )
    Simple Transformation Example
    Serialization of a nested structure. In the following ABAP program section, a nested structure struc1 is serialized to xml_string with the Simple Transformation st_trafo and deserialized with the same transformation.
    DATA: BEGIN OF struc1,
            col1 TYPE c LENGTH 10 VALUE 'ABCDEFGHIJ',
            col2 TYPE i VALUE 111,
            BEGIN OF struc2,
              col1 TYPE d VALUE '20040126',
              col2 TYPE t VALUE '084000',
            END OF struc2,
          END OF struc1.
    DATA: xml_string TYPE string,
          result     LIKE struc1.
    TRY.
        CALL TRANSFORMATION st_trafo
          SOURCE para = struc1
          RESULT XML xml_string.
        CALL TRANSFORMATION st_trafo
          SOURCE XML xml_string
          RESULT para = result.
      CATCH cx_st_error.
    ENDTRY.
    The Simple Transformation st_trafo has the following form:
    <tt:transform template="temp"
        xmlns:tt="http://www.sap.com/transformation-templates"
        version="0.1">
      <tt:root name="PARA"/>
      <tt:template name="temp">
        <X>
          <X1>
            <tt:value ref="PARA.COL1" />
          <X2>
            <tt:value ref="PARA.COL2" />
          <X3>
            <X1>
              <tt:value ref="PARA.STRUC2.COL1" />
            <X2>
              <tt:value ref="PARA.STRUC2.COL2" />
        </X>
    The transformation consists of a Template temp that defines the structure of the XML document and establishes relationships between value nodes and components of the structure. The result of the transformation is as follows (line breaks and indentations were inserted for clarification purposes):
    <X>
      <X1>ABCDEFGHIJ
      <X2>111
      <X3>
        <X1>2004-01-26
        <X2>08:40:00
    </X>
    The conversion of elementary data types is the same as for asXML. The reverse transformation generates the same content in the structure result as in struc1.
    Good luck.

  • Regarding calling internationally

    Good day,
    Firstly, sorry if this is posted in the wrong section. I also couldn't find something similar to my problem.
    Recently I bought a subscription to call to mobile/landlines in India and everything is working perfectly  except for the fact that my girlfriend is also getting charged for the calls, is this suppose to occur? Is she paying for the connection fee? This is the first time I've bought a Skype subscription so I'm not sure as to how it all works. Your insight would be appreciated, thanks in advance.
    Regards.
    Solved!
    Go to Solution.

    Phadey wrote:
    1. except for the fact that my girlfriend is also getting charged for the calls,
    2.Is she paying for the connection fee?
    Hello and welcome to the Skype Community!
    1. ??  That's not possible. Only the caller is charged. The only possible explanation could be that she is located in a country which charges to receive inbound calls and she is being charged by her telecom carrier. She should check with them.
    2. As you are using a Subscription to fund your calls there is no connection fee.
    TIME ZONE - US EASTERN. LOCATION - PHILADELPHIA, PA, USA.
    I recommend that you always run the latest Skype version: Windows & Mac
    If my advice helped to fix your issue please mark it as a solution to help others.
    Please note that I generally don't respond to unsolicited Private Messages. Thank you.

  • Regarding calling the fuctional module Using 'in update task'

    Hi ,
    I want to call a Functional module Z-PS_VK11_FRC  using the statement  IN UPDATE TASK .
    What is procedure to work with . can anybodt tell me how to proceed  or give me some sample program .
    Regards,
    Shilpa Talluri

    Function modules that run in update task can not return any values because your program has no longer control over the function module (the update task has).
    UPDATE TASK fm  mostly used to update database tables.
    You don't any special coding other than calling fm UPDATE TASK
    And in the attributes of function module you need to tick the Update mode and "Coll Run" so that it can be used to run individually in the V2 update process can be grouped together and run collectively.

Maybe you are looking for