Update data in r/3 from webdynpro using bapi

Hi ,
i am new to webdynpro.
i want to update data say sales order in r/3 backend from webdynpro.
can i have some links for the same.
i have seen previous forums in following link, but couldn't open.do i need to register to have some extra rights.
/thread/12846 [original link is broken]
thanks in advance

Hi Satya
In order to update data in R/3 from web dynpro you need to use RFC or BAPI
The Adaptive Remote Function Call (Adaptive RFC) is a technology that enables the Web Dynpro application developer to use the business functions encapsulated in Business APIs (BAPIs) even after a structure modification, without having to provide the new data using a second back end or a new structure with subsequent regeneration of the proxies.
Procedure for Importing Adaptive RFC model is as follows
  1. Choose the context menu entry Create Model on the Models node of the relevant Web Dynpro component.
2. In the model wizard, choose Import Adaptive RFC Model followed by Next.
3. Make the required entries – for example, to specify where the generated RFC model instances and RFC metadata are to be stored.
4. In the next wizard window, you enter your user data for the SAP System that contains the BAPIs from which you want to generate the proxies. You use it to log on to the SAP System online.
To be able to log on to the SAP System, it must be entered in the logon group.
5.  Next select the BAPIs for which you want to create Java proxies in a generation process. Then choose Next to proceed to the next wizard window.
6.The import log provides information about the generated model classes, properties, and model relations. Choose Finish to start the generation process.
Now add this model in "Used Model" for your application
Now for graphic display you create view,for the progarm control create controller and used this model to retrieve & update data.
For more information about web dynpro for Java refer
http://help.sap.com/saphelp_nw2004s/helpdata/en/14/c897427f18d06ae10000000a155106/frameset.htm
For information about RFC & BAPI
http://help.sap.com/saphelp_nw2004s/helpdata/en/22/042860488911d189490000e829fbbd/frameset.htm
Regards
Gauri

Similar Messages

  • How to get the complete data from Webdynpro using a RFC

    hi guys,
    A form is created in the webdynpro, when that pdf form is called the user have to provide the key field ie the employee number in the form and then when he press the 'go' button a rfc is called and it gives all the details of the employee in the form. Then the user have to input some fields in the form and he have press the submit button. My problem is here, when the user is going to press the submit button that form will be converted to a stream (binary) of data and it is sent to one of the import parameter used in the RFC.
    I have created a RFC and created a import parameter of data type XSTRING, since i want to see what exactly R3 is receiving from web dynpro i am writing this contant in the sever as a text file. When i saw that text file i cant see the complete data.
    And when i searched in R3 the capacity of xstring is 1024 CHAR, so i dont know how to capture the entire data from webdynpro into my R3.
    I give the code what i worte please tell me am i missing anything in my code, or is there any data type which can hold more than 500kb of data which is coming from webdynpro.
    FUNCTION ZSEND_MAIL_ATTACHMENT.
    ""Local Interface:
    *"  IMPORTING
    *"     VALUE(OUT_PLACE_LEVEL) TYPE  XSTRING OPTIONAL
    *"     VALUE(BIN_DATA) TYPE  INDX_CLUST OPTIONAL
    *"  TABLES
    *"      IT_MESSAGE STRUCTURE  SOLISTI1
    Data Declaration
      DATA: gd_cnt TYPE i,
          gd_sent_all(1) TYPE c,
          gd_error TYPE sy-subrc,
          tab_lines LIKE sy-tabix.
    Structure Declaration
      DATA : BEGIN OF it_file OCCURS 0,
              row(255),
             END OF it_file.
      DATA : BEGIN OF i_split OCCURS 0,
      row(50),
      END OF i_split.
    Internal Table Declaration
      data : it_receivers like table of SOMLRECI1 with header line."occurs 0.
      DATA : objbin LIKE SOLISTI1 OCCURS 0 WITH HEADER LINE. "sOLIX
      DATA : it_packing_list LIKE sopcklsti1 OCCURS 0 WITH HEADER LINE.
      data : wa_receiver like table of SOMLRECI1 with header line.
      data : it_receiver like table of SOMLRECI1 with header line.
      data : v_bin_data like SOLISTI1 occurs 0 with header line.
      DATA : gd_doc_data LIKE sodocchgi1 OCCURS 0 WITH HEADER LINE.
    *data bin_data1 like table of solix with header line.
      REFRESH : objbin, it_packing_list, it_receivers, wa_receiver.
      CLEAR   : objbin, it_packing_list, wa_receiver, it_receivers.
      DATA V_SUBJECT(255) VALUE 'HI'.
      gd_doc_data-doc_size = ( tab_lines - 1 ) * 255 + STRLEN( it_message ).
      gd_doc_data-obj_langu = sy-langu.
      gd_doc_data-obj_name = 'SENDFILE'.
      gd_doc_data-obj_descr = v_subject.
      gd_doc_data-sensitivty = 'O'.
      APPEND GD_DOC_DATA.
    Appending The Internal Table it_packing_list
      it_packing_list-head_start = 1.
      it_packing_list-head_num = 0.
      it_packing_list-body_start = 1.
      it_packing_list-doc_type = 'RAW'.
      it_packing_list-body_num = tab_lines.
      APPEND it_packing_list.
    *CALL FUNCTION 'GUI_UPLOAD'
    *EXPORTING
    *filename = V_FILE_PATH
    *filetype = 'BIN'
    *TABLES
    *data_tab = BIN_DATA.
      move bin_data to v_bin_data.
      append v_bin_data.
    *move soli to bin_data.
      LOOP AT V_BIN_DATA into objbin.
    MOVE v_bin_data TO objbin-line.
        APPEND objbin.
      ENDLOOP.
      CLEAR it_packing_list.
      DESCRIBE TABLE objbin LINES tab_lines.
      it_packing_list-transf_bin = 'X'.
      it_packing_list-head_start = 1.
      it_packing_list-head_num = 1.
      it_packing_list-body_start = 1.
      it_packing_list-doc_type = 'PDF'.
      it_packing_list-body_num = tab_lines.
      it_packing_list-doc_size = tab_lines * 255.
      APPEND it_packing_list.
    data file(255) value '/tmp/bali.txt'.
    *Appending The Internal Table it_receivers
    close dataset '/tmp/bali.txt'.
    open dataset '/tmp/bali.txt' for output in text mode encoding default.
    if sy-subrc = 0.
    loop at objbin.
    transfer objbin to '/tmp/bali.txt'.
    endloop.
    else.
    write 'hi'.
    close dataset '/tmp/bali.txt'.
    endif.
      it_receiver-receiver = '[email protected]'.
      it_receiver-rec_type = 'U'.
      it_receiver-com_type = 'INT'.
    APPEND wa_receiver.
    move wa_receiver[] to it_receiver[].
      append it_receiver.
    *Move wa_receiver[] to it_receivers[].
    Clear it_receivers.
    if i_OUT_PLACE_LEVEL NE 0.
    loop at it_receivers into wa_receiver.
       loop at it_receivers into wa_receiver.
    **Function Module To Post The Message To Externa Mail
         CALL FUNCTION 'SO_NEW_DOCUMENT_ATT_SEND_API1'
           EXPORTING
             document_data              = gd_doc_data
             put_in_outbox              = 'X'
             commit_work                = 'X'
           TABLES
             packing_list               = it_packing_list
             CONTENTS_TXT               = objbin
             receivers                  = it_receivers
           EXCEPTIONS
             too_many_receivers         = 1
             document_not_sent          = 2
             document_type_not_exist    = 3
             operation_no_authorization = 4
             parameter_error            = 5
             x_error                    = 6
             enqueue_error              = 7
             OTHERS                     = 8.
         clear wa_receiver.
    ENDFUNCTION.

    You have to convert your long string to a table of shorter strings.
    There may be other ways, but one possibility is to use a loop to process you string.
    while (there is something left)
       put the next e.g. 1024 characters in a new row of your table
    endwhile
    If you need to reconstruct your string from the table, don't use simple concatenation since it will remove blanks at the end of lines. Believe me (from experience) sooner or later this will happen.
    Instead you need to either set the subsections of your long string, or insert from the end of your table and keep shifting the contents (probably less efficient) right

  • Code To Update the Table in ECC from Webdynpro

    Hi All,
    I want to know, the table is dispalyed in the webdynpro browser when we calls the Adaptive RFC Model.
    after i want to add one more row in the webdynpro and just clicking on add button the row will be updated in the ECC server(backend) for that how can i write the coding,  regarding this issue can you please help me.
    ThanX All,

    Hi Sriram,
              Assuming you have a table filled with records by adding one by one, If you want to update a table in SAP ECC, follow these steps..   i think already you are triggering the action for the button in view(for table updation) to method in controller or created a custom controller and mapped the model node.
    1.  Initialize the main model node and bind the model node with the intialised object like
         Zbapi_MainModelNode_Input input = new Zbapi_MainModelNode_Input();
                           wdContext.nodeZbapi_MainModelNode_Input ().bind(input);     
    2.  Now loop the table node and set the values with corresponding class in the generated model (from webdynpro explorer) and initialize like
            IPrivateControllerName.ITableElement myTab = null;     
           for ( int i = 0; i < wdContext.nodeTable().size();i++)
                         myTab = this.wdContext.nodeTable().getTableElementAt(i);
         Bapi_structname name = new Bapi_structname();     
                        name.setFieldName1(myTab.getFieldName1);
                        name.setFieldName2(myTab.getFieldName2);
                        input.addT_Bapi_(name);
    Finally execute the BAPI..
       wdContext.currentZbapi_MainModelNode_Input tElement().modelObject().execute();
    Hope this solves your issue - Update the Table in ECC from Webdynpro.
    Regards,
    Manjunath
    Edited by: Manjunath Subramani on Nov 20, 2009 4:26 PM
    Edited by: Manjunath Subramani on Nov 20, 2009 4:27 PM

  • My iPhone 4s was stolen this weekend and I did the Remote Lock.  What exactly does that do?  Also, if i do the Remote Wipe will that erase all of my data and impede anyone from ever using the phone?

    My iPhone 4s was stolen this weekend and I did the Remote Lock.  What exactly does that do?  Also, if i do the Remote Wipe will that erase all of my data and impede anyone from ever using the phone?

    The remote lock locks the iphone with a passcode that you set. By remote wiping the device it will simply restore it and clear it of all its data, but by doing this it will prevent you tracking it and communicating with it (e.g. remote locking it) in the future

  • HT2693 How to activate cellular data on iphone5 bought from japan using globe nano prepaid sim here in the philippines.

    How to activate cellular data on iphone5 bought from japan using globe nano prepaid sim here in the philippines.

    joanmacedonio wrote:
    How to activate cellular data on iphone5 bought from japan using globe nano prepaid sim here in the philippines.
    You cannot. No Japanese carrier offers unlocking. You'll need to sell the phone and buy one you can actually use outside of Japan.

  • How to update date in a table from another database

    Hello,
    I am trying to code a way to Update my Testing database from another database. In the coding below the database that has the updated data ends in Restore.
    Use ClientDB_MASTER_Restore
    Truncate Table ClientDB_MASTER_Testing.dbo.Activity_Tracking_AZ
    GO
    SELECT * INTO ClientDB_Master_Testing.dbo.Activity_Tracking_AZ
    FROM Activity_Tracking_AZ
    Go
    I know with this Technique the table must be truncated if not deleted first.  There is probably a better way to do this which I'm very open to.  I'm also looking for coding that will roll back any changes made should an error occur.
      As always, any help is greatly appreciated.
    David92595

    USE ClientDB_MASTER_Testing
    go
    SET XACT_ABORT ON
    BEGIN TRANSACTION
    Truncate Table dbo.Activity_Tracking_AZ
    -- SET IDENTITY_INSERT dbo.Activity_Tracking_AZ ON
    INSERT dbo.Activity_Tracking_AZ (col1, col2, ...)
    SELECT col1, col2,
    FROM ClientDB_MASTER_Restore.dbo.Activity_Tracking_AZ
    -- SET IDENTITY_INSERT dbo.Activity_Tracking_AZ OFF
    COMMIT TRANSACTION
    If you find it boring to type the column lists, just find the table in Object Explorer, and drag the columns node to where you want the column list.
    You need the SET IDENTITY_INSERT command if the table has an IDENTITY column.
    By wrapping the code in a transaction, you are not left with an empty table if the INSERT fails. The command SET XACT_ABORT ON makes sure that the batch is aborted and rolled back in case of an error.
    Erland Sommarskog, SQL Server MVP, [email protected]

  • Data Read from Infoprovider using BAPI

    Hello Team
    we are using SCM 7.0
    We want a BAPI which can be used to fetch data from infoprovider (for selected Chars and CALMONTH) and display it on a Z Screen.
    Can any one one please let me know the BAPI?
    We tried FM RSDRI_INFOPROV_READ , BAPI /SAPAPO/DPBW_CUBE_READ in SE37, but it gives the error as - Error generating the test frame.

    kramish wrote:
    Im pretty sure that Access does support JDBCNo it does not. It supports ODBC.
    just doing a quick Google came up with some pages:
    http://blog.taragana.com/index.php/archive/access-microsoft-access-database-from-java-using-jdbc-odbc-bridge-sample-code/
    http://www.javaworld.com/javaworld/javaqa/2000-09/03-qa-0922-access.html
    Both articles explains how to use the jdbc-odbc bridge. I think I've seen a pure jdbc driver for access but it wasn't from Microsoft and it wasn't free.
    Kaj

  • Kicking off workflow from webdynpro using events?

    I have abap experience but no workflow. Any advice will be appreciated.
    I have to kick off a workflow from webdynpro. I assume that I have to set up a business object (eg. ZOBJECT), create an event therein (eg. ZEVENT).
    Then when webdynpro runs I use a rfc function module to trigger this event.
    The questions I have are:
    1. How do I set up the workflow to be triggered by this event?
    2. Do I set up an event in Business object builder or in SM62?
    3. How do I trigger an event in a function module. I have found SWE_EVENT_CREATE but don't want to create an event just want to trigger the event and in turn set off the workflow?
    Thank you,
    Warren.

    try this below parameters are passed or not
    CALL FUNCTION 'SAP_WAPI_CREATE_EVENT'
               EXPORTING
                 object_type    = 'BUS2105'
                 object_key     = lv_objkey
                 event          = 'CREATED'
                 commit_work    = 'X'
                 event_language = sy-langu
                 language       = sy-langu
                 user           = sy-uname.

  • Updating a child of a BOM material using bapi sales order change

    Hi, Appreciate your thoughts on the following issue..
    We have a batch program which uses a bapi sales order change and updates the plant at the line items of the sales order. when this plant is assigned.. if any of the line item is a BOM item, it explodes and the data from the parent ( like payment terms, fixed val date ) should get copied to the child items same as the parent. This is happening fine if manual mode using va01 and va02 but when plant is updated using bapi the childs are not getting the data from the parent ( which comes through config )...
    Appreciate your inputs and any additional information to be passed to the bapi for the BOM materials to get the same config data as parent to the child when exploded...
    Thanks and will reward helpful answers..

    Hi, Appreciate your thoughts on the following issue..
    We have a batch program which uses a bapi sales order change and updates the plant at the line items of the sales order. when this plant is assigned.. if any of the line item is a BOM item, it explodes and the data from the parent ( like payment terms, fixed val date ) should get copied to the child items same as the parent. This is happening fine if manual mode using va01 and va02 but when plant is updated using bapi the childs are not getting the data from the parent ( which comes through config )...
    Appreciate your inputs and any additional information to be passed to the bapi for the BOM materials to get the same config data as parent to the child when exploded...
    Thanks and will reward helpful answers..

  • Deleting deliveries , Batches from STO  Using BAPI

    Hi,
    I want to  delete outbound delivery for particular shipment number and this should be done using BAPI or a FM not using the tcode VL02N.
    I  wld  be very grateful
    Please List out  the BAPI 's or FM that can be  used for to perform these listed , with using Tcodes:
    1) REVERSE BILLING DOCUMENT(VF11)
    2) GOODS ISSUe REVERSAL (VL09N)
    3) REMOVE DELIVERY FROM SHIPMENT (VT02N)
    4) DELETING DELIVERY(VL02N)
    5) REMOVE BATCH FROM STO (ME22N)
    Its very urgent..
    Thank you in advance....
    Edited by: aditya on Jan 31, 2008 2:14 PM
    Edited by: Alvaro Tejada Galindo on Jan 31, 2008 9:26 AM

    Hi,
    Look at the below thread
    Deleting deliveries and sales orders using BAPI
    Regards,
    Satish

  • Creation of GR from Contract using bapi BAPI_GOODSMVT_CREATE

    Hi,
    As per requirement I need to create a GR for Contract line item. I tried to create using BAPI  BAPI_GOODSMVT_CREATE but It returns the error message. I tried with GM_CODE  '05', so could you please let me know which are the parameters I need to pass to create GR?
    Thanks,
    Nishad Shah

    Hi,
    Populate header, code, item and return table
    In header populate  PSTNG_DATE ,DOC_DATE ,PR_UNAME(if u have additional information then pass those also)
    In Item table MOVE_TYPE ,MVT_IND ,PO_NUMBER ,MATERIAL,PLANT ,STGE_LOC ,PO_ITEM = POITEM-PO_ITEM,ENTRY_QNT .
    MVT_IND filed u can leave it as blank as GM_CODE is 05.
    Regards,
    Sajith

  • How to Export data from webdynpro using Jecxcel

    Hi ,
    Can anyone help me how to export data from web dynpro using Jexcel. kindly send me the related links.
    Thanks

    Hi Sandeep,
    Have you refered in the blogs?
    U can find may more document related to this.the below blog helps u in
    Exporting Data from Web Dynpro in Different Formats Using Open Source (POI, JExcel, iText) APIu2019s.
    https://www.sdn.sap.com/irj/sdn/index?rid=/library/uuid/b030e7fb-2662-2b10-0dab-c4aa52c3550b
    Regards
    Supraja

  • Update Open Shared Excel spreadsheet from SSIS using SQL task

    I propose to call a SSIS package from excel and update a single cell in a sheet.  The spreadsheet is shared so it can be referenced by SSIS even though it is open.
    The update succeeds but the problem is the cell is not updated unless the spreadsheet is closed.
    any suggestions?  workarounds? 
    Overview:  I need to have a button that when clicked executes a ssis package,  that does some assorted magic, and finally updates a cell so that another sheet includes the updated cell in a formula.
    Thanks is advance.
    Susan

    Susan,
    so, did you already create the solution?
    Why SSIS?
    I expect this not to work as the Excel Destination will require exclusive rights to the already open Excel worksheet
    I suggest you use data query from Excel or a macro instead. This solution does not look right.
    Arthur My Blog

  • Problem in retrieving multiple records SAP xMII from SAP using BAPIS

    Hi friends,
             In SAP xMII i called BAPI_USER_GETLIST by passing import parameters 10 and y.In r/3 BAPI returned 10 rows but In xMII it was returned only one Record.
    i want to display 10 records in sap xmii
    1) I created to connection ECC5 in Dataservices-->SAPSERVERConfiguration
    2)In BLS we placed JCO Interface inside Sequence
    3)In BLS I used ECC5 connectrion(using JCO Interface) and called  BAPI_USER_GELLIST
    4)In Links-->Transaction created two input values for "maxnoofrows","withusername" and output value is "userid".
    Input what i mapped 
    Transaction>"maxnoofrows" =====SAPJCOINTERFACE->Request>BAPI_USER_GETLIST>INPUT-->MAX_ROWS
    Transaction>"withusername" =====SAPJCOINTERFACE->Request>BAPI_USER_GETLIST>INPUT-->WITH_USERNAME
    Output what i mapped 
    SAPJCOINTERFACE->Response>BAPI_USER_GETLIST>TABELS>USERLITS >ITEM>USERNAME=====Transaction-->userid
    5)Saved the Transaction.
    6)In Query Template -->xactuateQuery selected
    7)In Datasource Query mode was selected ,Inputrarams i passed 10 and y as parameters.
    It was returned one user id from R/3 inSAP xMII
    please help me to retrive all  10 rows from r/3
    Regards
    Srikanth

    hi,
    What is the data type of Transaction output (userid)?
    Make this as XML type.
    The format which BAPI returns the result does not match with xMII XML format.
    Create a xMII XML document and configure with column name as userid. and by using repeater and XML row add all tho values to the document. Then assign whole doument to transaction output.
    Hope this will help to resolve the issue.
    Regards,
    Kishore

  • Purchase Requisition data need to be filled while using BAPI

    Hi,
          I am using a BAPI for uploading open sales order and i have fields in the flat file.
    Sales Document Type     
    Sales Organisation     
    Distribution Channel     
    Division     
    Sold to Party,P.O.Number,
    P.O.Date,
    Req. Delivery Date,
    Payment Terms,
    Inco Terms,
    Inco Terms(Part2),
    HeaderCnType(01),
    Amount(01),
    Line Item No.     
    Material Code
    Material Description
    Order Quantity
    Item Category
    Plant
    WBS Element
    ItemCnTy(01)
    Base Price
    ItemCnTy(02)
    Requisitioner     
    Tracking Number
    Value Price
    Desired Vendor
    I found a BAPI called 'bapi_salesorder_createfromdat2' which fills the requirement with fields which is not highlighted. And let me know which BAPI can be used so that we can use the remaining 4 fields which is highlighted.
    The Non highlighted fields are belongs to Sales Order and the remaining highlighted fields belong to Purchase Requisition.

    Hello,
    I'm not sure you're taking the best approch.
    Usually when you need to migrate ISU contracts into an ISU-CRM integrated system, you first migrate everything you need in ISU through the VERY powerful migration workbench available (transaction code EMIGALL), and then you replicate your data to CRM via INITIAL download.
    That's definitely the strategy that will give you the best performance, and less work.
    Kind regards,
    Nicolas Busson.

Maybe you are looking for

  • BT says I'm not a customer so can I have a HomeHub...

    I've been trying to update my SpeedTouch 330 modem to a Home Hub, but the BT website is refusing to sell me one at the upgrade price because it says I'm not a BT broadband customer. How can I convince it that I have been since 2005? BT is still happi

  • Set sign-in status toggles to disabled on its own?

    Hello! I have a user whos "Set sign-in status" in OWA keeps toggling to disabled on a daily basis. MS support says this is managed by the AD settings for the user. I've checked ever setting and compared them to users who are not experiencing the issu

  • Tons of errors with sync and restore

    Let me state first, that this iPod Classic i brand new, and has latest software installed. So does my Mac Mini (also brand new). All latest software is installed. I have a large library, therefore i chose a Classic. From the very first sync, errors s

  • Attachment Count link in Resource list

    Hi gurus, I have setup a repository manager with several custom properties for the documents. One of these properties is a copy of the attachment property (attach files or links to other documents, to a document). When a user goes to a folder and see

  • Need help with bios for k9n sli v2(ms-7390)

    I recently got a phenom 2 720 black edition CPU, and I flashed my bios with the beta bios for my board(7390v123). Everything runs fine, except for now I can't change the CPU multiplier or CPU voltage(there locked on auto). Yes I do know about +/- and