How to extract a field from Binary object

Hi Guys,
I have a Binary object in custom aggregator and I would like to extract a field from the Binary object without de-serializing the Binary object. I know this can be done but figure out how.. Appreciate your help.
Have tried this
PofValue value = PofValueParser.parse(Binary, (PofContext) BinaryEntry.getSerializer());
PofValue child = value.getChild(1);
Object value = child1.getValue();
but no luck.
Thanks
D

Hi JK,
Thanks..  I have Binary  and tried
PofValue pofValue = PofValueParser.parse(binary, pofContext);
PofNavigator path = new SimplePofPath(1);
PofValue target = path.navigate(pofValue);
Object value = target != null ? target.getValue() : null;
but no luck.. I must be missing something.
Basically, am trying to do cache joins using aggregator and data affinity. Sample code snippet
@Override
  public Object aggregate(Set values) {
  List extractedValues = new ArrayList();
  for (Map.Entry entry : (Set<Map.Entry>)values) { 
   try {
    //these are BinaryEntries in TESTCACHE1
    BinaryEntry binaryEntry = (BinaryEntry)entry;  
    Long compId = (Long)binaryEntry.extract(new KeyExtractor("getComponentId")); 
    Long contId = (Long)binaryEntry.extract(new KeyExtractor("getPartyId"));
    BackingMapContext backingMapContext = binaryEntry.getContext().getBackingMapContext("TESTCACHE2");  
    ObservableMap backingMap = backingMapContext.getBackingMap();
    MapIndex mapIndex = backingMapContext.getIndexMap().get(new KeyExtractor("getComponentId"));   
    com.tangosol.util.InflatableSet keySet = (com.tangosol.util.InflatableSet) mapIndex.getIndexContents().get(compId);
    Binary object = null;
    for(Object key : keySet ) { 
     object = (Binary)backingMap.get(key);    
    PofNavigator  path  = new SimplePofPath(2);
    PofValue value = PofValueParser.parse(object,  (PofContext) binaryEntry.getSerializer());
    PofValue  target = path.navigate(value);  
    Object extractedValue = target != null ? target.getValue(): null;
    extractedValues.add(extractedValue);
   } catch (Throwable t) {
    log.error("Exception in aggregate method ", t);
    throw new RuntimeException("Exception in aggregate method", t);
  return extractedValues;

Similar Messages

  • How to Extract particular field from a string ( Mapping)

    how to exteract the particular field from the given string:
    ProcessEmp this element has a below string subfields.
    <ProcessEmp>&lt;?xml version="1.0" encoding="utf-8" standalone="no"?&gt;
    &lt;Employee PersonnelNumber="11111" FirstName="String" MiddleName="String" LastName="String" Department="String" Group="" SapUserID="10flname" EmailAddress="[email protected]" DefaultPassword="*" Status="Success" /&gt;</ProcessEmp>
    how to extract only PersonalNumber, department, EmailAddress from above ProcessEmp into 3 diff fields.
    Thanks
    dhanush.

    Hi,
    You are receiving XML message within a field. To access a particular field from that XML message, you could create a User Defined Function, as suggested by many already.
    You could write UDF using some of the String operation functions. This could include following:
    1. If you need to access field Employee PersonnelNumber, you could get last index of that within string using function lastIndexOf(String str). Pass string "Employee PersonnelNumber="" for this function.
    2. This function would return an index of rightmost occurance of this string.
    3. after this you could get the index of next occurance of ", as the value of field is within quotes. You could use function indexOf(int ch, int fromIndex) for getting the same. You would pass Character as " and index as the one received by previous function.
    4. Now you have index for starting and ending point of value string for desired field.
    5. After this you could use substring(int beginIndex, int endIndex) function by passing first and second index values to retrieve the needed string, which contains value of field.
    Hope this would be helful.
    Thanks,
    Bhavish
    Reward points if comments found helpful:-)

  • How to extract historical data from  business objects datamarts to Sap BW.

    Hi Guys,
    I had a scenario,where i need to extract or convert historical data which is resided in datamarts of businesobjects into SAP BI Infocubes.
    Can anyone have experienced or idea on this type of scenario.
    If you experience or idea plz guide me. If you know any documentation or Docs where i can follow to workout this task.please refer
    Thanks,
    Vikram B

    Hello Vikram,
    I recommend to post this query to the [Integration Kits - SAP|BusinessObjects Integration Kits; forum.
    This forum is dedicated to topics related to the BusinessObjects Integration Kit for SAP.
    It is monitored by qualified technicians and you will get a faster response there.
    Also, all SAP Kit queries remain in one place and thus can be easily searched in one place.
    Thanks a lot,
    Falk

  • AXIS2 - how to extract the response from OElement

    i implemented web services using the bottom to top method, i succed to
    deploy the webservice (embeded in axis.war) into tomcat.
    i generate also all stuf (skeleton, stub....), i have also a Junit test wich call the stub (this is the client of the webservice)
    when the execution finished, i have an OMElement, i would like to know how to extract the arraylist of Project object fromwithin the OMElement
    here is the code :
    public void testgetProjects() throws java.lang.Exception {          
              ProjectServiceImplStub stub = new ProjectServiceImplStub();
              // the default implementation should point to the right endpoint
              GetProjects getProjects24 = (GetProjects) getTestObject(GetProjects.class);
              getProjects24.setLogin("root");
              getProjects24.setSchema("autoprod");
              GetProjectsResponse projectsResponse = stub.getProjects(getProjects24);
              OMElement element = projectsResponse.get_return();
              //TODO extract list of Project object from element
              assertNotNull(projectsResponse);
         }thank you for your help

    You have to separate columns using comma as shown above.Hmm, no, you don't have to. You can also import into Excel from a fixed field length file.
    Just think about CHAR field which data includes a coma. This would just mess the Excel doc. So in these cases, it's a bit more tricky if you want to use CSV... you have to enclose CHAR data into " or '
    Regards,
    Yoann.

  • How to get Date Format from Local Object.

    Hi All,
    I am new to Web Channel.
    I need to know Date format From date of locale.
    suppose there is a date "01/25/2010" date in date field I want to get string "mm/dd/yyyy". Actually I have to pass date format to backend when I call RFC. 
    Is there any way to get Date format from "Locale" object. I should get date format for local object
    I get local object from "UserSessionData" object but how to get Date format from it.
    I am not looking for Date value. I am looking for current local date format ("mm/dd/yyyy or dd/mm/yyyy or mon/dd/yyyy) whatever local date format.  I could not find example which show how to get date format from "Locale" object.
    Any help will be appreciated with rewards.
    Regards.
    Web Channel

    Hi,
    You can get it from "User" or "Shop" business object.
    Try to get User or Shop Business Object as shown below.
    BusinessObjectManager bom = (BusinessObjectManager) userSessionData.getBOM(BusinessObjectManager.ISACORE_BOM);
    User user = bom.getUser();
    char decimalNotation = user.getDecimalPointFormat().getGroupingSeparator();
    If you are seeing "1,234.00" then above code will return "."
    I hope this information help you to resolve your issue.
    eCommerce Developer.

  • How to get Required field from R/3 to  load in Bw.

    To get a perticular value from R/3 to BW . in r/3 side I need to go to first table equi from there i pick equipmentno on the basis of this number i need to go to objnr from objnr i need to pick up objnr number and i have to see this number's value in table AUSP. like this same scenario i am facing in master as well as transaction tables , how i should fetch these values and load to BW .
    In standard datasources if i want to add the field value of which is derived by the value in two more tables then how do i Enhance the datasource.
    Can any one give clue to resolve It.

    Hi Srinivas,
       If you want to enhance any data source, by appending any field from any table.. basic rules are
    1. All the key fields in that perticular table should be available in your data source.
    2. Similar for more fields from different tables.
       Or if you want to extract more fields from different tables try to create a View on these table and go for generic extraction(create data source on this View). Choose which one if best option for your requirement.
    Hope it Helps
    Srini

  • How  to Extract sales document from r/3 ?

    hi,
          How to extract sales data from SAP R/3 considering all fields of data in different tables?
    Thanks & regards,
    Gopi.

    Hi Gopi,
    It depends what data you need to extract but most of the data would be available in following tables :
    Sales
    VBAK - Header
    VBAP - Item
    VBPA - Sales Document Partner
    Shipment
    VTTK - Shipment Header
    VTTP - Shipment Item
    Delivery
    LIKP - Delivery Header
    LIPS - Delivery item
    Customer
    KNA1 - Customer Master
    KNB1 - Customer Master (Company Code)
    Cheers,
    Vikram
    Pls reward for helpful replies!!

  • How to extract channels names from PhotoShop-written TIFFs?

    Hi,
    Does anybody know how to extract channel names from PhotoShop-written TIFFs? (I'm really asking about spot color channel names, as basic channel names, such as "Red," "Green," "Blue" or "Cyan," "Magenta," "Yellow," and "Black" can obviously be derived from the color space tag.)
    There's some XMP data in those TIFFs, but manual inspection does not seem to reveal channel names. So, this may not be an XMP question, after all. There's also a larger (for metadata) data block associated with a private (Adobe) tag, which could contain the information. It's binary, though, and I wouldn't know how to crack it open.
    The data must be present somewhere in the file, as PhotoShop will show the channel names on re-open of the TIFF.
    There's a TIFF/IT TIFFTAG_INKNAMES tag, which PhotoShop doesn't utilize.
    Any pointers greatly appreciated.
    Thanks,
    Oliver

    Solution is to speak to Adobe directly and receive confidential info.

  • How to extract Inventory data from SAP R/3  system

    Hi friends How to extract Inventory data from SAP R/3  system? What are report we may expect from the Inventory?

    Hi,
    Inventory management
    https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/com.sap.km.cm.docs/documents/a1-8-4/how%20to%20handle%20inventory%20management%20scenarios.pdf
    How to Handle Inventory Management Scenarios in BW (NW2004)
    https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/f83be790-0201-0010-4fb0-98bd7c01e328
    Loading of Cube
    •• ref.to page 18 in "Upgrade and Migration Aspects for BI in SAP NetWeaver 2004s" paper
    http://www.sapfinug.fi/downloads/2007/bi02/BI_upgrade_migration.pdf
    Non-Cumulative Values / Stock Handling
    https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/93ed1695-0501-0010-b7a9-d4cc4ef26d31
    Non-Cumulatives
    http://help.sap.com/saphelp_nw2004s/helpdata/en/8f/da1640dc88e769e10000000a155106/frameset.htm
    http://help.sap.com/saphelp_nw2004s/helpdata/en/80/1a62ebe07211d2acb80000e829fbfe/frameset.htm
    http://help.sap.com/saphelp_nw2004s/helpdata/en/80/1a62f8e07211d2acb80000e829fbfe/frameset.htm
    Here you will find all the Inventory Management BI Contents:
    http://help.sap.com/saphelp_nw70/helpdata/en/fb/64073c52619459e10000000a114084/frameset.htm
    2LIS_03_BX- Initial Stock/Material stock
    2LIS_03_BF - Material movements
    2LIS_03_UM - Revaluations/Find the price of the stock
    The first DataSource (2LIS_03_BX) is used to extract an opening stock balance on a
    detailed level (material, plant, storage location and so on). At this moment, the opening
    stock is the operative stock in the source system. "At this moment" is the point in time at
    which the statistical setup ran for DataSource 2LIS_03_BX. (This is because no
    documents are to be posted during this run and so the stock does not change during this
    run, as we will see below). It is not possible to choose a key date freely.
    The second DataSource (2LIS_03_BF) is used to extract the material movements into
    the BW system. This DataSource provides the data as material documents (MCMSEG
    structure).
    The third of the above DataSources (2LIS_03_UM) contains data from valuated
    revaluations in Financial Accounting (document BSEG). This data is required to update
    valuated stock changes for the calculated stock balance in the BW. This information is
    not required in many situations as it is often only the quantities that are of importance.
    This DataSource only describes financial accounting processes, not logistical ones. In
    other words, only the stock value is changed here, no changes are made to the
    quantities. Everything that is subsequently mentioned here about the upload sequence
    and compression regarding DataSource 2LIS_03_BF also applies to this DataSource.
    This means a detailed description is not required for the revaluation DataSource.
    http://help.sap.com/saphelp_bw32/helpdata/en/05/c69480c357354a8846cc61f7b6e085/content.htm
    http://help.sap.com/saphelp_bw33/helpdata/en/ed/16c29a27db6e4d81a015be8673eb80/content.htm
    These are the standard data sources used for Inventory extraction.
    Hope this helps.
    Thanks,
    JituK

  • How to extract PS data from sap r/3 to bw

    Hi,
    How to extract PS data from sap r/3 to bw
    PS data like plans,budget,accurals&commitmnets
    can any one help me regarding this..
    Thanks in Advance,
    Shankar.

    HI sankar,
    you can refer the belkow link to find the details on the relevant extractors and infoproviders
    http://help.sap.com/erp2005_ehp_04/helpdata/EN/17/416d030524064cb2b8d58ffb306f3a/frameset.htm
    Regards,
    Sathya

  • How to hide a field from table maintenance view?

    Hi,
    How to hide a field from table maintenance view? 
    The field is used for data created date. I need to hide it from display.
    Thanks

    Chk this link.
    http://help.sap.com/saphelp_nw04/helpdata/en/66/33f52010dd11d6999300508b5d5211/frameset.htm
    Maintenance Attributes
    You can assign a maintenance attribute P to individual fields in the maintenance view definition in the Dictionary (SE11). It can be  H (hidden)
    H (hidden)
    A field flagged H is not displayed on the screen. This field must also be filled in the background by a routine at an event.
    The system writes R and H fields to the database like all other fields when a new data record is saved.

  • How to load date field from a remote Oracle DB with DB Connect

    Hi,
    Does any one have experience extracting Date field from a remote Oracle database through DB Connect to BW?  I am experiencing data format issue.  The extracted data shows '04-Oct-0' for '10/4/05'.  It works fine if I create a view in Oracle database to preformat the data to '20051004'.  But, I am not allowed to create view in Remote DB.
    Any suggestion is very appreciated.
    Regards,
    Frank

    You have to change it to a varchar2 field. YYYYMMDD. I do not know of any other option.

  • How to Extract the data from R/3 Genric extractor to BW ?

    How to Extract the data from R/3 Genric extractor to BW ?

    hi,
    step by step procedure for generic extraction delta
    https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/84bf4d68-0601-0010-13b5-b062adbb3e33
    Refer:
    /people/siegfried.szameitat/blog/2005/09/29/generic-extraction-via-function-module
    http://help.sap.com/saphelp_nw04/helpdata/en/3f/548c9ec754ee4d90188a4f108e0121/content.htm
    https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/docs/library/uuid/84bf4d68-0601-0010-13b5-b062adbb3e33
    Generic Extraction via Function Module
    /people/siegfried.szameitat/blog/2005/09/29/generic-extraction-via-function-module
    Extractions in BI
    https://www.sdn.sap.com/irj/sdn/wiki
    New to Materials Management / Warehouse Management?
    https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/docs/library/uuid/1b439590-0201-0010-ea8e-cba686f21f06
    Ramesh

  • How to extract specific line from a string

    Hi guys.
    I?m starting to work with java...
    i have the following data inside a string variable:
    0 rows inserted.
    0 rows updated.
    0 rows ignored.
    98 rows marked as deleted.
    0 rows have no country.
    3345 rows have no geo.
    0 rows are invalid.
    what i want to do i to extract the number of rows marked as delete.
    I think that i figured out how to extract the number from this line :"98 rows marked as deleted."
    but how do i get to that line?
    I hope you can Help me. Thanks.

    the string is the result from a Function... this function gets the info from a store procedure...
                   rta = "Results for " + dh.getSource() + " source:\n" +
    dh.getInsertedCount() + " rows inserted.\n" +
    dh.getUpdatedCount() + " rows updated.\n" +
    dh.getIgnoredCount() + " rows ignored.\n" +
                   dh.getDeletedCount() + " rows marked as deleted.\n" +
                   dh.getNoCtryCnt() + " rows have no country.\n" +
                   dh.getNoGeoCnt() + " rows have no geo.\n" +
                   dh.getInvalidCnt() + " rows are invalid.\n";
    i can?t change this function...
    so i need to work with the returned value...
    i what thinking to use the following method to extract te number...
    private int GetNumericValue(string sVal)
    int iFirst, iCharVal, iEnd;
    int iMult = 1, iRet = 0;
    char[] aNumbers = "1234567890".ToCharArray();
    iFirst = sVal.IndexOfAny(aNumbers);
    iEnd = sVal.LastIndexOfAny(aNumbers);
    if (iEnd < 0)
    return 0;
    string subStr = sVal.Substring(iFirst, iEnd - iFirst + 1);
    iEnd = subStr.Length - 1;
    while (subStr.Length > 0)
    iCharVal = int.Parse(subStr[subStr.Length-1].ToString());
    iRet += iMult * iCharVal;
    iMult *= 10;
    if (iEnd <= 0)
    break;
    subStr = subStr.Substring(0, subStr.Length - 1);
    iEnd = subStr.LastIndexOfAny(aNumbers);
    subStr = sVal.Substring(iFirst, iEnd + 1);
    return iRet;
    but i still need the 4rd line to extract the number

  • How to extract rpt file from .b1px file in SAP B1

    How to extract rpt file from .b1px file in SAP B1

    Hi Trupti,
    You will not be able to export .b1px file without importing in SAP B1.
    Please import .b1px file in SAP B1 and then export .rpt file from SAP B1 one by one.
    Hope this helps
    Regards::::
    Atul Chakraborty

Maybe you are looking for

  • Arabic Language

    I recently purchased Xperia Z2... but i am having problem in changing the language to ARABIC as there is no arabic lanugage installed in the phone it seems... is there any way to install language pack... i can type in arabic but phone lanugage is not

  • G4 Mirror HD expansion help

    Hi. I'm trying to figure out how much internal HD space I can install on my MAC. Right now I have 2 - 60GB HDs internally and 3 external 200GB drives. I'd like to install a 500GB drive internally but can't find out if that is doable. Or maybe even la

  • How to create new MTA channels for redirecting mail.

    I have to forward a mail to faxserver.Faxserver has its own mail id on messaging server.When I send a mail to a user on my messaging server it should automatically be forwarded to faxserver user account.For that I need to make a new rule and channel.

  • When I try to connect to iCloud, say, the maximum number of free activations on the iphone

    when I try to connect to iCloud, say, the maximum number of free activations on the iphone.what should I do?

  • 'Runtime' help under XP

    All I want to be able to do is open up explorer to a specific directory and I can't work out the command. I can use; Runtime.getRuntime().exec("calc.exe");successfully for example or any other windows exe in any directory in the windows environment h