IDOC-File - records in Idoc to file based on some condition

Hello experts,
I have a idoc to file scenario. the incoming Idoc can have multiple records in it and i have to map these records to a csv file. Now the problem is not all records has to be mapped to the file. Based on the value of a perticular file (which is not root), i need to decide if the entire record has to be processed or not. Like the idoc structure is say:
IDOC
   E1WPA01            0....9999
      E1WPA04         0...99
          KONDART     0..1
Now for all valid E1WPA01 where the value of KONDART equals to some spacified value (known) , there has to be one record in the target csv file.
How can this be done at the root level?
One way of doing is we give empty values in the target file where the condition of KONDART is not fulfilled. Say if there are 10 records of E1WPA01 and only 4 satisfies the condition, we will ahve 10 records in the output file but only 4 records will have value and the rest 6 will be blank like (,,,,,,,). But I dont want this. I want only 4 records in the output file.
I tried mapping like this:
E1WPA01----
>Advanced -
> Root
E1WPA04-KONDART---->UDF
The problem i am facing here is if 4 records fulfill the condition, the first 4 are taken and the revelent 4.
Please help.
Regards,
Yash

Hi Chirag,
I wrote the following code in UDF:
for(i=0;i<a.length;i++)
if(a{i}.equals("Specified Values"))
result.addValue("a{i}");
else
result.addValue(ResuktList.SUPPRESS);
And its working partially. I mean the queue of the UDF looks like
1. AAAA                      SUPPRESS
2. <Specified value>     <Specified value>     
3. AAA                        SUPPRESS
4. AAA                        SUPPRESS
5. AAA                        SUPPRESS
6. AAA                        SUPPRESS
7. <Specified value>     <Specified value>
8. AAA                        SUPPRESS
9. AAA                        SUPPRESS
and it creates 2 ROOT nodes. But the root nodes are created for line 2 and line 8 insteed of 7.
What can be problem??
Yash

Similar Messages

  • How to dynamically add/remove a button from the ribbon based on some condition? (Ribbon XML)

    Hi,
    I have a ribbon (done using ribbon XML) with menu options. I need to remove few buttons from the menu dynamically based on some condition. Also, I want to change the label of another button. How to achieve this programmatically? (C#)
    Thanks in advance.
    Thanks Prasad

    Hello Prasad,
    Use callbacks for populating Ribbon controls such as menu, dropDown, gallery and etc. Then you can use the
    Invalidate or
    InvalidateControl methods of the
    IRibbonUI interface to get your callbacks invoked when required. Thus, you will be able to delete the required item(s).
    You will find the following articles in MSDN helpful:
    Chapter 11: Creating Dynamic Ribbon Customizations (1 of 2)
    Chapter 11: Creating Dynamic Ribbon Customizations (2 of 2)
    To change the label of your controls at runtime you need to use the getLabel callback and call the Invalidate or InvalidateControl methods of the IRibbonUI interface. The following series of articles describe the Fluent UI in depth:
    Customizing the 2007 Office Fluent Ribbon for Developers (Part 1 of 3)
    Customizing the 2007 Office Fluent Ribbon for Developers (Part 2 of 3)
    Customizing the 2007 Office Fluent Ribbon for Developers (Part 3 of 3)

  • Grey out a particular row in ALV based on some condition.

    Hi All,
    How can we grey out the particular row in ALV based on some condition( I am using the function modules and not OOPS).
    Regards
    Ramesh.

    Hello Ramesh
    In this case you need to add a specific field to your structure:
    TYPES: BEGIN OF ty_s_outtab.
    INLCUDE TYPE <my table or structure>.
    TYPES: CELLTAB   TYPE lvc_t_styl.  " name is arbitrary but this one is most frequently used
    TYPES: END OF ty_s_outtab.
    DATA: gt_outtab  TYPE STANDARD TABLE OF ty_s_outtab
                                 WITH DEFAULT KEY.
    You can use the fieldcatalog to make an entire column non-editable (LVC_S_FCAT-EDIT = ' ' ).
    However, in case of rows you need to inactivate all cells of this row. For sample coding please refer to thread:
    How to conditionally set ALV field as hotspot
    Regards
      Uwe

  • Display Image(which set as behind text)   based on some condition.

    hi all
    I have developed a xml report and in that rtf am displaying a static image (which is set as behin text).
    But i need to display the image based on some condition
    for example i have a field as ORG_ID
    if org_id=87 then image should display for that purpose am planning to use <?if:ORG_ID=87?> condition but where to place this condition for the image.
    kindly help me
    thanks for all in advance.

    that too not working because
    on image am displaying some other fields.
    see i think you didn't get my point.
    in my out put page am displaying item details ,quantity,and cost and customer details just like invoice copy .
    behind this data am displaying my company logo which will capture whole page size..
    if i place the image in table then fields will be automatically in table so i cant restrict image in this way.
    Kindly suggest any other way that works only for image which is behind text. i mean condition should be applicable only for image and leaving all other fileds in rtf.
    or
    help on this how to set a dynamic image as behind the text.
    Edited by: maddy on Nov 28, 2012 7:32 AM
    Edited by: maddy on Nov 28, 2012 7:35 AM

  • Display an exception based on some condition

    HI..
    how to run a exception based on some condition i.e
    i want to highlight the sales(key figure) which r less than the  average sales..
    where sales and average sales r keyfigures...

    Hi!
    welcome to SDN.
    create a calculated key figure which will be 1 if the sales is less then the average sales.
    create exception based on this calculated key figure.
    with regard
    ashwin
    <i>PS n: Assigning point to the helpful answers is the way of saying thanks in SDN.  you can assign points by clicking on the appropriate radio button displayed next to the answers for your question. yellow for 2, green for 6 points(2)and blue for 10 points and to close the question and marked as problem solved. closing the threads which has a solution will help the members to deal with open issues with out wasting time on problems which has a solution and also to the people who encounter the same porblem in future. This is just to give you information as you are a new user.</i>

  • How to make a region mandatory based on some conditions using CO Extension?

    Dear All,
    I want to make Attachments region in a seeded page mandatory, based on some conditions. I am able to make fields mandatory using CO Extension, but i am not able to make the attachments region mandatory. Please help.
    Thanks
    Raj

    Raj,
    I have not tried but check if you could get the rowcount which shows how many attachment are upload or not. Then by checking this throw exception if the rowcount is o.
    Thanks
    --Anil
    http://oracleanil.blogspot.com/

  • Calling a window in sapscript based on some conditions

    Hi all,
    I want to call a window in SAPScript based on some conditions.Plz suggest how could i do that.
    Regards,
    Chinmay.

    Hi,
    Use a text element in that window.
    ie..
    /E  TEXT
    &VBAK-VBELN&
    in ur driver program
    if vbak-vbeln is not initial. ( your condition)
    call function 'write_form'
    element = 'TEXT'
    window = 'WINDOW_NAME'
    Endif.
    hope this helps
    santhosh

  • Calling two table controlls based on some conditions......

    I hav a requirement in which i have two table controlls, which i want to call based on some conditions. Like if condition is satisfied the first table controll shud fill up the screen and other wise the secondtable controll shud fill the screen....

    Hello,
    In the main screen where u need to vary with the 2 table controls , create a subscreen area .
    Now create two subscreens with the required table controls respectively.
    You can dynamically call the subscreens accordingly for  the conditions.
    Hope this may help you.
    Neeraj

  • Insert data in same table based on some condition

    Hi. I am new to this forum.
    I have to write a stored procedure to Insert Data into a table say MYTABLE ,having structure as:
    Col1 Col2 Col3 ................ TotalInstallments CurrentInstallment PaidAmount MonthYear
    I have to insert all the data as it is in the same table(MYTABLE) except changing some fields on basis of some conditions:
    1. if PaidAmount>0 && CurrentInstallment<TotalInstallment then
    CurrentInstallment=CurrentInstallment+1
    2. In the MonthYear field I am having data in formate(month/year)ex. 01/2012, 11/2012 ....
    So I have to insert data by incrementing month and year. for example:
    if currentdata is 11/2012 then next data will be 12/2012
    But next will be 01/2013
    I have to select all the records which belongs to previous month(through MonthYear field ) and put checking & changes on each record of the selected data and then insert them into same table(MYTABLE).
    How to achive that?
    Thanks.

    978184 wrote:
    Every thing is working fine but some strange result as:
    when i run my Procedure TRANSFERDATATONEXTMONTH
    1. by Passing Value as : CUSTOMERID_var ='ABX101' and MONTHYEAR_var='12/2012' it insurts 5 rows
    which is correct , since I have 5 records where CUSTOMERID='ABX101' and MONTHYEAR='12/2012' and
    new 5 rows has CUSTOMERID='ABX101' and MONTHYEAR='01/2013' (all other values are as expected)
    2. now when i again run by passing values: CUSTOMERID='ABX101' and MONTHYEAR='01/2013' it inserts 10 records(just double )
    and new records has value CUSTOMERID='ABX101' and MONTHYEAR='02/2013' (while on the basis of condition CUSTOMERID='ABX101' and MONTHYEAR='01/2013' i have in my table only 5 records)
    and all records are duplicate. Some times it inserts three times , while on condition basis it should no. What is happening?Probably, meanwhile you were trying to Insert the First time and the second time, someone did run the procedure that Inserted 5 More records for 01/2013. And, hence your Second run inserted 10 records instead of 5.
    >
    Why it is inserting double of records while i have only 5 records on given condition? Am I missing some thing?Yes, you are. You are missing your Tables, Your Dummy/Sample Data, Working Procedure/Function that can be replicated.
    Without this, we cannot simply believe on assertions that Oracle is behaving incorrectly.
    In addition to this, the GetMonthYear function, should be scrapped. It is un-necessary, when the same logic can be achieved using Oracle ADD_MONTHS function (See my previous post). And you are storing the MonthYear in a Varchar field, which ideally should be a Date field. This eradicates the un-wanted need to cast from VARCHAR - DATE - VARCHAR.
    Please do make some time to read {message:id=9360002} and mentioned relevant details.
    And notice, the code difference in my previous post and in your code.
    Please use
    {noformat}
    (exactly as shown) above and below your code, that indents the code properly for better readability.
    {noformat}                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       

  • How can i end the Process chain based on some condition

    HI All,
    I have a scenario where i have a main pc chain which call  the  new chain at the end which in turn again call pc1. So its more like a closed loop .
    pc1-->pc2->pc1
    What main chain does is it reads some field value from a dso and assign that to some variable and set some flag to identify that value has been used. My second chain just run the report using the same variables assign by first chain. Now i have to design the main chain such that when all the values have been read from the dso, it should exit and should not trigger 2nd chain. How can i achieve this scenario.
    Thanks
    Prashant

    Hi,
    For this try using Process Type-"Decision between multiple Alternatives" in your main chain.It helps you the set condieion based on some formulas
    Pls refer links
    Decision Between Multiple Alternatives
    thanks
    nilesh
    Edited by: npathak on Aug 11, 2010 1:16 PM

  • ** Port is missing from the IDoc control record  (Receiver IDoc adapter)

    We are using a File to IDoc scenario and in the idoc sap sender port is not coming due to this IDoc posting is failing. Could any one tell us why idoc adapter is not able to get SAP port.
    The following is the error message in SAP side.
    Status : 56
    IDoc: 0000000006188579 Status: IDoc with errors added
    EDI: Partner profile inbound not available
    Kindly help me friends.
    Thanks,
    Jagathees P.

    hi,
    >EDI: Partner profile inbound not available
    this error message means that there is not partner profile
    configuration for this IDOC (you configure it in WE20 of ERP/R/3 )
    or your XI system is configured to post to a wrong partner profile
    (if you fill your partner data in a mapping for example)
    so it's one of the other for sure - check it/change it and it will work
    for more info about IDOCs and XI you can check my book:
    www.sap-press.com/product.cfm?account=&product=H1935
    Regards,
    Michal Krawczyk
    http://mypigenie.com XI/PI FAQ

  • JAVA Read XML file and modify attribute values based on some conditions

    I have the following XML file "C:/Data.xml".
    If the attributes on Dimension, Metirc, Data date Matches then Add the amount values and remove the duplicate DS node.
    I looked some examples on hashtable/hashmapping but I could not find that meets my creiteria. I appriciate any direction or suggestions on this.
    <ED LG="US">
    <DS name="1" source="A" freq="Day">
    <Dimension name="code" value="3">
    <Metric ref_name="A1-ACT">
    <Data date="2011-03-04T00:00:00" amount="30" />
    </Metric>
    </Dimension>
    </DS>
    <DS name="1" source="A" freq="Day">
    <Dimension name="code" value="3">
    <Metric name="A1-ACT">
    <Data date="2011-03-04T00:00:00" amount="40" />
    </Metric>
    </Dimension>
    </DS>
    <DS name="1" source="A" freq="Day">
    <Dimension name="code" value="3">
    <Metric name="A1-ACT">
    <Data date="2011-03-05T00:00:00" amount="20" />
    </Metric>
    </Dimension>
    </DS>
    </ED>
    Expected Result:
    <ED LG="US">
    <DS name="1" source="A" freq="Day">
    <Dimension name="code" value="3">
    <Metric ref_name="A1-ACT">
    <Data date="2011-03-04T00:00:00" amount="70" />
    </Metric>
    </Dimension>
    </DS>
    <DS name="1" source="A" freq="Day">
    <Dimension name="code" value="3">
    <Metric name="A1-ACT">
    <Data date="2011-03-05T00:00:00" amount="20" />
    </Metric>
    </Dimension>
    </DS>
    </ED>
    thanks
    Edited by: user7188033 on Mar 19, 2011 1:40 PM
    Edited by: user7188033 on Mar 19, 2011 2:01 PM
    Edited by: user7188033 on Mar 19, 2011 2:02 PM

    Use XSLT for transforming the XML document.

  • Records to be saved based on some condition

    hi all,
    i am using form6i.
    i have multi record block. i should allow the user to update the record based some condtion.
    my question is where to write the update statement and how to check the condition(i have to check for process_type = 'H' and status = '1,2,3' etc..)
    I am new to this type of requirement. please help me.
    Thanks..

    Hello,
    Better is to avoid the end user to update records that are not allowed.
    In the When-New-Record-Instance trigger, you can set the UPDATE_ALLOWED to true or false depending on any condition, via the Set_Item_Instance_Property() trigger (see the doc)
    Francois

  • How to change the insert allowed false dynamically based on some condition

    Hi,
    I have two data blcoks B1 and B2.
    B1 is heade and B2 is detail.
    B1 contain one filed PO number based on that user press the button.
    Based on PO we get the some fileds in B2 from cursor.
    In B2 filed contain total 5 fields. 4 fields come from cursor button. remaining one field user will enter.
    My requirement is afte the getting the records from cursor. I need to not allowed to create new records.
    Please do the needful.

    902434 wrote:
    Hi,
    I have two data blcoks B1 and B2.
    B1 is heade and B2 is detail.
    B1 contain one filed PO number based on that user press the button.
    Based on PO we get the some fileds in B2 from cursor.
    In B2 filed contain total 5 fields. 4 fields come from cursor button. remaining one field user will enter.
    My requirement is afte the getting the records from cursor. I need to not allowed to create new records.
    Please do the needful.As per i understand you want on block b2 insert allowed false.
    Try this
    If your_condition then
         SET_BLOCK_PROPERTY('block_name', INSERT_ALLOWED, PROPERTY_FALSE);
    else
         SET_BLOCK_PROPERTY('block_name', INSERT_ALLOWED, PROPERTY_TRUE);
    end if;Hopes this helps..

  • How do i export the table data based on some condition for backup

    Is is syntax correct
    exp scott@orcl92 file=emp_29aug.dmp tables=emp
    query=\"where emp_no in (1,2,3,4) \".
    How do i take the backup of more than one table?
    what is the syntax for that
    Thans

    Thanks for your response
    If i want to add more than one condition in the query, then how do i do that
    exp scott/tiger@orcl file=scott.dmp tables=(emp, dept) query=\"where deptno = 30\" and emp_no in (1,2,3,4);
    how do i do that

Maybe you are looking for

  • ITunes 8 not compatable with XP SP3?

    today I updated my iTunes using the apple software update and it said during the install that the software did not clear the windows testing. when the install finished I restarted the computer like it said too.Now when ever I try to open iTunes I get

  • PKCS #11 cfg file does not recognize "()" string in the library path

    Hi, I have a java applet using the provider class - sun.security.pkcs11.SunPKCS11 class to read the Windows Vista PKCS#11 library(DLL). However, the provider class cannot read the DLL file if it is installed into the default 32-bit directory, ie. C:/

  • CS1 to CS4 in a single leap

    Working on iMac 20" Leopard OS, 3GB RAM. From what I read, I should not have been able to install CS1 let alone work with it. At this point however, it's time to buy CS4. Some of the forums talk about difficulty working with legacy documents in CS4.

  • SVG not handled properly

    Oversized SVG files are shown without scollbars, right? Test case: http://upload.wikimedia.org/wikipedia/commons/7/77/Unix_history-simple.svg

  • Automator Workflow Warning

    Please help. I have an iMac, and I want to copy all my Mail Library to my MacBook Pro Mail Library. Kind of a backup, but I want to do it to have all the subfolders created on Mail on my iMac as well as on my MacBook Pro. I know Exchange Server is th