Retaining data for Upload Sync BO

Hi all ,
If I am using an Upload type of Sync BO , the local data on client is sent to server after synchronization . But if I want to retain the data on client after  synchronization , what setting should done or methods called in Java classes ?
   I think I need to edit SyncInboxObserver class  and the class which has method to save the data locally and call getLocal()  setLocal() methods . But I am not sure .
Can anybody help in this ?
Thank You
Rucha Atre

hi rucha,
just a summary of steps:
1) modify your metadata (meRepMeta.xml) and copy the definition of your upload
SyncBo giving it a new name. e.g: you have BOXXXX syncbo & the corresponding
local SyncBo BOXXXX_LOCAL. <b>notice the attributes too.</b>
you need to include your modified meRepMeta.xml in the app and re-deploy it.
<SyncBO id="BOXXXX" version="1" type="upload" allowCreate="false" allowModify="false" allowDelete="false">
<TopStructure name="TOP">
<Field name="SYNC_KEY" type="N" length="10" decimalLength="0" signed="false" isKey="true" isIndex="true">
  <Input type="create">false</Input>
  <Input type="modify">false</Input>
  </Field>
   </TopStructure>
  </SyncBO>
<SyncBO id="BOXXXX_LOCAL" version="1" type="twoWay" allowCreate="true" allowModify="true" allowDelete="true" suppressUpload="true" suppressDownload="true">
<TopStructure name="TOP">
<Field name="SYNC_KEY" type="N" length="10" decimalLength="0" signed="false" isKey="true" isIndex="true">
  <Input type="create">false</Input>
  <Input type="modify">false</Input>
  </Field>
   </TopStructure>
  </SyncBO>
2) implement the MessageReplyObserver and listen for MessageReplyType.SYNC_BEGIN
here's a sample implementation for MessageReplyObserver. you can make use
of the SyncBoOutDeltaObserver as well however it is deprecated.
class BOXXXBackupObserver implements MessageReplyObserver{
  public MessageReplyType[] observeMessageReplyTypes(){
    return new MessageReplyType[]{MessageReplyType.SYNC_BEGIN};
  public void messageReplyReceived(MessageReply messageReply){
    if(MessageReplyType.SYNC_BEGIN == messageReply.getType()){
       SyncBoDataFacade df = SmartSyncRuntime.getInstance().getSyncBoDataFacade();
       SyncBoDescriptorFacade dc = SmartSyncRuntime.getInstance().getSyncBoDescriptorFacade();
       SyncBoDescriptor bdo= dc.getSyncBoDescriptor("BOXXX");
       SyncBoDescriptor bdl = dc.getSyncBoDescriptor("BOXXX_LOCAL");
       try {
         if(bdl!=null){
            SyncBoCollection sbc = df.getSyncBos(bdo);
            for(MeIterator sit = sbc.iterator(); sit.hasNext();){
              SyncBo bo = (SyncBo)sit.next();
              SyncBo bl = df.createEmptySyncBo(bdl);
              copyToLocal(bo,bl);
              df.insertSyncBo(bl);
       } catch (Exception e) {
        e.printStackTrace();
  private void copyToLocal(SyncBo orig, SyncBo local) throws Exception{
     SyncBoDescriptor bdl = local.getSyncBoDescriptor();
     copyFields(orig.getTopRow(),local.getTopRow());
     RowCollection[] rca = orig.getRows();
     for(int idx = 0; idx < rca.length; idx++){
       for(MeIterator rit = rca[idx].iterator(); rit.hasNext();){
         Row ro = (Row)rit.next();
         RowDescriptor rd = bdl.getRowDescriptor(ro.getRowDescriptor().getRowName());
         if(rd!=null){
           Row rl = local.createEmptyRow(rd);
           copyFields(ro,rl);
           local.insertRow(rl);
  private void copyFields(Row orig, Row local) throws ModificationNotAllowedException{
    Field[] o= orig.getFields();
    Field[] l = local.getFields();
    for(int idx=1;  idx<o.length;idx++){
      l[idx].modifyValue(o[idx].getValue());
3) register your observer somewhere in your app. could be in your starting jsp.
  SmartSyncRuntime.getInboxNotifier().registerMessageReplyObserver(new BOXXXBackupObserver());
4) modify your existing pages or add new ones for listing of your local syncbo.
that's it... just note that i never had tested this. im writing it just to give you an
idea and basis for your needs. (typo errors might present).
i didnot put any comments on the code as well. they're pretty self-explanatory i
guess... but if you have questions, just let me know.
regards
jo

Similar Messages

  • Function module to retain data for a given period.

    Hi all,
    This is my requirement:
    I have a selection screen on which a specific number of months is entered. Using the FM 'FI_PERIOD_DETERMINE' and passing the current date to it, I'll be fetching the current fiscal year and fiscal period. I got to retain the data maintained in a custom table for that many number of months as is specified on the selection screen starting backwards from the current fiscal period obtained after the FM call. And thereby deleting all the data maintained in the same table prior to it.
    Is there any function module to do so..... If not, kindly let me know the procedure to follow in order to obtain this requirements
    Regards,
    Jean Pearl D'souza

    Hi,
    Use FM HR_GB_PERIOD_DATES
    Payroll area is mandatry.

  • Program  RFEBKA00(T-Code-   ff.5 ) for upload data problems

    Hi Gurus,
    Program RFEBKA00(T-Code-   ff.5  ) for upload the bank statement data and passing the with parameters.
    When execute then :
    Getting warning message     u201CWRONG PARAMETER: FILE_NAMEu201D
       Getting error message       u201CFile in disk drive can not be openu201D.
    My text file data for upload:--
    0000 01INGBNL2AXXXX00001
    0000 01INGBNL2AXXXX00001
    940 00
    :20:INGEB
    :25:0656905271                        
    :28C:132 
    :60F:C100708EUR25470,35
    :61:100709C2885,40N078
    :86:AT673200000003743077 RLNWATWW F . W Kopieranstaltbetriebs- GmbH
    :86: RG: 1001853                                                  
    :61:100709C1296,41N078
    :86:0666065284 Drukkerij Wilco BV Postbus 1477 3800 BL AMERSFOORT F
    :86:ACT.NRS 1001851                                               
    :62F:C100709EUR29652,16
    :64:C100709EUR29652,16
    :65:C100710EUR29652,16
    :65:C100711EUR29652,16
    :65:C100712EUR29652,16
    :65:C100713EUR34204,84
    :65:C100714EUR34204,84
    :65:C100715EUR34204,84
    :86:D000000C000002D0,00C4181,81
    :86:CF (Netherlands) Holding Limited BV
    -XXX
    If you have any Idea for upload data in ff.5 TCode please help.
    Subasha Sahoo

    Hi Sunita,
    If your data is in a text file , simply save the file as tab delimited.
    Then use FM 'GUI_UPOAD' to upload the file data into internal table.
    Hope this helps.
    Regards,
    Abhijeet Kapgate

  • Is there a place I can see how much data I uploaded other server like the old version of Sync did?

    In the old version of Firefox Sync you can see what data was uploaded, with the next Sync I see nothing and when I got my account on the website Firefox, I don't see nothing just a sign in and change password screen. Would there be more there soon?

    Hi Kurbo,
    Please do leave feedback for the developers at input.mozilla.org, currently there is not a feature that shows how much data or what data is uploaded.
    However if you are handy at picking up apis there are some apis that can be read about [https://blog.mozilla.org/services/2014/05/08/firefox-accounts-sync-1-5-and-self-hosting/ here]

  • Cannot upload strapping data for small tank

    Currently we are facing the problem that we cannot upload strapping
    data which has same volume for different level.
    This kind of data is possible in our business case given that some
    tanks are sphere tanks and differ of heigh in MM will has same volume and diameter < 1.
    The result of calibration of our vendor(SGS) of the tank has same volume for different level even we measure in MM.
    Please advise solution / workaround solution which we can let this data be upload and retain correct calculation.
    Thank you : )

    Hi,
    You may also check your storage object type., your small tank's characteristics may not have been in line with what was configured for your storage object type.  For example, for the object storage type you may have maintined the maximum quantity of 10000 lts, while the max volume in you strapping table is only 7000 liters.
    zccr

  • What is the Tcodes for Uploading of data using BDC & CATT

    PP members:
    I was going through the <b>cutover activities</b> ,  and what I understood is  we transfer all the legacy system data into SAP before going live
    The data upload follows certain steps (depends on the organizational design load strategies)
    First we upload all the master data ( material master, BOM, W/C's & Routings)
    Then the transaction data ( Ideally speaking, there should no open orders i.e. WIP as on the day of cutoff )
    If the WIP (Work in Process) is unavoidable then the materials consumed shall be treated as <b>materials of the previous stage</b> and necessary adjustments shall be made after cutover day
    At this point, I could not able to understand what does the author mean <b>materials of the previous stage</b>
    Now comming to the uploading of data into SAP from legacy system, we use tools like LSMW, CATT & BDC
    Is it a must to use <b>only LSMW tool</b> to upload master data or any other upload tools are fine
    Lastly,. I am not sure about the Tcode of CATT & BDC
    Summary of the questions:
    1.What does the author mean  <b>material of previous stage</b>, for WIP materials during cutover activities
    2. Is it mandatory to use only LSMW tool for uploading for master data
    3. What are the Tcodes for upload tools CATT & BDC ?
    Thanks for your time
    Suren R

    Dear,
    1.What does the author mean material of previous stage, for WIP materials during cutover activities - as i understood, what is the stage of material..like it must have gone through 2 work centers and other 2 is left. i.e. you need to create Production order with only 2 operation as other 2 is already over. - usually it is done in such a way that we will create Production order and confirm till 2 operations and WIp is calculated so thatb FI will tally the books in SAP and lagacy.
    2. Is it mandatory to use only LSMW tool for uploading for master data - no you can use any tool as required and suits yr requirement
    3. What are the Tcodes for upload tools CATT & BDC- BDC through a prog in SE38. CATT through - SCEM.

  • Data Source to upload plan data for CO_OM_CCA_: CC: Costs and Allocations

    Hi Guru's,
    We have Data source that which upload Actual data for CCA (0CO_OM_CCA_1 - Cost Centers:cost and allocations).  Every time it is full upload before loading the data deletion of previous load request will be done.
    One more information required that i have checked in the BW cube for plan data it is available in the info cube for one cost center and rest of the costcenter i don't have the data now the users are requesting to upload the plan data for rest of cost centers.
    Now as per the business requirement the users are requesting to upload the plan data in to the same i am not sure whether it will pull the plan data with actuals in to BW cube. Is there any alternate with the same data source or else is there any specific data source for uploading Costs and Allocations plan data
    Please suggest me how can i go a head with this requirement.
    Thanks in Advance.
    Ganni

    You can use the same datasource to load plan/budget data to the cube for all the costcenters. And regarding the actuals, you can use 0CO_OM_CCA_9 datasource to load to actuals cube and create a multi on top of both plan and actuals cube for reporting purposes.

  • I bought iPhone 4 for my wife, didn't create a separate apple ID account for her at that time. How can I now create a new one for her, sync her phone to the same PC that I sync my iPhone with without loosing all of her data, contacts, etc. Please help!

    I bought iPhone 4 for my wife, didn't create a separate apple ID account for her at that time. How can I now create a new one for her, sync her phone to the same PC that I sync my iPhone with without loosing all of her data, contacts, etc. Please help!

    I bought iPhone 4 for my wife, didn't create a separate apple ID account for her at that time. How can I now create a new one for her, sync her phone to the same PC that I sync my iPhone with without loosing all of her data, contacts, etc. Please help!

  • Can i restrict apple mail client from downloading all emails...and allow it to pick a start date for gmail mail to sync? i am flooded with old emails, thousands on them ...eating hard drive space of my macbook pro and un necessary overhead

    can i restrict apple mail client from downloading all emails...and allow it to pick a start date for gmail mail to sync? i am flooded with old emails, thousands on them ...eating hard drive space of my macbook pro and un necessary overhead

    The genius bar technicians can check your MBP for possible hardware problems and specific software issues that you may have.  The diagnosis will be free.  Any extensive repairs will not be free.
    If you have minor software problems, you essentially will have to deal with them yourself.  Examine these two comprehensive documents for possible problem definition and solutions.  If you encounter problems that you are unable to cope with, start a new discussion and there will be persons willing to assist you in solving them.
    https://discussions.apple.com/docs/DOC-3521
    https://discussions.apple.com/docs/DOC-3353
    Ciao.

  • Upload transaction data for transactions like KSU2/KSU5,KB31N

    We are trying to upload transaction data for transactions like KSU2/KSU5,KB31N etc using batch data processing within LSMW. We are facing couple of problems as mentioned:<br />
    We have to upload data, which has a single header record with 200-300 line items record. How to define target structures to represent header & line items. Currently we are able to upload header data with 1-2 line items depending upon the recording. The present recording gives us option to load 1 line item per document. <br />
    Can excel be used instead of text file for uploading data in LSMW? <br />
    During processing of transaction, User clicks on button and checks a value. Based on this value the future course of action is determined. How can we do the BDC recording or do customization (Write a custom code) <br />
    If errors occur during upload of data, will the processing stop at that line item or will it ignore the error record and continue processing of the remaining data. <br />
    How can we write custom code to modify the data during BDC session and not before session? <br />
    Immediate pointers to this would be very useful. Let me know if more information is required.<br />
    <br />
    Thanks,<br />
    Mehfuze

    hi ali,
    as for your question related to excel upload via lsmw , please find the below links to be usefull
    [Upload of excel file in LSMW]
    [Upload excel by LSMW for FV60 ?]
    [Upload Excel file through LSMW]
    [How upload an excel file using an LSMW.]
    regards,
    koolspy.

  • What is the method used for upload of  data

    Hi All,
    What is the method used for upload of  Data from excel spread sheets to SAP HR.
    it is Bulk Data from many countries.LSMW or BDC Session Method?
    what are country specific infotypes used for PA and OM.
    can u plz give the list of country specific infotypes used for PA n OM Module.
    Thanks
    Archana

    Hi Archana,
    To Upload bulk data I think BDC is the best and effecient way.
    Regarding Infotypes we dont have any country specific Infotypes in OM & PA. In Payroll we do have according to country wise.
    I hope you had understood the point
    Regards
    Pavani
    Remainder: Points to be given on answers

  • Scheduling Problem for uploading Data from Flat file to SAP

    Hi guys,
    I am facing a weared problem in uploading some leave records in z table. The code is working fine if we run it through se38 after selecting the file from a shared location from production server which has all the access rights.
    This folder lies in the \usr folder of SAP Production.
    I have kept all the Flat files in the shared path "
    Tis-mum-iz-s1\migration\SAP-INT\leave\" ...
    To give u exact directory structure..
    Tis-mum-iz-s1 is the Server Name
    usr is the SAP System folder used for uploads and downloads
    usr |
    ...-> Migration |
                      -> SAP-INT |
                                 -> leave -> (Flat Files)
    Migration folder is shared with all rights.
    Obviously, we cannot give shared drive as the variant in the scheduler.
    So i use the system path i.e. \usr\sap\tmp\migration\sap-int\leave\ as the variant.
    All my other download programs are working fine with this path as a variant...
    But my this particular upload program does not work with this path....
    I am giving u my code...
    TATA INTERACTIVE SYSTEMS (A Division of TATA INDUSTRIES LIMITED)
    REPORT      :  ZMIGRATE_ZLEAVE
    DESCRIPTION :  To Upload the Leave data. (ZLEAVE)
    CREATED BY  :  Abhishek Bachhawat
    CREATED ON  :  01.09.2005
    CONSULTANT  :  ANAND
    REPORT  ZMIGRATE_ZLEAVE.
    TABLES: ZLEAVE.
    data: begin of wtab,
              MANDT(3),
              ZLVID(8),
              PERNR(8),
              ZSTDT(8),
              ZENDT(8),
              ZDAYS(4),
              AEDAT(8),
              ERDAT(8),
          end of wtab,
          itab like WTAB occurs 0 WITH HEADER LINE.
    data: temp like zleave occurs 0 WITH HEADER LINE.
    SELECTION-SCREEN BEGIN OF BLOCK file
                   WITH FRAME TITLE text-005.
    parameters: file like rlgrap-filename Obligatory.
    Concatenate File SY-DATUM '_Leave.txt' into File.
    SELECTION-SCREEN END OF BLOCK file.
    at SELECTION-SCREEN ON VALUE-REQUEST FOR file .
      CALL FUNCTION 'WS_FILENAME_GET'
        IMPORTING
          FILENAME = file.
      IF SY-SUBRC <> 0.
      ENDIF.
    start-of-selection.
      if file ne space.
        CALL FUNCTION 'WS_UPLOAD'
          EXPORTING
            FILENAME = FILE
            FILETYPE = 'DAT'
          TABLES
            DATA_TAB = ITAB.
      else.
        message e000(zps) with 'Specify a file'.
      endif.
      SORT ITAB BY ZLVID.
      LOOP AT ITAB.
        REFRESH TEMP.
        CLEAR TEMP.
        TEMP-MANDT = sy-mandt.
        TEMP-ERDAT = SY-DATUM.
        TEMP-ZLVID = ITAB-ZLVID.
        TEMP-PERNR = ITAB-PERNR.
        TEMP-ZSTDT = ITAB-ZSTDT.
        TEMP-ZENDT = ITAB-ZENDT.
        TEMP-ZDAYS = ITAB-ZDAYS.
        TEMP-AEDAT = ITAB-AEDAT.
        TEMP-ERDAT = ITAB-ERDAT.
        APPEND TEMP.
        SELECT SINGLE *
               FROM   ZLEAVE
               WHERE  ZLVID = TEMP-ZLVID
               AND    PERNR = TEMP-PERNR.
        IF SY-SUBRC = 0.
          UPDATE ZLEAVE SET ZSTDT = TEMP-ZSTDT
                            ZENDT = TEMP-ZENDT
                            ZDAYS = TEMP-ZDAYS
                            AEDAT = TEMP-AEDAT
                            ERDAT = TEMP-ERDAT
                 WHERE ZLVID = TEMP-ZLVID
                 AND   PERNR = TEMP-PERNR.
        ELSE.
          INSERT ZLEAVE FROM TABLE TEMP.
          COMMIT WORK.
        ENDIF.
      ENDLOOP.

    Hi,
    open dataset file for input in text mode.
    check sy-subrc = 0.
    while sy-subrc = 0.
      read dataset file into wa.
      if sy-subrc = 0.
      append wa to itab.
      else.
        exit.
      endif.
    endwhile.
    close dataset file.
    regards
    Siggi
    PS: check also the F1-help for open, read and close statements!

  • Best practice to upload data for Appraisals: BDC, LSMW or functional module

    Hi,
    I have heard that BDC and LSMW do not work for data upload in appraisals. Is it true?
    Can we use ECATT or SECATT to upload data in appraisals?
    I somewhere got the information that functional modules
    HRHAP_DOCUMENT_PREPARE
    HRHAP_DOC_UPDATE_BODY_AND_SAVE
    HRHAP_DOCUMENT_CREATE
    are used to upload the data for appraisals?
    Many of my earlier clients found it very hectic to create appraisal templates every year (PHAP_CREATE). They needed something automated for this.  I managed to suggest them manual upload or SECATT, but I am not sure if BDC/LSMW work for this.
    Can somebody throw some light on this?
    Best regards,
    Veera Sasidhar Jangam

    Hi,
    You need to write a code for same and use function modules available as those does direct updates to database.
    If client is not bothered about look and feel during dataload or do not care about display infotypes during data updates then use above method otherwise BDC needs to be written with screen control programming in it.
    Thanks,
    Ameet

  • While uploading data for employee as a vendor (with their loans and advance

    Hi,
    We are going for one company live. We are not taking HR module as of now.
    We are creating employee as a vendor for all employees with outstanding loans and advances.
    Now while uploading initial data for these employee (created as vendor), business wants personal loan outstanding balances employee as a vendor wise.
    Generally in case of normal vendor, we treat like
    Vendor A/C Dr
    to takeover creditors a/C  Cr
    while going for initial upload.
    In above case what should we do if we want outstanding balances (personal loan) while initial balance upload?
    Thanks,
    Taral Patel

    Hi,
    You can create a separate employee vendor for Advances paid to them with an assignment to a separate recon account titled as Advance to Employees. Later, you can upload the entries by Debiting the Employee Advance Vendor account and crediting Vendor Upload Account.
    Advances paid to employees (recon account) will represent in the TB as a separate line item forming an MIS.
    Regards
    Hari

  • Upload the data for sales order using BAPI

    hi experts,
    how to upload the data for sales order using BAPI.
    what is the FM?
    it would be much helpful if i have the sample code as i am very new to BAPI.
    thanks and Regards
    Shyam

    Hi  Shyam
    Its very useful for u
    BAPISDORDER_GETDETAILEDLIST
    BAPI_ACC_SALES_ORDER_CHECK
    BAPI_ACC_SALES_ORDER_POST
    BAPI_ACC_SALES_QUOTA_CHECK
    BAPI_ACC_SALES_QUOTA_POST
    Reward all the helpful answers..
    With Regards
    Navin Khedikar

Maybe you are looking for