Update the custom table by using Custom Function module.

Hi Experts,
        My requirement is ,
1) To create the Custom Z table with fields
           vbak-vbeln
           likp-vbeln
           vbuk-vbeln
  After creating this Z table.
2) I have to create one custom function module.
    Based on this function module i have to update that Z table.
3) Before these steps i have to write down an ALV report based on the tables vbak and vbeln, in that table i have to print vbak-vbeln. and also in report i generated check box and one custom button in application toolbar. after the report will displayed , when ever i click the button in application tollbar , this function module will executed and the table will be updated.
    But I developed the ALV report with custom button and check box successfully.
  My doubt is how to write the function module and based on that function module how to update the table.
      Please suggest me on this requirement.
    Thanks in Advance.
Thanks and Regards
Srihari.

HI ,
     Can any one help me out on my above requiremnet..
Thanks and Regards
Srihari.

Similar Messages

  • Update TVARV table entries using a Function Module or Program

    Hi Gurus,
    My requirement is that I have a entry in TVARV table which has a 'low'. We would like to change this value whenever we desire. We are unable to do it via sm30 and se16 as table maintenance access is not permitted in Production environment.
    Can you please provide any Function module or program code to do it?
    Requirement - User can enter a value into TVARV table by executing a function module or program
    Thank you all, will award points,
    Priyansh

    Hi Priyansh,
    Please refer to SAP Help for more information on variant maintenance and more specifically variable values in variants. You can use t/code STVARV for maintaining the variant variables in table TVARVC (Client-Specific Variant Variables).
    Note: I suggest to use the TVARVC table instead of TVARV.
    If you are looking for Function Modules in the area of Variant Maintenance, then please have a look at Function Group SVAR (t/code SE80).
    If you are looking for Function Modules in the area of User Variables in Variants, then please have a look at Function Group SVUV (t/code SE80).
    Furthermore, if you are looking for a program to update table TVARVC, please have a look at ABAP: Dynamic Variant Processing with STVARV.
    Best eregards,
    Sander

  • Stored procedure to update the new table by using back up table

    Hi all,
    oracle version -10g
    iam planning to do one time legacy conversion during the migration of one of the tables.
    for that i took the back up of table , now i need to transfer all of the data from the backup table to the new table with some changes..
    so please suggest me how to write the stored procedure?
    back up table name: test t
    new table: test n
    new table will have extra one row .. in that i need to put the logic
    so am planning to write a procedure like below
    create or replace procedure test as
    begin
    insert into TEST T ( u
              v
              w
              X
              y
              z) VALUES
    SET T.U = O.U
    T.V = O.V
    T.W = DECODE(O.W, AD     '01',
                   00     '01')
    T.X = O.X
    T.Y = IF O.W = 'AD' AND O.Y = 'YES' THAN PUT 'AD'
         IF O.W = '00' AND O.Y = 'YES' THAN PUT 'PD'
    IF O.W NOT IN ('AD','00') AND O.Y = 'YES' THEN PUT 'E'
    O.Y= 'NO' THEN PUT 'D'.
         '

    10g is not an Oracle version number. Please run the following:
    SELECT * FROM v$version;What about your situation indicates a requirement for a stored procedure? I wouldn't write one based on what you have posted. It seems, again from what little you posted, that all you need is:
    INSERT INTO <new_table>
    SELECT ... FROM <temp_table>;

  • Issue in updating the Huge XML by using updatexml function

    Hi All,
    Database Credentails:
    Oracle 9i R2.
    I have a huge xml like this,
    <Root>
    <abc></abc>
    <abc></abc>
    <abc></abc>
    </Root>
    The <abc></abc> will be more than 10000 under the <Root> tag.
    I have tried to update this xml by using the following script,
    for i in 1 .. 10000
    loop
    SELECT UPDATEXML(v_xml,'/Root/abc['|| i ||']','<abc>'|| i || '<abc>')
    INTO v_xml;
    dbms_output.put_line(i); -- Just to check how many values were updated
    end loop;
    While executing the above sample code, i am getting the error called
    INVALID XPATH EXPRESSION,
    some times it is executing to some number after that i am getting the above error. when i try execute the same code again i will get error for different i value.
    Could you please help me out to fix this bug/mistake for me. Please provide me some sample code for this.
    Thanks in Advance,
    Vinoth Kumar S.

    You don't need any loop for this. simple UPDATEXML statement should do.
    sql> WITH myxmltab AS
      2  (SELECT XMLTYPE('<Root>
      3  <abc>4</abc>
      4  <abc>5</abc>
      5  <abc> </abc>
      6  <abc> </abc>
      7  <abc> </abc>
      8  <abc></abc>
      9  <abc></abc>
    10  <abc></abc>
    11  <abc></abc>
    12  <abc></abc>
    13  </Root>') xmlcol FROM dual)
    14  select UPDATEXML(t.column_value,'/abc',xmltype('<abc>' || rownum || '</abc>')) from myxmltab,
    15  table(xmlsequence(extract(xmlcol,'/Root/abc'))) t;
    UPDATEXML(T.COLUMN_VALUE,'/ABC',XMLTYPE('<ABC>'||ROWNUM||'</ABC>'))
    <abc>1</abc>
    <abc>2</abc>
    <abc>3</abc>
    <abc>4</abc>
    <abc>5</abc>
    <abc>6</abc>
    <abc>7</abc>
    <abc>8</abc>
    <abc>9</abc>
    <abc>10</abc>
    10 rows selected.
    Elapsed: 00:00:00.04

  • Update sap table using a function module call by php code

    Hello,
    I m trying to update the table VBAP using a function module ZZ_SET_DISTANCE  call by a php code.
    But I have this problem:
    the saprfc seems to work well but when I look to the table VBAP the fields have not been update.
    I tried the function module in debug mode and it work good. The fields are update.
    I also handle the saprfc call function and the return SAPRFC_OK
    This are the function module ZZ_SET_DISTANCE, and the php code
    //PHP CODE
    $fce = saprfc_function_discover($sap,"ZZ_SET_DISTANCE");
                  if (! $fce ) {echo "Echec d'ouverture du module fonction "; exit;}
                   saprfc_import ($fce,"COMMANDE", '0000001998');
                   saprfc_table_init($fce,"TBLE_CMDE");
                        $val=array();
                        $val['NUM_POST']='000030';
                        $val['HN_EXP']='';
                        $val['ST_EXP']='';
                        $val['PC_EXP']='';
                        $val['CI_EXP']='';
                        $val['CO_EXP']='';
                        $val['HN_REC']='';
                        $val['ST_REC']='';
                        $val['PC_REC']='';
                        $val['CI_REC']='';
                        $val['CO_REC']='';
                        $val['DIST']='popo';
                        saprfc_table_append ($fce,"TBLE_CMDE", $val);
                 $rfc_rc = saprfc_call_and_receive ($fce);
                 echo "\n".$rfc_rc;
                 if ($rfc_rc != SAPRFC_OK) { if ($sap == SAPRFC_EXCEPTION ) echo ("Exception raised: ".saprfc_exception($fce)); else echo (saprfc_error($fce)); }else{echo '/execution de la function ;}
                 saprfc_function_free($fce);
    //FUNCTION MODULE ZZ_SET_DISTANCE
    FUNCTION ZZ_SET_DISTANCE.
    ""Local Interface:
    *"  IMPORTING
    *"     VALUE(COMMANDE) TYPE  VBELN
    *"  TABLES
    *"      TBLE_CMDE STRUCTURE  ZADD_COM_LOXAN
    DATA : NUMC TYPE VBELN.
    NUMC = COMMANDE .
    WHILE STRLEN( NUMC ) < 10 .
      CONCATENATE '0' NUMC INTO NUMC .
    ENDWHILE .
    DATA tble_addrcomm LIKE LINE OF TBLE_CMDE .
    LOOP AT  TBLE_CMDE INTO  tble_addrcomm.
      DATA : NUMP TYPE POSNR.
      NUMP = tble_addrcomm-NUM_POST.
      WHILE STRLEN( NUMP ) < 6 .
      CONCATENATE '0' NUMP INTO NUMP .
      ENDWHILE .
      UPDATE VBAP SET ARKTX = tble_addrcomm-DIST
      WHERE VBELN EQ COMMANDE
      AND POSNR EQ NUMP.
    ENDLOOP.
    ENDFUNCTION.
    Is anybody can help me?
    thank.

    Marie, create a Blog please, about more details for dummies....
    1) how to connect to sap system?
    2) you run the php code where? in a webserver or where?
    3) wich is the url for run the FM: ZZ_SET_DISTANCE
    4) you placed some dlls files on the web server?
    please is interesting this...
    Thanks

  • If record is in application server how do u update the single table

    hi
    could anybody tel me
    if record is in application server how do u update the single table
    by using direct input method

    If your Flash player/plugin is older, the only way is to go to Adobe's site (use Limnos' link) and download the full installer. A .DMG file, which you doubleclick to have it mount on the desktop. Inside is the Flash installer app you doubleclick to run and have it upgrade all. Will need an Admin user account.
    After you've upgraded to the latest & greatest, currently 11.5.502.110, a Flash perfpane will show up in System Preferences, where you can set it to auto-update itself, warn you of new updates or manually check for same.

  • BAPI or Function Module to Update the Alternative Payer  (KNZA) of Customer

    Hi Experts,
    My client requirement is to update the Customer Permitted Alternative Payer during creation of BP
    Would you please let me know the any BAPI or Fictional Module available to UPDATE the u201CPermitted Alternative Payer (KNZA)u201D of Customer Master.
    iam trying  SD_CUSTOMER_MAINTAIN_ALL function module, its failed to update the  KNZA tables. please help to close the issue. 
    Thanks in Advance.
    Venkatesh M.

    Hi Ravi,
    Thanks for the quick reply.
    The Function Module, what you are given is BTE. it will not trigger when creating of contract.
    My Requirement is when creating the contract for the particular BP, we need to UPDATE the Alternative Payer of Customer.
    Here i required BAPI or Function Module to change or Update the customer master Alternative Payer (KNZA).   
    Regards,
    Venkatesh M

  • How to Fill custom table data using standrad BAPI

    Hello Team,
    I have some clarification on usage of Standard BAPI :  BAPI_Material_savereplica.
    I have some custom fields in MARA and MARC tables so i have used BAPIExtensionin and able to pass custom field of MARA and MARC.
    My issue is in material master the MARC custom fields of a material are going to update in a Z table along with MARC table.
    So can we achieve this functionalioty using BAPI : BAPI_Material_savereplica menas can we upadate custom table by using standarda bapi
    Please let me know the available options ..

    Hi Some,
    You are saying most of the data is resides out of sap, then you try with mapping of those data in sap standard tables if match or if not then develop a custom interface which will read data from outside & will put in your pay roll processor interface,
    and normally your SAP data you can interface through PU12.
    If you want single interface then you need to develop unique interface program.
    All the best.

  • Rfc enabled function module for the updating the database table

    Hi,
            I need one rfc enabled function module for the updating the database table from the legacy system.currently i am using the rfc_read_table to read the database table.similarly i need for the update.

    Hi
    I believe you need to create one by yourself
    Max

  • Unalbe to delete lock entry table using Dequeue function module

    Friends,
    I display a base ALV list with custom app. tool bar. When i click on a button, i submit another report which updates a z-table for that corresponding row. I create a lock object for this entry before submitting the report. After updating the table, I try to delete the lock object using dequeue function module in the called report, but though the subrc is 0, the lock entry is not getting deleted in SM12. The called report, after dequeue, again submits report 1 (the caller). So, when i try to do some operation for the same row which I first selected, it triggers Foreign_lock exception. When I completely go out of the base list, only then the entry is deleted. Can anyone tell me the reason? I have tried with parameters _SCOPE & _SYNCHRON, but same result.
    Regards,
    Sathish R

    Hi,
    The triggering of the dequeue is not in the proper position as it need to be placed.
    Thats the only problem as per u have described the issue.
    Place the deque as soon as the report is return the value.
    I hope it may work ur issue.

  • Updation of material data using a function module

    HI
      i want to update fields in the mvke table,but the field is a Customer field in the table, not sap table field.i want to update the field using a program , not going to mm02. which function can i use for the updation.There is a function module MATERIAL_MAINTAIN_DARK for updation,will this funtion module update the customer fields also. Can anyone tell me about this function module and how to use this function module or MATERIAL_MAINTAIN_DARK.

    Using the function Module BAPI_MATERIAL_SAVEDATA , you can also update the custom fields.
    This is the documentation for the extension fields:
    <b>Reference Structure for BAPI Parameters EXTENSIONIN/EXTENSIO
    Description
        You use this structure to transfer the material's customer-defined
        fields. For information on transferring these fields, see the function
        module documentation.
    Note
        Besides the table fields already defined, customer-defined table fields
        can also be supplied with data. Since these fields are created by the
        customer, they are known only during the runtime and must therefore be
        determined dynamically.
        The structures BAPI_TE_<NAME> (<NAME> = MARA, MARC, MARD, MBEW, MLGN,
        MLGT, MVKE) and the relevant checkbox structures BAPI_TE_<NAME> (<NAME>
        = MARAX, etc.) must first be extended by the customer to include the
        fields required. The standard structures contain only the corresponding
        key fields. When including new fields in these structures, make sure
        that the field has the same name as the field in the database table. In
        addition, the fields in the structures BAPI_TE_<NAME> may only be of the
        type CHARACTER. The data element BAPIUPDATE must be used for the fields
        in the checkbox structure (except for key fields).
        The two parameters EXTENSIONIN and EXTENSIONINX are used to transfer the
        data to the method. The field STRUCTURE contains the name of the
        structure (for example, BAPI_TE_MARA or BAPI_TE_MARAX) used to identify
        the work area (for example, WA_BAPI_TE_MARA or WA_BAPI_TE_MARAX) to
        which the data is transferred. The remaining fields for the parameter
        EXTENSIONIN or EXTENSIONINX contain the data for the key fields (for
        example, the material number) and the data for the customer-defined
        fields. The number of characters reserved in the two parameters for the
        content of a customer-defined field must be the same as the number of
        characters for the corresponding work area field. If the number of
    characters required is smaller, the remaining characters in the two
    parameters must be filled with blanks. Only then may the content of
    another field be transferred. Here too, remember that the data is
    written to the database only if the corresponding indicator has been set
    in the work area.</b>
    Regards,
    ravi

  • Update the database table inside an user exit.

    Hi Experts,
    I have a issue where i have to update a custom table in an User exit.
    I am using Lock object for ENQUE/DEQUE.
    I have tried to use statements like UPDATE/MODIFY inside the user exit.
    But the problem is that it's not updating the database table at the same time.
    I know if i use COMMIT WORK it can update at the same time but it's not advisable to use COMMIT inside a work.and also it gives a short dump.
    The real issue is that this custom table is read for batch creation at the same time for different users.
    Now if it the program does not update the database table at the same time then other users also read the same data and create the same Batch number..
    While requirement is to create a different/unique batch numbers.
    Program is updating the table but it's taking time..so in between other users are creating the same batch number.
    Please guide me what would be the best solution for this.
    Regards,
    Amit Kumar Singh

    Thanks for your quick reply.
    My actually requirement is like that.
    I have to create a Process Order using tcode COR1.
    After passing some input value it goes inside an User Exit.
    There one Custom table is maintained which stores some fields like month,year,numeric key field,etc.
    The new batch number is created using the combination of these table fields.
    Once a new batch number is created it increment the numeric key field number by one.
    Issue is we have to update this new numeric field value into the database field so that other users can read a diffrent numeric field value.hence it will create a new/different batch number.
    Here i am not able to update the database table inside this User Exit.
    Table is geeting updated but after some time and out of this User Exit.
    Please suggest what's required in that case?
    Regards,
    Amit Kumar Singh
    Edited by: Amit  Singh on Feb 3, 2009 11:33 AM

  • Customer 9000AAAE : Exception 7 in function module VIEW_KUAG2

    Hi,
    Hi all,
    When I do the intercompany billing for STO (vf01), I got the system message attached below. The customer 9000AAAE is a ship to party and assigned to the ordering plant. It has the partner function SH. So can anybody kindly tell me where is wrong in the custmer master data or somewhere else according to the following message? Or where to find the VIEW_KUAG2? What does it mean?
    Customer 9000AAAE: Exception 7 in function module VIEW_KUAG2
    Diagnosis
    During the attempt to read customer master record 9000AAAE,
    an error occured which is not handled separately.
    System Response
    The billing document for this business transaction was not
    created.
    Procedure
    If the error occured during a background job, you should try
    to create the billing document online. If the error occured
    online, the billing document can be created online. In any
    case, you should check the customer master record. If you
    cannot find any error in the master data, contact SAP.
    Technical data
    Tech. data details
    Client                                                002
    Group Number
    Sales Document Number                  0080100090
    Item Number of the SD Document      000000
    Schedule Line Number                      0083
    Counter in Control Tables                  00
    Message Identification                      VF
    System Message Number                 083
    Output Type                                     E
    Message Variable 01                        9900AAAE
    Message Variable 02
    Message Variable 03                        VIEW_KUAG2
    Message Variable 04
    Group Type                                      F
    In our Intercompany, our ship to party is different from the Sold to, bill to and Payer.  The configuration done as follows -
    a.  Defined Ship to Party as 9000AAAE
    b.  Define Sold to, Bill to, Payer as 9000AAAA
    c.  Assignd Ship to Sold to
    d.  Assigned Ship to customer to plant assignment in STO configuration in MM
    e.  Assigned internal customer of sales organization as 9000AAAA
    Please help in this
    Best Regards
    Goutham

    Hi,
    Thanks for ur reply
    I check the partner determination and the settings are as below -
    a.  Defined new account group for Sold to, Bill to and Payer
    b.  Defined new account group for Ship to
    c.  In the Ship to party account group, system only determine the ship to partner function
    d.  Customer defined in Sold to is assined as interneal customer to sales org
    e.  Customer defined in Ship to is assigned as customer for plant in Shipping data configure for STO in MM Configuration
    Please provide more insights
    Best Regards
    Goutham

  • Change the data in fieldcat and update the database table in alv oops

    Hi,
    my requirement is i have displayed a fieldcat in change mode and when i change the data and click on save it has to be updated the database table..
    this has to be done using alv oops...

    Hi,
    This code will reflect all the changes into the internal table that is being displayed.
    * to reflect the data changed into internal table
          DATA : ref_grid TYPE REF TO cl_gui_alv_grid. "new
          IF ref_grid IS INITIAL.
            CALL FUNCTION 'GET_GLOBALS_FROM_SLVC_FULLSCR'
              IMPORTING
                e_grid = ref_grid.
          ENDIF.
          IF NOT ref_grid IS INITIAL.
            CALL METHOD ref_grid->check_changed_data.
          ENDIF.
    Now after this code is executed the internal table is modified as per the changes done in alv output.
    Now you can use this internal table to update the database table.
    Hope this helps you.
    Regards,
    Tarun

  • How to update two database tables when using DatabaseProvider

    I'm a begginer and I've made an application which uses a database. In one page, I have a table which I've took it from "woodstock basic" palette. I was using DatabaseProvider to populate the table with data from a database table called "copii". My code is:
    //i'm check all the rows in the table to see if the field "IDCOPIIC" =0 and if true I will put the value of "newCopiiId"
    do {
    if (copiiDataProvider.getValue("IDCOPIIC").equals
    (new Long(0))) {
    copiiDataProvider.setValue("IDCOPIIC", new Long(newCopiiId));
    newCopiiId++;
    } while (copiiDataProvider.cursorNext());
    copiiDataProvider.commitChanges();
    My problem comes now because I have another database table tided with a foreign key by this one and I want to update this one too when I'm updating the "copii" table. I don't know how to do it ...I've tried in many ways but is impossible. Can anyone help me ! I'm desperate...I cannot figure it out how I could insert, update in two tables in the same time when I'm using DataProvider .
    Thanks in advance!

    Hmm.
    Not sure where your going with the <select> menu.
    The description you made:
    "Both have an id column, which is presumably the record's primary key, but you need to create a relationship by storing the primary key of one table as a foreign key in the child (related) table. For example, you should insert the primary key of the first table in the second table as user_id. That enables you to identify which username and password are related to an individual listed in the second table"
    Seems to be the direction that I'm looking for.
    Now my question is how do I insert the primary key of the first table in the second table as user_id?
    >
    >"For example, you should insert the primary key of the first table in the second table as user_id"
    Since both tables have an id column and they both are the primary key, do I just change the name of the second tables id column to "user_id" then?
    Or is there an actual "insert the primary key to another table" function that I don't know about?

Maybe you are looking for

  • Best Practice setting up NICs for Hyper V 2008 r2

    I am looking at some suggestions for best practice for setting up a hyper V 2008 r2 at a remote location with 5 nics, one for managment vlan and other 4 on the data vlan.  This server will host  2 virtual machines, one is a DC and the other is a memb

  • Generate a text .sql

    i want to know how to exported objects to database into a document text in sql langage. THANKS.

  • ITunes log file.. Does one exist?

    To cut a long story short, I want to know if there is a log file that tells you everything iTunes does to your iDevice. For example, when you're syncing and you see messages in the status area of iTunes, are these or a more detailed anything recorded

  • The new I tunes is terrible!! HELP??

    Firstly, am I forced to upgrade and not have the option to go back to the old way? I hate the new format, and I've also noticed that I am now prevented from doing things that made the old itunes so user friendly. For example itunes artwork that cant

  • 10.4.7 and Palm Desktop not launching

    I upgraded to 10.4.7 via Software Update, and now can't launch my Palm desktop. I get the following error message: I/O Error - my only option is to click OK, when I do, I get the same error message with the same OK button - when I click it again, the