Usage of update-bapi and getdetail-bapi within one view

Hello,
i'm a student and i'm new to webdynpro and abap. Im trying to get data through a bapi into some screens and want to update some of these inputfields back through an update-bapi.
I get all the needed data by a getdetails-bapi  and can show the data within binded inputfields, but how could i get the infos about which field was changed and how could i implement an update through the update-bapi?
It is possible, that a view with two inputfileds gets the data through the getdetails-bapi and after a change in this fields there will be an update through a update-bapi, after pushing a button?
Could you give me an example code, or could you explane me a way for implementing these?
Thanks for your help!
John

Hi John,
changes made at Contexts are stored in a table WDR_CONTEXT_CHANGE_LIST. So you can retrieve the old and new values from the table.
Please follow the below steps :
1. Create a context node (Ex:Changes) with dict.str wdr_context_change.
2. Then create one subnode under Changes ex(details) with two attributes old_value and new_value with the type of string.
3. Then write the below code at any button action.
DATA: l_ref_componentcontroller TYPE REF TO ig_componentcontroller .
    DATA: l_changes                 TYPE        wdr_context_change_list,
          l_subnode                 type ref to if_wd_context_node,
          l_subnodedata             type if_USERLOG=>element_details.
    field-symbols: <change> type wdr_context_change,
                   <new>    type data,
                   <old>    type data.
    l_ref_componentcontroller =   wd_this->get_componentcontroller_ctr( ).
    l_changes = l_ref_componentcontroller->get_changes( ).
    data: l_node type ref to if_wd_context_node.
    l_node = wd_context->get_child_node( 'CHANGES' ).
    l_node->bind_table( l_changes ).
    loop at l_changes assigning <change>.
      if <change>-old_value is not initial and <change>-new_value is not initial.
        l_subnode = l_node->get_child_node( index = sy-tabix name = 'DETAILS' ).
        assign <change>-new_value->* to <new>.
        assign <change>-old_value->* to <old>.
*        l_subnodedata-new_value_string = cl_wdr_conversion_utils=>to_string( value = <new> ).
*        l_subnodedata-old_value_string = cl_wdr_conversion_utils=>to_string( value = <old> ).
         l_subnodedata-new_value_string = <new>.
        l_subnodedata-old_value_string = <old>.
*        l_subnodedata-new_value_string = 'AC'.
*        l_subnodedata-old_value_string = 'CD'.
        l_subnode->bind_structure( l_subnodedata ).
       endif.
      endloop.
So now your context has the changed records.
Thanks.

Similar Messages

  • Difference between Retail Bapi and Normal BAPi

    HI,
       could anyone of u let me know whats the difference between a normal bapi and RETAIL BAPI...
    I wanna use some RETAIL_BAPI in my Program..
    so please let me know if u guys have any idea??
    Is it a good idea to usea RETAIL BAPI? and alo please let me know its PROS and CONS.
    Thanks in ADVANCE
    TINA

    hi Tina,
    Check this out
    http://www.allsaplinks.com/bapi.html
    Regards,|
    Santosh

  • I just purchased a Canon 7D Mark II, new DellXPS and the Lightroom 5.2.  The Lighthouse is not openinging the 7DMark II but does open the older 7D that I imported.  I checked the Abode update page and do not see one for the 7D Mark II.  Please say it is t

    I just purchased a Canon 7D Mark II, new DellXPS and the Lightroom 5.2.  The Lighthouse is not openinging the 7DMark II but does open the older 7D that I imported.  I checked the Abode update page and do not see one for the 7D Mark II.  Please say it is there - if not when.  I am "on hold till its done.  Thanks.

    Update to the current release, which is Lightroom 5.7.1. You can do this from the Lightroom help menu and choosing updates.

  • I have just updated iTunes, and I am unable to view my iPhone but I can view my iPod?

    I have just updated iTunes, and I am now unable to view my iPhone but I can view my iPod?

    Hello there, HighLanderPete.
    The following Knowledge Base article provides a few steps for you to try with your iPhone:
    Turn your iOS device off and on (restart) and reset
    http://support.apple.com/kb/ht1430
    If the issue persists after both restart/reset, then this section of the iPhone Hardware Troubleshooting article should provide additional steps:
    iPhone: Hardware troubleshooting
    http://support.apple.com/kb/ts2802
    Not seen in iTunes / USB connection issues
    See these articles for help with troubleshooting this issue:
    iOS: Not recognized in iTunes for Windows
    iOS: Troubleshooting USB connections
    Thanks for reaching out to Apple Support Communities.
    Cheers,
    Pedro.

  • I would like to be able to see my work and personal calendars in one view although I'm having a lot of difficulties.

    I have :-
    An iPhone 4S set up with my personal calendar syncing to my iCloud account. All works fine.
    A blackberry 9320 from work which is set using enterprise and encrypted with my corporate email (outlook 2010) and calendar. All works fine
    I'd like to be able to see all my appointments/calendar all in one view so I can ensure I don't have meetings clash. This however seems impossible and I'd like some help.
    So far I have tried using the active sync function to pull my corporate calendar through to my iPhone, this was successful but my company has now after 3 months disabled the function (after a new sever install, and despite challenging it is still not likely to be turned back on,due to security concerns).
    I have tried entering a gmail calendar or iCloud calendar to my blackberry but again this is restricted by my company (to reduce data charges).
    I'm currently struggling with inviting each calendar to each event but is not always easy and I'm getting muddled.
    (Btw reverting to just my corporate calendar is not possible as I need to share my personal calendar with my wife, or I'd never see her).
    Does anyone have any advice, app, procedure to help me get both of these together.
    Thanks
    Simmshady

    What app are you using to access your email?  That is where I would start first.  Also check the webpage desktop version of your email homepage for further options in settings regarding personal options to include folders, views, and etc...

  • Pages '09 integrating straight and curly quotes within one file.

    I'm doing an edit in Pages and the document has a mix of straight and curly quotes. I can't seem to find a way to get them all the same. Find-and-replace turns some of the quotes backwards (as in 'em for them) Nothing in the archives addresses this.

    Look for patterns in search and replace.
    Search for a space + " to get the leading quote and " + space to get a trailing quote.
    Or get WordServices to fix all this.
    Peter

  • Dynamic create sequence and select nextval within one transaction

    The following procedure doesn't compile if sequence SEQ_ADR does not exist before compilation. I had to create the sequence manually before being able to compile this procedure. How can I avoid this manual generation?
    PROCEDURE A_270(proc_id number) IS
    seq_cnt number;
    curr_max number;
    BEGIN
    select count(*) into seq_cnt from user_sequences where sequence_name='SEQ_ADR';
    if seq_cnt > 0 then
    execute immediate 'drop sequence SEQ_ADR';
    end if;
    select max(id)+1 into curr_max from adress;
    execute immediate 'create sequence SEQ_ADR start with '||curr_max||'';
    insert into adress(ID,
    IMPORTED_DT
    select
    SEQ_ADR.nextval ID,
    sysdate IMPORTED_DT
    from new_adress;
    END;Edited by: totalnewby on Aug 23, 2012 6:41 AM

    totalnewby wrote:
    The following procedure doesn't compile if sequence SEQ_ADR does not exist before compilation. I had to create the sequence manually before being able to compile this procedure. How can I avoid this manual generation?
    PROCEDURE A_270(proc_id number) IS
    seq_cnt number;
    curr_max number;
    BEGIN
    select count(*) into seq_cnt from user_sequences where sequence_name='SEQ_ADR';
    if seq_cnt > 0 then
    execute immediate 'drop sequence SEQ_ADR';
    end if;
    select max(id)+1 into curr_max from adress;
    execute immediate 'create sequence SEQ_ADR start with '||curr_max||'';
    insert into adress(ID,
    IMPORTED_DT
    select
    SEQ_ADR.nextval ID,
    sysdate IMPORTED_DT
    from new_adress;
    END;Edited by: totalnewby on Aug 23, 2012 6:41 AMEssentially the same question asked by 'gogol' two days ago at creating and using sequence inside a proc
    It was a bad idea then. It is a bad idea now.

  • Difference betrween BAPI and RFC

    Hi All
              Can anyone tell me the difference between BAPI and RFC.
    I am unable to find it out ,except one,ie  BAPI is based on object oriented concept .
    please justify your answers with real scenerios.

    Remote Function Call:
    RFC is an SAP interface protocol. Based on CPI-C, it considerably simplifies the programming of communication processes between systems.
    RFCs enable you to call and execute predefined functions in a remote system - or even in the same system.
    RFCs manage the communication process, parameter transfer and error handling.
    http://help.sap.com/saphelp_47x200/helpdata/en/22/042860488911d189490000e829fbbd/frameset.htm.
    BAPI
    BAPI stands for Business API(Application Program Interface).
    A BAPI is remotely enabled function module
    ie it can be invoked from remote programs like standalone JAVA programs, web interface etc..
    You can make your function module remotely enabled in attributes of Function module but
    A BAPI are standard SAP function modules provided by SAP for remote access.
    Also they are part of Businees Objest Repository(BOR).
    BAPI are RFC enabled function modules. the difference between RFc and BAPI are business objects.
    You create business objects and those are then registered in your BOR (Business Object Repository)
    which can be accessed outside the SAP system by using some other applications (Non-SAP) such as VB or JAVA.
    In this case u only specify the business object and its method from external system
    in BAPI there is no direct system call. while RFC are direct system call.
    Some BAPIs provide basic functions and can be used for most SAP business object types.
    These BAPIs should be implemented the same for all business object types.
    Standardized BAPIs are easier to use and prevent users having to deal with a number of different BAPIs.
    Whenever possible, a standardized BAPI must be used in preference to an individual BAPI.
    Difference Between BAPI and RFC
    What is the main difference between BAPI and RFC and difference between BAPI and BDC?
    BAPI is used only when it is available for the particular transaction like Delivery Sales order. but BDC can be used for any
    transaction which have screen and fields.
    BAPI is directly updated the database instead BDC run through the screen flow.
    So BAPI can't handle all the flow logic checking and enhancement put by programmer to faciliate the user requirement.
    Difference between BAPI and BDC:
    BAPI is a higher end usage for tranfering the data from SAP to non-SAP and vice-versa. for ex: if we are using VB application,where in that we want to connect to SAP and retireve the data,and then change and update the data in SAP for that purpose we can use that.
    Apart from that, we can also use it for Uploading/Downloading the data from SAP to Non-SAP like BDC, provided we have an existing BAPI for that.
    BAPI function modules will also do all the checks required for data integrity like Transactions for BDC.
    There is one more advantage using BAPI instead of BDC. When we go for upgradation, there might be pozzibility to change the screen elements for transactions depending on the requirement. In that case,our BDC pgm may or may not work (depending on the screen changes they have made). Unless and until we prepare new BDC we cant use the old BDC pgm. But in BAPI, SAP promises that they are going to keep the old BAPI and for new functionality they will provide an upgraded BAPI. Until we write a new BAPI pgm, we can use the exisitng BAPI pgm.
    BAPI are RFC enabled function modules. the difference between RFc and BAPI are business objects. You create business objects and those are then registered in your BOR (Business Object Repository) which can be accessed outside the SAP system by using some other applications (Non-SAP) such as VB or JAVA.
    In this case you only specify the business object and its method from external system in BAPI there is no direct system call. while RFC are direct system call Some BAPIs provide basic functions and can be used for most SAP business object types. These BAPIs should be implemented the same for all business object types. Standardized BAPIs are easier to use and prevent users having to deal with a number of different BAPIs. Whenever possible, a standardized BAPI must be used in preference to an individual BAPI. It is not possible to connect SAP to Non-SAP systems to retrieve data using RFC alone. RFC can acces the SAP from outside only through BAPI and same is for vice versa access.
    RFC is the protocol used by SAP for remote communication, that is, for communications between remote (independent) systems. RFC is used for communications between two independent SAP systems, or for communications between an SAP system and a non-SAP system, such as an external application. It can also be used for communications between modules on the same system. Using the RFC interfaces you can extend the functionality of R/3 applications from an external program.
    BAPI-step by step
    http://www.sapgenie.com/abap/bapi/example.htm
    list of all bapis
    http://www.planetsap.com/LIST_ALL_BAPIs.htm
    for BAPI's
    http://www.sappoint.com/abap/bapiintro.pdf
    http://www.sappoint.com/abap/bapiprg.pdf
    http://www.sappoint.com/abap/bapiactx.pdf
    http://www.sappoint.com/abap/bapilst.pdf
    http://www.sappoint.com/abap/bapiexer.pdf
    http://service.sap.com/ale
    http://service.sap.com/bapi
    http://help.sap.com/printdocu/core/Print46c/en/data/pdf/BCMIDAPII/CABFAAPIINTRO.pdf
    http://help.sap.com/printdocu/core/Print46c/en/data/pdf/CABFABAPIREF/CABFABAPIPG.pdf
    http://help.sap.com/printdocu/core/Print46c/en/data/pdf/BCFESDE8/BCFESDE8.pdf
    http://www.planetsap.com/Bapi_main_page.htm
    http://www.topxml.com/sap/sap_idoc_xml.asp
    http://www.sapdevelopment.co.uk/
    http://www.sapdevelopment.co.uk/java/jco/bapi_jco.pdf
    also refer these threads
    What is the difference between RFC and BAPI?.
    whats difference between rfc and bapi?
    difference between rfc & bapi
    difference between RFC and BAPi
    Difference between BAPI and RFC?
    also chk this
    http://www.sap-img.com/abap/interview-question-on-bapi-rfc-abap-objects-tables.htm
    regards,
    srinivas
    <b>*reward for useful answers*</b>

  • Difference between BAPI and IDocs

    hello all
    what is difference between BAPI and IDocs

    Hi,
    BAPI
    One of the big plusses for BAPIs is that the interface and function are not supposed to change.  This is a big plus when you do upgrades or hot packs because the transaction can change (format, required inputs etc) which means you then need to update the call transaction.
    Some of the BAPIs are better documented and easier to use than others. You usually need to perform the BAPI that actually does the COMMIT after you call your BAPI.
    The Program coding for calling a BAPI is usually cleaner than setting up the screen flow etc for the Call Transaction.
    You don't need to worry about special data circumstances interrupting the normal data flow of the screens and causing errors because of that.
    BAPIs probably have better performance since they don't do the screen flow processing.
    In general if the BAPI exists for the transaction you want to perform and you can figure out how to use it the BAPI is probably the best way to go.
    BAPIs are a subset of the RFC-enabled function modules, especially designed as Application Programming Interface (API) to the SAP business object, or in other words: are function modules officially released by SAP to be called from external programs.
    IDOC
    IDocs are text encoded documents with a rigid structure that are used to exchange data between R/3 and a foreign system. Instead of calling a program in the destination system directly, the data is first packed into an IDoc and then sent to the receiving system, where it is analyzed and properly processed.   Therefore an IDoc data exchange is always an
    asynchronous process. The significant difference between simple RFC-calls and IDoc data exchange is the fact, that every action performed on IDocs are protocolled by R/3 and IDocs can be reprocessed if an error occurred in one of the message steps.
    While IDocs have to be understood as a data exchange protocol, EDI and ALE are typical use cases for IDocs. R/3 uses IDocs for both EDI and ALE to deliver data to the receiving system. ALE is basically the scheduling mechanism that defines when and between which partners and what kind of data will be exchanged on a regular or event triggered basis. Such a set-up is called an ALE-scenario.
    The philosophical difference between EDI and ALE can be pinned as follows: If we send data to an external partner, we generally speak of EDI, while ALE is a mechanism to reliable replicate data between trusting systems to store a redundant copy of the IDoc data.   The difference is made clear, when we think of a purchase order that is sent as an IDoc. If we send the purchase order to a supplier then the supplier will store the purchase order as a sales order. However, if we send the purchase order via ALE to another R/3 system, then the receiving system will store the purchase order also as a purchase order.
    Regards,
    Bhaskar

  • BAPI and BAPI Wrapper

    Hi All,
    I would like to know the difference between a BAPI and a BAPI Wrapper in detail.
    I would also like to know the procedure to create the various types of BAPI Wrappers- Getlist, GetDetail, Create, Modify and Delete.
    regards,
    Sunil

    Hi Sunil,
    Conceptually, BAPIs and BAPI wrappers are the same. BAPI wrappers, like BAPIs also must have a standard interface. THey are also RFC enabled FMs and like BAPIs they can comprise of the backend applciation business logic. They can also comprise of calls to Web services.
    You can easily create BAPI wrappers - GETLIST, GETDETAIL, CREATE, MODIFY and DELETE from the DOE workbench (SDOE_WB transaction) using the BAPI wrapper wizard, available under the Utilities menu.
    Once you create the BAPI wrappers, you can compare them with BAPIs and you will see that they are the same. Of course this is under the assumption that you are using MI 7.1.
    You do not need specific OO knowledge for creating BAPI Wrappers.
    Regards,
    Wenonah
    Edited by: Wenonah Jaques on May 9, 2008 7:44 AM

  • Network coneccting and getting disconnected after one or two minute

    I am using Vodafone carrier i have problems with network .
    My network is getting coneected and gets disconnected within one or two minutes. what should i do .
    please suggest some of the steps

    Check your computers time and date are correct, and updating to your location via Apple's servers.
    WiFi, Internet problems, possible solutions

  • Moving images within Grid View in LR3beta2

    Frustrated. In LR3Beta1 I could manually move and place images within Grid View or from the slide view at bottom for purposes of sorting "similar subject" content within a specified Text/Attribute naming. All of this was accomplished from the Parent folder, with no need for drilling down the Tree.
    Now, since installing LR3Beta2 I can no longer manually move (sort) within Grid View...unless I am in the lower most folder of the tree. This change is not practical since a tree folder may not match the relevance of my specified Text/Attributes.
    Can anyone tell me what I may be doing wrong, or is the ability to manually sort from Parent folder no longer an option?

    Here's an example of how I catalog/label/sort my images...
    Architectural images project - 3 locations of shootng, 4 areas of focus: Doors, Windows, Facades, Walls
    So, I may have 20 images w/both a door and a facade in the shot, 20 images with a window and a door, etc. I prefer to Keyword all of the images as Architectural, and then Keyword those applicable to Doors, Windows, Facades, Walls, etc.
    Now, suppose those all go into a folder labeled Architecture.
    The next week I get an assignment for Urban settings. It may include shops, churches, etc. However, within those, I decide to Keyword (where appropriate) Doors, Windows, Churches, Shops, etc. That project goes into a folder labeled Urban Settings.
    Now, let's say I have a request specifically for "Doors". Now, those Doors are spread across multiple folders at this point so I have no opportunity to manually sort all of the doors my similar content if they fall into multiple folders. Doesn't matter that I have pulled up Doors through Text, I still cannot sort them by similar style, shape, color, etc since they are spread across multiple folders.
    In the 1st beta, I could slice and dice a hundred ways to arrive at a final view and then...sort those so that they always appeared that way whenever I called them up again. Didn't matter that they were in multiple folders. That was extremely useful and...sweet.
    Any ideas?

  • Problem in creating and updating of  material by the use of bapi and bdc

    Hello All,
    I am using bapi (BAPI_MATERIAL_SAVEDATA ) and than bdc to create and update classification data of material.
    I am facing a problem.
    1) firstly I am creating material by the use of bapi and than after creation i want to update classification data for taht perticular material .
    2) To update classification data i am using bdc . while at the time of updating material through bdc system showing me error that material is currently locked by user (my login name ).
    Please suggest what to do.
    Tkank you
    With Regards
    Shantanu Modi

    When u update/create data it takes sometime to commit. So after using BAPI
    give 10 minutes wait in ur program before updating classification data.
    you can write like
    wait up to 20 seconds.
    and update the classification.

  • BAPI to update LIKP and LIPS

    Is there a BAPI to update LIKP and LIPS?
    Thanks

    Please close your post "Updating Address changes" if your question is answered in there.
    This is related to the same issue you entered there, and again I don't see how you can achieve that. You can only update these tables through the business object associated with them, which is the delivery. If you are not changing the delivery, but want to change the contents of these two tables, direct update is the only option.
    I, once again try to convince you not to do these updates directly to the tables. SAP is not database application like Oracle. This is a business application and the tables are updated through transactions. Please try to talk to your users about the problems with such updates and give them the alternative of reversing the document. Any reasonable business will understand the ramifications if they are presented with the alternatives.
    Please close the posts and reward as they are answered. You don't have to post different messages if they are related to the same problem.
    Thanks,
    Srinivas

  • BAPI or FM to update IBAN and email of a customer

    Hi,
         I am creating a RFC function module where I need to update the IBAN (International Bank Account Number) of a customer in XD02 or table KNBK.
    In the FM I am importing customer number, IBAN and email . The value of IBAN which I am giving as input must get updated against that customer(importing) in table KNBK or XD02.
    But my problem is I am not getting any FM that will update the IBAN against that particular customer in XD02.
    I have used few FM like  CONVERT_IBAN_2_BANK_ACCOUNT, CONVERT_BANK_ACCOUNT_2_IBAN, BAPI_IBAN_CHANGE and many more but none is updating the value with the new input value.
    Same problem is with email address when I am trying to update. No FM I have found to update email.
    So plz can u help me as how to update IBAN and EMAIL.
    Thanks
    PP

    First convert IBAN to account with CONVERT_IBAN_2_BANK_ACCOUNT
    Then update vendor with class VMD_EI_API method MAINTAIN_BAPI (*) or BDC.
    Regards,
    Raymond
    (*) Account and IBAN are in VENDORS ->CENTRAL_DATA -> BANKDETAILS -> DATA[X] parameter of the method.

Maybe you are looking for

  • How to unable my MacBook Pro from recognizing apple tv remote control

    When changing menues in my apple tv, the MacBook Pro recognizes and automatically activates front row. Don't want my MacBook Pro to recognize this remote control. How can I do this? Thanks

  • Flash not working in chrome

    I have a mac and use google chrome. Flash player stopped working one day because it said it was out of date. So I installed the updates but it keeps saying it's out of date. I've installed the latest version with automatic updates and manually severa

  • What is "other" on iphone sync? How to free up space?

    Upgraded to Lion, iOS5, and cloud. Now I can't sync iPhone. Half the space is "other". How can I free up the space?

  • Can Captivate be set to advance when only a certain key is pressed

    I am doing software training simulation.  I am trying to teach the user how to do a set of tasks.  In the software you must press certain key to accomplish certain steps so  I want to set captivate to advance to the next slide only when the correct k

  • Checkboxes with Intermediate Values ("Three State")

    Is it possible to create a checkbox in APEX, that has three values? Normally, a checkbox is either checked or unchecked, but you sometimes see them with an intermediate value (sort of looks grayed out), which indicates that the user hasn't chosen a v