Copy Data from a System Form to another (GetByKey)

Hi All,
I 'll try the following: "After the succesful add of a specific Credit Note I want to copy the Cardcode and the Cardname (of this Credit Note) to cardcode and cardname of a Delivery Note".
I tried the following code without success:
            If (pval.FormType = 179) And (pval.ItemUID = "1") And (pval.EventType = SAPbouiCOM.BoEventTypes.et_ITEM_PRESSED) And (pval.Before_Action = False) And (pval.ActionSuccess = True) Then
                Dim DocEntry As Integer
                Try
                    Dim oCredit As SAPbobsCOM.Documents
                    oCredit = oCompany.GetBusinessObject(SAPbobsCOM.BoObjectTypes.oDeliveryNotes)
                    Dim oDeliv As SAPbobsCOM.Documents
                    'Creation of Business Objects
                    oDeliv = oCompany.GetBusinessObject(SAPbobsCOM.BoObjectTypes.oDeliveryNotes)
                    oCredit.GetByKey(DocEntry)
                    oDeliv.CardCode = oCredit.CardCode
                    oDeliv.CardName = oCredit.CardName
                Catch ex As Exception
                    MessageBox.Show(ex.Message)
                End Try
Thanks in advance,
Vangelis

Hello,
There are a few errors in the code you've pasted:
oCredit = oCompany.GetBusinessObject(SAPbobsCOM.BoObjectTypes.oDeliveryNotes)
oDeliv = oCompany.GetBusinessObject(SAPbobsCOM.BoObjectTypes.oDeliveryNotes)
a) both the above lines are creating delivery notes.
b) where are you getting the docentry value from, get it from the form using UI-API
c) you can also get the cardcode / cardname value using UI-API, by referring to the fields on the form, rather than using oCredit object.
c) you are not calling add/update after writing delivery note
d) lets be clear that you cannot change cardcode / cardname in already created delivery note, and if you are adding a new delivery note you can not do it by just specifying cardcode / cardname
Rahul

Similar Messages

  • Copy data from a UDO form to Goods Receipt PO using UI API

    Hi, all
    I tried to copy data from a UDO form to Goods Receipt PO using UI API through following codes.
    It works fine while copying to a Item-type Goods Receipt PO.
    But when the doctype is set to service, I got errors.
    I use for-loop to copy two items, Description and LineTotal, into the matrix of Goods Receipt PO form, but both failed.
    any suggestion?
    Edited by: Chao-Yi Wu on Aug 25, 2009 5:50 AM

    Hi  Chao-Yi Wu ,
    SBO_Application.ActivateMenuItem("2306")
    Dim oFormGR As SAPbouiCOM.Form = SBO_Application.Forms.ActiveForm
    Dim omtxIQC, omtxGR As SAPbouiCOM.Matrix
    Dim oedIQC, oedGR, oed As SAPbouiCOM.EditText
    Dim ocbIQC, ocbGR As SAPbouiCOM.ComboBox
    oFormGR.Mode = SAPbouiCOM.BoFormMode.fm_ADD_MODE
    oedIQC = oFormIQC.Items.Item("13").Specific
    oedGR = oFormGR.Items.Item("4").Specific
    oedGR.Value = oedIQC.Value
    oedIQC = oFormIQC.Items.Item("21").Specific
    oedGR = oFormGR.Items.Item("24").Specific
    oedGR.Value = oedIQC.Value
    oedIQC = oFormIQC.Items.Item("edComments").Specific
    oedGR = oFormGR.Items.Item("16").Specific
    oed = oFormIQC.Items.Item("3").Specific
    oedGR.Value = oedIQC.Value + ", Goods Recript PO:" + oed.Value
    ocbIQC = oFormIQC.Items.Item("cbDocType").Specific
    ocbGR = oFormGR.Items.Item("3").Specific
    If ocbIQC.Selected.Value = "I" Then
         ocbGR.Select(0, SAPbouiCOM.BoSearchKey.psk_Index)
    Else
         ocbGR.Select(1, SAPbouiCOM.BoSearchKey.psk_Index)
    End If
    omtxIQC = oFormIQC.Items.Item("mtx_0").Specific
    For i As Integer = 1 To omtxIQC.RowCount
    omtxGR = oFormGR.Items.Item("38").Specific
           If ocbIQC.Selected.Value = "I" Then
                oedIQC = omtxIQC.Columns.Item("c_ItemCode").Cells.Item(i).Specific
                oedGR = omtxGR.Columns.Item("1").Cells.Item(i).Specific
                oedGR.String = oedIQC.String
                oedIQC = omtxIQC.Columns.Item("c_AQty").Cells.Item(i).Specific
                oedGR = omtxGR.Columns.Item("11").Cells.Item(i).Specific
                oedGR.String = oedIQC.String
                oedIQC = omtxIQC.Columns.Item("col_19").Cells.Item(i).Specific
                oedGR = omtxGR.Columns.Item("14").Cells.Item(i).Specific
                oedGR.String = oedIQC.String
       Else  
    omtxGR = oFormGR.Items.Item("39").Specific
               oedIQC = omtxIQC.Columns.Item("c_Descrp").Cells.Item(i).Specific
               oedGR = omtxGR.Columns.Item("1").Cells.Item(i).Specific
               oedGR.String = oedIQC.String
               oedIQC = omtxIQC.Columns.Item("col_16").Cells.Item(i).Specific
               oedGR = omtxGR.Columns.Item("12").Cells.Item(i).Specific
               oedGR.String = oedIQC.String
      End If
                Next
    for items the matrix is 38 and for service the matrix is 39
    Rgds
    Micheal

  • Copy data from 1 company code to another company code

    hi friends
    my client has 3 company codes but now they want to close one company code for that they want to copy data from one company code to another company code after  copying the data they want to delete that company code
    i am fresher to sap(fico) please tell me the solution for this,
    1) what is the process of copy from one company code data to another
    2) what is rules and integrations for that

    Company Codes are the individual identity and we have to give accounting details (Balance Sheet and Profit and Loss account) to statutory bodies so deletion of Company code or coping data from one to another is not posible and not suggested too.
    Expalin your client to block all the transaction in one company code and transfer all the closing balance as per trail balance, open Purchase orders, open Sales orders, inventory valuation to another company code and start doing trasaction there.
    This is the only solution as per my knowledge.
    Uttam

  • Dynamic script task to copy data from one server table to another server table excluding Timestamp column ?

    I have two server TestSource and TestDestination . In both the tables I have common table like below. I would like to copy the data from TestSource server src_Table to TestDestination server  table dest_table
    excluding the column timestamp. This process I would like to achieve dynamically. Since I have 50 tables where I need to copy from source server to destination server.
    Rule : This needs to achieve using script task. Please help me to find the solution as it is very urgent requirement.
    Above rule is because No option to choose export wizard dynamic query option for linked server.
     --Source
    Table
    CREATE TABLE src_table
    a int,
    b int,
    c timestamp
    --Dest Table
    CREATE TABLE dest_table
    a int,
    b int,
    c timestamp
    Thank you in advance.
    Hari

    I have two server TestSource and TestDestination . In both the tables I have common table like below. I would like to copy the data from TestSource server src_Table to TestDestination server  table dest_table
    excluding the column timestamp. This process I would like to achieve dynamically. Since I have 50 tables where I need to copy from source server to destination server.
    Rule : This needs to achieve using script task. Please help me to find the solution as it is very urgent requirement.
    Above rule is because No option to choose export wizard dynamic query option for linked server.
     --Source
    Table
    CREATE TABLE src_table
    a int,
    b int,
    c timestamp
    --Dest Table
    CREATE TABLE dest_table
    a int,
    b int,
    c timestamp
    Thank you in advance.
    Hari

  • [php+mysql] how to pass data from one insert form to another?

    Hi all,
    I have an insert form (in a mysql db) on the page. Is there a way to
    view the inserted data after inserting so stat the user can print it
    out?
    TIA
    tony

    >Hi Tony,
    >let´s assume the table´s Primary Key column is named "id" -- just add this value (available as "Dynamic Data") to the "Redirect after Insert" URL in the following way:
    >print.php?id={id}
    >...and on that page add a recordset which queries the table like that:
    >"SELECT * FROM tablename WHERE id" equals the URL parameter "id"
    >That should be all there is to do.
    >Cheers,
    >Günter Schenk
    >Adobe Community Expert, Dreamweaver
    Hi Günter,
    Thanks, it works.
    I added a bit of code to set a session variable using this Parameter
    URL, so that I can manage the record ID along the whole user session.
    So, I ask you a little question: when it is best to delete or destroy
    session variables? after displaying the inserted records or just befor
    inserting the first one?
    Here is my little test workflow:
    1- destroy variable sessions (I think I will unset session variables
    one by one instead, to eliminate the risk to delete other sesssion
    variable (UserID...)
    2- insert the first record (redirect to the next page using the record
    ID1)
    3- set a session variable (S1) using the ID1 coming from previous page
    ($_GET)
    4- insert the second record (redirect to the next page using the
    record ID2)
    5- set a session variable (S2) using the ID2 coming from previous
    page ($_GET)
    6- insert the third record (redirect to the next page using the
    record ID3)
    7- set a session variable (S3) using the ID3 coming from previous page
    ($_GET)
    8- create a recordsets to filter the db by S1, S2 and S3.
    9- display the report
    it seems to work.
    do you think there is something to refine?
    Thanks again for your kindness.
    tony

  • How  to copy data from one internal table to another

    i am using some function module to get some data for my function module
    and the retrieved data is not getting populated in mu fumctional module
    i am sucessful in getting the data to an internal table in my function module but dont know how to pass it to my table parameter
    thanks in advance

    Hi Naval,
    Declare an internal table of type table parameter structure and pass it the table parameters of the Function module.
    Check the code for this function module.
    DATA IT_MARA LIKE MARA OCCURS 0 WITH HEADER LINE.
    SELECT * FROM MARA UP TO 10 ROWS INTO TABLE IT_MARA.
      CALL FUNCTION 'GUI_DOWNLOAD'
        EXPORTING
          FILENAME                = 'C:\TEST.TXT'.      FILETYPE                = 'ASC'
          WRITE_FIELD_SEPARATOR   = 'X'
    <b>    TABLES
          DATA_TAB                = IT_MARA</b>
        EXCEPTIONS
          FILE_WRITE_ERROR        = 1
          NO_BATCH                = 2
          GUI_REFUSE_FILETRANSFER = 3
          INVALID_TYPE            = 4
          NO_AUTHORITY            = 5
          UNKNOWN_ERROR           = 6
          HEADER_NOT_ALLOWED      = 7
          SEPARATOR_NOT_ALLOWED   = 8
          FILESIZE_NOT_ALLOWED    = 9
          HEADER_TOO_LONG         = 10
          DP_ERROR_CREATE         = 11
          DP_ERROR_SEND           = 12
          DP_ERROR_WRITE          = 13
          UNKNOWN_DP_ERROR        = 14
          ACCESS_DENIED           = 15
          DP_OUT_OF_MEMORY        = 16
          DISK_FULL               = 17
          DP_TIMEOUT              = 18
          FILE_NOT_FOUND          = 19
          DATAPROVIDER_EXCEPTION  = 20
          CONTROL_FLUSH_ERROR     = 21
          OTHERS                  = 22.
      IF SY-SUBRC <> 0.
            MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
                    WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
      ENDIF.
    Thanks,
    Vinay

  • Data transfer from one adobe form to another adobe form (offline)

    Hi,
    Is it possible to transfer data from one adobe form to another adobe form(offline).
    Advance Thaks
    Murali Papana.

    I dont know what your requirement but simple way is use 'Save' or 'Save as' to create a copy of offline form. ...:-)

  • Copy data from one Table to another Table

    How can I copy data from one Oracle Table to another Oracle Table on a different server? Question 2: How can I clear all of the data in one Table with a single SQL script?
    Thanks...

    Question 1:
    I assume you have the privileges. If you don't, ask the DBA to give them to you. Then
    1. Login to database_source (It could be either the source or the target. Let's assume it's the source.)
    2. Create a database link to database_target: CREATE DATABASE LINK link_to_database_target CONNECT TO myuserid IDENTIFIED BY mypassword USING 'database_target'; Note the single quotes.
    3. Copy the table data: INSERT INTO targetowner.mytable@link_to_database_target SELECT * FROM sourceowner.mytable; COMMIT;
    Question 2:
    You have two options, but you may not have privileges for both.
    Option 1:
    DELETE FROM tableowner.tablename; COMMIT;
    Advantage: Since this is a DML (Data Manipulation Language) statement, you have to commit the transaction. Also, the data will be gone but the table size is NOT changed, so it's ready for accepting replacement data. DML statements can simply be executed not only from SQL scripts, but from PL/SQL scripts as well.
    Disadvantage: Slow, because all record deletion is logged, so you can recover from it by issuing a ROLLBACK; instead of the COMMIT; above. The table size is NOT changed, so if you are short of disk space or tablespace space, you have not resolved the issue.
    Option 2:
    TRUNCATE TABLE tableowner.tablename;
    Advantage: Since this is a DDL (Data Definition Language) command, you do NOT have to commit the transaction. (DDL commands automatically commit both before and after their execution.) The table size will be changed back to the initial extent size which is the minimum size a table can have and can only be set when the table is created. If it needs to be changed, the table has to be dropped and recreated with a different initial extent size. The statement execution of this command is not logged, therefore it's much faster then the DELETE.
    Disadvantage: No rollback. Being a DDL, this command cannot be executed straight from PL/SQL. If you need to issue this within PL/SQL, you will have to use dynamic SQL.

  • How to extract data from legacy system to source file

    Hi can anyone tell me the procedute to copy data from legacy system to source files....this data needs to be moved to base tables
    can any one tell me the procedure and any sample code i,e any example
    Thanks & Regards
    Krish

    You should post your thread to ...:
    http://forums.oracle.com/forums/forum.jspa?forumID=183
    providing all necessary info......!!!!
    Greetings...
    Sim

  • IP Exit Planning function copy data from cca to pca planning cubes

    Hello All,
    I have a requirement where I have to copy the characteristics and keyfigures of CCA plan cube data to pca plan cube data.The infoobjects in CCA aggregation level are are {0amount,0costcenter,0costelement,version,0calmonth,0infoprovider} which needs to be copied to corresponding infoobjects in PCA level  {0amount,0profitcenter,0account,0version,0calmonth,0infoprovider}.
    The CCA and PCA aggregation level are built on the top of the multiprovider.
    I can do it using the fox coding but 0costelement cannot be mapped to 0account as these two are different fields.Since I have to copy the values of 0costelement to 0account , I was wondering how can I do it using the exit function.
    As I have never used the exit function before, I was wondering if somebody can help me out with this.
    By the way, I have read the forums and figured out to create a class in se24 and use interface
    IF_RSPFLA_SRVTYPE_IMP_EXE and since I am generating some records , will be using the method IF_RSPLFA_SRVTYPE_IMP_EXEC~INIT_EXECUTE.
         By the way , I read in the forums where there are methods/function modules which can copy data from one aggregation level to another aggregation level.Anyways, can you tell how can I loop thru the records of CCA aggregation level and copy the records to the PCA aggregation level.
    Edited by: nazeer on Feb 22, 2009 12:04 PM

    This thread might help you.
    https://forums.sdn.sap.com/click.jspa?searchID=22634973&messageID=5317176

  • Copy data from one SAP system to another based on conversion rules

    Hi All,
    Please provide your input on how can we copy data from one SAP system to another based on conversion rules.
    Conversion rule :
    vkrog in 110  vkorrg in 120
    1234            4567   
    <<text removed>>
    Thanks
    Edited by: Matt on Feb 16, 2009 4:35 PM

    Please read the Rules of Engagement here: Please read "The Forum Rules of Engagement" before posting!  HOT NEWS!!
    Please note that offering points is against the rules.
    matt

  • How  to transfer data from one system to another by datamart please give de

    how  to transfer data from one system to another by datamart please give details

    Hi Deba,
    Find the below SAP help doc which may help u...
    http://help.sap.com/saphelp_nw70/helpdata/en/12/43074208ae2a38e10000000a1550b0/frameset.htm
    Also find the below threads...
    Loading data from one cube to another cube.
    data copy from infocube to infocube in two different BW systems
    Delta when loading from ODS to ODS
    reg datamart
    Data mart flag
    Regards,
    KK.

  • Copy data from one table to another

    Hello everyone,
    I have a student table with fields sno, sname. I created another table student1 with same fields sno, sname and with one new field class.
    Now i want to copy data from sno, sname of student table to sno, sname of student1 table when the class field in styudent1 has no data i.e., its null.
    Could any one let me know how to do this?
    Thanks,
    Prathima

    i want to copy data from sno, sname of student table to sno, sname
    of student1 table when the class field in styudent1 has no dataSo what is the join condition? What column in STUDENT1 tells us what row in STUDENT to copy?
    Cheers, APC
    Blog : http://radiofreetooting.blogspot.com/

  • I need to copy data from a table in one database (db1) to another table in

    Hi
    I need to copy data from a table in one database (db1) to another table in another database (db2).
    I am not sure if the table exists in db2,,,if it doesnot it needs to be created as well data also needs to be inserted...
    How am I supposed to this using sql statements..?
    I shall be happy if it is explained SQL also...
    Thanking in advance

    How many rows does the table contains? There are manyway you can achieve this.
    1. export and import.
    2. create a dblink between two databases and use create table as select, if structure doesnot exists in other database, if structure exists, use, insert into table select command.
    example:
    create a dblink in db2 database for db1 database.
    create table table1 as select * from table1@db1 -- when there is no structure present
    -- you need to add constraints manually, if any exists.
    insert into table1 select * from table1@db1 -- when there is structure present.
    If the table contains large volume of data, I would suggest you to use export and import.
    Jaffar

  • How to copy data from one BB to another via Desktop Manager

    I've got two BBs (8900 and 9300), both actively in use and with different data (contacts, memos, etc.) on them.
    I need to copy my tasks, memos and contacts from 8900 to 9300. I tried "switch phones" option, but it substitutes data, while I need to syncronize it, so that data from 8900 is added to what is currently is on the 9300. 
    Is it possible to do it via Desktop Manager? It seems there was somewhere an option "copy data from another BB", but I can't find it in the latest Desktop Manager version.

    You would need to use Desktop Mangaer to sync BB1 with a local PIM program (such as Outlook or Lotus Notes) to get the information off BB1. Then use Desktop Manager to sync BB2 with the same PIM program. 

Maybe you are looking for

  • How to connect TV with limited HDMI ports?

    My Panasonic Plasma TV has 2 HDMI ports. I have been using HDMI 1 for a DVD Recorder and TV linked through HDMI 2. This gave me upscaled 1080p resolution on both. I want to move TV to the Component ports to allow me to attach a Cinema system to the

  • Powermac or iMac G5 for Graphic Design industry?

    I was wondering what kind of computer does the Graphic Design industry uses? iMac G5 or the Powermac? What do you recommend? I heard that the Powermac is usually used by professionals. Is this true? How does the iMac G5 compare to it?

  • Need to create a ? mark in G510n password

    I had to have a new router and laptop replaced  The compter recognizes the printer, but cannot commumicate.  My new lptop does not have a CD player.  Is there any way to type in a ? in the password when inputing  the pasword from the printer number p

  • Setting page size

    hi! i'm connecting to a db and displaying the result set in a html table. i want to limit the no of rows displayed on a page to 20. The next 20 rows should be displayed on another page on clicking the 'next page' button. how do i go about it??

  • How can I use a ButtonBar for a TabNavigator?

    Don't ask me why they want <Previous><Next> navigation for a Tabbed view, but it is what it is. I need a <Previous><Next> ButtonBar on each of the inner tabs (and obviously a <Next> and <Previous> ButtonBar for the first and last tabs respectively) t