How to update Z table with delivery number using MV50AFZ1

Hi Friends,
I am working with user exit MV50AFZ1/ USEREXIT_SAVE_DOCUMENT.
My requirement is I have a Ztable with delivery number field (initially blank). If I create a delivery thru sales order VA02 , my created delivery number should get populated/updated in my Ztable.
I would appreciate if someone could help me on this.
Thanks.

Hi
First of all, read SAP Note 415716 - User exits in delivery processing, as for instance, avoid your own COMMIT WORK.
For instance, as the sample code suggests, the better is encapsulate your ABAP coding in a function module with the option IN UPDATE TASK. Define the interface with the data that you need (XLIKP, XLIPS, XVBUK, and so on), after in your own coding (for instance)
FUNCTION Z_SAVE_DELIVERY
     IMPORTING
       VALUE(IM_LIKP) TYPE SHP_LIKP_T.
   DATA: w_zeta LIKE z_table.
   DATA: ty_likp TYPE likp.
  LOOP AT im_likp INTO ty_likp.
     MOVE-CORRESPONDING ty_likp TO w_zeta.
     MODIFY z_table FROM w_zeta.            "or your own algorithm, searching records and modify them.
  ENDLOOP.
In the userexit you can do this coding:
  CALL FUNCTION 'Z_SAVE_DELIVERY' IN UPDATE TASK
      EXPORTING
            im_likp = xlikp.
I hope this helps you
Regards
Eduardo
Edited by: E_Hinojosa on Jun 21, 2011 5:49 PM

Similar Messages

  • How to update two tables with trigger

    Hi:
    how to update two tables with trigger ?
    I have two tables :
    (1)ASIA
    MI number;
    (2)ASIA_P
    ID number;
    When I insert a new value into the asia.MI ,I also can
    insert the same value into the asia_p.id field.
    I have write a trigger as follows but it does't work.
    create or replace trigger MI_TRG
    before insert on asia
    for each row
    declare
    seq number;
    begin
    select MI_SEQ.Nextval into seq from dual;
    :new.MI:=seq;
    insert into ASIA_PRO(MI_ID)
    values
    (seq);
    end MI_TRG;
    How to realize it ?
    thanks
    zzm

    Why do you say it does not work?

  • How to create a table with varied number of columns?

    I am trying to create a balance table. The colunms should include years between the start year and end year the user will input at run time. The rows will be the customers with outstanding balance in those years.
    If the user input years 2000 and 2002, the table should have columns 2000, 2001, 2002. But if the user input 2000 and 2001, the table will only have columns 2000 and 2001.
    Can I do it? How? Thanka a lot.

    Why did you create a new thread for this?
    How to create a table with varied number of columns?

  • Recordset - updating 2 tables with 1 recordset using application object update record

    I have a recordset that uses a field from 2 different tables
    with a select statement where clause that joins a userid. I can
    display the field’s data just fine. Now I want to use the
    Application object “update record” so I can modify
    either of the fields. The problem is the Application object
    “update record” only allows you to update one table.
    How does Dreamweaver mx 2004 allow me to update 2 tables with one
    recordset and 1 submit button? Currently using php.
    Example of where:
    Where member.userid = member_detail.userid
    I tried creating the one form with the field from the first
    table and that works just fine. I added the other field from the
    other table into the form but ofcourse there isn’t any code
    that will update the second table so it won’t work.
    My application requires me to update alot of fields between 2
    tables at the same time.
    Does anyone know a way using Dreamweaver mx 2004 to do this?
    I don’t have much php experience.

    jon-rookie wrote:
    > DreamerJim,
    >
    > I am sorry but I don't think you are correct. I just
    can't believe that with
    > all the powers to be at Macromedia and now Adobe can't
    figure out how to update
    > two tables at once. There are millions of db's out there
    that require this. I
    > spent several hours today perusing lots of posts on the
    internet. It seems I
    > am not the only one out there that has asked this
    question. Unfortunately
    > there are no good answers yet to my surprise.
    >
    > I did find a Dreamweaver extension that does exactly
    what I myself and many
    > others want. The problem is it is no longer available
    unless you purchase a
    > bundle of software from Adobe.
    >
    > I have not looked into it in detail so I am not 100%
    sure that is accurate!
    >
    > Still, alot of php programmers do this all the time
    without much trouble. I
    > just want to know if Dreamweaver mx 2004 has the
    capability if a person knows
    > the right steps.
    >
    > Hopefully a Dreamweaver expert will post something to
    let us know for sure.
    > Until then I am stuck.
    >
    Not even CS3 has this built in, you will either have to code
    it yourself
    or buy the extension you have found. Dreamweaver gives you
    basic
    features to help you develop applications, but if you want to
    do
    anything really clever you have to do it yourself.
    One thing to consider is maybe creating an SQL view that is
    can be
    updated. I am pretty sure it exists, then you use the view
    instead of
    the table in the update behaviour. I have never done it
    myself, but I am
    sure it can be done.
    Steve

  • How to update Nested tables with xsu

    Hello,
    I have three tables.
    1) DEPARTMENT_TAB
    2) EMPLOYEE_TYP
    3) ADDRESS_TYP
    ADDRESS_TYP is a collection and it is nested inside EMPLOYEE_TYP.
    EMPLOYEE_TYP is a collection and it is nested inside DEPARTMENT_TAB.
    created with below scropt
    CREATE TYPE ADDRESS_TYP AS OBJECT (CITY VARCHAR2(10), STATE VARCHAR2(2));
    CREATE TYPE ADDRESS_TYP_NT AS TABLE OF ADDRESS_TYP;
    CREATE TYPE EMPLOYEE_TYP AS OBJECT (EMPNO NUMBER(4), ENAME VARCHAR2(10), ADDRESS_VAR ADDRESS_TYP_NT);
    CREATE TYPE EMPLOYEE_TYP_NT AS TABLE OF EMPLOYEE_TYP;
    CREATE TABLE DEPARTMENT_TAB (DEPTNO NUMBER(4), DNAME VARCHAR2(10), EMPLOYEE_VAR EMPLOYEE_TYP_NT)
         NESTED TABLE EMPLOYEE_VAR STORE AS EMPLOYEE_TAB
         ( NESTED TABLE ADDRESS_VAR STORE AS ADDRESS_TAB);
    I inserted two rows in DEPARTMENT_TAB and their nested tables using normalsql. and i generated below xml content using XSU java API
    oracle.xml.sql.query.OracleXMLQuery
    My Question is How to UPDATE a row in ADDRESS_TAB using XSU java API
    oracle.xml.sql.dml.OracleXMLSave.
    (When i was trying to update address_tab nested table's row with xml input file. it is deleting other existing rows)
    Thanks.

    Why do you say it does not work?

  • How to update a table with strin that contains &

    Hi,
    I would like to update ename col of emp table with a string that contains &
    update emp set ename = 'tom&jerry' where empno = 7369But this gives an error.Please advice.
    Regards,

    Consult the sql*plus reference manual on how to disable the &
    Software engineers should be capable of doing research themselves, please stop abusing this forum to increase your salary by being spoon fed for free.
    Sybrand Bakker
    Senior Oracle DBA

  • How to Update ESTMJ table with appended fields

    Attempting to do a mass load of data to table ESTMJ. Tried using an LSMW, but took a very long time...days in fact. Added a couple Z fields to this table in an append structure. Attempting to run BAPI_BUS1077_CREATE to add records, but how do I update the new Z fields using this BAPI?

    Hi,
    the af:column allows you to group columns
    <af:column>
    <af:column> </af:column>
    <af:column> </af:column>
    </af:clomn>
    Also, in HTML it is easy to assign a background color to cell, e.g. cell with Label 1 is red, Label 2 is green.
    Is there something like this in JSF?
    You can use CSS on the inlineStyl or contentStyle property to dynamically set CSS using EL. You can reference e.g. a managed bean , access the #{row} variable within the managed bean method and return the color based on the value you read for the each row
    Frank

  • How to Update EKPO table with enhancement at header level-customer data tab

    Experts,
    I have a requirement where I had to create a new button in the 'customer data' tab(header) in the ME21N/ME22N Transaction and once it gets clicked a table control will appear and in that all the line items with item no, material and plant and an additional check box will display, and once any one checks the check box against the item/material in the table control the item data with additional z fields (already created the zfields in EKPO Table) should get updated.
    Displaying Table control and item data on the click of button was successful, but once you check the check box against the item and save the PO it is not updating the z-fields in the EKPO table.
    I have implemented all the user exits , badis but no results. 
    Once you check the box in the table control against each item in the header part (Table control is in header part (customer tab)) the line item EKPO table with z fields should get updated.
    Any Clues/ideas will be appreciated.
    Thanks in advance,
    Kalikonda.

    Hi,
    Can you please share the remedy for above issue, recently we have same issue in our system.
    or please send me any supportive doc. for the below mail
    Looking forward for your positive response.
    Thanks
    Mohan
    ([email protected])

  • How to update a table with huge data

    Hi,
    I have a scenario where I need to update tables that are having huge data (each table is having more than 10,00000)
    I am writing this update in PLSQL block.
    Is there any way to improve the performance of this update statement? Please suggest...
    Thanks.

    user10403630 wrote:
    I am storing all tables and columns that needs to be updated in tab_list and forming a dynamic qry.
    for i in (select * from tab_list)
    loop
    v_qry := 'update '||i.table_name||' set '|| i.column_name ' = '''||new_value||'''' ||' where '||i.column_name = ''||old_value||'''';
    execute immediate v_qry;
    end loop;Sorry to say so but this code is aweful!
    Well the only thing to make this even more slow would be to add a commit inside the loop.
    Some advices. But I'm not sure which one works in your case.
    The fastest way to update a million rows is: write a single update statement. On typical systems this should only run for like a couple of minutes.
    if you need to update several tables then write a single update for each table.
    If you have different values that need to be updated then find a way how to consider those different values in a single update or merge statement. Either by joining another table or by using some in-lists.
    e.g.
    update myTable
    set mycolumn = decode(mycolumn
                                     ,'oldValue1','newvalue1'
                                     ,'oldValue2','newvalue2'
                                     ,'oldValue3','newvalue3')
    where mycolumn in ('oldValue1','oldvalue2','oldvalue3'....);If you need to do this in pl/sql then
    1) use bind variables to avoid hard parsing the same statement again and again
    2) use bulk binding to avoid pl/sql context switches

  • How to Capture a Table with large number of Rows in Web UI Test?

    HI,
    Is there any possibility to capture a DOM Tabe with large number of Rows (say more than 100) in Web UI Test?
    Or is there any bug?

    Hi,
    You can try following code to capture the table values.
    To store the table values in CSV :
    *web.table( xpath_of_table ).exportToCSVFile("D:\exporttable.csv", true);*
    TO store the table values in a string:
    *String tblValues=web.table( xpath_of_table ).exportToCSVString();*
    info(tblValues);
    Thanks
    -POPS

  • How to update application table with notification id

    What is the best method for updating an application table with the notification id of a notification just generated.
    We tried creating a suspended activity with a delay but it only works randomly. Sometimes the suspended update activity runs before the notification is generated and the update fails. Thanks, Tom

    Well, you could do a select in WF_NOTIFICATIONS and check if you application table is updated.
    select NOTIFICATION_ID from WF_NOTIFICATIONS where MESSAGE_TYPE like 'item type name'
    But as you noticied, notification id is not created immediately.
    Hope could help.
    Regards,
    Luiz

  • How to update database table with key field?

    Hello Experts,
    I have a database table with following fields
    MATNR   - Key
    SSOUR  -  Key
    KUNNR   - Key
    MENG1 
    MENG2
    MENG3
    And this table contains records like...
    MSD50001     R      1000001     5.30    2.30    5.25
    MSD50002     R      1000002     5.30    2.30    5.25
    MSD50003     R      1000003     5.30    2.30    5.25
    MSD50005     R      1000004     5.30    2.30    5.25
    MSD50004     R      1000005     5.30    2.30    5.25
    I have an internal table with same fields of above database table.
    MSD50001     A      1000001     5.30    2.30    5.25
    MSD50002     A      1000002     5.30    2.30    5.25
    MSD50003     A      1000003     5.30    2.30    5.25
    MSD50005     A      1000004     5.30    2.30    5.25
    MSD50004     A      1000005     5.30    2.30    5.25
    MSD50006     A      1000006     5.30    2.30    5.25
    I want to update the DB table with following internal table records.
    If internal table records = db table records are same then Update....else insert from internal table to db table.
    But here, SSOUR is key field so i am not able to use
    MODIFY dbtab from itab.
    It results me , entries in internal table are inserted into db table.
    So i have double records.
    Is there any statement which updates the key field? and if no fields in db table then insert it?
    Regards
    RH

    hi,
    u cannot update akey field.u can update only non key fields by using key field as a selection criteria.For example if u go to sm30 if u enter any table for inserting values, the key field will always be greyed out it is not succumbed to chnges.but u can insert value into ,if ur inserting and in the insert staemnet if  u have key field which is already present in the table it will return sy-subrc = 4 otherwise it will insert the record and return 0.
    eg for update :
    UPDATE zdm_wtyprof  SET upload_status = 'S'
                             WHERE spart = wa_upd-spart.
    here spart is the key field and it will update the status field in the table as S.
    if updated succesfully it will return 0.
    SIMILARLY U CAN USE select.

  • How to create a table with auto number?

    I want to create a table with a column default to increasing integer. The first thought came up to me is to use sequence. I find in google the following create statement create table etl_stats1 (run_time date,arr_rows int,lid int default nextval('etl_req'));get ORA-04044: procedure, function, package, or type is not allowed here.
    There are threads metioned using trigger to do the job. But does what not support default to a sequence, it appears such a nature way.

    You need to create a sequence and a trigger:
    SQL> create table etl_stats1 (run_time date,arr_rows int,lid int)
      2  /
    Table created.
    SQL> create sequence etl_seq;
    Sequence created.
    SQL> create or replace
      2    trigger etl_stats1_bir
      3    before insert
      4    on etl_stats1
      5    for each row
      6    begin
      7        select etl_seq.nextval into :new.lid from dual;
      8  end;
      9  /
    Trigger created.
    SQL> insert into etl_stats1 (run_time,arr_rows) values(sysdate,99)
      2  /
    1 row created.
    SQL> select * from etl_stats1
      2  /
    RUN_TIME   ARR_ROWS        LID
    15:38:41         99          1
    SQL> SY.

  • How to update a table with if condition

    here is my table 
    Party1 party2 DELFlag
    JON     NYC     0
    JON     NYC1   0 
    SAM     NYC   0
    SAM    NYC1   0
    TOM     NYC1   0
    GIT      NYC1   0
    No I need to change all NYC1 to NYC , but I get primary key error As JON is already related to JON->NYC  in this case I need to make the flag to 1 
    To be more specific JON->NYC1 must be JON-NYC1-1 and TOM-NYC1-0 must change to TOM-NYC-0 as tom does not have any records 
    My table update must look like 
    Party1 party2 DELFlag
    JON     NYC     0
    JON     NYC1   1
    SAM     NYC   0
    SAM    NYC1   1
    TOM     NYC   0
    GIT      NYC   0

    I can't use this INSERT INTO @partyRock (Party1, Party2, DELFLag) VALUES my table has thousands of rows and other relations even 
    Dont want to create a new table as this is in all my prod servers , want to update 
    Party1 party2 DELFlag
    JON     NYC     0
    JON     NYC1   0 
    SAM     NYC   0
    SAM    NYC1   0
    TOM     NYC1   0
    GIT      NYC1   0
    SDS      ORD 0
    DED      MEX  0
    Update output table
    Party1 party2 DELFlag
    JON     NYC     0
    JON     NYC1   1
    SAM     NYC   0
    SAM    NYC1   1
    TOM     NYC   0
    GIT      NYC   0
    SDS      ORD 0
    DED      MEX  0

  • How to update database table with this new internal table

    hi
    i have a internal table having 8 records and it contains one record which was modified by user
    not i want this new record to be updated to the database table which was modified by the user
    how to do it pls suggest?
    i want to use index for comarision as using index will not have any problems like promary key etc
    like i want to capture the index for this table which was modified thr recoed index and use thi record indext to modify the database table
    or any other suggestion
    regards
    nishant

    Hi Nishant,
    Have an additional field in a table to indicate a change with which you avoid in updating the record modified by user.
    Regards,
    Madhu.

Maybe you are looking for

  • I am not able to compile this program because it has an compile error.

    Please identify the problem and offer and/or correct the problem.+_ Thank you very much for helping a new java wana_be programmer!+_ Below is the source code:+_ *===================*_ import java.awt.*; import java.awt.MediaTracker; import java.awt.e

  • Connection steps for SAP BW and R/3

    Hi Every Body, Can you please explain me detail about the connectivity between R/3 and BW. General steps which am aware is as follws;- SAP R/3 steps to be performed 1.     Define Logical system---->(e.g ABC100) 2.     Assign client to logical system

  • Reply button has no effect, can't reply

    I posted a question about Final Cut 7 and got an excellent reply. However, after logging in to offer my thanks and more information about the answer, the reply button seemed dead to the world. I can clip the reply button but nothing happens. Anyone w

  • Non invoice related deductions through EDI

    I am trying to automate the cash application process via the receipt of the customer inbound 820 (using message type REMADV, type PEXR2002). I can successfully post payment, clear open items, and set up deductions relating to a specific invoice, but

  • Oracle Alert

    Hey ppl, I do have a requirement in Oracle Alerts to get the email alert whenever an employee is created.. Now everything is working fine... But this alert works only for one particular BG... Even if i choose the Operaing Unit in Installation Tab, it