Incrementing Values to be mapped in a field

Hi All,
I have a requirement to map incremental values to a field in a Record based on repeations of the Record.
For Example:
Suppose I have a structure as below
Employee
            - S.No
            - Name
            - ID
So here the S.No should be a incremental based on number of repeations of employee record which is in turn dependent on the source structure.
Output put should be like
<Employee>
          <S.No> 1</S.No>
          <Name>Kiran</Name>
          <ID>1234</ID>
</Employee>
<Employee>
          <S.No> 2</S.No>
          <Name>Ram</Name>
          <ID>1234</ID>
</Employee>
<Employee>
          <S.No>32</S.No>
          <Name>Alex</Name>
          <ID>1234</ID>
</Employee>
Please give me some suggestions

Hi,
      Create one UDF for Sequence number generation and assign SNo to that UDF and output of that UDF to target SNO field.It will work.
int inc=1;
Integer seqno=(Integer) container.getParameter("seqno");
if(seqno==null)
seqno = new Integer(1);
else
int number=seqno.intValue()+inc;
seqno=new Integer(number);
container.setParameter("seqno",seqno);
return seqno.toString();
Edited by: murali krishna on Sep 2, 2008 3:06 PM

Similar Messages

  • Value mapping with 1000 fields?

    Hi
    We are having 1000 fields and trying to map using value mapping,
    How to map these 1000 fields automatically without entering manuvally using value mapping?
    thanq
    krishna

    HI krishna,
    I would prepare a csv with key values and upload them in "imported archive".
    Now in message mapping create UDF and read the imported archiv:
    try {
         InputStream fstream = this.getClass().getClassLoader().getResourceAsStream(fileName);
         DataInputStream in = new DataInputStream(fstream);
         BufferedReader br = new BufferedReader(new InputStreamReader(in));
         String strLine;
         // Read File Line By Line
         while ((strLine = br.readLine()) != null) {
              String ValueLeft = strLine.substring(0, strLine.indexOf(";"));
              if (WertLinks.equals(key)) {
                   return (strLine.substring(strLine.indexOf(";")+1, strLine.length()));
              }//if
         }// while
         // Close the input stream
         in.close();
         return "no Value found; check CSV : " + key;
    } catch (Exception e) {// Catch exception if any
         return "Error: " + e.getMessage();
    The import-paremeters for UDF are:
    - key
    - fileName
    Regards Mario
    Edited by: Mario Müller on Apr 24, 2008 8:27 AM

  • How to Map the Unit field  in case of DSO and INFOCUBE

    Dear Experts,
    I have a issue ,Please help me to solve this
    I have DSO as provider ,
    And, i have to map transformations  btw the Datasource and DSO.
    In generic Data source,  i have unit fields like BASME,MEINS (Quantity units) & STWAE (currency field)
    and normal Quantity fields  like KWMNG,OAUME(quantity related),OAUWE (value related).
    In DSO data fields as Key figure info objects like  0Quantity (which have 0Unit as unit of measure) and some other  key figures which have there respective unit of measure in info object  definition.
    So you Please tell me how to map the Quantity ,Amounts, unit fields to key figures that we have.
    (How it will be for both DSO and Info cube is there any difference?)
    Edited by: AnjunathNaidu on Jan 18, 2012 1:20 PM

    Navasamol ,
    If it is works ,will u please tell me what is the difference ,if the transformations btw data source and DSO and
    what is the difference btw data source and info cube and btw DSO to Infocube or cube to cube .
    And i have  seen the Quantity fields  and there respective unit fields are mapped directly  to key figure info object
    in case of Info cube . Its working fine .
    If only 1:1 mapping allowed in DSO data fields key figures and there respective unit of measure characteristic.
    why this difference btw DSO and Info cube can any one explain me in detail.
    Expecting your valuable suggestions.
    Thanks & Regards,
    Anjunath Naidu
    Edited by: AnjunathNaidu on Jan 18, 2012 4:05 PM

  • How can we make one view field value to be copied to other field of the the

    Hi   
       I am new  in CRM2007 I have enhanced sap component & enhanced SAP View but I wanted the field value of the enhanced view to be mapped to the field value of the same view which is added from EEWB
    Pls tell me if the added new field can be made as Dropdown list box without fixed values & Design Layer customizing I mean to say through coding can we made the input field as Dropdown
    Appreciate any help in advance
    Thanks
    Neel

    Hi,
    You can write your own ligic in GET_V_<FIELD> method. Select the values which needs to be displayed in the drop down list based on your own condition. Some sample code is given below:
    METHOD get_v_zzverksomr.
      DATA: lt_ddlb           TYPE bsp_wd_dropdown_table,
              ls_ddlb           TYPE bsp_wd_dropdown_line,
              lv_display_only   TYPE string,
              gr_ddlb_verksomr  type ref to CL_CRM_UIU_DDLB,
              ls_verksomr_values  TYPE LINE OF vrm_values.
        SELECT verksomr verksomrtxt FROM zkb_verks
           INTO TABLE lt_ddlb.
        IF sy-subrc EQ 0.
          INSERT INITIAL LINE INTO lt_ddlb INDEX 1.
        ENDIF.
      IF gr_ddlb_verksomr IS NOT BOUND.
        FREE gr_ddlb_verksomr.
        CREATE OBJECT gr_ddlb_verksomr
          EXPORTING
            iv_source_type = 'T'.
        LOOP AT gt_verksomr_values INTO ls_verksomr_values.
          ls_ddlb-key   = ls_verksomr_values-key.
          ls_ddlb-value = ls_verksomr_values-text.
          APPEND ls_ddlb TO lt_ddlb.
        ENDLOOP.
        gr_ddlb_verksomr->set_selection_table( it_selection_table = lt_ddlb ).
      ENDIF.
      rv_valuehelp_descriptor = gr_ddlb_verksomr.
    ENDMETHOD.
    Thanks
    Swagatika

  • Encountering Error in webadi : "&Value is invalid. Enter a valid value for the Mapping column &Column"

    We are having a custom WebADI, containing a field (Employee Name) which is a LOV.
    The LOV has ID : Person ID, Meaning : Employee name, Description : Position Name.
    There are multiple records with same Employee name but different Person ID.
    If I select an Employee in the LOV which has multiple records (through different IDs), I am getting an error in WebADI:
    "Enter a valid EMPLOYEE_NAME.
    XX is invalid. Enter a valid value for the Mapping column EMPLOYEE_NAME"
    The Query for the LOV is correct and is returning correct records.
    Any pointers on this issue highly appreciated.

    Hi,
    The problem could be with HR security profile attached to the responsibility from where you are launching the spreadsheet. Check it once.
    Thanks.

  • Value is not populated for new field in RSA7 from PI Interface

    Hello Experts -
    We have 3.5 bw and PI 7.x. we have a  PI interface in bw working in production and now we enhanced the interface with a new added field. I mapped the new field in transfer rule/ modified update rules/ods and regenerated the soap datasource in bw. The user has uploaded the file in FTP with this new field added. PI picked the file processed  and the value for new field got populated and pushed the data to BW. In RSA7, i dont see the data filled in for this new added field. 
    Not sure, if i missed any steps, in BW, so that I can populate the value for this field.
    Thanks for any inputs/comments.

    Hi ,
    Replicate the Data source in BI and activate it using RS_DATASOURCE_ACTIVATE_ALL program.
    Regards,
    Ramnaresh.P.
    Edited by: ramnaresh porana on Apr 26, 2011 9:43 PM

  • Fetching value selected in Searchhelp of a field

    Hi Friends,
    In ICCMP_BT_SLO there are two views SLo1header and Slo1HCprice.
    In Slo1HCprice there is a field CONTRACT_ID.I want to display this field alongwith it's searchhelp on SLo1header View.
    For this I have taken following approach.
    1) In SLo1header view in Context Node BTOrder, I added a model attribute through the wizard which will point to Campaign_Id attribute in BTCampaignSet. As I stated above exactly similar field is already existing in Slo1HCprice View. So I copied GET_V method code from there and pasted in the GET_V method of my newly added attribute.
    2) Similarly I have also copied 'ON_NEW_FOCUS'  event handler method's code from Slo1HCprice View into  SLo1header View's BTOrder Context Class.
    3) Later I did View Customization to bring this newly added field on  SLo1header  View.
    4) Now I can see the field as well as the F4 help for the new field on   SLo1header  View.
    5) My problem is when I try to select a particular entry from the F4 Help then the selected value is not getting copied back to my new field. But If I maually input the value then it is properly getting saved in Database as well.
    Any suggestions ?? Do I need to code something in addition to this ? If input is given manually in the new field then the record gets perfectly saved in database.
    Thanks in advace.
    Regards
    Sandeep

    Hi Sandeep,
    i think this is the solution to your problem:
    you have to adapt your get_v method like this.....
      data:
          ls_map    type if_bsp_wd_valuehelp_f4descr=>gtype_param_mapping,
          lt_inmap  type if_bsp_wd_valuehelp_f4descr=>gtype_param_mapping_tab,
          lt_outmap type if_bsp_wd_valuehelp_f4descr=>gtype_param_mapping_tab.
    ls_map-context_attr = 'struct.TITLE_ACA1'.
      ls_map-f4_attr      = 'KEY'.
      append ls_map to: lt_outmap.
      ls_map-context_attr = 'TITLE_ACA1_TEXT'.
      ls_map-f4_attr      = 'VALUE'.
      append ls_map to: lt_outmap.
      create object rv_valuehelp_descriptor type cl_bsp_wd_valuehelp_f4descr
        exporting
          iv_help_id = 'BUT000-TITLE_ACA1'
          iv_help_id_kind   = if_bsp_wd_valuehelp_f4descr=>help_id_kind_comp
          iv_input_mapping  = lt_inmap
          iv_output_mapping = lt_outmap.
    You have to define the input and output parameter  for your f4-help. These are some specific IDs from your view. In this example the f4 Input parameter KEY is mapped to the  field id struct.TITLE_ACA1 ( an input field in the view). the f4 output parameter VALUE is mapped to the field id TITLE_ACA1_TEXT (also an input field in view). The Chosen value is going to be displayed in the input field with the id TITLE_ACA1_TEXT.
    I hope this helps!
    Kind regards
    Andreas
    Edited by: Andreas Binder on Apr 29, 2009 4:22 PM
    Edited by: Andreas Binder on Apr 29, 2009 4:35 PM

  • Value Transport (Exporting) to multiple screen fields in Search Help

    Hi all,
    I have created elementary search help using exit and attached it to data element. After F4 when I get hitlist I want all the values from the selected rows to get copied to the screen fields. I.e. I want the value transport.
    In the search help I am exporting those values which I want to get copied back but I am unable to get the result.
    With Regards,
    Chandra

    Hi,
        You can get this behaviour only by making the SEARCH HELP assignment at the STRUCTURE level.
    You need to create or use an existing structure to create your screen fields which you want to populate using the search help. Then assign this search help directly to the structure and there do the mapping between structure fields and the search help export params.
    Only by doing this you can autopopulate the values using one search help.
    Regards,
    Sesh

  • How can I control incremental value in ODI?

    Hi guys,
    I have to do something on the target table by insert a incremental value to some field that need to automatically increase by 1.
    Although , I tried with a variable that query a sequence from oracle but the output to the target table was the same number not the automatic increase number.
    eg. I have a variable name "AUTO_INC" on ODI and "AUTO_SEQ" which is a sequence on oracle target site.
    This variable has this statement
    select AUTO_SEQ.nextval from dual;
    So,This is my fault because after testing.
    This variable was executed once.
    The output from this variable is 1.
    After I executed the interface. And check the result in the target table it shows that the field that contain incremental value is 1 in all rows.
    Any idea?
    By the way ,
    I have tried the sequence and has some trigger on the target table.
    And Let oracle do the automatic generate a sequence number not the ODI.
    But it has a problem with number of the sequence that oracle generate was skipped.
    eg. first time I execute the interface . The field that bind to the automatic sequence was fine (increasing value by 1 with sequnce)
    Let's say I have 187 rows , So the last sequence number is 187.
    After that I execute the interface again , and the next sequence number should be 188
    But the result was 211.
    I don't know why because this table nobody touch it excepts me.
    Why the sequence number was skipped.
    My SQL to create a Sequence:
    create sequence AUTO_SEQ
    start with 1
    increment by 1
    nomaxvalue;
    A trigger that binding with target table :
    create trigger test_trigger
    before insert on test
    for each row
    begin
    select AUTO_SEQ.nextval into :new.id from dual;
    end;
    Thanks in advance for every ideas.

    Hi ananda,
    I have an error on step insert into flow table with this error
    *2287 : 42000 : java.sql.SQLException: ORA-02287: sequence number not allowed here*
    here are statement on this step
    insert /*+ APPEND */ into ODI_TMP.I$_TEST2
         ID,
         NAME,
         ID_KEY,
         IND_UPDATE
    select      
         TEST.ID,
         TEST.NAME,
         auto_seq.nextval,
         'I' IND_UPDATE
    from     CUST_DW_DEV.TEST TEST
    where     (1=1)
    minus
    select
         ID,
         NAME,
         ID_KEY,
         'I'     IND_UPDATE
    from     CUST_DW_DEV.TEST2
    I have an procedure name "create sequence" which have 2 steps
    step one : drop sequence with ignore error and has following code
    drop sequence auto_seq
    step two : create sequence with following code
    CREATE SEQUENCE auto_seq
    MINVALUE #TEST.auto_inc
    MAXVALUE 5888888
    START WITH 1
    INCREMENT BY 1
    I have a variable name "auto_inc" and has an SQL with following
    select nvl(max(auto_id),1) from test2
    (need to change from 9000 to 1 because if I didn't change it had an error with 4006 : 22023 : java.sql.SQLException: ORA-04006: START WITH cannot be less than MINVALUE)

  • Need your assistance in mapping Structure and Field in DME Tree

    Hello Friends - I need your help in "Mapping from structure field" in DME.
    In the existing format tree, It is mapped Structure as "FPAYP" and Field name "BNAME" to populate Company Code name in the Payment file.
    Now I am asked to change this to populate value either from OX02 or OX15.
    When Company Code name was maintained, It was maintained in short and in the address tab, Full name is maintained.
    Please let me know which Structue and Field I should assign to pull the value either from OX02 or OX15.
    Thanks for your help.

    Thanks a lot Henri/Lakshmi.
    I have maintained mapping procedure Sturecture/field - FPAYHX/AUST1 to get the CoCd name in the file. In AUST1, Length of the CoCd is more  than 18, and as per Bank format, It should be 18 characters in length.
    User is not happy that complete CoCd name is not populated in the file. He has come up with an alternative and shortened the CoCd name that needs to be populated in the file and suggested us to get the value into the payment file. We should not replace CoCd name with the name he suggested in OX02/OX15,FBZP.
    My doubt is that if there is any filed I can use to maintain the name he suggested and assign it in mapping procedure.
    Thanks

  • Map Auto ID field in import manager

    Hello all
    I need to make a quick fix to the data in our repository. A field needs to be updated based on a small formula. To do so I have syndicated the information and imported it to and SQL database where calculated the result. I exported it to a text file.
    Now I need to create a map to update the field. However the only common ID is the auto ID field I have set up. I can't map the source to the destination - the map button is grayed out when I select the auto ID field.
    Is it not possible to map it or is it because the auto ID field is numeric and my import is text.
    BR
    /Alexander

    Hi Alexander,
    It is true that the Auto Id field cannot be  imported or syndicated.But as you said you have used only the auto id field as the Primary matching fiel dand you need the Auto id information only so as to import then a workaround  i would suggest
    - Create a new field in your repository in console say(Auto id1)
    - Make this field as calculated field
    - In the calculation expression just selct the auto id field from the dropdown
    - This will populate the autoid field1 with the values same as the auto id field
    - And then try mapping it to this newly craeted field while importing.
    - This is just a workaround i am not sure whether it will address your problem directly
    Hope It Helped,
    Thanks & Regards
    Simona Pinto

  • Question w/ mapping header text fields from the ORDERS05 idoc - Need help!!

    My mapping seems to be combining two header texts categories(IDs) and putting in into the XML target field. That's the first issue.
    The 2nd issue is trying to figure out how to only use only a part of the tdline.
    The idoc value is: <TDLINE>232828-0 06/25/2009 EDI Vendor Confirmed</TDLINE> .
    I only want to use the first part: 232828-0 and ignore the rest(
    06/25/2009 EDI Vendor Confirmed).
    Would someone have 30 mins to help a newbie out.
    I can send screen shots of the idoc coming into PI and the XML file going out as well as my mapping for the field.
    Thanks,
    Jeff
    jschreiber@ballhort .com

    Jeff,
    I have sent a test email pl send me screenshots.
    Issue 2: Did you try to use standard function for texts i.e "substring". Open the mapping in editing mode and all the way down you  can see "Function" from where you can choose std functions.
    -Sid

  • Join 2 fields into one to map to destination field

    Hi! Is it possible to join data in 2 fields into one to map to the destination field? I have image file name kept in one field and want to prefix with a URL which I hope to maintain in a manually added field. Alternatively, it will be great to be able to prefix the image filename with the URL to be mapped to the image destination field.
    Any help is very much appreciated.
    Thanks!
    SF

    Hi,
    Yes it is possible to combine values from two fields to map a single field of MDM repository using Import Manager. This feature of Import manager is called as Field Partitioning.
    You can do it by following below mentioned steps:
    1. Open import manager and connect to source file.
    2. Specify source and destination tables. expand Source Table under source Hierarchy in Import Manager. And click on first field to select it.
    3. Now Go to "Partition Field/Value" tab. In the Source Partition sub Pane  you will see your First Field under "partition by" (* because you select first field from source hierarchy).
    4. From source Partition sub pane under "Available Fields" select the second field and click on "Add". This will bring second field also under "partitioned By".
    5. Now select both Fields under "partition by" and right click and select "Combine" (*Combine option will be enabled only when more than 1 field is selected by "partition By"
    6. Once you select Combine, it will combine values from both Fields. Again right click and select "Set combine delimiter" and specify the required value delimiter.
    7. Now Go to "Map Field /Values" tab. You will see one more field (*starting with the name of your first field and ending with partition word. Map this field to the required destination field.
    8. Follow other normal steps for data import and import data. after data import check data in data manager. you will get combined values from 2 source field in the MDM field.
    Check Page no 203 of [import manager reference guide |http://help.sap.com/saphelp_nwmdm71/helpdata/en/4b/72b8e7a42301bae10000000a42189b/MDMImportManager71.pdf]for more details.
    Please revert if you face any issue.
    Regards,
    Shiv
    Edited by: Shiv Prashant Dixit on Mar 11, 2010 9:53 AM

  • Mapping the values of a Map as Transformation

    Hi,
    Is it possible to map the value of a (Java) Map with a transformation? The values in my Map are arbitrary object hierarchies, and I want to transform them to XML using XStream before they're put to a CLOB field in the database, and vice versa.
    Thanks!

    And I'm using 10g Release 3 (10.1.3)

  • Bapi bbp_create_be_rs_new mapping a customer field to standard field

    hey guys , I am trying to create a reservation in ECC and i am trying to map a custom field to a standard field in ecc.  In the structure of the reservation in the bapi there field does not exist but it exists in ecc.  How do i map one of the values from the item table to a field to ECC when the field does not even exists in the bapi?
    The field that i want to map is PRIO_URG in ecc and it does not exists in the bapi bbp_create_be_rs_new.  I saw that there is an IT_RS_EXtensionin strucutre but I dont know how to pass a custom field to a standard?
    I also want to pas a text id field to ECC too?  How should i do that?  thank you.

    help!  I don't understand how to pass my value that i got from a table in SRM to the bapi structure bapiparex?

Maybe you are looking for