Update of Ztable

Hi,
We have a requirement in the testing, Quality and Production systems, where Z table is getting the data from a Web Page. It has to get the value of a field from the Development box. Its not getting the value for that particular field.
Could you let know how to retrive the data.
Hope the problem is clear.
Regards,
Ajaz

Hi,
there is a table zusr02, which has the fields
REQNO
SYSNAME
MANDT
UNAME....PARENTREQNO
The table in the Dev system has
req no 15
SYS NAME ...
PARENT REQNO 0.
the Quality system has the following values.
REQNO 02
SYSNAME..
PARENT REQNO  15.
The value of Parent req no is picked from the zusr02 table of Dev system.
Hope the requirement is a bit clear, else let me know shall try to provide more details.
Regards,
Ajaz

Similar Messages

  • Auto update of Ztable when ever BSID or BSAD tables updated

    Auto update of Ztable when ever DB table updated     
    Hi experts
    I want my Ztable get updated automatically when ever a record is created or updated in BSID or BSAD tables.
    Here clear requirement
    Generally using Company code & Allocation number  ( 18 char ) my programs access BSID & BSAD tables it is taking very long time for execution almost more than 30 minutes ( data in millions ).
    Step 1.
    I created a new Ztable with limited fields Company Code, Customer, Document, Allocation Number and Posting date.
    Step 2.
    Before look into BSID or BSAD my program searches Ztable for Customer number & Document number using Allocation field and Company code.
    Step 3.
    Once get the Customer & Document numbers accessing BSID & BSAD table is very easy (now just taking less than 1 minute).
    Created a new program to update Ztable every day but BSID and BSAD are live table so I want my Ztable get updated immediately when any entry posted in BSID or BSAD
    Please help me
    Satya
    Singapore

    You need to check what is the procedure (T-Code) from which the data gets updated into these tables.
    For example
    when we craete a material from MM01 the data gets updated in the corresponding table i.e. EKPO.
    In same way you need to find the process and then you can use BTE (Busineess transaction events) for that process. BTE are only for FI module and these tables are also related to FI .

  • Creation of function module for updating the ztable

    Hi,
    I am sending the requirement for ceation of function module for updating the ztable.
    Requirement----
    Table Updation rule (New record)
    While creating a new record the calling function will export the following to the table handling function.
    Table field     Probable Values
    ZORDERNO------->     Sales Delivery no in case of sales orderShipment no in case of transfer order
    UNAME----
    >     User ID
    ZORDTYPE----
    >     SALEOR in case of sales orderTRANSF in case of transfer order
    ZREFDOCNO----
    >Sales Order no in case of sales orderPurchase Order no in case of transfer order
    ZREFDOCNO1----
    >Delivery no in case of transfer order
    The table handling function will calculate the following fields
    Table field     Probable Values
    ZREQNO----
    >Running serial number (incremented by 1 for each new record)
    ZREQDAT     -
    >System date
    ZREQTIME----
    >     System time
    ZSTATUS----
    >OPEN (for all new records)
    Before inserting a new record the table handling function will always check if a previous record exists for the same order / shipment no. if record exists the function will not insert a new record.
    Table Updation rule (Status Update)
    While updating a record the calling function will export the following to the table handling function.
    Table field     Probable Values
    ZORDERNO----
    >Sales order no in case of sales orderShipment no in case of transfer order
    ZSTATUS----
    >CANCEL if cancellation successfulERROR if cancellation not possible (order already processed)
    The table handling function will calculate the following fields
    Table field     Probable Values
    ZSTATDAT----
    >System date
    ZSTATTIME----
    >     System time

    Do you have to create/update new record in Ztable through Function Module ?
    or you need to write FM only for validation?
    Any how, you need to create a Program with Input values for the fields of Ztable, and for rest of fields the Value can be calculated based on input as per your requirement.
    Let me know clearly what exactly u need ?
    Regards,
    Kiran

  • Updation of Ztable clicking on submit button in adobe interactive forms

    Hi all,
    In my adobe interactive form i have student details and one SUBMIT BUTTON.After clicking on that button i need to update the details in my Ztable. How Can I do?Where Can I write the code?
    Please reply me.
    Thanks in advance.

    Hi, I'm afraid I think there is no place where you can "catch" click on button in interactive form in sapgui, but you can:
    use http submit button and send data to your web service, which receive dataa and update your ztable,
    or you can create webdynpro, where you can catch click on submit button a in this event you can update yout ztable (my previous post).
    Please remember, that you can run your webdynpro application in sapgui:
    REPORT  DEMO_START_WD_IN_PLACE1 MESSAGE-ID SWDP_RUNTIME.
    start-of-selection.
      CALL FUNCTION 'WDY_EXECUTE_IN_PLACE'
        EXPORTING
         PROTOCOL               = 'HTTP'       " HTTP | HTTPS
        INTERNALMODE           = 'X'    "SPACE - browser is started
        PARAMETERS             =
          APPLICATION            = 'your_webdynpro_application
         CONTAINER_NAME         = 'SAP Formuláře'
        EXCEPTIONS
          INVALID_APPLICATION    = 1
          BROWSER_NOT_STARTED    = 2
          OTHERS                 = 3.
      IF sy-subrc EQ 1.
        MESSAGE a400.
      ELSEIF sy-subrc = 2.
        MESSAGE a401.
      ELSEIF sy-subrc = 3.
        MESSAGE a667.
      ENDIF.

  • How to update the ztable by using table handling function

    how to update the ztable by using table handling function
    It is very urgent ...............................
    thanks in advance

    see the  below code for the direct   ztable update
    Report  ZUPDATE_PRPS.
    tables: zprps.
    parameter: p_wbs like zprps-pspnr,
               p_value like zprps-fakkz default 'X'.
    data: wa_fakkz type zprps-fakkz.
    *START-OF_SELECTION
    start-of-selection.
    call function 'CONVERSION_EXIT_ABPSP_INPUT'
         exporting
             input     = p_wbs
        importing
             output    = p_wbs
        exceptions
             not_found = 1
             others    = 2.
    select single fakkz
      into wa_fakkz
      from zprps
    where pspnr eq p_wbs.
    if sy-subrc eq 0.
       update zprps set fakkz = p_value where PSPNR eq p_wbs.
       if p_value is initial.
         message i999(za) with 'Billing element field has been unchecked'.
       else.
         message i999(za) with 'Billing element field has been checked'.
       endif.
    else.
      message i999(za) with 'WBS element not found'.
    endif.
    reward  points if it is usefull .....
    Girish

  • How to update the ztable using screen.

    hi experts,
    i have one ztable with 8 fields
    and i created one screen with 8 fields
    how to update the ztable using this screen menas when i press the some push button in my screen the table should update.
    Devi

    hi
    check the link shown below
    Coding & screen shots of how to update a database table from screen(Module poool)
    http://www.scribd.com/doc/15628693/moduleprog090311165111phpapp011
    in the attachment u will find
    data  : begin of i_ysrtmm occurs 0,
            sno type ysrtmm-sno,
            sname type ysrtmm-sname,
            scity type ysrtmm-scity,
            sedu type ysrtmm-sedu,
            spercent type ysrtmm-spercent,
            select(1),
            end of i_ysrtmm.
    in the SE51 click on layout & in that menu goto - secwindow- enter the internal table i_ysrtmm
    and click on get from program.u will get all the fields of the internal table select all of them except
    SELECT  field  and then drag and drop on table control . double click on the table control u see the attributes screen there in the w/colselect enter i_ysrtmm-select for tab selection of table control.
    Regards

  • How to update the Ztable using modulepool Tablecontrol...

    Hi All,
    could anyone help me how to update the Ztable using modulepool Tablecontrol...
    if it is possible give me a example with code..
    Many thanks in advance...!!
    Rajesh

    Hi,
    For that pls refer to the link:
    http://help.sap.com/saphelp_nw70/helpdata/en/9f/dbac3735c111d1829f0000e829fbfe/frameset.htm
    Also refer the sample program:
    RSDEMO02
    Then for updating:
    modify the internal table(which u used to populate the tabcntrl) from the table control.
    Then update database table like:
    update dbtab from table itab.
    Regards,
    Renjith Michael.

  • Regarding Updation of ZTable

    hi all,
          I want to update ZTable from Internal Table.
    I write like this.
    Update <ztable> from table <internal table>.
    but error is coming like this.
    "the work area gt_final(internal table) is not long enough.
    What will be the problem.
    Please suggest.
    Regards
    Reddy

    HI,
    plz declare internal table as following :
    types: begin of type_itab,
              matnr type mara-matnr,
              end of type_itab.
    data: itab type standard table on type_itab,
             wa_itab like line of itab.
    this will help.
    thanx.

  • Not updating in ztable

    Hi all,
    REPORT  zevpoc_update.
    TABLES : evpoc.
    DATA: BEGIN OF itab OCCURS 0,
          objnr LIKE evpoc-objnr,
          versn_ev LIKE evpoc-versn_ev,
          evpai LIKE evpoc-evpai,
          datab LIKE evpoc-datab,
          poc LIKE evpoc-poc,
          END OF itab.
    DATA : wa TYPE zevpoc.
    SELECT * FROM evpoc INTO CORRESPONDING FIELDS OF TABLE itab.
    LOOP AT itab.
      wa-objnr = itab-objnr.
      wa-versn_ev = itab-versn_ev.
      wa-evpai = itab-evpai.
      wa-datab = itab-datab.
      wa-poc = itab-poc.
      wa-date1 = sy-datum.
      wa-time1 = sy-uzeit.
      INSERT INTO zevpoc VALUES wa.
    ENDLOOP.
    my code inserts all the values from table EVPOC to ZEVPOC.
    But when i update some fields in EVPOC it doesnt show in ZEVPOC.
    pls help.

    This is your code:
    DATA: BEGIN OF itab OCCURS 0,
    objnr LIKE evpoc-objnr,
    versn_ev LIKE evpoc-versn_ev,
    evpai LIKE evpoc-evpai,
    datab LIKE evpoc-datab,
    poc LIKE evpoc-poc,
    END OF itab.
    DATA : wa TYPE zevpoc.
    SELECT * FROM evpoc INTO CORRESPONDING FIELDS OF TABLE itab.
    LOOP AT itab.
    wa-objnr = itab-objnr.
    wa-versn_ev = itab-versn_ev.
    wa-evpai = itab-evpai.
    wa-datab = itab-datab.
    wa-poc = itab-poc.
    wa-date1 = sy-datum.
    wa-time1 = sy-uzeit.
    * INSERT INTO zevpoc VALUES wa.
    update zevpoc from table itab.
    ENDLOOP.
    Here some of my remarls:
    1. ITAB and ZEVPOC do NOT have the same structure.
    2. within LOOP you are doing update zevpoc from table itab. So every LOOP pass you are updating your table. Do the update within the LOOP but from workarea.
    3. If you insist on doing this from internal table, make sure structure of ITAB and DB is the same, and get it out of the loop. So first LOOP AT itab, pass to workarea and APPEND to NEW internal table with same structure as ZEVPOC.
    4. No longer use OCCURS 0 (not possible in ABAP OO), use TYPE STANDARD / SORTED / HASHED TABLE OF...<name>.
    5. LOOP AT itab INTO workarea..Use this

  • I need insert /update/modify  ztable from  internal table or work area

    I have one simple problem.
    TYPES: BEGIN OF t_account,
            acc_no          LIKE zztaccountheader-acc_no,
            cust_id         LIKE zztaccountheader-cust_id,
            acc_type        LIKE zztaccountheader-acc_type,
            od_option       LIKE zztaccountheader-od_option,
            od_limit        LIKE zztaccountheader-od_limit,
            od_issue_date   LIKE zztaccountheader-od_issue_date,
            END OF t_account.
    data: lwa_account TYPE  t_account,
         li_account TYPE STANDARD TABLE OF t_account,
    bu scerrin i am inputing data :
    i want modify updare or insert record into ztable by work area  i put following thing
    MOVE : zztaccountheader-acc_no        TO lwa_account-acc_no,
               zztcustomer-cust_id            TO lwa_account-cust_id,
               zztaccountheader-acc_type      TO lwa_account-acc_type,
               zztaccountheader-od_option     TO lwa_account-od_option,
               zztaccountheader-od_limit      TO lwa_account-od_limit,
               zztaccountheader-od_issue_date TO lwa_account-od_issue_date.
        INSERT   zztaccountheader CLIENT SPECIFIED FROM lwa_account .
        CLEAR lwa_account.
      ENDIF.
    i am etting error
    The type of the database table and work area (or internal table)
    "LWA_ACCOUNT" are not Unicode convertible.
    please solve it

    hi,
    decalre like this.
    tables : zztaccountheader.
    data : t_account like zztaccountheader occurs 0 with header line.
    data: lwa_account TYPE t_account,
    li_account TYPE STANDARD TABLE OF t_account,
    MOVE : zztaccountheader-acc_no TO lwa_account-acc_no,
    zztcustomer-cust_id TO lwa_account-cust_id,
    zztaccountheader-acc_type TO lwa_account-acc_type,
    zztaccountheader-od_option TO lwa_account-od_option,
    zztaccountheader-od_limit TO lwa_account-od_limit,
    zztaccountheader-od_issue_date TO lwa_account-od_issue_date.
    INSERT zztaccountheader CLIENT SPECIFIED FROM lwa_account .
    CLEAR lwa_account.
    ENDIF.
    rgss
    anver
    if hlped mark points

  • Module pool - table control - update ztable

    hello , i doing a module pool that will have few screens , now i have one screen with a table control that fetch the data from a ztable when screen is call the table control is showing the data and is in grey and no editable i add a pf-status for change that mode i can delete the row from the table control but i don't figure out how update to the ztable when i press save , i wan't too another button for add a new row ( and remain the already in grey ) for add new entrie in the table and update the ztable
    pd: sorry for my bad english
    this is my code:
    TOP:
    PROGRAM  z_pp_lote_etiquetas MESSAGE-ID zz.
    TABLES:zc2p_lote_etique,
           zc2p_lider_modul.
    DATA: ok_code LIKE sy-ucomm.
    DATA save_ok LIKE sy-ucomm.
    * internal table
    DATA: it_zc2p_lote_etique LIKE STANDARD TABLE OF zc2p_lote_etique.
    DATA: it_zc2p_lider_modul TYPE STANDARD TABLE OF zc2p_lider_modul WITH HEADER LINE.
    DATA: it_zc2p_lider_modul_del TYPE STANDARD TABLE OF zc2p_lider_modul WITH HEADER LINE.
    **************Workarea
    DATA: wa_c2p_lote_etique TYPE zc2p_lote_etique.
    DATA: wa_c2p_lider_modul TYPE zc2p_lider_modul.
    DATA: wa_c2p_lider_modul_del TYPE zc2p_lider_modul.
    DATA: sel.
    DATA: MARK.
    DATA: init.
    DATA:  col TYPE scxtab_column.
    DATA: lines TYPE i.
    * Variable Declaration
    DATA : flg, "Flag to set the change mode
    ln TYPE i. "No. of records
    * Table Control Declartion.
    CONTROLS: zc2p_lider_crtl TYPE TABLEVIEW USING SCREEN '101'.
    **PROCESS BEFORE OUTPUT INCLUDE **
    *&  Include           Z_PP_LOTE_ETIQUETAS_O01
    *& Module set_status OUTPUT
    * Setting the GUI status
    MODULE status_0100 OUTPUT.
      SET PF-STATUS 'Z_PP_LOT_ETIQ_MENU'.
      SET TITLEBAR 'Z_PP_LOT_ETIQ'.
    ENDMODULE. " set_status OUTPUT screen 100
    *  MODULE status_0101 OUTPUT
    * Setting the GUI status
    MODULE status_0101 OUTPUT.
      SET PF-STATUS 'Z_PP_LOT_ETIQ_ME_101'.
      SET TITLEBAR 'Z_PP_LOT_ETIQ'.
    * Data retreving
      if init is INITIAL.
      select * from zc2p_lider_modul into CORRESPONDING FIELDS OF TABLE it_zc2p_lider_modul.
        DESCRIBE TABLE it_zc2p_lider_modul LINES ln.
        zc2p_lider_crtl-lines = ln + 10.
        init = 'X'.
    endif.
    ENDMODULE.                    "status_0101 OUTPUT
    module change_sdyn_conn output.
    * you can change the content of current table control line via
    * sdyn_conn
      READ TABLE it_zc2p_lider_modul INTO zc2p_lider_modul INDEX zc2p_lider_crtl-current_line.
    endmodule.                             " FILL_TABLE_CONTROL  OUTPUT
    MODULE set_screen_fields OUTPUT.
    LOOP AT SCREEN.
    IF flg IS INITIAL.
    screen-input = 0.
    ELSE.
    screen-input = 1.
    ENDIF.
    *ENDIF.
    * Modifying the screen after making changes
    MODIFY SCREEN.
    ENDLOOP.
    ENDMODULE. " set_screen_fields OUTPUT
    PROCESS AFTER INPUT INCLUDE.
    *  MODULE USER_COMMAND_0100 INPUT
    MODULE user_command_0100 INPUT.
      CASE ok_code.
        WHEN 'LIDM'.
          CALL SCREEN 101.
        WHEN 'CANC'.
          LEAVE PROGRAM.
        WHEN 'BACK'.
          LEAVE PROGRAM.
        WHEN 'EXIT'.
          LEAVE PROGRAM.
      ENDCASE.
    ENDMODULE.                    "USER_COMMAND_0100 INPUT
    *  MODULE USER_COMMAND_0101 INPUT
    MODULE user_command_0101 INPUT.
      save_ok = ok_code.
      CLEAR ok_code.
      CASE save_ok.
        WHEN 'SORT'.
          DATA: fldname(100),help(100).
          READ TABLE zc2p_lider_crtl-cols INTO col WITH KEY selected = 'X'.
          SPLIT col-screen-name AT '-' INTO help fldname.
          SORT it_zc2p_lider_modul BY (fldname).
        WHEN 'CHANGE'.
    * Setting the flag to make the table control in editable mode[excluding
    * primary key].
          flg = 'Y'.
        WHEN 'BACK'.
          CALL SCREEN 100.
          LEAVE SCREEN.
        WHEN 'CANCEL'.
          LEAVE PROGRAM.
        WHEN 'EXIT'.
          LEAVE PROGRAM.
        WHEN 'SAVE'.
          MODIFY  zc2p_lider_modul FROM it_zc2p_lider_modul.
          COMMIT WORK.
      ENDCASE.
    ENDMODULE.                    "USER_COMMAND_0101 INPUT
    *  MODULE read_table_control INPUT
    MODULE read_table_control INPUT.
    * Check input values
      IF mark = 'X' AND save_ok = 'DELETE'.
        DELETE TABLE it_zc2p_lider_modul FROM zc2p_lider_modul.
        DESCRIBE TABLE it_zc2p_lider_modul LINES zc2p_lider_crtl-lines.
      ENDIF.
    ENDMODULE.                             " READ_TABLE_CONTROL  INPUT
    Screen Flow Logic 100
    PROCESS BEFORE OUTPUT.
    MODULE status_0100.
    PROCESS AFTER INPUT.
    MODULE user_command_0100.
    Screen Flow Logic 101.
    PROCESS BEFORE OUTPUT.
      MODULE status_0101.
      LOOP AT it_zc2p_lider_modul INTO zc2p_lider_modul WITH CONTROL
    zc2p_lider_crtl.
    * Dynamic screen modifications
        MODULE set_screen_fields.
        MODULE change_sdyn_conn.
      ENDLOOP.
    PROCESS AFTER INPUT.
      MODULE user_command_0101.
      LOOP AT it_zc2p_lider_modul.
        MODULE read_table_control.
      ENDLOOP.
    i hope somebody can help for what i missing here  thanks

    >
    Sanjeev Kumar wrote:
    > Hello Edgar,
    >
    > Problem seems to be there in the flow logic of 101
    >
    >
    > PROCESS BEFORE OUTPUT.
    >   MODULE status_0101.
    >   LOOP AT it_zc2p_lider_modul INTO zc2p_lider_modul WITH CONTROL
    > zc2p_lider_crtl. " no need to have 'INTO zc2p_lider_modul' above
    > * Dynamic screen modifications
    >     MODULE set_screen_fields.
    >     MODULE change_sdyn_conn.
    >   ENDLOOP.
    > *
    > PROCESS AFTER INPUT.
    >   MODULE user_command_0101. "this should be shifted after the following LOOP...ENDLOOP.

    >   LOOP AT it_zc2p_lider_modul. "need to have 'WITH CONTROL zc2p_lider_crtl' here
    >     MODULE read_table_control.
    >   ENDLOOP.
    >
    >
    >
    > With MODULE user_command_0101 call before the LOOP calls the MODIFY statement (under case save_ok 'SAVE') first and Z-table is updated with the old values as the changes are transferred from screen into the internal table it_zc2p_lider_modul in the LOOP...ENDLOOP later.
    >
    > Try these changes and I hope it will work.
    >
    > Thanks
    > Sanjeev
    i do the firts advice but the second one i get syntax error :
    my code :
    PROCESS AFTER INPUT.
      LOOP  at it_zc2p_lider_modul WITH CONTROL zc2p_lider_crtl.
        MODULE read_table_control.
      ENDLOOP.
       MODULE user_command_0101.
    error :
    In the event PROCESS AFTER INPUT, no additions are allowed with "LOOP     
    AT".

  • Update ztable is taking long time

    Hi All,
    i have run the 5 jobs with the same program at a time but when we check the db trace
    zs01 is taking long time as shown below.here zs01 is having small amount of data.
    in the below dbtrace for updating zs01 is taking 2,315,485 seconds .how to reduce this?
    HH:MM:SS.MS Duration     Program   ObjectName  Op.   Curs   Array   Rec     RC     Conn     
    2:36:15 AM     2,315,485     SAPLZS01  ZS01       FETCH  294     1     1     0     R/3     
    The code as shown below
    you can check the code in the program SAPLZS01 include LZS01F01.
    FORM UPDATE_ZS01.
    IF ZS02-STATUS = '3'.
        IF Z_ZS02_STATUS = '3'.            "previous status is ERROR
          EXIT.
        ELSE.
          SELECT SINGLE FOR UPDATE * FROM  ZS01
                 WHERE  PROC_NUM    = ZS02-PROC_NUM.
          CHECK SY-SUBRC = 0.
          ADD ZS02-MF_AMT TO ZS01-ERR_AMT.
          ADD 1           TO ZS01-ERR_INVOI.
          UPDATE ZS01.
        ENDIF.
      ENDIF.
    my question is when updating the ztable why it is taking such long time,
    how to reduce the time or how to make faster to update the ztable .
    Thanks in advance,
    regards
    Suni

    Try the code like this..
    data: wa_zs01 type zs01.
    FORM UPDATE_ZS01.
    IF ZS02-STATUS = '3'.
        IF Z_ZS02_STATUS = '3'.            "previous status is ERROR
          EXIT.
        ELSE.
          SELECT SINGLE FOR UPDATE * FROM  ZS01
                 WHERE  PROC_NUM    = ZS02-PROC_NUM.
    -- change
      CHECK SY-SUBRC = 0.
          ADD ZS02-MF_AMT TO wa_ZS01-ERR_AMT.
          ADD 1           TO wa_ZS01-ERR_INVOI.
          UPDATE ZS01 from wa_zs01.
        ENDIF.
      ENDIF.
    And i think this Select query for ZS01 is inside the ZS02 SELECT statement,
    This might also make slow process.
    If you want to make database access always use Workarea/Internal table to fetch the data
    and work with that.
    Accessing database like this or with Select.... endselect is an inefficient programming.

  • Unable to Update data in Ztable (dbase) through Table Control.

    Hi Experts.
    I am able to pull dta from Ztable into table control and also able to insert a new line and delete a row from table control. But after trying a lot I am unbale to pass the same from Table control to Ztable.
    Any ideas. Seems like here Update of Ztable needs some different treatment.
    PLZ LOOK into the code in red only. rest are for reference.
    The code on the Flow Logic Screen:
    PROCESS BEFORE OUTPUT.
      module init_100.
      LOOP At it_auftrag1 with CONTROL tctrl1 cursor tctrl1-current_line.
      ENDLOOP.
    PROCESS AFTER INPUT.
    LOOP AT it_auftrag1.
       Module modify_it_auftrag1.
    ENDLOOP.
    MODULE fcode_100.
    MODULE USER_COMMAND_9000.
    The code on main Screen (Mod. Pool Screen ) follows:
    PROGRAM  SAPMZDEMO_MPOOL_06.
    TABLES: ZLT_Auftrag1, ZLT_Kunde.
    DATA: fcode2(4), fcode(4).    "OK_Code.
    CONTROLS : tctrl1 type TABLEVIEW USING SCREEN '9000'.
    DATA: col TYPE cxtab_column.
    DATA: demo_cprop, demo_tprop.
    DATA:  Begin Of it_Auftrag1 occurs 20,
            marked.
            include structure ZLT_auftrag1.
    DATA:  END OF it_Auftrag1.
    DATA: linno TYPE i.
    DATA: fld(20).
    DATA: off TYPE i.
    module fcode_100 input.
    endmodule.                 " fcode_100  INPUT
    module modify_it_auftrag1 input.
      modify it_Auftrag1 index tctrl1-current_line.
    endmodule.                 " modify_it_auftrag1  INPUT
    module init_100 output.
      set pf-status 'ZSTATUS01'.
      Describe Table it_auftrag1  lines  tctrl1-lines.   "TO add Scroll Bar to Table Control1
      UPDATE ZLT_Auftrag1 From it_auftrag1.
    endmodule.                 " init_100  OUTPUT
    module USER_COMMAND_9000 input.
       CASE sy-ucomm.
    *To Populate Data into Kunde through Pushbuttons
        When 'OK_GETK'.
            IF ZLT_Kunde-K1 is NOT INITIAL.
                SELECT SINGLE *
                FROM  ZLT_Kunde
                Where K1 = ZLT_KUNDE-K1.
               IF ZLT_Kunde-K1 is NOT initial.
                  Select *
                  From ZLT_Auftrag1
                  INTO Corresponding fields of TABLE it_auftrag1
                  Where A3 = ZLT_Kunde-K2.
               ENDIF.
            ELSE.
                MESSAGE S000(8i) With 'Enter Kunde Name'.
            ENDIF.
      when 'DELL'.
    * remove marked lines
           delete it_auftrag1.
          loop at it_auftrag1 where marked = 'X'.
          UPDATE ZLT_Auftrag1 From it_auftrag1.
          endloop.
          if sy-subrc <> 0.
            get cursor field fld line linno offset off.
            set cursor field fld line linno offset off.
            if fld cp 'IT_auftrag1*' and sy-subrc = 0.
              linno = linno + tctrl1-top_line - 1.
              delete it_auftrag1 index linno.
              tctrl1-lines = tctrl1-lines - 1.
            endif.
          endif.
       When 'INSL'.
    * insert line above cursor position
          get cursor field fld line linno offset off.
          set cursor field fld line linno offset off.
          if fld cp 'IT_auftrag1*' and sy-subrc = 0.
            if linno >= 1.
              linno = linno + tctrl1-top_line - 1.
              clear it_auftrag1.
              insert it_auftrag1 index linno.
              tctrl1-lines = tctrl1-lines + 1.
            else.
              clear it_auftrag1.
              append it_auftrag1.
              tctrl1-lines = tctrl1-lines + 1.
            endif.
          endif.
         When 'SAVE'.
         loop at it_auftrag1 where marked = 'X'.
    *        Modify it_Auftrag1.
            Modify ZLT_Auftrag1 From it_Auftrag1.
          Endloop.
            IF sy-subrc = 0.
             MESSAGE s000(8i) With 'Data Saved'.
           ENDIF.
       When 'BACK'.
           Leave Program.
        When 'OK_CLEAR'.
          Clear : ZLT_KUNDE, ZLT_AUFTRAG1, it_auftrag1.
    ENDCASE.
    endmodule.                 " USER_COMMAND_9000  INPUT
    Looking forward for your advice,
    Regards
    Chandan

    Hi Venkat,
    Thanks again. I will try ur suggestion too. In the meanwhile I did the following changes in the code:
    Purpose: After data is getting pulled from dbase table (ZLT_Auftrag1) into internal table it_auftrag1 then and just after I press the button delete ( i.e. When the user command starts: When 'DELL' )
    then I delete all the contents reflecting in it_auftrag1 from ZLT_Auftrag1, Now the Ztable is empty but it_auftrag1 holds all values. futher when loop starts then the Marked line gets deleted. Now at this stage the it_Auftrag1 contains all data of ZLT_auftrag1 except the line that I want to delete. If I am able to MODIFY  the ZLT_auftrag1 from it_Auftrag1 at this stage then ZLT_Auftrag1 will again be populated with all those data except the line that I want to delete.
    Here goes the code that I modified ( ref the code in my 1st post in red to compare)
       WHEN 'DELL'.
    * remove marked lines
    *      If it_Auftrag1-Marked = 'X'.
            DELETE from ZLT_Auftrag1 where A3 = ZLT_kunde-K2.
    *      ENDIF.
          IF sy-subrc = 0.
                loop at it_auftrag1 where marked = 'X'.
                 DELETE it_auftrag1.
    *             INSERT ZLT_Auftrag1 From TABLE it_auftrag1 accepting duplicate keys.
    *             UPDATE ZLt_auftrag1 from TABLE it_auftrag1.
    *             MODIFY ZLT_Auftrag1 From TABLE it_auftrag1.
                endloop.
    *            INSERT ZLT_Auftrag1 From TABLE it_auftrag1.
    *             UPDATE ZLt_auftrag1 from TABLE it_auftrag1.
    *             MODIFY ZLT_Auftrag1 From TABLE it_auftrag1.
    *        If sy-subrc = 0.
    *          MESSAGE S000(8i) With 'Data Deleted from Database'.
    *        ENDIF.
          ENDIF.
            MODIFY  ZLT_Auftrag1 from it_Auftrag1.  ==> This modification doesn't works.
             If sy-subrc = 0.
              MESSAGE S000(8i) With 'Data Deleted from Database'.
            ENDIF.
          if sy-subrc <> 0.
            get cursor field fld line linno offset off.
            set cursor field fld line linno offset off.
            if fld cp 'IT_auftrag1*' and sy-subrc = 0.
              linno = linno + tctrl1-top_line - 1.
              delete it_auftrag1 index linno.
              tctrl1-lines = tctrl1-lines - 1.
            endif.
          endif.
    Looking forward for your suggestions.
    Regards
    Chandan

  • Update ztable from internal table

    I want to update the Ztable from internal table datas.
    what is the syntax to update.
    Its urgent send with coding example is better

    Hi
    PARAMETERS: p_carrid TYPE sflight-carrid,
                percent(1) TYPE p DECIMALS 0.
    DATA sflight_tab TYPE TABLE OF sflight.
    FIELD-SYMBOLS <sflight> TYPE sflight.
    SELECT *
           FROM sflight
           INTO TABLE sflight_tab
           WHERE carrid = p_carrid AND
                 fldate = sy-datum.
    IF sy-subrc = 0.
      LOOP AT sflight_tab ASSIGNING <sflight>.
        <sflight>-price =
          <sflight>-price * ( 1 - percent / 100 ).
      ENDLOOP.
    ENDIF.
    <b>UPDATE sflight FROM TABLE sflight_tab.</b>
    Thanks
    Vijay
    PLZ reward points if helpful

  • Update ztable from database table directly

    hi all,
    can u tell me the possible ways to update a ztable from database table directly.
    i mean is there anyway to update ztable whenever entry is created in database table .
    i dont want to update using insert,modify statements.
    points will be rewarded to all hlpful answers.

    A slightly dirty solution:
    Use SAP functions for reading from CDHEADER and CDPOS tables [with enough filters such that you extract minimum records possible] to read changes to MARA table fields since last run of your program. Use this information to update your ZTABLE. I would recommend having a table maintainance generator on ZTABLE. The actual update should be by a BDC by calling transaction SM30 for ZTABLE maintainance. Now the program may be set up as a batch job running 1ce an hour. You get updates to the extent of 1 hour latency.
    Alternatively, you may look if an opportunistic BADI / user Exit is there alongside MM01/02 transactions - assuming the latter are the only ones updating MARA. In this BADI you may write the code to update ZTABLE- again, look to do it by BDC call transaction sm30 to maintain ZTable. To lighten up the code -load on BADI you may simply raise a custom event and move on. You will configure a job that runs your program when that particular event is raised. This will need the 'burden' of figuring out the changes, though.
    An elegant way would be to fire a MATMAS fIDOC for every change to Material, capture that and turn back the changes to ZTABLE. This will facilitate the delta load.

Maybe you are looking for

  • Ipod not recognised in my computer or i tunes

    tried uninstall and reinstall i tunes twice no luck, read discussion about windows recognising i pod in my computer under usb device - not there- saw article about updating drivers telling me to go to run program from start and giving dode to input w

  • Reg. FM HR_READ_INFOTYPE

    Hi all,       I have a requirtement where in i used the FM HR_READ_INFOTYPE to fetch data from PA0001 and PA0105tables. Prior to this i am using theFM FM HRCA_GETEMPLOYEESDETAILS_FROMUSER, where i pass sy-uname and sy-datum and get the pernr . In thi

  • SSDT Unit Test - How to mock GETDATE()?

    Some of our procedures/triggers returns values basing on current date, i.e.: GETDATE(), GETUTCDATE() In such case a unit test will produce different result every time it is executed. I found an article that one embeds GETDATE() into user defined func

  • Illustrator SC4 crushes at launch on Mac OS 10.10, what can I do to fix this?

    Since the new update to the mac OS 10.10 my illustrator SC4 is crushing when i launch it. It gives me two pop up windows 1st "Do you want the application "SFCore" to accept incoming network connections?" No matter what i answer "deny or allow" it doe

  • Upgrade to OS X 10.9: return of AppleIDAuthAgent crash?

    Hi to everybody!!! Some days ago, when I've reboot my MBP 13" (Lion), after login, I had a crash report of AppleIDAuthAgent process. Now, I would like to instal OSX 10.9 but I've a question: if I do a clear instal and then I restore e backup TM, ther