Count of Target fields

Hello gurus,
I am doing a scenario where I have one input file with several Recordsets and i need to split the file based on Company Code.My output structure has Hearder,Data and Footer.I have achieved this.
I also need to count the number of times the Header,Data and Footer comes in output file and then add all of them and also add the Index.I need to map this to one of the target field.
Can you please guide me as to how I should proceed.
Thanks in Advance,
Swathi

Hi,
Use the std. fun. "Count" for this.
All Source fields (map into corresponding input box) --->RemoveContext -
>Count -
>UDF(write a code which will have n number of input box and then write the code to sum all the values from dirrerent sources) ---> Target.
Regards,
Sarvesh

Similar Messages

  • COPA Derivation based with target field as non-copa field

    Hello experts,
    There is a requirement to derive the Characteristic maintained in Classification view(AUSP table) in Material master based on material number.The target field into which the characteristic value needs to be populated is not in COPA(it is a non-copa field).
    I tried to use table look up with AUSP table, but it is asking for values of certain key fields like
    ATZHL(Characteristic value counter)  MAFID(Indicator: Object/Class) and
    KLART(Class Type), which are not there in COPA.
    With the Enhancement in KEDR transaction, EXIT_SAPlKEDRCOPA_001 and Include ZXKKEU11, I  created an enhancement step by giving  the material as the key in the source fields.With that material number I can do a select on the AUSP table inside the include ZXKKEU11 and get the characteristic value. The problem i am facing is that the target field which stores the internal characteristic value is not there in COPA?And while creating a derivation rule, I can only select the COPA fields as target fields.
    It's urgent....any suggestions  please? Points will be rewarded for any useful answer.
    Thanks,
    Anky

    Hi,
    As far as I know the derivation functionality in COPA is meant for derivation of characteristic values to store them in a characteristic field.
    If you splitt up the derivation in two steps it might be possible to use the USERTEMP fields, to store the information needed and to pass it on to an other lookup step as a key-reference.
    Regards,
    Roy

  • Copy first source context to target field

    Hi,
    As I have not worked with the manipulation od contexts very much, I currently have the following problem.
    Source message has 5 contexts of a segment <Partner> and the information in the first context needs to go into target field 1 as it is related to a specific type of partner and the other remaining contexts need to go into target field 2.
    Therefore my question (albeit a pretty simple one I hope) is how do I detect the first context and move it into target field 1 ??
    Thanks
    Colin.

    you can use the function "count" to compare:
           count
                 equalS 
    constant(1) /        
                           ifWithoutElse
                  partner /

  • 6 IF-THEN and OR conditions for one target field mapping

    Hi Mapping experts,
    I have a validation condition involving 2 source fields and 1 target field only, however the number of conditions is 6 (OR)
    Source Fields:
    TYPE
    PONUM
    Target Field:
    BELNR
    If TYPE = 1st value   then   BELNR = PONUM substring (0, 8)  0=start position, 8=character count
    OR
    If TYPE = 2nd value   then   BELNR = PONUM substring (2, 8)
    OR
    if TYPE = 3rd value  then  BELNR = PONUM substring (4, 8) ..........  up to the 6th Validation Condition.
    When I do this using graphical mapping only (multiple IF-THEN and OR's) the validation is successful only on the 1st IF-THEN statement, then it passes the substringed value to the 1st OR function.....    When I "Display Queue" the 1st OR function the substringed value is taken as null (or:in1 <null>)  Is this because OR function is expecting Input as "True or False" value only and not a string value?
    For my requirement above, can I achieve this using graphical mapping only?    or do I have to use UDF for this?
    If it's better to use UDF for this, would anyone give me a jumpstart on the code?  (I have no experience yet in UDFs)
    Thanks, and hoping that somebody will respond accurately and completely.

    Create UDF with two inputs as TYPE & PONUM and use bleow code there..
    String out = "";
    if( TYPE.equals("1"))
    out = PONUM.substring(0,8);
    return out;
    else if( TYPE.equals("2"))
    out = PONUM.substring (2,8);
    return out;
    else if( TYPE.equals("3"))
    out = PONUM.substring (4,8);
    return out;
    else if( TYPE.equals("4"))
    out = PONUM.substring (4,8);
    return out;
    else if( TYPE.equals("5"))
    out = PONUM.substring (4,8);
    return out;
    else if( TYPE.equals("6"))
    out = PONUM.substring (4,8);
    return out;
    return "";
    Note: change the substring range as per your need in above code.
    Now do your mapping as shown below
    TYPE ------>|
                | -----> UDF ---> BELNR
    PONUM----->|

  • Couldn't assign target field for characteristics in PI sheet config

    Dear All,
          I'm trying to configure PI sheet, i have created Process message categories as well as characteristics. Everything is working fine except the inputted value (for example weight, density) in PI sheet not getting transferred into process order. When i try to assign the destination message to the message characteristics, i couldn't find any value for the message categories which i created. System shows the below  error:
    No entries found that match selection criteria
    Message no. SV004
    Even if i try to assign manually,system shows with error
    Corresponding entry in "Destinations/Message categories" missing
    Message no. SV534
    Steps i did :
    1. Created new Control Recipe destination(ZCR) ( by copying sap provided CRD "05")
    2. Created new characteristics group(ZMCG) for process message ( by copying sap provided group "PPPI_01") and released
    3. Created Characteristics (ex. weight, density) with chars. group as ZMCG
    4. Didn't create any new message destination (Trying to use defaut "PI01")
    5. Create New Process Message Category(ZTEST) and assign the characteristics (weight, density along with PPPI_PROCESS_ORDER)
    The problem is i couldn't assign target field as "process order" to update the inputted values for the characteristics (weight, density) in O13C
    I gone through all the node in "Process Management" but unfortunately i don't know where we have to assign this destination. I hope if i assign the destination message as "PI01"  with characteristics "PPPI_PROCESS_ORDER" along with target field as "PROCESS_ORDER" for the characteristics it may update into process order. How to assign the destination message for the message category?
    Thanks

    Hi Kumar,
        Thanks. When i try to assign the destination message for the characteristics through O13C, i got the error message that "No entries found that match selection criteria". It means there is no characteristics with the combination of Process message category "ZTEST" with Destination as "PI01". If i trying to assign manually through "New entries" option, systems shows with the error "Corresponding entry in "Destinations/Message categories" missing.
    Thanks

  • End Routine - populating Target Field based on Master Data

    Hi,
    I have an issue with my End Routine in BI 7.0. The scenario is as follows....
    The Target-Fields ZSALES_OFFICE , 0SALES_CHANNEL etc. are being mapped 1:1 from their respective source fields. In addition to these target fields I have a target field 0SALESORG which I need to populate based on the values from 0COMP_CODE which is an attribute of ZSALES_OFFICE. The values of 0COMP_CODE are 9000, 9001, 9002 and 9003 respectively. The end routine condition needs to be implemented as follows...
    For every 0COMP_CODE which has value 9000, 0SALESORG should be populated with the value "EAST". Similarly for every 0COMP_CODE which has value 9001, 0SALESORG should be populated with the value "WEST",  for every 0COMP_CODE which has value 9002, 0SALESORG should be populated with the value "NORTH" and  for every 0COMP_CODE which has value 9003, 0SALESORG should be populated with the value "SOUTH". I tried the following code but it doesnt seem to work. Could you pls help!!
    Thanks,
    SD
    DATA: it_tab4 TYPE TABLE OF /BIC/PZF31SALOFF,
              wa_tab4 TYPE /BIC/PZF31SALOFF.
        SELECT *
          FROM /BIC/PZF31SALOFF
        INTO CORRESPONDING FIELDS OF TABLE it_tab4.
        sort it_tab4 by /BIC/ZF31SALOFF.
        LOOP AT RESULT_PACKAGE
          INTO <result_fields>.
          read table it_tab4
          with key /BIC/ZF31SALOFF = <result_fields>-/BIC/ZF31SALOFF
          into wa_tab4
          binary search.
          if sy-subrc eq 0.
            CASE wa_tab4-comp_code.
              WHEN '9000'.
                <result_fields>-salesorg = 'EAST'.
              WHEN '9100'.
                <result_fields>-salesorg = 'WEST'.
              WHEN '9200'.
                <result_fields>-salesorg = 'NORTH'.
              WHEN '9300'.
                <result_fields>-salesorg = 'SOUTH'.
              MODIFY it_tab4 FROM wa_tab4.
            ENDCASE.
          endif.
        ENDLOOP.

    Replace your select statement ,
    SELECT *
    FROM /BIC/PZF31SALOFF
    INTO CORRESPONDING FIELDS OF TABLE it_tab4.
    instead of selecting all the fields , pick only the fields which are required.(one good performance improvement)
    SELECT    /BIC/PZF31SALOFF  comp_code
    FROM /BIC/PZF31SALOFF
    INTO CORRESPONDING FIELDS OF TABLE it_tab4.
    Remove the line below , this is not required
    MODIFY it_tab4 FROM wa_tab4.

  • How do I get more target fields to apper in inspector for a mail merge?

    I am trying to do a mail merge from a Numbers spreadsheet to a Pages document. The spreadsheet has three columns: first name, last name, units. When I choose and add the merge fields to inspector the target fields 'first name' and 'units' appear but no target field entitled 'last name' appears. I can't figure it out.

    Which version of Pages?
    Peter

  • Forcing Creation of Target Field

    Hi,
    I want 2 force the creation of target field C in my Message Mapping.:
    So, if A exist and not empty, map A to C,
    if not, map B to C.
    The problem is, if i have a not existing field on left side, the right side wont be created. But I want C to be created in any way.
    Regards,
    Udo

    There must be a hundred threads that deal with this subject already.
    http://help.sap.com/saphelp_crm60/helpdata/en/45/ff8980cbb709eee10000000a1553f6/frameset.htm
    /people/gregor.wolf3/blog/2006/07/22/create-run-and-analyze-an-e-mail-campaign-with-a-survey-part-1
    /people/gregor.wolf3/blog/2006/05/11/advanced-campaign-automation-in-mysap-crm-40-teaser

  • XSLT for dynamic target field names

    Hello,
    I got a requiremt where I need to create target field names from input values.
    Input XML -
    <?xml version="1.0" encoding="UTF-8"?>
    <Createelement_MT>
    <Field Name="A">
    <Value>1</Value>
    </Field>
    <Field Name="B">
    <Value>1</Value>
    </Field>
    </Createelement_MT>
    Expected OutPut XML -
    <?xml version="1.0" encoding="UTF-8"?>
    <Createelement_MT>
    <Statement><TableName><table>XYZ</table>
    <access>
    <A> 1 </A>
    <B> 2 </B>
    </access>
    </Statement></TableName>
    </Createelement_MT>
    The value of the attribute 'Name' of field 'Field' should be the name of target field.
    XSLT:
    <?xml version="1.0"?>
    <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
    <xsl:output method="xml"/>
    <xsl:template match="@*|node()">
    <xsl:copy>
    <xsl:apply-templates select="@*|node()"/>
    </xsl:copy>
    </xsl:template>
    <xsl:template match="Createelement_MT">
    <xsl:element name="statement">
    <xsl:element name="TableName">
    <xsl:element name="table">ABC</xsl:element>
    <xsl:element name="access">
    <xsl:for-each select="Field">
    <xsl:element name="{@Name}">
    <xsl:value-of select="Value"></xsl:value-of></xsl:element></xsl:for-each>
    </xsl:element>
    </xsl:element>
    </xsl:element>
    </xsl:template>
    </xsl:stylesheet>
    Error:
    Error: at xsl:element on line 15 of file:///......: XTDE0820: Invalid element name. Invalid QName {}
    Please help me with the xslt code for this requirement.
    Thanks!

    Hi,
                Please try this code
    <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
         <xsl:output method="xml"/>
         <xsl:template match="/">
              <Createelement_MT>
                   <Statement>
                        <TableName>
                             <table>XYZ</table>
                        <access>
                             <xsl:for-each select="Createelement_MT/Field">
                                  <xsl:variable name="field" select="@Name"></xsl:variable>
                                  <xsl:element name="{$field}">
                                  <xsl:value-of select="Value"></xsl:value-of>
                                  </xsl:element>
                             </xsl:for-each>
                        </access>
                        </TableName>
                   </Statement>
              </Createelement_MT>
         </xsl:template>
    </xsl:stylesheet>
    input xml
    <?xml version="1.0" encoding="UTF-8" ?>
    - <Createelement_MT>
    - <Field Name="A">
      <Value>1</Value>
      </Field>
    - <Field Name="B">
      <Value>1</Value>
      </Field>
      </Createelement_MT>
    output xml
    <?xml version="1.0" encoding="UTF-8" ?>
    - <Createelement_MT>
    - <Statement>
    - <TableName>
      <table>XYZ</table>
    - <access>
      <A>1</A>
      <B>1</B>
      </access>
      </TableName>
      </Statement>
      </Createelement_MT>
    One small request, if you think your question has been answered,could you please kindly, if possible, close this thread.
    regards
    Anupam

  • In XI Mapping multiple fields mapping to single target field.

    Hi Friends,
    In XI Mapping multiple fields mapping to single target field.
    For example my requirement is :
    Source Fields:(This RFC BAPI Structure)
    Empno                0-1
    EmpName           0-1
    Address             0-1
    Taget Field is:
    Details               0-1
    The above three fields passed to the Details Field. Here i am using Concat function
    But i have one query on that on,Every field having "line Break" required.
    Can you please help me out above this requirement.
    Thanks in Advance,
    Sateesh N.

    If you want a line break between the three fields, then try
    passing a,b,c to the udf and in the udf you would have
    return a+"\n"+b+"\n"+c;

  • Creating target field based on input node

    Hi all,
      I'm facing a problem in creating the target node based on input node. See if the input node value is repeated I don't want to create the target field for the second occurrence.
    <?xml version="1.0" encoding="UTF-8"?>
    <ns0:MT_temp xmlns:ns0="urn:test">
       <row>
          <temp_id>1002</temp_id>
       </row>
       <row>
          <temp_id>1002</temp_id>
       </row>
    </ns0:MT_ItemEvent>
    In the above structure you can see the temp_id is repeated , I want to create only one target node. Plz help me to solve this.

    HI,
    Use the UDF and in that use Vector to create the result list with the values.
    use temp_id as imput and before that remove context
    after the UDF use the Splitbyvalue
    See the below code
    String () a;
    Vector prod = new Vector();
    for (i=0;i<a.length;i++){
    if(!prod.contains(a(i))) prod.add(a(i));
    Collections.sort(prod);
    for(i=0;i<prod.size();i++){
    result.addValue((String) prod.get(i));
    Regards
    Chilla

  • Message-Mapping: Use same RFC lookup for different target fields

    Hello,
    I need to apply an RFC Lookup which delivers a boolean flag back (true or false). This RFC lookup should be used for different target fields.
    Is there a way to execute the RFC lookup just once and then store the result in an internediate variable that I can use for all futher checks for different target fields?
    If this is not possible and I have to apply the RFC lookup for all necessary target fields is it then executed for each target field ? This is exactly what I want to avoid in order not to slow down performance.
    The input parameter (=source field value) would be the same.
    Thank you for your advice!

    Exactly.
    Here is a UDF example I have that you could adapt to your needs.
    Set
    public String setCounter(String a,String b,Container container){
    /* Store values in global datacontainer
    a: mapping value and return valueparameter
    b: name for stored value parameter
    GlobalContainer myGlobalContainer;
    myGlobalContainer = container.getGlobalContainer();
    myGlobalContainer.setParameter(b.toUpperCase(), a);
    return a;
    Get
    public String getCounter(String a,Container container){
       //write your code here
    GlobalContainer gc = container.getGlobalContainer();
    if (gc.getParameter(a) != null) {
      return String.valueOf(gc.getParameter(a));
    } else {
    return "1";

  • Mapping Issue. Parsing problem to target Fields based on condition.

    Hi All,
    File to Idoc scenario.
    My file looks like below.
    HD 89650 28/01/11 "Presciber tan"
    AF "disc-rsn"
    RK "007287001" A
    KE disc-code "007287"
    KE addr-num "001"
    DF fax-num ""
    DF in-out "I"
    DF phone-2 "23221"
    AF "drs"
    RK "007287" A
    KE dr-num "00221"
    KE addr-num "001"
    DF affil "OPSM"
    DF rec-stat "A"
    DF phone-2 "12444"
    AF "disc-rsn"
    RK "dr-addraddress-1 17287|1EN" A
    KE disc-code "008287"
    KE field-name "address-1"
    KE element " 1"
    DF in-out "I"
    DF phone-2 "1232"
    DF post-code "3109"
    DF provider-num "5349201J"
    DF rec-stat "A"
    T         24
    I need to capture and create target segments only for the values "AF "disc-rsn"".And pass all the relavant rows (RK,KE,DF...) which are under "AF "disc-rsn"" to the target fields.
    I'm struggling to parse the value to the output structure as RK,KE,DF will be present under anywhere like "AF drs", "AF disc-rsn" etc.
    I'm able to create the target segments (2 Zdisc segments as 2 "AF disc-rsn" present in the file), but unable to parse the field values to the target fields.
    Ex: DF phone-2 is present in 8th, 15th,22nd row. I need to pass only 8th and 22nd rows to the target fields.
    After content conversion, My Source XML looks like below.
    <?xml version="1.0" encoding="utf-8" ?>
    - <MT_DiscountDetails>
    - <HD>
      <KeyField>HD</KeyField>
      <HDRow>89650 28/01/11 "Presciber tan"</HDRow>
      </HD>
    - <AF>
      <KeyField>AF</KeyField>
      <AFRow>"disc-rsn"</AFRow>
      </AF>
    - <RK>
      <KeyField>RK</KeyField>
      <RKRow>"007287001" A</RKRow>
      </RK>
    - <KE>
      <KeyField>KE</KeyField>
      <KERow>disc-code "007287"</KERow>
      </KE>
    - <KE>
      <KeyField>KE</KeyField>
      <KERow>addr-num "001"</KERow>
      </KE>
    - <DF>
      <KeyField>DF</KeyField>
      <DFRow>fax-num ""</DFRow>
      </DF>
    - <DF>
      <KeyField>DF</KeyField>
      <DFRow>in-out "I"</DFRow>
      </DF>
    - <DF>
    Is there any way I can acheive my  mapping based on the above condition?? Kindly suggest me.
    Thank you for your time.
    Regards
    Deepthi

    Not required. Using Java function. Solved the issue.

  • Dynamically  filename is required in CC but not reuired in Target field

    HI,
    my requirement is to create filename dynamically(UDF) in Receiver communication channel but I dont want the name should be populated in the target field as target field is not provided by business.
    I received the below UDF from SDN
       String date = var1[0];
       String RFCL = var2[0] ;
       String FN = RFCL + date  ;
    AbstractTrace trace = container.getTrace();
    trace.addWarning("Test" + FN);
       String NameSpace = "http:/"+"/sap.com/xi/XI/Syatem/File";
    DynamicConfiguration conf =
    (DynamicConfiguration)container.getTransformationParameters().get(StreamTransformationConstants.DYNAMIC_CONFIGURATION);
    DynamicConfigurationKey key = DynamicConfigurationKey.create(NameSpace, "FileName" );
    conf.put(key,FN);
    //trace.addWarning("Test" + var2);
    //trace.addWarning("Test" + RFCL);
    result.addValue(var2);
    Can any one suggest me how I can achieve my requirement
    Thanks

    Hi
    Use the code
    public String getFileName(Container container) throws StreamTransformationException{
    DynamicConfiguration conf = (DynamicConfiguration) container.getTransformationParameters().get(StreamTransformationConstants.DYNAMIC_CONFIGURATION);
    //For getting filename
    DynamicConfigurationKey key = DynamicConfigurationKey.create("http://sap.com/xi/XI/System/File","FileName");
    // Retrieve the filename
    String FileName = conf.get(key);
    return FileName;}
    Map this to the root node. Do not forget to keep the Adapter Specific Message Attributes(ASMA) checked in the communication channels.
    Set Adapter Specific Message Attributes
    File Name.
    Regards
    Monika

  • File content conversion: Target Field is optional

    I am using FCC in receiver file adapter.
    My file is getting generated.
    In target structure one field is optional and hence target xml element doesnt have value. hence that field is not there in txt file. with this what happens next subsequent field gets shifted to my optional field place and then i get error field length is not correct.
    I want to put 2 spaces if that optional field length is 2 char and then there should be field separator(space) and the subsequent column.
    I am already giving fixedfieldlegnth of all the fields.
    Pl can anyone suggest how to do this.
    thanks,
    sharada

    Hi Sharada,
    Do your normal mapping to the target field that is optional.
    Use a If function before mapping the field.
    Check if the node is created in usual mapping, else map a constant with 2 spaces.
    DO something like this:
    Mapping ---------------->
                               equalsS ----> if
    constant(empty Value)--->
                      constant(2 spaces)--> then -> tgtField
                       Mapping -----------> else   
    regards,
    P.Venkat

Maybe you are looking for

  • IDOC to Web Service

    We currently have an IDOC in our R/3 System. Whether it is possible for us to convert the IDOC functionality into a WEB Service, if possible how to perform the Task. Thanks.

  • Suddenly stopped recognizing CD-Rs

    Recently I've tried to make a few copies of CDs with my MBP using iTunes The first CD copied just fine, no problems. And now, every time since that incident I've not been able to insert a CD-R and have my MBP Recognize it. I've transfered a lot of fi

  • Dynamic rendered component

    Expert, I am using jdev10g ADF BC and JSF page I have two pages, I have a table in first page, user can select one row to edit the record in second page. in the table in first page, there is a column called 'status'. there are total 10 status definit

  • HANA DB install other than SAP Provided appliance--testing restore

    Hi All, We want to test HANA DB backup and restore procedures.Can we install HANA DB on any other hardware or OS pther than SAP provided appliance? Regards Purna

  • Drawing with shift key

    So there is something that has been bugging me in photoshop and I'm hoping there is a way to turn it off or keep it from happening.  Oftentimes when using the brush tool (using a cintiq) I use the shift key to draw straight horizontal and vertical li