Updating VKDFS table through Delivery

Hi,
My requirement is as follows:
Im using a USEREXIT to assign the Billing Date (LIKP-FKDAT) with the Delivery Date (LIKP_LFDAT) in VL02N transaction.
I also need to update the Field VKDFS-FKDAT through VL02N transaction.
Please let me know how I can do it.
Thanks in advance,
Ashwini

You can set initial billing date values during data transfer in copy control.  Adjusting the date should be done in the SAVE_DOCUMENT_PREPARE method of delivery BADI LE_SHP_DELIVERY_PROC.  The date in VKDFS will take care of itself...

Similar Messages

  • Updating HRP table through abap codes - is it correct

    Hi all,
    In my hrp1001 table,I want that All Qualifications (Q) and Tasks (T) assigned to all the functional roles (ZF) existing in the system should be transferred to the positions(S) tagged to those respective functional roles.
    For that I am supposed to write a code which copies the entries from Qualifications (Q) and Tasks (T) and tag the same to the positions (S).
    Below is the sample code which is adding just one record to HRP1001 through abap statment. What I am curious to know is wheather it is logically correct to update HRP  table through abap statments or no. If not, Please let me know what should we do as a solution - should we update all records through LSMW of PP01 or any thing else we can do???
    REPORT  ZHRPAR0005 .
    TABLES: HRP1000, HRP1001.
    DATA IT_1001 LIKE HRP1001 OCCURS 5 WITH HEADER LINE..
    SELECT SINGLE * FROM HRP1001 INTO IT_1001 WHERE OTYPE = 'CP' AND PLVAR = '01' AND SCLAS NE 'S'.
    IT_1001-OTYPE = 'S'.
    APPEND IT_1001.
    INSERT INTO HRP1001 VALUES IT_1001.
    Thanks
    Ribhu

    Hi Ribhu..
    there are various FMs available for this purpose..
    use those... becasue if u directly insert, update or modify record in HRP1000 or HRP1001...
    then some related table might not be updated..
    So use FMs..
    RH_COPY_INFTY
    RH_CUT_INFTY
    RH_DELETE_INFTY
    RH_INSERT_INFTY
    RH_INVERT_RELA_INFTY
    RH_UPDATE_INFTY
    <b>For IT 1001 </b>
    RH_CUT_INFTY_1001_EXT
    RH_CUT_INFTY_1001_EXT_GENERIC
    RH_DELETE_INFTY_1001_EXT
    RH_DEL_INFTY_1001_EXT_GENERIC
    RH_INSERT_INFTY_1001_EXT
    RH_UPDATE_INFTY_1001_EXT
    RH_BASE_READ_INFTY_1001
    RH_READ_INFTY_1001
    RH_READ_INFTY_1001_EXT
    RH_READ_INFTY_1001_EXT_ONLY
    Reward if useful
    Regards
    Prax

  • Updating HRP tables through abap code- is it correct?

    Hi all,
    In my hrp1001 table,I want that All Qualifications (Q) and Tasks (T) assigned to all the functional roles (ZF) existing in the system should be transferred to the positions(S) tagged to those respective functional roles.
    For that I am supposed to write a code which copies the entries from Qualifications (Q) and Tasks (T) and tag the same to the positions (S).
    Below is the sample code which is adding just one record to HRP1001 through abap statment. What I am curious to know is wheather it is logically correct to update HRP table through abap statments or no. If not, Please let me know what should we do as a solution - should we update all records through LSMW of PP01 or any thing else we can do???
    REPORT ZHRPAR0005 .
    TABLES: HRP1000, HRP1001.
    DATA IT_1001 LIKE HRP1001 OCCURS 5 WITH HEADER LINE..
    SELECT SINGLE * FROM HRP1001 INTO IT_1001 WHERE OTYPE = 'CP' AND PLVAR = '01' AND SCLAS NE 'S'.
    IT_1001-OTYPE = 'S'.
    APPEND IT_1001.
    INSERT INTO HRP1001 VALUES IT_1001.
    Thanks
    Ribhu

    Hi Ribhu..
    there are various FMs available for this purpose..
    use those... becasue if u directly insert, update or modify record in HRP1000 or HRP1001...
    then some related table might not be updated..
    So use FMs..
    RH_COPY_INFTY
    RH_CUT_INFTY
    RH_DELETE_INFTY
    RH_INSERT_INFTY
    RH_INVERT_RELA_INFTY
    RH_UPDATE_INFTY
    For IT 1001
    RH_CUT_INFTY_1001_EXT
    RH_CUT_INFTY_1001_EXT_GENERIC
    RH_DELETE_INFTY_1001_EXT
    RH_DEL_INFTY_1001_EXT_GENERIC
    RH_INSERT_INFTY_1001_EXT
    RH_UPDATE_INFTY_1001_EXT
    RH_BASE_READ_INFTY_1001
    RH_READ_INFTY_1001
    RH_READ_INFTY_1001_EXT
    RH_READ_INFTY_1001_EXT_ONLY
    Reward if useful
    Regards
    Prax

  • T-Code to update condition table for delivery & transport scheduling to SCM

    Hello,
    Could you tell the T-code to update condition table for delivery & transport scheduling to SCM system
    These are the some SAP fileds
    /SAPCN1/KOTABNR (Condition Table)
    /SAPCND/KAPPL(Application)
    /SAPCND/KSCHL(Condition type)
    /SAPCND/KOLNR(Access sequence)
    Thanks in Advance
    RK
    Edited by: RK on Jun 9, 2009 5:58 PM

    HI
    The TCODE for this is /SAPAPO/ATP_GCM.
    Regards
    Anurag.

  • How does SAP updates MKPF Table Through TCODE MB0A

    Hello There,
       how does SAP updates MKPF Table Through TCODE MB0A ( POST GOODS RECEIPT )? I tried to debug the same by posting GR, but could not figure out.
    Awaiting Reply
    Santosh

    Hi ,
    These are the table that are updated through the MB0A ,,
    DGESV DMAEX DMAKT DMAPE
    DMARM DMEAN DMKAL DMLAN
    DPROW DQMAT DUNGV MARA
    MARC MARD MBEW MFHM
    MLGN MLGT MPGD MPOP MVKE,
    MCHA, MCHB, MCHD.
    Regards,
    Bharani

  • Error while updating lookup table through PSI

    Hi,
    I am trying to update a lookuptable through PSI using following code : 
    $lookupTableGuid = $svcPSProxy.ReadLookupTables($EPMTYString, 0 , 1033).LookupTables | where {$_.LT_NAME -eq $Lookuptablename}
    $lookuptable = $svcPSProxy.ReadLookupTablesbyUids($lookupTableGuid.LT_UID, 1 , 1033)
    $lookuptablerowValues = $svcPSProxy.ReadLookupTablesbyUids($lookupTableGuid.LT_UID, 0 , 1033).LookupTableTrees
    #get lookup table count
    $lookuptableValues = $svcPSProxy.ReadLookupTablesbyUids($lookupTableGuid.LT_UID, 0 , 1033).LookupTableTrees
    $count = $lookuptableValues.Count +1
    #Insert the rows of table in Lookup Table
    foreach ($rows in $table)
    $value_Code = $rows.Item("Project_code")
    $value_Name = $rows.Item("project_desc")
    $GUID = [System.Guid]::NewGuid()
    $LookupRow = $lookuptable.LookupTableTrees.NewLookupTableTreesRow()
    $LookupRow.LT_STRUCT_UID = $GUID
    $LookupRow.LT_UID = $lookupTableGuid.LT_UID
    $LookupRow.LT_VALUE_TEXT = $value_Code
    $LookupRow.LT_VALUE_DESC = $value_Name
    $LookupRow.LT_VALUE_SORT_INDEX = ($count ++)
    $lookuptable.LookupTableTrees.AddLookupTableTreesRow($LookupRow)
    $error.clear()
    #Exceptions Handling :
    Try
    $svcPSProxy.UpdateLookupTables($lookuptable , 0 , 1 , 1033)
    Catch
    write-host "Error updating the Lookup table, see the error below:" -ForeGroundColor Red -BackGroundColor White
    write-host "$error" -ForeGroundColor Red
    Initially, I tried to run with value of $value_code as "AACL", the code worked.
    But when I tried to insert value of code as "AACL - ALKYL AMINES CHEMICALS LIMITED"
    I got following error:
    Exception calling "UpdateLookupTables" with "4" argument(s): "Response is not well-formed XML."
    I could not understand why this error is appearing as I just added ' - ' to my code value. I checked for validity of ' -  'in the targeted column. No issue with that.
    Please help.
    Thanks and regards,
    Jayesh

    Hi All,
    The entries are maintained from DB level.
    Thanks for the help.
    DVRK

  • PL/SQL Trying to update a table through trigger on the same table

    Hi everyone my name is Edwin and I'm new to this forum. I hope I can learn a lot from this community and over time contribute to it.
    The problem I'm facing at the moment is a tough one. I need to update a table (table a) with a value called block_id. This block_id is generated by a procedure I have written myself, the end result is stored in another table (table b). This block_id needs to be generated after certain rows of table a get updated with a trans_id. The trans_id is all the same for these rows in table a, but the generated block_id isn't. In my code I use an after update on collumn a of table a trigger. So if the the collumn gets updated the trigger fires. The trigger calls the procedure that generates the block_id and the procedure generates table b with all the block_id's. But then I want to update the rows in table a with the generated block_id in table b. The problem is that this self-deadlocks.
    You might think that this would call a recursive trigger, but I have written code in the trigger that checks if the block_id isn't allready filled in on table a.
    Also I really need all the values wich get updated (table a), so I believe a before update is also out of the question.
    And the first update of table a is done through an erp-packet and I can't get at that code, otherwise I would just have run my code from there.
    Message was edited by:
    user625855

    CREATE OR REPLACE TRIGGER block_id_trigger AFTER UPDATE ON unload_details_tab
    DECLARE
    current_transport_id NUMBER;
    check_value NUMBER;
    check_block_id NUMBER;
    PRAGMA AUTONOMOUS_TRANSACTION;
    BEGIN
    current_transport_id := get_curent_trans_id; --function that gets the current transport_id
    check_value := check_site_and_directive(current_transport_id); --function checks if this transport_id should have a block_id
    check_block_id := check_for_block_id(current_transport_id); --function checks if there isn't allready a block_id set.
    IF check_value = 1 AND check_block_id = 0 THEN
    create_blok_id_table(current_transport_id); --this procedure creates the blok_id in temptable
    UPDATE unload_details_tab a SET a.block_id = (SELECT DISTINCT b.blok_id FROM temptable b WHERE b.mark = a.mark_1) WHERE a.transport_id = current_transport_id; --this statement should update the table back, if I leave it out everything works fine, but when I leave it I get the self-deadlock error.
    ELSE
    null;
    END IF;
    END block_id_trigger;
    Ok, I cleaned the code somewhat.
    user625855

  • Updating two tables through JDBC

    <b>Hai,
    Can anybody please answer the following question?
    How can I update two table in Receiver by using JDBC Adapter at receiver side from single source structure.
    Thanks in advance.</b>

    Hi ,
    Create following structure for inbound data type to insert data in DB using JDBC receiver adapter here dbTableName1 is for first table and dbTableName2 for second table .
    <StatementName2>
    <dbTableName1 action="UPDATE_INSERT">
    <table>realDbTableName</table>
    <access>
    <col1>val1</col1>
    <col2>val2</col2>
    </access>
    <access>
    <col1>val11</col1>
    </access>
    </dbTableName1> 
    <dbTableName2 action="UPDATE_INSERT">
    <table>realDbTableName</table>
    <access>
    <col1>val1</col1>
    <col2>val2</col2>
    </access>
    <access>
    <col1>val11</col1>
    </access>
    </dbTableName2> 
      </StatementName2>
    Thanks ,
    Suvarna
    pls award pts if it helps

  • Updating Database table through Format Trigger in 10g Reports

    Dear Users
    I'm using 10g Reports Rel.2. I'm using a report column as a hyperlink using SRW.Set_Hyperlink. I've taken 2 actions through this hyperlink. 1stly I'm callin a report from this link n 2ndly I'm running an update statement after the hyperlink statement like below:
    SRW.Set_Hyperlink('....');
    Begin
    Update table_name Set
    column_name=value;
    End;
    So the 1st statement is running well i.e report is being called but update statement is not executing. I've tried this both in HTMLCSS and PDF formats but Update statement is not executing. I was doing the same job successfully in 6i reports behind a button (except that report was being called using Srw.Run_Report). Is there any thing different in 10g reports for this job ???

    I'm using 'Update statement' behind the hyperlink in different situations for example I wish that a report should print only through a button or a hyperlink and its destination should be a printer. 2ndly I want to keep record of printed reports through updating a field against printed records in a table so that user should not be able to print a data again and again. I was doing this successfully in 6i behind a button but in 10g, report is being called through hyperlink but update statement below the report calling code does not execute.
    Have u understood the situation

  • Can we update mseg table through badi mb-migo_badi or not???

    Hi Experts
    I had a requirement to add an additional tabstrip at the item level of MIGO transaction .
    I have implmeented the same using MB_MIGO_BADI .
    I have also added a field quantity on this tab.
    The problem now is i'm not able to update this field in the MSEG table.
    I have extended the MSEG table using append structures.
    Regards,
    Sunny

    use this fm inside ur badi
    J_1IEXGM_BADI_POST_DOCUMENT
    also chk this thread
    Re: MB_MIGO_BADI   IMPLEMENTATION
    кu03B1ятu03B9к
    Edited by: kartik tarla on Mar 11, 2009 12:12 AM

  • Updating a table through a manually created tabular form does not work.

    Hi Friends,
    I don't know why the "On submit - After computations and validations" process does not update the referenced table. May I miss something. Here is my source :
    select
    apex_item.hidden(1,eqp_id) id,
    apex_item.hidden(2,tcs_tcs_id) tcs,
    apex_item.text(3,eqp_equip_name,50) name,
    apex_item.text(4,eqp_equip_ident,50) ident,
    apex_item.text(5,eqp_equip_type,15) type
    from equip_physical
    where tcs_tcs_id = :P1_TCS_ID
    and here is the process source
    FORALL i IN 1..apex_application.g_f01.count
    UPDATE equip_physical
    SET eqp_equip_name=apex_application.g_f03(i),
    eqp_equip_ident=apex_application.g_f04(i),
    eqp_equip_type=apex_application.g_f05(i)
    WHERE eqp_id=apex_application.g_f01(i);
    No error message is displayed and my success message associated to the process is displayed. But the modified text field value is erased and the database table is not updated.

    I'd call it a bug/missing feature.
    It appears that within a Basic report, sorting on a column created using APEX_ITEM.DATE_POPUP2() does not sort by date.
    I'd file this with Oracle Support and see what they say.
    Include a link to this thread and your workspace login information.
    I got something to work by: (probably not what you want.)
    using the C004 column directly. (I just added it to the SQL code)
    setting the column's attribute "Display As" to "Date Picker"
    setting the column's attribute "Number /Date Format" to DD-MM-YYYY
    I suspect: since you don't start with p_idx => 1, this column becomes "1" ==> g_f01
    MK

  • Updating a table through ALV

    Hi all,
    I have one requirement.
    I need to display output using alv grid display.Next when somebody select the rows in the grid display and press a push button then the selected fields are updated in the ztable created.
    How can i achieve this.
    How to get a push button on the alv.
    how to update the the table with the selected rows.
    Please give some suggestions for this.
    Thanks to all in advance.

    CHk this program...
    U have to mention button names in PF-status creation
    REPORT  ZVA0T_PRCTR_FAL NO STANDARD PAGE HEADING MESSAGE-ID RA.
                              Modification Log                           *
    Program Name  : ZVA0T_PRCTR_FAL                                      *
    Author        : Suman K                                              *
    Date Written  : 04/27/2004                                           *
    Request #     : SAGK901471                                           *
    Requested by  : Torrence Roundtree                                   *
    Description   : This program is for maintainance of table            *
                    ZVA0T_PRCTR_FAL. The program has been copied from    *
                    custom program named ZSSVT_USR_TBL_MAINTENANCE and   *
                    done with essential changes to include table         *
                    ZVA0T_PRCTR_FAL and selection screen options. The    *
                    existing program documentation is as below           *
    Program Specifications:                                              *
    Mod date  Programmer        Reference    Description                 *
    *04/27/2005 Suman K           SAGK901471   Initial Development         *
    Type pools                                                           *
    TYPE-POOLS : slis.                     " Used for ALV display
    Tables
    TABLES: ZVA0T_PRCTR_FAL .              " LO43 Profit Center Listings
    Constants
    CONSTANTS:
    For authorization check for modifying Table Entries
      c_act_auth_01 LIKE tactz-actvt VALUE '01',
      c_act_auth_02 LIKE tactz-actvt VALUE '02',
      c_act_auth_06 LIKE tactz-actvt VALUE '06',
      c_table       LIKE dd02l-tabname VALUE 'ZVA0T_PRCTR_FAL',
                                           " Table name
      c_save        TYPE c VALUE 'A',      " Save
      c_chg(3)      TYPE c VALUE 'CHG',    " Change Group
      c_a           TYPE c VALUE 'A',      " Cancel Indicator
      c_ct(2)       TYPE c VALUE 'CT'.     " Style Name
    Work Variables declaration
    DATA:
      w_transaction_code LIKE tstc-tcode,  " Transaction Code
      w_variant          TYPE disvariant,  " Variant
      ok_code            LIKE sy-ucomm.    " OK Code
    Reference variables for the ALV grid control........................
    DATA:
      w_grid TYPE REF TO cl_gui_alv_grid,  " ALV Grid
      w_custom_container TYPE REF TO cl_gui_custom_container.
                                           " Reference to Container
    Variables used in User_command_0100
    DATA:
      w_confirm_ind    TYPE c,             " Deletion Indicator
      W_SUBRC          LIKE SY-SUBRC.      " Subrc
    Flag declaration
    DATA:
      fl_chng   TYPE c,                    " Flag
      fl_cancel TYPE c.                    " Flag
    Internal tables declaration
    To store the function codes.........................................
    DATA:
      BEGIN OF wa_fcode,
        fcode LIKE sy-ucomm,               " User Command
      END OF wa_fcode.
    Table for User Command
    DATA: t_fcode LIKE STANDARD TABLE OF wa_fcode.
    To store the data of ZVA0T_PRCTR_FAL table
    DATA:
      T_ZVA0T_PRCTR_FAL LIKE STANDARD TABLE
                          OF ZVA0T_PRCTR_FAL.
    Table used in User_command_0100
    DATA:
      t_selected_rows  TYPE lvc_t_row.     " Selected row information
    DATA:
      FS_SELECTED_ROWS LIKE LINE OF T_SELECTED_ROWS.
                                           " Work area for Selected Rows
    Selection screen elements
    SELECTION-SCREEN: BEGIN OF BLOCK blk1 WITH FRAME TITLE text-008.
    SELECT-OPTIONS:
      s_prctr FOR ZVA0T_PRCTR_FAL-leg_prctr.
                                           " Profit Center
    SELECTION-SCREEN: END OF BLOCK blk1.
    SELECTION-SCREEN: BEGIN OF BLOCK blk2 WITH FRAME TITLE text-009.
    PARAMETERS:
      p_varant  LIKE ltdx-variant.         " ALV variant
    SELECTION-SCREEN: END OF BLOCK blk2.
    Initialization
    INITIALIZATION.
    Authorization check for transaction code
      SELECT tcode
        FROM tstc
        INTO w_transaction_code
          UP TO 1 ROWS
       WHERE pgmna EQ sy-repid.
      ENDSELECT.
      IF sy-subrc EQ 0.
        AUTHORITY-CHECK OBJECT 'S_TCODE'
                     ID 'TCD' FIELD w_transaction_code.
        IF sy-subrc NE 0.
          MESSAGE e100 WITH text-e01 w_transaction_code.
        ENDIF.                             " IF SY-SUBRC NE 0
      ENDIF.                               " IF SY-SUBRC EQ 0
    At selection screen                                                 *
    AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_varant.
    to get the existing values for the display variant
      PERFORM f4_on_display_variant CHANGING p_varant.
    AT SELECTION-SCREEN ON p_varant.
    validates the diplay variant
      IF p_varant IS NOT INITIAL.
        PERFORM validate_variant.
      ENDIF.                               " IF P_VARANT IS NOT INITIAL
    Start Of Selection
    START-OF-SELECTION.
      CALL SCREEN 0100.
    *&      Form  f4_on_display_variant
    This subroutine is used to get the existing values for display variant
    The parameter passed to the subroutine is Variant parameter
    FORM f4_on_display_variant CHANGING p_varant TYPE any.
      DATA: lw_variant LIKE disvariant.    " Variant
      lw_variant-report   = sy-repid.
      lw_variant-username = sy-uname.
      CALL FUNCTION 'REUSE_ALV_VARIANT_F4'
        EXPORTING
          is_variant = lw_variant
          i_save     = c_save
        IMPORTING
          es_variant = lw_variant
        EXCEPTIONS
          OTHERS     = 1.
      IF sy-subrc EQ 0.
        p_varant = lw_variant-variant.
      ELSE.
        MESSAGE s100 WITH text-012.
      ENDIF.                               " IF SY-SUBRC EQ 0
    ENDFORM.                               " F4_ON_DISPLAY_VARIANT
    *&      Form  validate_variant
    This subroutine validates the variant entered onthe selection screen
    There are no interface parameters to be passed to the subroutine
    FORM validate_variant .
      CLEAR w_variant.
      w_variant-report = sy-repid.
      MOVE p_varant TO w_variant-variant.
      CALL FUNCTION 'REUSE_ALV_VARIANT_EXISTENCE'
        EXPORTING
          i_save        = c_save
        CHANGING
          cs_variant    = w_variant
        EXCEPTIONS
          wrong_input   = 1
          not_found     = 2
          program_error = 3
          OTHERS        = 4.
      IF sy-subrc <> 0.
        MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
                WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
      ENDIF.                               " IF SY-SUBRC <> 0
    ENDFORM.                               " VALIDATE_VARIANT
    *&      Module  STATUS_0100  OUTPUT
    This is the PBO module for the ALV GRid dispaly
    MODULE status_0100 OUTPUT.
    Check the User authorizations and display the PF status accordingly
      PERFORM check_authorizations.
    Set the user status as per Authorizations
      SET PF-STATUS 'ZVA0T_PRCTR_FAL' EXCLUDING t_fcode.
      SET TITLEBAR 'ZVA0T_PRCTR_FAL'.
    Instantiate the container control and Grid control.
      IF w_custom_container IS INITIAL.
        CREATE OBJECT w_custom_container
           EXPORTING
              container_name = 'CUSTOM_CONTAINER'.
        CREATE OBJECT w_grid
           EXPORTING
             i_parent = w_custom_container.
      ENDIF.                               " IF W_CUSTOM_CONTAINER IS ...
    Clearing the work variables
      PERFORM intialize.
    Retrieve the table contents
      PERFORM get_data.
    Display the data in the ALV Grid control
      PERFORM display_data.
    ENDMODULE.                             " STATUS_0100  OUTPUT
    *&      Form  check_authorizations
    This subroutine is used to check the user authorizations
    There are no interface parameters to be passed
    FORM check_authorizations .
      REFRESH t_fcode.
    Authorization check for Create entry
      AUTHORITY-CHECK OBJECT 'ZZ:TABLMNP'
               ID 'ACTVT' FIELD c_act_auth_01
               ID 'TABLE' FIELD c_table.
      IF sy-subrc NE 0.
        PERFORM fillcode USING 'CREA'.
        PERFORM fillcode USING 'COPY'.
      ENDIF.                               " IF SY-SUBRC NE 0
    Authorization check for Change the entry
      AUTHORITY-CHECK OBJECT 'ZZ:TABLMNP'
               ID 'ACTVT' FIELD c_act_auth_02
               ID 'TABLE' FIELD c_table.
      IF sy-subrc NE 0.
        PERFORM fillcode USING 'CHNG'.
      ENDIF.                               " IF SY-SUBRC NE 0
    Authorization check for Delete the entry
      AUTHORITY-CHECK OBJECT 'ZZ:TABLMNP'
               ID 'ACTVT' FIELD c_act_auth_06
               ID 'TABLE' FIELD c_table.
      IF sy-subrc NE 0.
        PERFORM fillcode USING 'DELE'.
      ENDIF.                               " IF SY-SUBRC NE 0
    ENDFORM.                               " CHECK_AUTHORIZATIONS
    *&      Form  fillcode
    This subroutine is used to fill the function code in the table t_fcode
    The parameter that passed to this subroutine is function code
    FORM fillcode  USING    value(p_fcode) TYPE any.
      CLEAR wa_fcode.
      MOVE p_fcode TO wa_fcode-fcode.
      APPEND wa_fcode TO t_fcode.
    ENDFORM.                               " FILLCODE
    *&      Form  intialize
    This subroutine is used to initialize the work variables
    There are no interface parameters that need to be passed
    FORM intialize .
      CLEAR   t_ZVA0T_PRCTR_FAL.
      REFRESH t_ZVA0T_PRCTR_FAL.
    ENDFORM.                               " INITIALIZE
    *&      Form  get_data
    This subroutine is used to get data from the table
    There are no interfaces parameters that need to be passed
    FORM get_data .
    retrieve the status and codegroup from the table
      REFRESH t_ZVA0T_PRCTR_FAL.
      SELECT *
        FROM ZVA0T_PRCTR_FAL
        INTO TABLE t_ZVA0T_PRCTR_FAL
       WHERE leg_prctr IN s_prctr.
      IF sy-subrc NE 0.
      ENDIF.                               " IF SY-SUBRC NE 0
    ENDFORM.                               " GET_DATA
    *&      Form  display_data
    This subroutine is used to display the data in the ALV Grid control
    *There are no interface parameters that need to be passed to subroutine
    FORM display_data .
      DATA:
        w_grid_layout TYPE lvc_s_layo,     " Grid Layout
        LT_fieldcat   TYPE lvc_t_fcat.     " Field Catalog
      DATA:
        FS_FIELDCAT LIKE LINE OF LT_FIELDCAT.
    Filling the Layout
      w_grid_layout-grid_title = text-001.
      w_grid_layout-sel_mode   = c_save.
      w_grid_layout-stylefname = c_ct.
      w_grid_layout-cwidth_opt = 'X'.
    Filling the Variant structure
      w_variant-report   = sy-repid.
      w_variant-username = sy-uname.
      w_variant-variant  = p_varant.
    Filling the fieldcatalog.............................................
      CALL FUNCTION 'LVC_FIELDCATALOG_MERGE'
        EXPORTING
          i_structure_name = c_table
        CHANGING
          ct_fieldcat      = lt_fieldcat.
    To make the ALV list use the medium text label from DDIC
      LOOP AT lt_fieldcat INTO FS_FIELDCAT.
        MOVE 'M' TO fs_fieldcat-colddictxt.
        MODIFY lt_fieldcat FROM FS_FIELDCAT.
      ENDLOOP.                             " LOOP AT T_FIELDCAT
      CALL METHOD w_grid->set_table_for_first_display
        EXPORTING
          i_structure_name              = c_table
          is_variant                    = w_variant
          i_save                        = c_save
          is_layout                     = w_grid_layout
        CHANGING
          it_outtab                     = t_ZVA0T_PRCTR_FAL
          it_fieldcatalog               = lt_fieldcat
        EXCEPTIONS
          invalid_parameter_combination = 1
          program_error                 = 2
          too_many_lines                = 3
          OTHERS                        = 4.
      IF sy-subrc NE 0.
        MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
                WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
      ENDIF.                               " IF SY-SUBRC NE 0
    ENDFORM.                               " DISPLAY_DATA
    *&      Module  USER_COMMAND_0100  INPUT
    This is the PAI module for the screen 100.
    MODULE user_command_0100 INPUT.
      REFRESH t_selected_rows.
      CLEAR   FS_SELECTED_ROWS.
      CLEAR fl_chng.
    Getting the selected rows
      CALL METHOD w_grid->get_selected_rows
        IMPORTING
          et_index_rows = t_selected_rows.
    If more than one record is selected, error message
      DESCRIBE TABLE t_selected_rows.
      IF sy-tfill GT 1
      AND SY-UCOMM NE 'REFR'
      AND SY-UCOMM NE 'CREA'
      AND SY-UCOMM NE 'DELE'.
        MESSAGE e048(zcsv_sfdr).
      ENDIF.                               " IF SY-TFILL GT 1
    Read the first record
      READ TABLE t_selected_rows INTO FS_SELECTED_ROWS INDEX 1.
      READ TABLE t_ZVA0T_PRCTR_FAL
            INTO ZVA0T_PRCTR_FAL INDEX fs_selected_rows-index.
      CLEAR W_SUBRC.
      W_SUBRC = SY-SUBRC.
      CASE ok_code.
        WHEN 'CREA'.
          CLEAR ZVA0T_PRCTR_FAL.
          CALL SCREEN 0200.
        WHEN 'COPY'.
          IF W_SUBRC EQ 0.
            IF t_selected_rows IS NOT INITIAL.
              CALL SCREEN 0200.
            ELSE.
              MESSAGE e100 WITH text-013.
            ENDIF.                         " IF T_SELECTED_ROWS IS NOT ...
          ELSE.
            MESSAGE e100 WITH text-014.
          ENDIF.                           " IF W_SUBRC EQ 0
        WHEN 'CHNG'.
          IF W_SUBRC EQ 0.
            MOVE 'X' TO fl_chng.
            IF t_selected_rows IS NOT INITIAL.
              CALL SCREEN 0200.
            ELSE.
              MESSAGE e100 WITH text-e04.
            ENDIF.                         " IF T_SELECTED_ROWS IS NOT ...
          ELSE.
            MESSAGE e100 WITH text-014.
          ENDIF.                           " IF W_SUBRC EQ 0
        WHEN 'DELE'.
          IF t_selected_rows IS NOT INITIAL.
            IF W_SUBRC EQ 0.
              CALL FUNCTION 'POPUP_TO_CONFIRM'
                EXPORTING
                  titlebar              = text-002
                  text_question         = text-003
                  text_button_1         = text-004
                  text_button_2         = text-005
                  default_button        = '1'
                  display_cancel_button = 'X'
                IMPORTING
                  answer                = w_confirm_ind.
              IF w_confirm_ind EQ '1'.
                LOOP AT T_SELECTED_ROWS INTO FS_SELECTED_ROWS.
                  CLEAR ZVA0T_PRCTR_FAL.
                  READ TABLE T_ZVA0T_PRCTR_FAL
                        INTO ZVA0T_PRCTR_FAL INDEX fs_selected_rows-index.
                  IF SY-SUBRC EQ 0.
                    DELETE ZVA0T_PRCTR_FAL.
                    IF sy-subrc NE 0.
                      W_SUBRC = 4.
                    ENDIF.                 " IF SY-SUBRC EQ 0
                  ENDIF.                   " IF SY-SUBRC EQ 0
                ENDLOOP.                   " LOOP AT T_SELECTED_ROWS ...
                IF W_SUBRC EQ 0.
                  MESSAGE s100 WITH text-010.
                ELSE.
                  MESSAGE   e100 WITH text-e03.
                ENDIF.                     " IF W_SUBRC EQ 0
              ELSEIF w_confirm_ind EQ '2'.
              ENDIF.                       " IF W_CONFIRM_IND EQ '1'
            ELSE.
              MESSAGE e100 WITH text-014.
            ENDIF.                         " IF W_SUBRC EQ 0
          ELSE.
            MESSAGE e100 WITH text-e05.
          ENDIF.                           " IF T_SELECTED_ROWS IS NOT ...
        WHEN 'BACK'.
          SET SCREEN 0.
          LEAVE SCREEN.
        WHEN 'CANCEL'.
          SET SCREEN 0.
          LEAVE SCREEN.
      ENDCASE.                             " CASE OK_CODE
      CLEAR ok_code.
    ENDMODULE.                             " USER_COMMAND_0100  INPUT
    *&      Module  exit  INPUT
    This subroutine is used to leave the current screen
    MODULE exit INPUT.
      CALL METHOD w_custom_container->free.
      CALL METHOD cl_gui_cfw=>flush.
      SET SCREEN 0.
      LEAVE SCREEN.
    ENDMODULE.                             " EXIT  INPUT
    *&      Module  STATUS_0200  OUTPUT
    This module is used to set the PF Status of the modify screen
    MODULE status_0200 OUTPUT.
      SET PF-STATUS 'STATUS_200'.
    ENDMODULE.                             " STATUS_0200  OUTPUT
    *&      Module  modify_0200  OUTPUT
    This module is used to print the values on the screen
    MODULE modify_0200 OUTPUT.
      IF NOT fl_chng IS INITIAL.
        LOOP AT SCREEN.
          IF screen-group1 EQ c_chg.
            screen-required = '0'.
            screen-output   = '1'.
            screen-input    = '0'.
            MODIFY SCREEN.
          ENDIF. 
        ENDLOOP.                           " LOOP AT SCREEN
      ELSE.
        LOOP AT SCREEN.
          IF screen-group1 EQ c_chg.
            screen-required = '1'.
            screen-output   = '1'.
            screen-input    = '1'.
            MODIFY SCREEN.
          ENDIF. 
        ENDLOOP.                           " LOOP AT SCREEN
      ENDIF.                               " IF NOT FL_CHNG IS INITIAL
    ENDMODULE.                             " MODIFY_0200  OUTPUT
    *&      Module  exit_0200  INPUT
    This module is used to exit from the screen on pressing exit button
    MODULE exit_0200 INPUT.
      IF sy-datar IS INITIAL
      AND fl_cancel IS INITIAL.
        CLEAR fl_chng.
        LEAVE PROGRAM.
      ELSE.
        CALL FUNCTION 'POPUP_TO_CONFIRM'
          EXPORTING
            titlebar              = text-011
            text_question         = text-006
            text_button_1         = text-004
            text_button_2         = text-005
            default_button        = '1'
            display_cancel_button = 'X'
          IMPORTING
            answer                = w_confirm_ind.
        CASE w_confirm_ind.
          WHEN '1'.
            sy-ucomm = 'SAVE'.
            CLEAR fl_cancel.
          WHEN '2'.
            CLEAR fl_chng.
            CLEAR fl_cancel.
            LEAVE PROGRAM.
          WHEN c_a.
            fl_cancel = 'X'.
        ENDCASE.                           " CASE W_CONFIRM_IND
      ENDIF.                               " IF SY-DATAR IS INITIAL
    ENDMODULE.                             " EXIT_0200  INPUT
    *&      Module  USER_COMMAND_0200  INPUT
    This module is used to update the database table with the user values
    MODULE user_command_0200 INPUT.
      IF sy-ucomm EQ 'SAVE'.
        PERFORM SAVE.
      ELSEIF SY-UCOMM EQ 'BACK'.
        PERFORM BACK_CANCEL.
        IF SY-UCOMM EQ 'SAVE'.
          PERFORM SAVE.                    " IF SY-UCOMM EQ 'SAVE'
        ENDIF.
      ELSEIF SY-UCOMM EQ 'CANC'.
        PERFORM BACK_CANCEL.
        IF SY-UCOMM EQ 'SAVE'.
          PERFORM SAVE.                    " IF SY-UCOMM EQ 'SAVE'
        ENDIF.
      ELSEIF SY-UCOMM EQ 'ENTE'.
        fl_cancel = 'X'.
      ENDIF.                               " IF SY-UCOMM EQ 'SAVE'
    ENDMODULE.                             " USER_COMMAND_0200  INPUT
    *&      Form  BACK_CANCEL
    This subroutine provides functionality for BACK & CANCEL
    form BACK_CANCEL .
      IF sy-datar IS INITIAL
      AND fl_cancel IS INITIAL.
        CLEAR fl_chng.
        SET SCREEN 0.
        LEAVE SCREEN.
      ELSE.
        CALL FUNCTION 'POPUP_TO_CONFIRM'
          EXPORTING
            titlebar              = text-011
            text_question         = text-006
            text_button_1         = text-004
            text_button_2         = text-005
            default_button        = '1'
            display_cancel_button = 'X'
          IMPORTING
            answer                = w_confirm_ind.
        CASE w_confirm_ind.
          WHEN '1'.
            sy-ucomm = 'SAVE'.
            CLEAR fl_cancel.
          WHEN '2'.
            CLEAR fl_chng.
            CLEAR fl_cancel.
            SET SCREEN 0.
            LEAVE SCREEN.
          WHEN 'A'.
            fl_cancel = 'X'.
        ENDCASE.                           " CASE W_CONFIRM_IND
      ENDIF.                               " IF SY-DATAR IS INITIAL
    endform.                               " BACK_CANCEL
    *&      Form  SAVE
    This subroutine provides functionality for SAVE
    form SAVE .
        MOVE:
          SY-DATUM TO ZVA0T_PRCTR_FAL-erdat,
          SY-UZEIT TO ZVA0T_PRCTR_FAL-erzet,
          SY-UNAME TO ZVA0T_PRCTR_FAL-ernam.
        IF fl_chng IS INITIAL.
          INSERT ZVA0T_PRCTR_FAL.
          IF sy-subrc EQ 0.
            MESSAGE s100 WITH text-010.
          ELSE.
            MESSAGE e100 WITH text-e03.
          ENDIF.                           " IF SY-SUBRC EQ 0
        ELSE.
          MODIFY ZVA0T_PRCTR_FAL.
          IF sy-subrc EQ 0.
            MESSAGE s100 WITH text-010.
          ELSE.
            MESSAGE e100 WITH text-e03.
          ENDIF.                           " IF SY-SUBRC EQ 0
          CLEAR t_ZVA0T_PRCTR_FAL.
        ENDIF.                             " IF FL_CHNG IS INITIAL
        SET SCREEN 0.
        LEAVE SCREEN.
    endform.                               " SAVE
    Reward if helpful...

  • Updating custom table through table control in module pool

    Hi
    I am entering a data in the module pool screen in a table control . The functionality is that whatever i enter in a row gets updated in a custom table in the database with the same values . My problem is that when i enter some values and press the save button on the module pool screen , the data gets updated on the table but gets invisible from the module pool screen . The user wants the data to be displayed even after it has been saved ..if anyone can help on this ...
    thanks

    hi,
    Check whether u have activated the report and screen.

  • Update database table through table control

    Dear friends
    i have to update entered data in table control to data base table please suggest some modification in my coding for the same
    following is my coding
    report  zrb_ins_data.
    data wa_tmp_rebset type zrb_hed.
    data wa_tmp_rebset1 type zrebate_items.
    types:begin of st_hdr,
              bukrs            type zrb_hed-bukrs,
              sch_typ          type  zrb_hed-sch_typ,
              sch_desc         type  zrb_hed-sch_desc,
              sch_no           type  zrb_hed-sch_no,
              vtweg            type  zrb_hed-vtweg,
              vkorg                type  zrb_hed-vkorg,
              vkbur            type  zrb_hed-vkbur,
              vkgrp                type  zrb_hed-vkgrp,
              spart            type  zrb_hed-spart,
              regio            type  zrb_hed-regio,
              ort02            type  zrb_hed-ort02,
              ort01            type  zrb_hed-ort01,
              kunnr                type  zrb_hed-kunnr,
              konzs            type  zrb_hed-konzs,
              matkl            type  zrb_hed-matkl,
              matnr            type  zrb_hed-matnr,
              lifsk            type  zrb_hed-lifsk,
              shtyp            type  zrb_hed-shtyp,
              from_date        type  zrb_hed-from_date,
              to_date          type  zrb_hed-to_date,
              hkont            type  zrb_hed-hkont,
              aufnr            type  zrb_hed-aufnr,
    end of st_hdr.
    types : begin of st_itm,
              item_id          type zrebate_items-sch_no,
              sch_no           type zrebate_items-sch_no,
              from_dat         type zrebate_items-from_dat,
              to_dat           type zrebate_items-to_dat,
              type             type zrebate_items-type,
              qty_per_rate     type zrebate_items-qty_per_rate,
              key1             type zrebate_items-key1,
              curr_com         type zrebate_items-curr_com,
              key2             type zrebate_items-key2,
              qty_per_rate1    type zrebate_items-qty_per_rate1,
              curr_com1        type zrebate_items-curr_com1,
            end of st_itm.
    data:it_hdr type table of st_hdr with header line,
         wa_hdr type st_hdr,
         it_itm  type table of st_itm with header line,
         wa_itm type st_itm.
    controls ztbl type tableview using screen 1000.
    *CALL SCREEN 1000.
    *&      Module  STATUS_1000  OUTPUT
          text
    module status_1000 output.
      set pf-status 'SYMBOL'.
      set titlebar 'xxx'.
    endmodule.                 " STATUS_1000  OUTPUT
    *&      Module  USER_COMMAND_1000  INPUT
          text
    *module USER_COMMAND_1000 input.
    *&      Module  get_data  OUTPUT
          text
    *&      Module  user_command_1000  INPUT
          text
    module user_command_1000 input.
      case sy-ucomm.
        when 'EXEC'.
    perform get_data.
    endcase.
    endmodule
    *&      Form  GET_DATA
          text
    -->  p1        text
    <--  p2        text
    form get_data .
      move-corresponding wa_hdr to wa_tmp_rebset.
          modify zrb_hed  from wa_tmp_rebset.
      move-corresponding wa_itm to wa_tmp_rebset1.
      wa_tmp_rebset1-item_id = 'TS1234'.
      wa_tmp_rebset1-sch_no =   wa_hdr-sch_no.
      wa_tmp_rebset1-from_dat = wa_itm-from_dat.
      wa_tmp_rebset1-to_dat = wa_itm-to_dat.
      append wa_itm to it_itm.
    modify zrebate_items from wa_tmp_rebset1.
    endform.

    hi,
    Refer to this link...you'll get the idea..
    how to update dbtab from table control?
    Re: How to update a DB from a table control.
    Edited by: avinash kodarapu on Dec 27, 2008 12:36 PM

  • 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

Maybe you are looking for