How to copy the data of one node to another of the same context

hi experts,
      i need to copy the data of one node to the other node of the same context.
the source node is a model node ( i.e comming from <b>RFC</b> ) and the destination node is a value node which i have creted.
what i have done is.
i have read the source node using wizard
do.
elem_t_p0591 = node_t_p0591->get_element(
    index = sy-index ).
    IF ( elem_t_p0591 IS INITIAL ).
      EXIT.
    ENDIF.
elem_t_p0591->get_static_attributes(
      IMPORTING
        static_attributes = stru_t_p0591 ).
IF stru_t_p0591 IS NOT INITIAL.
      wa_p0591 = stru_t_p0591.
      APPEND wa_p0591 TO itab_p0591.
    ENDIF.
  ENDDO.
and then i am trying to read the destination node so the tha data i have got by above method can be binded to the destination node.
but when i am trying to get the child node it is giving me a dump saying that
<b>'Access via 'NULL' object reference not possible' </b> i understand this because when i debug my value node is becoming <b>initial</b>, and when i am trying to access the destination node using this <b>initial</b> node it will give me a dump,
but what is the work aroud for this.
Plz help.
Regards,
Santosh.

Hi Santosh,
               I tried replicating your behaviour in my system. This is what my context structure looks like:
Node_Test (c-> 0:n)
  Name(attribute)
  Node_Test2 (c-> 0:1)
     Name2(attribute)
Now when i try to access Node_Test2 then it returns me (initial) i.e. no reference and i believe the reason is that my parent node, Node_Test, is of type table( because of the cardinality) so I am expected to perform an operation on my sub node, Node_Test2, based on the node i have selected, or have specified via index .. 1 is taken by default, in Node_Test.. which in WDDOINIT is initial as i havent got access to my view yet.. so instead what you can do is bind data to your parent node, relevant data ofcourse, and then bind the recieved data to your child node i.e. Node3.
I am pasting the code here for your reference :
method WDDOINIT .
       DATA:
         node_test                           TYPE REF TO if_wd_context_node,
         elem_test                           TYPE REF TO if_wd_context_element,
         stru_test                           TYPE wd_this->element_test ,
         lt_table   LIKE TABLE OF stru_test,
         item_test_1                         LIKE stru_test-test_1.
     navigate from <CONTEXT> to <TEST> via lead selection
       node_test = wd_context->get_child_node( name = wd_this->wdctx_test ).
     @TODO handle not set lead selection
       IF ( node_test IS INITIAL ).
       ENDIF.
     get element via lead selection
       elem_test = node_test->get_element(  ).
     @TODO handle not set lead selection
       IF ( elem_test IS INITIAL ).
       ENDIF.
stru_test-test_1 = 'Anoop'.
APPEND stru_test to lt_table.
stru_test-test_1 = 'Avi'.
APPEND stru_test to lt_table.
stru_test-test_1 = 'Sid'.
APPEND stru_test to lt_table.
CALL METHOD node_test->bind_table
  EXPORTING
    new_items            = lt_table
   set_initial_elements = ABAP_TRUE
   index                =
      DATA:
        node_t2                             TYPE REF TO if_wd_context_node,
        elem_t2                             TYPE REF TO if_wd_context_element,
        stru_t2                             TYPE wd_this->element_t2 ,
        item_t2_1                           LIKE stru_t2-t2_1.
    navigate from <CONTEXT> to <TEST> via lead selection
     node_test = wd_context->get_child_node( name = wd_this->wdctx_test ).
    @TODO handle not set lead selection
      IF ( node_test IS INITIAL ).
      ENDIF.
<b>*     navigate from <TEST> to <T2> via lead selection
      node_t2 = node_test->get_child_node( name = wd_this->wdctx_t2 ).</b>
<b>*     alternative navigation via index
     Node_T2 = Node_Test->get_Child_Node(
       Name = `T2` Index = 1 ).</b>
    @TODO handle non existant child
    if ( Node_T2 is initial ).
    endif.
    get element via lead selection
      elem_t2 = node_t2->get_element(  ).
    get single attribute
      elem_t2->get_attribute(
        EXPORTING
          name =  `T2_1`
        IMPORTING
          value = item_t2_1 ).
endmethod.
I hope this helps.
Regards,
Anoop

Similar Messages

  • How to copy game data from one device to another

    I downloaded Injustice: Gods Among Us onto an iPhone 5 and I wanted to have all of my save data copied onto the iPhone 5. The same iCloud account is used on both devices and I recently backed up my iPhone 4. I want to know how to copy (if there is a way) my game data onto the iPhone 5. Is there a way I can just copy the game data and nothing else to the iPhone 5?

    There is no way to just copy the game data. Game data is saved as part of the backup, and the only way to transfer it is to restore the new phone from a backup of the old phone. Just remember, anything that you have done on the new phone since the backup of the old phone will be deleted.

  • How to copy form data from one pdf to another?

    Hi,
    I have created a pdf, added form data to it. Saved the form data as a fdf file - all good.
    I've updated the document and saved as a new pdf and would like to load the fdf data into it.
    So I select tools - forms - more forms options, and press the "import" function  - it goes grey and nothing happens.
    If I re-open the document the import function remains greyed out.
    I can find no way to import this data.... any ideas?
    I've tried going into form edit mode - adding a new field.  The import option is no longer greyed out so I click it and can select the fdf file hit open and ... the dialogue disappears and nothing happens.
    Is my Acrobat XI 11.0.07 badly installed - or what?

    You need to learn about the different types of PDFs. PDF/ A is an archive format that does not allow changes. PDF/X is used for graphics exchange
    For forms I would use only the PDF with a target version. Do not use the Optimizer feature.
    Forms always become larger due to the need to include the font for the various form fields. You might have to review the type fonts used by the form fields and one standard font as much a possible.
    It is possible to use the FDF file to move field values from one PDF to another.
    If you are trying to replace the underlying content and keep the form fields, use the replace pages.

  • How to copy the data from one database to another database without DB link

    Good Day,
    I want to copy the data from one database to another database with out DB link but the structure is same in both.
    Thanks
    Nihar

    You could use SQL*Plus' COPY command
    http://technology.amis.nl/blog/432/little-gold-nugget-sqlplus-copy-command
    http://download.oracle.com/docs/cd/B19306_01/server.102/b14357/apb.htm#sthref3702
    Edited by: Alex Nuijten on Sep 16, 2009 8:13 AM

  • How do I transfer the data from one iPad to another

    How do I transfer all of the data from one ipad to another one?

    The best way IMO is to sync each iPad with your computer. Having all your stuff backed up on a computer is a good idea anyway. Just read how many folks here are trying to recover lost stuff that could easily be copied back from either backup or iTunes on the computer.
    Sync both iPads to the computer. Transfer all photos to the same computer. Then sync again selecting which items you want on each iPad.

  • How to copy List item from one list to another using SPD workflow using HTTP call web service

    Hi,
    How to copy List item from one list to another using SPD workflow using HTTP call web service.
    Both the Lists are in different Web applications.
    Regards, Shreyas R S

    Hi Shreyas,
    From your post, it seems that you are using SharePoint 2013 workflow platform in SPD.
    If that is the case, we can use Call HTTP web service action to get the item data, but we cannot use Call HTTP web service to create a new item in the list in another web application with these data.
    As my test, we would get Unauthorized error when using Call HTTP web service action to create a new item in a list in another web application.
    So I recommend to achieve this goal programmatically.
    More references:
    https://msdn.microsoft.com/en-us/library/office/jj164022.aspx
    https://msdn.microsoft.com/en-us/library/office/dn292552.aspx?f=255&MSPPError=-2147217396
    Thanks,
    Victoria
    TechNet Community Support
    Please remember to mark the replies as answers if they help, and unmark the answers if they provide no help. If you have feedback for TechNet Support, contact
    [email protected]

  • How to copy table data from onde DB to another DB using clipboard

    HI,
    i copied table data from one DB to another DB, but it displays an error as "policy with check option violation" when inserting the table data.. so how to resolve the proble.. thanks in advance.

    DECLARE
    log_utl_dir VARCHAR2(100) :=('/apps/home/cmsftp/log/gaa');
    CURSOR tb_compy_cur is
    select tb.compy_acronym
    -- QC 158113 - added below
    ,tb.ivr_plan_num
    from tb_fc_compy tb,tb_xop_entitlements te
    where tb.grant_award_accept_flag = 'Y'
    and tb.ivr_plan_num = te.ivr_plan_num
    and te.entitle_name = 'GAA_RECONCILED'
    union all
    select compy_acronym
    -- QC 158113 - added below
    ,tb.ivr_plan_num
    from tb_fc_compy tb
    where tb.res_stock_flag = 'Y'
    --and   (tb.res_auto_lapse_flag = 2 OR
    --tb.res_auto_lapse_flag = 3)
    and exists (select entitle_name from tb_xop_entitlements te
    where tb.ivr_plan_num = te.ivr_plan_num
    and te.entitle_name = 'GAA_RES_FLAG'
    and te.optionee = 'Y'
    and te.psrep = 'Y'
    and te.sponsor = 'Y'
    and te.advisor = 'Y');
    v_xopgrantz_insertcount NUMBER := 0;
    -- QC 158113 - added below
    v_xopgrantz_accpt_count NUMBER := 0;
    v_user_id VARCHAR2(30);
    insert_file_id UTL_FILE.FILE_TYPE;
    insert_log_file varchar2(45) := 'xop_grantz_insertstats.log';
    BEGIN
    DBMS_OUTPUT.PUT_LINE('success1');
    insert_file_id := UTL_FILE.fopen(log_utl_dir,insert_log_file,'w');
    UTL_FILE.put_line(insert_file_id,'Starting the Process at '|| CURRENT_TIMESTAMP);
    UTL_FILE.put_line(insert_file_id,'INSERTING ROWS FOR Companies turned on for GAA_RECONCILE and GAA/RESSTOCK');
    for compy_rec in tb_compy_cur loop
    v_user_id := 'CMS'||compy_rec.compy_acronym||'_USER';
    ctx_set_session.set_user_session(v_user_id);
    dbms_output.put_line ('success2'||''|| v_user_id);
    INSERT into xop_grantz(grant_num,
    user_id,
    last_user_id,
    restrict_grant,
    child_symbol,
    parent_grant_flag,
    bulking_overide_flag,
    exerrestrict_code,
    rounding_method,
    exercisiable_dt,
    def_res_units_flag,
    opt_gain_def_elig_flag,
    opt_gain_deferred_flag,
    opt_gain_deferred_dt,
    opts_accepted,
    lst_updtby_usercd,
    accepted_type,
    GAA_eligible,
    GAA_LST_UPDTBY)
    select g.grant_num,
    v_user_id,
    'GRNTACCPT',
    'N',
    'N',
    (sel ect code
    from tb_xop_exerrestrict_codes
    where cash_allowed = 'Y'
    and cashlesshold_allowed = 'Y'
    and cashlesssell_allowed = 'Y'
    and stockswap_allowed = 'Y'
    and restricted_allowed = 'Y'
    and sar_allowed = 'Y'
    and cashmargin_allowed = 'Y'
    and cashpartial_allowed = 'Y'
    and sarsale_allowed = 'Y'),
    NULL,
    'N',
    'N',
    'N',
    NULL,
    NULL,
    NULL,
    'N',
    NULL,
    NULL
    from grantz g
    where not exists(select 1
    from xop_grantz xg
    where xg.grant_num = g.grant_num);
    v_xopgrantz_insertcount := SQL%ROWCOUNT;
    dbms_output.put_line ('1');
    -- QC158113 - Optimisation fix--starts
    DELETE FROM gt_xop_grant_accpt_type;
    INSERT INTO gt_xop_grant_accpt_type
    SELECT g.grant_num,e.ivr_plan_num,
    pk_xop_grntaccpt.fn_get_accpt_type (v_user_id,
    g.plan_num,
    g.grant_dt,
    g.opt_num,
    g.grant_cd,
    g.plan_type,
    'Y'
    FROM grantz g,tb_xop_entitlements e
    WHERE plan_type IN (2, 4, 5, 7, 8)
    and g.user_id = v_user_id
    and e.ivr_plan_num = compy_rec.ivr_plan_num
    and entitle_name = 'GAA_RES_FLAG' ;
    dbms_output.put_line ('success3');
    v_xopgrantz_accpt_count := SQL%ROWCOUNT;
    UTL_FILE.put_line(insert_file_id,'Inserted count in gt_xop_grant_acceptance '|| v_user_id||v_xopgrantz_accpt_count);
    -- QC158113 - Optimisation fix--ends
    COMMIT;
    UTL_FILE.put_line(insert_file_id,'Inserted count in XOP_GRANTZ for USER_ID '|| v_user_id||v_xopgrantz_insertcount);
    ctx_set_session.set_user_session('');
    dbms_output.put_line ('process completed');
    end loop;
    UTL_FILE.fclose(insert_file_id);
    EXCEPTION
    when others then
    rollback;
    dbms_output.put_line ('Code '||SQLCODE||':'||SQLERRM||' at '||v_user_id||' .pr_xopgrantz_insert');
    pr_xop_log_errors('Code '||SQLCODE||':'||SQLERRM||' at '||v_user_id||' .pr_xopgrantz_insert');
    pr_xop_log_errors('Code '||SQLCODE||':'||SQLERRM||'INSERTING into xop_grantz for ALL grants');
    END;
    i received this error when running the procedure also, so the table gt_xop_grant_accpt_type is not populated
    {Code -28115:ORA-28115: policy with check option violation at CMSFB_USER .pr_xopgrantz_insert}

  • How can I Move data from one column to another in my access table?

    I have two columns, one that stores current month’s data and one that stores last month’s data. Every month data from column 2 (this month’s data) needs to be moved to column 1 that holds last month’s data. I then null out column 2 so I can accumulates this month’s data.
    I understand how to drop a column or add a column, how do I transfer data from one column to another.
    Here is my trial code:
    <cfquery name="qQueryChangeColumnName" datasource="#dsn#">
      ALTER TABLE leaderboard
      UPDATE leaderboard SET  points2 = points3
    </cfquery>
    Unfortunately, I get the following error:
    Error Executing Database Query.
    [Macromedia][SequeLink JDBC Driver][ODBC Socket][Microsoft][ODBC Microsoft Access Driver] Syntax error in ALTER TABLE statement.
    How can I transfer my data with the alter table method?

    I looked up the Access SQL reference (which is probably a
    good place to start when having issues with Access SQL), and
    it suggests you probably need a WHERE clause in there.
    I agree the documentation is a good place to start. But you should not need a WHERE clause here.
    Too few parameters. Expected 1.
    If you run the SQL directly in Access, what are the results? At the very least, it should provide a more informative error message..

  • How can you transfer data from one ipod to another ?

    How can you transfer data from one ipod to another ipod ?

    The geniusbar told me what to do, I understood but there is still a problem for me >:/ It's not showing up though. Like "device."  Nothing is happening, and I tried as soon as I got home. Then after half an hour, then an hour, then 3 hours. My problem is that it's not showing up! It's stuck in recovery mode! There's still like 25% battery. So I have no idea why.

  • How do I transfer data from one iPhone to another?

    How do I transfer data from one iPhone to another?

    If your old device is an Apple using iOS 5 or later, and you have an iCloud account, you can transfer all your saved messages, email accounts, photos, notes, and other personal settings to your new iPhone.
    Here's how...
    Connect your old Apple device to WiFi and to a power source.
    Back it up to iCloud by going to Settings > iCloud > Storage & Backup and toggling iCloud Backup on. The time it takes to ba ckup depends on how much data you have and on the speed of your internet connection.
    iCloud backs up your device once a day. If it needs backing up before you transfer to your new iPhone 5, tap Back Up Now in Settings > iCloud > Storage & Backup. Do not start transferring before the backup is finished.
    Turn on your new iPhone and complete the setup by selecting your language and country, and choose whether to enable Location Services. When prompted, choose your WiFi network.
    When prompted to set up, choose Restore from iCloud Backup, tap Next, and enter your Apple ID and password.
    Select the backup of your old device and tap Restore. Wait until the device has finished restoring from the backup.
    When the restore process is complete, your iPhone will restart and be ready to use.
    Connect your iPhone 5 to iTunes to sync data not contained in the backup (such as music, videos, apps, and so on). You can choose the data that are synced by clicking the syncing tabs in iTunes.

  • How do i backup data from one iphone to another

    how do i backup data from one iphone to another?

    Back up your old phone, then restore your new one from the backup.  See http://support.apple.com/kb/HT2109.

  • How can I transport data from one client to another client?

    How can I transport data from one client to another client? 
    Regards,
    Subho

    hmmm, CTS = cutomizing transport?
    If you have a customizing table, there are still two possibilities.
    1. customize in DEV system and transport
    2. customize right there where you need it.
    this depends on how the maintainance view is built. If it is a simple customizing table and you get not asked for a TR when customizing a new record or changing an existing one, you hit possibility 2.

  • HOW TO TRANSFER HISTORICAL DATA FROM ONE ACCOUNT TO ANOTHER

    제품 : FIN_GL
    작성날짜 : 2006-05-29
    HOW TO TRANSFER HISTORICAL DATA FROM ONE ACCOUNT TO ANOTHER
    =============================================================
    PURPOSE
    특정 기간의 Balance 를 Account 별로 Transfer 하는 방법에 대해 알아 보도록 한다.
    Explanation
    GL 의 Mass Maintenance 기능을 이용하면 한 Account 에서 다른 Account 로 혹은 Multiple Account 에서 다른 하나의 Account 로 Balance 를 이동 시킬 수 있다.
    1. GL Responsibility 에서 Other> Mass Maintenance 를 선택한다.
    2. Move/Merge 작업을 위한 Request Name 과 Description을 입력한다.
    3. Request Type 으로 Move 혹은 Merge 를 선택한다.
    4. source-to-target account 를 위해 line number 를 입력한다.
    5. LOV 에서 source Account 를 선택하여 입력한다.
    모든 Account 는 enable 상태여야 한다.
    6. target account 역시 LOV에서 선택하여 입력한다.
    7. 지정한 작업을 수행 하기 전에 먼저 확인 작업을 할 수도 있다.
    8. 작업한 내용을 저장한다.
    9. Move/Merge request 를 수행한다.
    Example
    N/A
    Reference Documents
    Note. 146050.1 - How to Transfer Historical Data from One Account to Another

    Follow the directions here:
    http://support.apple.com/kb/HT2109

  • Best Way to port the data from one DB to another DB using Biztalk

    Hi,
    please suggest best way to move the data from one db to another DB using biztalk.
    Currently I am doing like that, for each transaction(getting from different source tables) through receive port, and do some mapping (some custom logic for data mapping), then insert to target normalized tables(multiple tables) and back to update the status
    of transaction in source table in sourceDB. It is processing one by one.
    How/best we we can do it using  bulk transfer and update the status. Since it has more than 10000 transaction per call.
    Thanks,
    Vinoth

    Hi Vinoth,
    For SQL Bulk inserts you can always use SQL Bulk Load
    adapter.
    http://www.biztalkgurus.com/biztalk_server/biztalk_blogs/b/biztalksyn/archive/2005/10/23/processing-a-large-flat-file-message-with-biztalk-and-the-sqlbulkinsert-adapter.aspx
    However, even though a SQL Bulk Load adapter can efficiently insert a large amount of data into SQL you are still stuck with the issues of transmitting the
    MessageBox database and the memory issues of dealing with really large messages.
    I would personally suggest you to use SSIS, as you have mentioned that records have to be processed in specific time of day as opposed to when the
    records are available.
    Please refer to this link to get more information about SSIS: http://msdn.microsoft.com/en-us/library/ms141026.aspx
    If you have any more questions related to SSIS, please ask it in
    SSIS 
    forum and you will get specific support.
    Rachit

  • How to copy OVD configuration from one machine to another?

    We have two machines with OVD servers on them. The configurations should be identical from one machine to the other. We suspect there is a problem with the configuration on one of them. We need to know how to copy OVD configuration from one machine to another.
    Can you tell us how to do that?

    well i have this in mind which may help you.
    You would need to have a public ip address to the machine you have consoled to and on internet.
    Download the tftp software from below link.
    http://tftpd32.jounin.net/
    This software does not only act as the tftp server but also you can select the interface of you ethernet card as tftp server ip address.
    For ex if you are connected to a console and have a wireless card which is connected to internet also you connect you eth lan card to the eth or fast eth of the router.
    you can select which ever interface you want to act as the tftp server.
    you will need to add ip addres for you lan card and also config the router port as same if needed.

Maybe you are looking for