Plsql - varray in a varray doubt/issue

Hi,
My Oracle version:
Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - 64bit Production
PL/SQL Release 11.2.0.1.0 - Production
"CORE     11.2.0.1.0     Production"
TNS for Linux: Version 11.2.0.1.0 - Production
NLSRTL Version 11.2.0.1.0 - Production
Please find the code below:
create or replace
procedure p_varray_test
AS
type t_va_emp_group_sal is varray(10) of number(9);
type t_2d_VA is varray(2) of t_va_emp_group_sal;
L2DVAv_test t_2d_VA := t_2d_VA(t_va_emp_group_sal(11,12,13,14,15,16,17,18,19));
begin
L2DVAv_test.extend;
L2DVAv_test(2)(1) := 21;
dbms_output.put_line(L2DVAv_test(2)(1));
end;
its getting compiled but when I am trying to run it, I am getting the following error:
ORA-06532: Subscript outside of limit
please help me with this issue.
Now if I modify the code something like this:
create or replace
procedure p_varray_test
AS
type t_va_emp_group_sal is varray(10) of number(9);
type t_2d_VA is varray(2) of t_va_emp_group_sal;
L2DVAv_test t_2d_VA := t_2d_VA(t_va_emp_group_sal(11,12,13,14,15,16,17,18,19),t_va_emp_group_sal(11,12,13,14,15,16,17,18,19));
begin
L2DVAv_test.extend;
L2DVAv_test(2)(1) := 21;
dbms_output.put_line(L2DVAv_test(2)(1));
end;
this code is perfectly working fine for me but I want to understand why am i getting the error above.
Regards
Rahul

Let's start with your second (working) example first:
L2DVAv_test t_2d_VA := t_2d_VA(t_va_emp_group_sal(11,12,13,14,15,16,17,18,19),t_va_emp_group_sal(11,12,13,14,15,16,17,18,19));Now you have an "outer" varray initialized with two elements. Each of those two elements are initialized with an "inner" varray each with 9 elements.
L2DVAv_test.extend;The "outer" varray has now been extended with a third element. That third element is as yet not initialized.
L2DVAv_test(2)(1) := 21;The value of first element of the "inner" varray in the second element of the "outer" varray is changed to 21.
So "11" in your second t_va_emp_group_sal expression is changed to 21.
Now your first example:
L2DVAv_test t_2d_VA := t_2d_VA(t_va_emp_group_sal(11,12,13,14,15,16,17,18,19));Now you have an "outer" varray initialized with one element. That single element is initialized with an "inner" varray each with 9 elements.
L2DVAv_test.extend;The "outer" varray has now been extended with a second element. That second element is as yet not initialized.
L2DVAv_test(2)(1) := 21;L2DVAv_test(2) will get you the second element of the "outer" varray.
But that element is not yet initialized, so you cannot reference "the first element of the inner varray" here.
But this should work after your extend:
L2DVAv_test(2) := t_va_emp_group_sal(21);Now you are initializing an "inner" varray with one element and assigning that newly initialized varray to become the second element of the "outer" varray.

Similar Messages

  • Can I have a varray inside a varray

    is this possible?

    I declare the following:
    ++++++++++++++
    create or replace type GROUP_L1 as table of GROUP_T1
    create or replace TYPE GROUP_T1 AS OBJECT
    EI_INFOSYSTEMACRONYMNAME VARCHAR2(50),
    GROUPT2 GROUP_T2
    create or replace type GROUP_L2 as table of GROUP_T2
    create or replace TYPE GROUP_T2 AS OBJECT
    GE_REFERENCEPOINTTEXT VARCHAR2(50)
    ++++++++++++++
    When I ran the following:
    ++++++++++++++++++++
    SELECT cast(multiset(select
    EI.EITC_ENV_INTEREST_TYPE_ID EI_INFOSYSTEMACRONYMNAME,
    cast(multiset(select 'DWW' as GE_REFERENCEPOINTTEXT from dual) as GROUP_T2) GROUP_T2
    FROM FDM.ENVIRONMENTAL_INTERESTS EI
    WHERE M.MANAGED_ENTITY_ID = EI.ME_MANAGED_ENTITY_ID) as GROUP_L1) GROUP_L1
    FROM FDM.MANAGED_ENTITIES M;
    +++++++++++++++++++++
    I get this error:
    Error at Command Line:3 Column:89
    Error report:
    SQL Error: ORA-22907: invalid CAST to a type that is not a nested table or VARRAY
    22907. 00000 - "invalid CAST to a type that is not a nested table or VARRAY"
    *Cause:    Attempted to CAST to a type that is not a nested table or
    VARRAY
    *Action:   Re-specify CAST to a nested table or VARRAY type.
    What am I doing wrong?
    Thanks.

  • Embeded PLSQL Gateway & 404 page not found issue

    Hi
    If I use APEX_ITEM.TEXTAREA with Embeded PL SQL Gateway and submit the page, it throws "HTTP 404-page not found" error.
    It doesn't happen when I use apache server instead of EPG.
    Our production APEX is down because of this issue.
    Any help/suggestions would be greately appreciated.
    Here are the simple steps to reproduce the same in a EPG environment.
    Note: It works fine in apex.oracle.com [http://apex.oracle.com/pls/otn/f?p=20193:6]
    Create a blank page with a report region for the following query. Add a self submit button to it. Run the page and hit the submit button and you will get 404-page not found error.
    SELECT APEX_ITEM.TEXTAREA(3, 'a' || lpad('z',1999),3,80) COMMENTS
    FROM dual
    CONNECT BY ROWNUM <=10
    Note:
    If you want to see this error in the same browser : exec
    dbms_epg.set_dad_attribute('APEX',
    *'error-style',*
    *'DebugStyle');*
    Ref: --blocked::[http://daust.blogspot.com/2008/04/troubleshooting-404-not-found-error-on.html]--
    To increase the loging level: SQL> execute dbms_epg.set_global_attribute('log-level', 7)
    Thanks
    Balaji Chellappa

    Hi Masa,
    I am also facing the same issue. After creating a Target Mapping tile for our custom application, when I save I get the below error :
    Configuration changes not saved for tile 'Target Mapping'
    Error (404, Not Found) in OData response for PUT "/sap/opu/odata/UI2/PAGE_BUILDER_CUST/PageChipInstances(pageId='X-SAP-UI2-CATALOGPAGE%3Aicch_report',instanceId='00O2THPMYBCTODLKRWF1EBX3F')": HTTP request failed Details: Resource PageChipInstance not found.
    I assigned a customizing transport as suggest in your response and saved again, but that did not help either.
    The surprising thing is, when our basis consultant (who has SAP_ALL) saves the tiles, he can save them. This tells me that all the necessary services to create/save the tiles are active.
    We have tried to trace my userid for missing authorizations - but none was found.
    Not sure what is causing the error when I save the tile..
    Regards
    Kalpana

  • Using VARRAYs as parameters to a Stored Procedure

    I'm trying to pass a VARRAY as an IN/OUT parameter into a simple stored procedure by doing the following ..
    call.addNamedInOutputArgument(.., .., .., oracle.sql.ARRAY.class);
    I'm using a DataReadQuery. I set the call in the query, bind all parameters and add the IN/OUT argument to the query (i.e. query.addArgument(<name>)). Then I create an oracle.sql.ArrayDescriptor to describe the ARRAY.
    ArrayDescriptor ad = ArrayDescriptor.createDescriptor(<name of VARRAY>, <connection>);
    The VARRAY is of size 1 whose type is INTEGER. I create an ARRAY of Integer objects.
    Integer fields[1] = new Integer[1];
    fields[0] = new Integer(2);
    ARRAY a = new ARRAY(ad, <connection>, fields);
    I create a Vector of parameters and add the ARRAY to it. Then I execute the query ..
    Object result = session.executeQuery(<query>, <Vector>);
    When I execute the query I keep getting an ORA-06550: wrong number or types of arguments in call to <stored procedure>. Any help would be appreciated. Thanks. -Michael-

    The workaround above using JDBC directly to call store procedures using VARRAY types is still probably your best solution.
    In TopLink 10.1.3 there is a new API on StoredProcedureCall that allows passing the JDBC type code which should allow binding of VARRAY output parameters.
    addNamedInOutputArgument(String procedureParameterName, String inArgumentFieldName, String outArgumentFieldName, int type, String typeName) {                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   

  • Clarification needed in calling synchronous bpel process from plsql

    Hello all,
    I am trying to a bpel from the plsql function as given in the folowing link:
    http://orasoa.blogspot.com/2006/10/calling-bpel-process-from-raw-plsql.html
    I have a doubt that, what is: p_DefaultDetail ?
    and what is XMLTRANSFORM method here is used for?
    I am getting an error that XMLTRANSFORM is not detected.
    can any one provide some pointers to get it resolved.
    Thanks
    Krrish

    If you install the database you also have the option to install optional components. One of these is the xmldb (or some support for it in the database , dunno how to call it).
    So i guess you need to install this extra component and you're there (assuming Marc his reply on the question where to find the xmltransform function is correct :))

  • Using UDT's for passing rows to a PL/SQL procedure

    I'm trying to get a list of rows into a procedure...
    With ODP 11 - I thought that I would simply need to create a UDT of an object (i.e. user_id, first_name, last_name) and - then type which is a collection of that object.
    Then - using that object type collection as a parameter in my procedure - pass the numerous rows from .NET in.
    I've found a examples with varray's, nested varrays etc... but - nothing straight forward with passing a collection of rows.
    Does anyone know of any online examples that illustrate this?
    Thanks for your help!

    Hi,
    A BLOB variable is just a pointer to binary data and you are passing a text string to your procedure which is why you have the error. So to write a blob into a table in a procedure you need something like this:
    CREATE OR REPLACE PROCEDURE testone(
    V_TEXT IN VARCHAR2
    AS
    V_SIGIMG BLOB;
    BEGIN
    insert into sin_image values(empty_blob())
    returning blobcol into V_SIGIMG;
    -- then copy the text as binary data, this does not convert the text to binary data
    DBMS_LOB.WRITE(V_SIGIMG,1,LENGTH(V_TEXT),v_TEXT);
    commit;
    END;
    /However, if you want to upload images into the table it is easier to use the Apex functionality to upload the image into the APEX_APPLICATION_FILES table then move the blob into your table using an INSERT or UPDATE.
    Rod West

  • Info Record - Purchase group

    Hi, I'm creating info records and I have two doubts/issues:
    1 - Even if in the screen layout configuration the purchase group is not mandatory, when I'm creating the info record the system gives me a error message. The purchase group is really necessary? Why?
    2 - The message is "Enter Purch. Group - Message no. ME083". I tried to find this message at Materials Management - Purchasing - Environment Data - Define Attributes of System Messages to change the Error to Warning but I didn't find. Someone knows where it could be done?
    Thanks,
    Guiza

    1 - Even if in the screen layout configuration the purchase group is not mandatory, when I'm creating the info record the system gives me a error message. The purchase group is really necessary? Why?
    - This is system defined message - it is in the program so you have to maintain the  purhcase group, generally it is copied from material master
    2 - The message is "Enter Purch. Group - Message no. ME083". I tried to find this message at Materials Management - Purchasing - Environment Data - Define Attributes of System Messages to change the Error to Warning but I didn't find. Someone knows where it could be done?
    This message is self -explanatary message you can see in SE91 tcode.
    generally this kind of message are defined in the program.

  • How to make Auto Parallelism work?

    Hello,
    We are running Oracle Database 11g Enterprise Edition Release 11.2.0.3.0 - 64bit Production. We have upgraded from 11gR1 recently. We are building a data warehouse in the instance of Oracle I am writing about. Heretofore we had been using hints in queries to take advantage of parallelism. We were hoping to achieve a performance boost by using the new "automatic degree of parallelism" support in 11gR2, but are having some problems understanding how to use it properly. From reading the Oracle white paper on parallelism http://www.oracle.com/us/products/database/twp-parallel-execution-fundamentals-133639.pdf , we had thought that by setting the database initialization parameters properly, and removing the query-level hints, and removing the parallel specifications in the table declarations, that Oracle would automatically determine the correct level of parallelism, and apply it. Instead, we have found that the removal of the hints and declarations results in a single-thread execution for our data-load queries, which load 100s of millions of rows, involving joins among tables that each contain more than 90 million rows. Reapplying the hints significantly improves our throughput. During the time we are running the data loads, the data load is the only significant user on our system, and our goal is to complete execution as quickly as possible.
    The PLSQL packages that load the data issue a "ALTER SESSION ENABLE PARALLEL DML " before running the loads.
    Here are our database initialization parameter settings that relate to parallelism:
    NAME TYPE VALUE
    fast_start_parallel_rollback string LOW
    parallel_adaptive_multi_user boolean FALSE
    parallel_automatic_tuning boolean FALSE
    parallel_degree_limit string CPU
    parallel_degree_policy string AUTO
    parallel_execution_message_size integer 16384
    parallel_force_local boolean FALSE
    parallel_instance_group string
    parallel_io_cap_enabled boolean FALSE
    parallel_max_servers integer 128
    parallel_min_percent integer 0
    parallel_min_servers integer 8
    parallel_min_time_threshold string AUTO
    parallel_server boolean FALSE
    parallel_server_instances integer 1
    parallel_servers_target integer 128
    parallel_threads_per_cpu integer 2
    recovery_parallelism integer 4
    Any help you can provide to help us use parallelism more effectively in 11gR2 would be gratefully appreciated.

    One common mistake is to not run the IO CALIBRATE before enabling AUTODOP=AUTO
    you may need to tweak this value or set it manually to something like (0,200,...) -- Check MOS for more on this
    this requires a bounce of all instancesAlso: there are thresholds that need to be surpassed:
    .e.g the default 10 seconds for parallel_min_time_threshold would suppress parallelism attempts for shorter queries vs. longer
    If default load has thousand of short queries this may not be the parameter for you: However you can decrease the threshold to a lower value
    such as 5 seconds or less.
    EM is a good place to monitor parallelism in real time ( or historically)
    - You might consider testing and reviewing if the above is relevant
    Last- Trace files including 10046 or 10053 should show AUTODOP being used
    - If this is LIMITED but the parameter is AUTO, you probably have no io calibrate stats
    Take care
    CL

  • SSRS 2012 SharePoint Mode Impersonate

    SP 2013 / SSRS 2012 in SharePoint Mode. Everything worked fine until we started configuring for Kerberos for using Pass-Through Authentication to data sources. We have this working in our current SP 2010 / SSRS 2008 Integrated Mode and so have experience
    both with creating SPNs for delegation and editing SSRS config-files.
    Any documentation we have found from Microsoft on editing the report server web.config are in best case incomplete and many are just wrong. For example adding what Microsoft recommends - '<authentication mode="Windows"/>' -
    causes the RS service application to crash. This does seem to be covered by other options in the config-file, but we are not able to find any documentation for that.
    Is anybody aware of a place where this is actually documented?
    Thanks.
    Regards, Stig

    Hi Heidi,
    many thanks for the reply. We have already been through this post and believe that we have configured Kerberos with constrained delegation exactly as described. We have quite some experience with that already as we do have a functioning SharePoint 2012 with
    SSRS Integrated mode that have also been configured for Kerberos.
    Our doubts/issues here lies purely with what we need to do with the SSRS web.config file. We have been through not only the referenced post, but a multitude of others as well. Our understanding from all these is that we need to have <identity impersonate="true"
    /> in the SSRS web.config file for it to be able to pass-through the identify of the client user.
    This however produces an error for accessing SSRS in any way: "
    The report server cannot decrypt the symmetric key that is
    used to access sensitive or encrypted data in a report server database.".
    We have researched this error and tried all manners of backup/restore the key and deleting the encrypted data as it is being referred to, but none of this helps.
    If we set this back to <identity impersonate="false" /> the SSRS functionality then works again, but we are then not getting the Kerberos identity passed through to the remote database server (which the data source points to).
    This is why we asked for documentation on how exactly SSRS is using the web.config file.
    Regards, Stig
    Regards, Stig

  • HT2486 How do I see what groups a contact is in?

    In my address book...how do I see all the groups a contact is in?

    HI,
    Great, it works!. However, I have one additional doubt/issue. I use to have ALL my contacts assigned to a group (1760 contacts, 9 groups). Since I am adding new contacts "on the go" using my iPhone, there is no way to assign the new comers to a group using the iPhone, so I have to wait till I get my iMac at the of the day or the week. The question is easy: how do I know which contacts are not assiged? (other than going through the entire list pressing the Option key, of course)
    Thanks!

  • Transforming single XML doc to Multiple XML docs

    I have a XML file with the structure shown below stored in the system.
    For now, I am just showing the empty elements for now -
    <DEPT>
    <ID>
    <NAME>
    <EMPLOYEE>
    <FIRST_NAME>
    <LAST_NAME>
    <PROJECT>
    <PROJ_NAME>
    <PROJ_ID>
    </PROJECT>
    <PROJECT>
    <PROJ_NAME>
    <PROJ_NAME>
    </PROJECT>
    <ADDRESS>
    <STREET>
    <CITY>
    </ADDRESS>
    <EMPLOYEE>
    </DEPT>
    I wish to load this file into multiple Oracle 8i database tables like DEPT,EMPLOYEE, PROJECT, ADDRESS
    which are master details, using XSU PLSQL API.
    My Problems/doubts are:
    1. I tried creating Object views but because of limitation of creating repeating collections
    in Oracle 8i I can not use that. It works only for one level of repetition.
    So I found out that it can be done by breaking xml to multiple xml documents.
    How can I convert this xml into multiple xml documents so that I can insert into different tables. Please provide your guidance and sample code for xslt file if possible.
    2. If I use XSLT how can I apply XSLT to external XML document that I am receiving (I cannot modify it).
    I found example of this using ORAXSL command line utility. But I wish to know if it's possible
    to appy XSLT within PLSQL procedure. If not, is ORAXSL only the way to do it.
    Thanks for the help. If possible pls provide Sample code
    Thanks

    Please refer to Steve Muench's book: Building Oracle XML Applications. It has good example for your case.
    Inside database, you can use xslprocessor PL/SQL package for XSLT transformation

  • Clearing Online redo logs on the target physical standby

    Hi,
    Version 11202.
    Primary on machine A
    Standby on machine B
    Following note: 11.2 Data Guard Physical Standby Switchover Best Practices using SQL*Plus [ID 1304939.1].
    Online redo logs on the target physical standby need to be cleared before that standby database can become a primary database. And later :
    On the target physical standby run the following query to determine if the online redo logs have not been cleared... 1) I did not understand where i should run the query. On machine A or on machine B ?
    2)
             Online redo logs on the target physical standby need to be CLEARED
            What does it mean that it need to be CLEARED ? Does transaction might be lost by running the clearing command?
    Thanks

    I have used my note many times in production.
    For example they needed to do some power work on the main server room a few months back on the weekend.
    We did switchovers until the work was complete and then a switch back.
    I wrote a short document called "Switchover post-mortem lessons" the main point from that was :
    1.
    getting ORA-01017 issues in Oracle forms (  Application ) after the switchover to standby.
    The issue was caused by the Standby database having a different parameter for passwords than the Primary database.
    This did not show up in testing because all the tester we used had converted passwords from Oracle 10.
    Solution
    When in doubt issue this on the new Primary :
    SQL>ALTER SYSTEM SET SEC_CASE_SENSITIVE_LOGON = FALSE;
    Note: This command can be issued repeatedly with no negative effect on the system.2.
    The query to check switch_over status was returning "LOG SWITCH GAP"
    select switchover_status from v$database;
    This is an issue because Oracle says the return values should be one of these :
    NOT ALLOWED
    SESSIONS ACTIVE
    SWITCHOVER PENDING
    SWITCHOVER LATENT
    TO PRIMARY
    TO STANDBY
    RECOVERY NEEDED
    LOG SWITCH GAP is not one of the expected value. In addition this phase is not search friendly either on the Oracle support site or your favorite search engine.
    Given this I ran this query :
    SELECT 
      NAME AS STANDBY,
      SEQUENCE#,
      APPLIED,
      COMPLETION_TIME
    FROM
      V$ARCHIVED_LOG;
    Solution
    SQL>ALTER SYSTEM SWITCH LOGFILE;
    And wait a few minutesMy switchover document had no issue.
    Best Regards
    mseberg

  • FORALL and FOR when to use

    Hi,
    I am just confusing..what is the difference between FORALL and FOR.

    Why it works?
    declare
    var1 varchar2(500);
    type varray_type is table of varchar2(50);
    v_varray varray_type;
    begin
    v_varray := varray_type('smith', 'king', 'jones');
    for i in 1 .. 3 loop
    var1 := var1 || ',' || v_varray(i);
    end loop;
    dbms_output.put_line(var1);
    end;
    OUTPUT: ,smith,king,jones
    And why it is not..
    declare
    var1 varchar2(500);
    type varray_type is table of varchar2(50);
    v_varray varray_type;
    begin
    v_varray := varray_type('smith', 'king', 'jones');
    forall i in varray.first .. varray.last
    var1 := var1 || ',' || v_varray(i);
    end loop;
    dbms_output.put_line(var1);
    end;
    I am still confusing..can't we assign values to variable in FORALL?
    please suggest me.

  • XSLT code giving emplty output

    Hi ,
    i am a beginer in XSLT.  when i execute the code  i am getting emplty structure.
    Can anyone point out what is missing in my code, are the xpath expressions correct??
    input Xml  will look as below
    <?xml version="1.0" encoding="UTF-8"?>
    <ns0:MT_XSLT_Source xmlns:ns0="http://XYZ.com/gen">
         <Person>
              <FirstName>James</FirstName>
              <LastName>Bond</LastName>
              <Gender>Male</Gender>
              <Address>
                   <Street>6B</Street>
                   <Houseno>bbbb</Houseno>
                   <City>AAAA</City>
              </Address>
         </Person>
    </ns0:MT_XSLT_Source>
    my output should be...
    <?xml version="1.0" encoding="UTF-8"?>
    <ns0:MT_XSLT_Target xmlns:ns0="http://XYZ.com/Gen">
          <Title>Male</Title>
         <Name> James Bond</Name>
          <Street> 6B bbbb</Street>
          <City>AAA</City>
    </ns0:MT_XSLT_Target>
    my XSLT code is  as below .. (  i think the xpath's are not executing)
    <?xml version="1.0" encoding="UTF-8"?>
    <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:ns0="http://XYZ.com/Gen">
         <xsl:template match="/">
              <ns0:MT_XSLT_Target>
                   <Title>
                        <xsl:value-of select="/ns0:MT_XSLT_Source/Person/FirstName"/>
    ( i doubt issue is in xpath??)
                   </Title>
                   <Name>
                        <xsl:value-of select="concat(concat(ns0:MT_XSLT_Source/Person/FirstName,' '),
                         Person/LastName)"/>
                   </Name>
                   <Street>
                        <xsl:value-of select="concat(concat(ns0:MT_XSLT_Source/Person/Address/Houseno,' '),ns0:MT_XSLT_Source/Person/Address/Street)"/>
                   </Street>
                   <City>
                        <xsl:value-of select="ns0:MT_XSLT_Source/Person/Address/City"/>
                   </City>
              </ns0:MT_XSLT_Target>
         </xsl:template>
    </xsl:stylesheet>
    Edited by: sam kumar on Aug 31, 2010 2:37 PM

    Hi, take this code:
    <?xml version="1.0" encoding="UTF-8"?>
    <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:ns0="http://XYZ.com/gen">
         <xsl:template match="/">
              <ns0:MT_XSLT_Target>
                   <Title>
                        <xsl:value-of select="ns0:MT_XSLT_Source/Person/FirstName"/>
                   </Title>
                   <Name>
                        <xsl:value-of select="concat(concat(ns0:MT_XSLT_Source/Person/FirstName,' '),
                         Person/LastName)"/>
                   </Name>
                   <Street>
                        <xsl:value-of select="concat(concat(ns0:MT_XSLT_Source/Person/Address/Houseno,' '),ns0:MT_XSLT_Source/Person/Address/Street)"/>
                   </Street>
                   <City>
                        <xsl:value-of select="ns0:MT_XSLT_Source/Person/Address/City"/>
                   </City>
              </ns0:MT_XSLT_Target>
         </xsl:template>
    </xsl:stylesheet>
    I Just change the xmlns:ns0="http://XYZ.com/Gen" to xmlns:ns0="http://XYZ.com/gen"
    Regards,
    Edson Thomaz

  • Use change pointers to send complete employee in HRMD_A

    Hi
    I need to distribute employee data from my SAP system. I want to send a Idoc every time a record in PA30 is changed. But know it only sends out a IDoc with the infotype that is changed, I need to distribute all infotype's.
    Example: One person is changed in infotype IT0002. I need to send out not only IT0002 but also IT0006 and IT0008.
    Is there a way to solve this?
    Best Regards,
    Morten

    Hello Morten,
    Yes, you can do it. I have done same thing in one of my interface. You need to write code into BADI.
    BADI : BDCP_BEFORE_WRITE   
    Method : FILTER_BDCPV_BEFORE_WRITE
    Basic idea is to populate internal table change_pointers with remaining infotype details.
    Refer following code for reference....
    BADI implemented in order to send customised data as
    maintained in the distribution mdoel
    METHOD if_ex_bdcp_before_write~filter_bdcpv_before_write.
    Type Declaration
      TYPES : BEGIN OF ts_range,
                sign    TYPE tvarv-sign,
                option  TYPE tvarv-opti,
                low     TYPE tvarv-low,
                high    TYPE tvarv-high,
              END OF ts_range.
      TYPES : BEGIN OF ts_group,
                int_grp     TYPE zthr_infty_subty-int_grp,
              END OF ts_group.
    Internal table
      DATA:
        lt_zthr_infty_subty TYPE TABLE OF zthr_infty_subty,
        lt_dist_infty_subty TYPE TABLE OF t788u,
        lt_groups           TYPE TABLE OF ts_group.
      DATA:
        lt_changed_objects  TYPE TABLE OF hrobjinfty.
      DATA :
        lr_infty    TYPE RANGE OF t591s-infty,  " Range for infotypes
        lr_subty    TYPE RANGE OF t591s-subty.  " Range for subtypes.
    Work Areas
      DATA:
        lw_change_pointers   TYPE  bdcpv,
        lw_change_pointers1  TYPE  bdcpv,
        lw_text(254)         TYPE  c,
        lw_infty             TYPE  ts_range,
        lw_subty             TYPE  ts_range,
        lw_groups            TYPE  ts_group.
      DATA:
        lw_zthr_infty_subty  TYPE zthr_infty_subty,   "Infotype & Subtype
        lw_zthr_infty_subty1 TYPE zthr_infty_subty,   "Infotype & Subtype
        lw_dist_infty_subty  TYPE t788u.              "Infotypes
      DATA:
        lw_changed_objects   TYPE  hrobjinfty,
        lw_changed_objects1  TYPE  hrobjinfty,
        lw_changed_objects2  TYPE  hrobjinfty.
    Local Variables
      DATA:
        lv_tabix      TYPE sy-tabix,      " Table index
        lv_cpident    TYPE cpident,       " Change pointer no.
        lv_pernr      TYPE pa0000-pernr,  " Employee Number
        lv_tabname    TYPE dd02t-tabname, " Table Name
        lv_abkrs      TYPE pa0001-abkrs,  " Payroll Area
        lv_infty(4)   TYPE n.             " Infotype Number
    Local Constants
      CONSTANTS:
        lc_e       TYPE t591s-sprsl   VALUE  'E',
        lc_i       TYPE tvarv-sign    VALUE  'I',
        lc_x       TYPE c             VALUE  'X',
        lc_7       TYPE c             VALUE  '7',
        lc_p       TYPE otype         VALUE  'P',
        lc_zhrmd   TYPE edi_mestyp    VALUE  'ZHRMD_A',
        lc_eq      TYPE tvarv-opti    VALUE  'EQ',
        lc_pa(2)   TYPE c             VALUE  'PA',
        lc_begda   TYPE sy-datum      VALUE  '19000101',
        lc_02      TYPE pa0001-abkrs  VALUE  '02',
        lc_1000(4) TYPE n             VALUE  '1000',
        lc_2000(4) TYPE n             VALUE  '2000'.
    Clear all local variables / internal tables / Work Areas
      REFRESH : lt_groups,
                lr_infty,
                lr_subty,
                lt_changed_objects.
      CLEAR : lv_tabix,
              lv_abkrs,
              lw_change_pointers,
              lw_dist_infty_subty,
              lv_tabname,
              lw_groups.
    Select only otypes and infotypes from distribution model
    Read change infotype / subtype data
      IF NOT change_pointers[] IS INITIAL.
        LOOP AT change_pointers INTO lw_change_pointers.
          lw_changed_objects = lw_change_pointers-tabkey.
    Filter CE Employee if Pay-Area not '02'          ***
          IF flt_val EQ  lc_zhrmd.    " Check for CE emploeyee
            SELECT abkrs
              INTO lv_abkrs
              FROM pa0001 UP TO 1 ROWS
            WHERE pernr EQ lw_changed_objects-objid
              AND endda GE sy-datum
              AND begda LE sy-datum
              AND abkrs EQ lc_02.
            ENDSELECT.
            IF sy-subrc EQ 0.
              APPEND lw_changed_objects TO lt_changed_objects.
            ELSE.
              DELETE change_pointers.
            ENDIF.
          ELSE.
            APPEND lw_changed_objects TO lt_changed_objects.
          ENDIF.    " IF flt_val EQ  lc_zhrmd.
        ENDLOOP.  " LOOP AT change_pointers INTO lw_change_pointers.
        lv_cpident =  lw_change_pointers-cpident.
      ENDIF.  "IF NOT change_pointers[] IS INITIAL.
    Select only otypes and infotypes from distribution model**
    Select corresponding infotypes / subtypes from table    **
    ZTHR_INFTY_SUBTY to create change pointers              **
      CALL FUNCTION 'RH_DISTRIBUTED_INFOTYPES'
        EXPORTING
          message_type            = flt_val
          check_model             = lc_x
        TABLES
          distributed_infty_subty = lt_dist_infty_subty.
      IF NOT lt_dist_infty_subty[] IS INITIAL.
    Read table ZTHR_INFTY_SUBTY
        SELECT mandt                         "  Client
               mestyp                        "  Message Type
               infty                         "  Infotype
               subty                         "  Info Subtype
               int_grp                       "  Change pointer group
          INTO TABLE lt_zthr_infty_subty
          FROM zthr_infty_subty AS a
          FOR ALL ENTRIES IN lt_dist_infty_subty
          WHERE mestyp EQ flt_val
            AND infty EQ lt_dist_infty_subty-infty.
        IF sy-subrc EQ 0.
          CLEAR : lw_changed_objects.
          LOOP AT lt_changed_objects INTO lw_changed_objects.
            MOVE : lw_changed_objects TO lw_changed_objects2.
            AT NEW objid.
    Read all groups belongs to infotype.
              CLEAR  : lw_groups.
              REFRESH: lt_groups.
              LOOP AT lt_zthr_infty_subty INTO lw_zthr_infty_subty
                      WHERE infty = lw_changed_objects2-infty
                        AND subty = lw_changed_objects2-subty.
                lw_groups = lw_zthr_infty_subty-int_grp.
                APPEND lw_groups TO lt_groups.
              ENDLOOP.  " LOOP AT lt_zthr_infty_subty INTO ....
    Do not create change pointer if infotype not maintained in
    table 'ZTHR_INFTY_SUBTY'.
              IF sy-subrc NE 0.
                DELETE change_pointers WHERE
                            tabkey+12(4) = lw_changed_objects2-infty
                        AND tabkey+16(4) = lw_changed_objects2-subty.
              ENDIF.  " IF sy-subrc NE 0.
    Read all infotypes belongs to all above groups.
              LOOP AT lt_groups INTO lw_groups.
                LOOP AT lt_zthr_infty_subty INTO lw_zthr_infty_subty
                              WHERE int_grp EQ lw_groups-int_grp.
    Check if change pointer already present
                  READ TABLE lt_changed_objects INTO lw_changed_objects1
                      WITH KEY infty = lw_zthr_infty_subty-infty
                               subty = lw_zthr_infty_subty-subty.
                  IF sy-subrc NE 0.
    Check if data exist for infotype / subtype
                    IF lw_changed_objects-otype EQ lc_p.
                      CONCATENATE : lc_pa lw_zthr_infty_subty-infty
                             INTO   lv_tabname.
                      SELECT SINGLE pernr
                        INTO lv_pernr
                        FROM (lv_tabname)
                       WHERE subty EQ lw_zthr_infty_subty-subty
                         AND pernr EQ lw_changed_objects2-objid.
                      IF sy-subrc EQ 0.    " Change pointer for employee
    Create change pointer for infotype / subtype combination
                        ADD 1 TO lv_cpident.
                        lw_change_pointers-cpident      = lv_cpident.
                lw_change_pointers-tabkey+12(4) = lw_zthr_infty_subty-infty.
                lw_change_pointers-tabkey+16(4) = lw_zthr_infty_subty-subty.
                        lw_change_pointers-tabkey+20(8) = lc_begda.
                        APPEND lw_change_pointers TO change_pointers.
                      ENDIF.  " IF sy-subrc EQ 0.
                    ELSE.
    Create change pointer for Org Data
                      ADD 1 TO lv_cpident.
                      lw_change_pointers-cpident      = lv_cpident.
                lw_change_pointers-tabkey+12(4) = lw_zthr_infty_subty-infty.
                lw_change_pointers-tabkey+16(4) = lw_zthr_infty_subty-subty.
                      lw_change_pointers-tabkey+20(8) = lc_begda.
                      APPEND lw_change_pointers TO change_pointers.
                    ENDIF.  " IF lw_changed_objects-objtyp EQ lc_p.
                  ENDIF.  " IF sy-sybrc NE 0.
                ENDLOOP.  " LOOP AT lt_zthr_infty_subty INTO..
              ENDLOOP.  " LOOP AT lt_groups INTO lw_groups.
            ENDAT.  " AT NEW objid.
          ENDLOOP.  " LOOP AT lt_changed_objects INTO lw_changed_objects.
        ENDIF.  " IF sy-subrc EQ 0.
      ENDIF.  " IF NOT lt_dist_infty_subty[] IS INITIAL.
    ENDMETHOD.
    But make sure you maintained remaining infotypes in distribution model. I have created table zthr_infty_subty twhere I am keeping track of all infotype and subtype for which I have to send a data.. You can hardcode values in u r program if you want / if you know the all infotype for which you have to send data.
    if you still have any doubt / issues let me know your email id will mail you badi-code.
    Cheers,
    Nilesh

Maybe you are looking for

  • Server 4.0.3 Opening a port

    I am running OS X Server 4.0.3, and need to open a specific port for remote backup software. It appears that I *should* be able to do this now in server.app under the server | Access tab however when I add an entry to custom access and the port numbe

  • Create Materialized view is very slow

    Hi Please assist the pasted MV is taking more time(nearly 10hrs) to create, however the select query is executed fraction of seconds. CREATE MATERIALIZED VIEW ACOSQ2.CDVEDLCRD_MV PCTFREE 10 PCTUSED 40 INITRANS 2 MAXTRANS 255 STORAGE ( INITIAL 64 K MI

  • Getting error in idoc FD 008

    Hello , i am getting an error in idoc which is related with Tax code &  Tax rate conversion in EDI .  The Message number is FD 008  and message is  "Assigning a new tax key for and VAT .000 not possible   . Can anyone please help me what could be pos

  • Uploading Customer balance f-22....

    Hi All, I need to upload customer balances using f-22 transaction. Could anyone provide me the BDC coding to upload customer items as soon as possible. regards PSNG

  • Is there a way to add a toolbar seperator?

    Hi there, Is there a way to add a toolbar seperator on the toolbar before adding a custom button? Ming