Table control program for updating database table

Does anybody have a sample code for a table control program which can insert/delete/update a database table?
I mean like on the output on table control, if the user insert/delete/update the records, the corresponding records will be updated in database table also.
Appreciate your input.
Thanks.

hi nuren,
TABLES: kna1,knbk.
DATA: v_kunnr LIKE kna1-kunnr.
DATA: v_check TYPE c.
DATA: BEGIN OF it_knbk OCCURS 0,
      banks LIKE knbk-banks,
      bankl LIKE knbk-bankl,
      bankn LIKE knbk-bankn,
      bkont LIKE knbk-bkont,
      koinh LIKE knbk-koinh,
      chk TYPE c,
      END OF it_knbk.
DATA: v_ucomm TYPE sy-ucomm,
      v_dynnr TYPE sy-dynnr.
DATA: l_index TYPE sy-index.
data: count type i.
CONTROLS: tc1 TYPE TABLEVIEW USING SCREEN 0200.
*&      Module  STATUS_0100  OUTPUT
      text
MODULE status_0100 OUTPUT.
  SET PF-STATUS 'ABC'.
SET TITLEBAR 'xxx'.
ENDMODULE.                 " STATUS_0100  OUTPUT
*&      Module  USER_COMMAND_0100  INPUT
      text
MODULE user_command_0100 INPUT.
  v_ucomm = sy-ucomm.
  CASE v_ucomm.
    WHEN 'DISP' OR 'CHNG'.
      IF v_kunnr <> space.
        SELECT banks
               bankl
               bankn
               bkont
               koinh
               FROM knbk
               INTO TABLE it_knbk
               WHERE kunnr = v_kunnr.
        LEAVE TO SCREEN '0200'.
      ENDIF.
    WHEN 'BACK'.
      LEAVE TO SCREEN 0.
  ENDCASE.
ENDMODULE.                 " USER_COMMAND_0100  INPUT
*&      Module  MOD_KUNNR  INPUT
      text
MODULE mod_kunnr INPUT.
  IF NOT v_kunnr IS INITIAL.
    SELECT SINGLE
           kunnr
           FROM kna1
           INTO v_kunnr
           WHERE kunnr = v_kunnr.
    IF sy-subrc <> 0.
      MESSAGE e000(zz) WITH 'INCORRECT CUSTOMER NUMBER'.
    ENDIF.
  ENDIF.
  IF v_kunnr IS INITIAL.
    MESSAGE e000(zz) WITH 'PLEASE ENTER A VALUE'.
  ENDIF.
ENDMODULE.                 " MOD_KUNNR  INPUT
*&      Module  STATUS_0200  OUTPUT
      text
MODULE status_0200 OUTPUT.
  SET PF-STATUS 'ABC1'.
SET TITLEBAR 'xxx'.
ENDMODULE.                 " STATUS_0200  OUTPUT
*&      Module  SCREENMOD  OUTPUT
      text
MODULE screenmod OUTPUT.
  IF v_ucomm = 'DISP'.
    LOOP AT SCREEN.
      screen-input = 0.
      MODIFY SCREEN.
    ENDLOOP.
  ELSE."if v_UCOMM = 'CHNG'.
    LOOP AT SCREEN.
        IF screen-group1 = 'G1'.
          screen-input = 0.
        ELSE.
          screen-input = 1.
        ENDIF.
     MODIFY SCREEN.
    ENDLOOP.
endif.
if sy-ucomm = 'INSE'.
loop at screen.
IF ( tc1-current_line <> tc1-lines ).
  screen-input = 0.
else.
screen-input = 1.
modify screen.
endif.
endloop.
endif.
ENDMODULE.                 " SCREENMOD  OUTPUT
*&      Module  EXIT2  INPUT
      text
MODULE exit2 INPUT.
  LEAVE TO SCREEN 0.
ENDMODULE.                 " EXIT2  INPUT
*&      Module  modify  INPUT
      text
MODULE modify INPUT.
      IF v_check =  'X'.
        it_knbk-chk =  'X'.
        MODIFY it_knbk index tc1-current_line.
      ELSE.
        CLEAR it_knbk-chk .
     ENDIF.
ENDMODULE.                 " modify  INPUT
*&      Module  USER_COMMAND_0200  INPUT
      text
MODULE user_command_0200 INPUT.
v_ucomm = sy-ucomm.
  CASE v_ucomm.
    WHEN 'DELE'.
        DELETE it_knbk where chk eq 'X'.
        DESCRIBE TABLE it_knbk LINES tc1-lines.
    WHEN 'INSE'.
      CLEAR it_knbk.
      APPEND it_knbk.
      DESCRIBE TABLE it_knbk LINES tc1-lines.
    WHEN 'LIST'.
      LEAVE TO LIST-PROCESSING AND RETURN TO SCREEN '0200'.
      WRITE 'Report'.
    WHEN 'BACK'.
      LEAVE TO SCREEN '0100'.
  ENDCASE.
ENDMODULE.                 " USER_COMMAND_0200  INPUT
*&      Module  validate  INPUT
      text
module validate input.
IF IT_KNBK IS INITIAL.
MESSAGE E000(ZZ) WITH 'A BLANK LINE CANNOT BE SAVED'.
ENDIF.
endmodule.                 " validate  INPUT

Similar Messages

  • Adobe Forms - Table control data Saved in Database table through Web Dynpro

    Hello Friends,
    I Am facing a Problem in Adobe Forms through Web Dynpro.
    i Want to Make Interactive online Adobe Forms - In Table Control user enter the multiple entry in the table control and after that Click on SAVE button , entry will saved in Database table.
    Please guide me.
    Thanks in advance.
    Gaurav.

    Hi Gaurabh,
    For interactive form you have to check the property DisplayType = native and PdfSource should be a Context Attribute of type 'Xstring'.
    For data retrieval, create a NODE and have all the required attributes within that node of AOBE form.
    Fetch the data in WDDOINIT.
    Also check, that the offline senario for this form is working.
    Hope it helps you.

  • ....how to create table maintanence generator for a z table and how to use

    Hi...
    3....how to create table maintanence generator for a z table and how to use that for transfering a selected records to one server to another server.
    thanks and regards,
    k.swaminath reddy

    Hi,
    Table maintanance Generator is used to manually
    input values using transaction sm30.The Table Maintenance Generator is used to create table maintenance program to add, modify or delete records in the database table. This can be accessed using transaction SE54 or in SE11 using the menu Utilities->Table Maintenance Generator
    <b>
    Follow below steps</b>
    go to se11 check table maintanance check box under
    attributes tab
    utilities-table maintanance Generator->
    create function group and assign it under
    function group input box.
    also assign authorization group default &NC& .
    select standard recording routine radio in table
    table mainitainence generator to move table
    contents to quality and production by assigning
    it to request.
    select maintaience type as single step.
    maintainence screen as system generated numbers
    this dialog box appears when you click on create
    button
    save and activate table
    http://help.sap.com/saphelp_nw04/helpdata/en/cf/21ed2d446011d189700000e8322d00/content.htm
    One step, two step in Table Maintenance Generator
    Single step: Only overview screen is created i.e. the Table Maintenance Program will have only one screen where you can add, delete or edit records.
    Two step: Two screens namely the overview screen and Single screen are created. The user can see the key fields in the first screen and can further go on to edit further details.
    please check the link for getting information about table maintenance generator !
    https://www.sdn.sap.com/irj/sdn/advancedsearch?query=use%20of%20table%20maintenance%20generator&cat=sdn_all
    http://www.sapdevelopment.co.uk/tips/tips_tabmaint_tcode.htm
    http://www.sap-img.com/abap/create-a-table-maintance-program-for-a-z-table.htm
    Regards,
    Priyanka.

  • Updating database table via program

    Hi,
    I am updating a DB table (Sap standard table) via my program.
    I have few doubts with regard to same. They are given below,
    1.  I came to know that it is not best practise to update the sap standard table via program using "update" statement. Why so? Is there any other way or statement in doing the same?
    2.  The sap standard table which i update via my program is BDRGIN. Now my question is, when my  program is modifying the values of the table, if some other user also modifies the value at the same time via SE16 then conflict occurs. How to resolve it? Is SAP uses any automatic handling for such conflicts?
    kindly help me out.
    Regards,
    Raghavendraprasad.N

    Hi,
    Its not a good practise to modify the Standards tables through programs, because most of the standard tables will be interdependant with forign key relation ships (check table relations). So incase we create an irrelavant entry, then it will cause a lot of confusions.
    For example we create entries in MARA/MAKT table using MM01/02 transactions.
    There are a few standard tables like TVSA (containing customising data), these have to be maintained through the SPRO transaction. You can open SPRO transaction and search for the node to maintain entries in it or you can go to the transaction SM30 and you can give the table name and click on customizng to go the SPRO node.
    Still if you are trying to create entries in your table, Enque/Lock the table do the updations and then Deque/Unlock the table, so that there will be no conflicts happening during that time.
    Regards,
    S.Dakshna Nagaratnam.

  • How to update database table !!!

    hi all,
    Please advice how to update database table with certain cndition needs to be checked.
    Please consider below scenario.
    have used enqueu and dequeue function to lock entries  and also i have used BAPI so considering that return parameter . i want to update table
    /tdk/st0027.
    1. I want to update database table
    2. there are certain condition needs to be checked like ,
       loop at it_final into wa_final.
    th_return-type = 'S'.
               if th_final-vbeln = /tdk/st0027-vbeln and
                  th_final-posnr = /tdk/st0027-posnr and
                  th_final-etenr = /tdk/st0027-sdslno.
    above condition which i need to check .and need to append below system fields need to be appended in table.
              th_final-prstsind = '20'.
              th_final-chgdate  = g_date.
              th_final-chgtime  = g_uzeit.
              th_final-chgprog  = g_cprog.
              th_final-chguser  = g_uname.
              append th_final to td_final.
              update /tdk/st0027 FROM th_final.
              endif.
    endloop.
    but i am getting error saying that  "The type od database table and work area (TH_FINAL)  are not unicode convertible"?
    I am not able to understandwhat would be the solution for this ?
    Thanks and regards,
    Prasad K. NAralkar

    The error occurs in the UPDATE statement included in the code. In this statement it is seen that there is a mismatch of structure defined for the DDIC table /tdk/st0027 and that of your work area th_final.
    try to create a structure w.r.t the DDIC table.
    Eg: DATA: wa_temp TYPE /tdk/st0027.
    MOVE-CORRESPONDING th_final TO wa_temp.
    Then try to UPDATE using the temporary work area i.e wa_temp which has structure similar to that of the database table.

  • Enqueue and Dequeue before updating Database table

    Hi all,
    We are updating database tables using INSERT, MODIFY and UPDATE statements. Since many people will be running the application at the same time we need to lock the table before updating database table. So we need to use ENQUEUE and DEQUEUE functionality for this purpose.
    Can any plz explain what are the steps we should follow now?
    Thanks in advance.

    Hi,
    Any Database access should carefully handled as multiple applications may be accessing the database at the same time. To read a record from the database you don't need to implement a lock, but to write you need not only locks but also ideally should use the Update Function Modules to comply SAP "All or Nothing" Principle. This will prevent data inconsistency of the database and the data will be proper state. You need to use the COMMIT WORK and ROLLBACK WORK in you code to handle the consistency part of the database.
    The best design approach would be seperate the Database Layer completely from the business layers. This will make your code robust and easy to maintain.
    As, for the Locking Concepts, you will get multiple resources from SDN as how to create Locks and implement the Locking modules in your code. But more than that what matters is why and how to implement the SAP Locking concepts to make your application run better.
    Have a look at the following link
    http://help.sap.com/saphelp_nw70/helpdata/en/cf/21eea5446011d189700000e8322d00/content.htm
    Hope this helps.
    Thanks,
    Samantak.

  • Doubt in updating database table

    hi all
    i want to modify values ztable from a internal table ....
    for eg : the ztable contains matnr and accept_qty
    matnr   qty
    mat01   
    mat02
    i need to modify qty of the table .. i am using where condition (ie modify where matnr = ) but where condition is not working for database tables .... how to proceed with this ..
    thanks
    lokesh

    hi,
    before that :- modify statemnt will modify a record if there is record having the same key like that of record in work area.
    if there is no record in itab with key of work area record, it will insert a new record in itab.
    look this sample code.
    *modify internal table
    loop at itab into wa.
    wa-field1 = data1.
    wa-field2 = data2.
    wa-field 3= data3.
    modify itab from wa transporting field1 field2 field3 where key_field = wa-keyfield. "there shuld not be any chang in key field.
    endloop.
    *now update database table
    *work area and data base structure shuld be same type
    if itab[] is not initial.
    modify ztable from table itab.
    endif.
    rgds
    anver
    if hlped pls mark points

  • Settlement Receiver Value not Saved in Table Control Program

    Hi,
    I have Table control program regarding to Equipment Log, where in output it show the Equipment details with Account assignment category, General settlement receiver, Shift Hours, Work Hours, Idle Hrs, Maint. Hrs., Production Hours etc...
    In report, we have a formula i.e.
    Shift Hrs. = Work Hours + Idle Hrs + Maint. Hrs. + Production Hours.
    and all those fields are linked to each other.
    If we want that Work Hours should be 0, then msg showing - Working Hrs. should be entered. , means without enter Working Hrs. value we cann't save it.
    Now we removed the link of Working Hrs to others, means if we insert value 0 of Working Hrs., no msg showing. BUT Problem is this after remove this link, General settlement receiver value should not be saved.
    We want Work Hrs. as 0 value and General settlement receiver value must not be BLANK. It should be Saved.
    Plz guide..

    hi
    write a if statement after the Shift Hrs. = Work Hours + Idle Hrs + Maint. Hrs. + Production Hours.
    if work hours = 0, message i000 with 'Working Hrs. should be entered'.
    else ,write:/ shift hrs.end if. try to create a button for save when you click data will be saved or create a subrountine perform shift hrs than use if loop and select form end form inside keep Shift Hrs. = Work Hours + Idle Hrs + Maint. Hrs. + Production Hours.
    thanking you

  • Table control programming

    Hi experts,
    Please give me information about table control programming.
    explain it with example.
    Thanks & Regards,
    Rajesh Kumar

    Hi Rajesh,
    Lets say the table has more than 20 fields and at first shot there are say 15 screen fields and to enter the 16th field you have to press page down so in this case you have to have a control on table..
    The below example would help you to analyse..
    check the example...
    *"Selection screen elements............................................
    parameters:
      p_file like rlgrap-filename.
    *" Data declarations...................................................
    * Work variables                                                      *
    data w_file type string.
    data wa(80) type c.
    data : w_fname(20),
        w_tabix(2) type n,
        w_table(20),
        w_index,
        w_fkey(20),
        w_ftype(20),
        w_flen(20),
        w_fdesc(20).
    *" Internal table declarations.........................................
    * Internal table to hold                                               *
    data:
      begin of itab_fields occurs 0,
        count,
        fname(20),
        fkey,
        ftype(10),
        flen(10),
        fdesc(30),
      end of itab_fields.
    data:
      begin of itab_header occurs 0,
        dbcheck,
        tname(20),
        tdesc(40),
        devclass,
        maintain,
      end of itab_header.
    data t_data like standard table of wa .
    data:
      t_bdcdata like
       standard table of bdcdata with header line.
    data w_count type i.
    *       AT SELECTION-SCREEN ON VALUE-REQUEST EVENT                    *
    at selection-screen on value-request for p_file.
      call function 'F4_FILENAME'
    * EXPORTING
    *   PROGRAM_NAME        = SYST-CPROG
    *   DYNPRO_NUMBER       = SYST-DYNNR
    *   FIELD_NAME          = ' '
       importing
         file_name           = p_file
      w_file = p_file.
    *                       START-OF-SELECTION EVENT                      *
    start-of-selection.
      call function 'GUI_UPLOAD'
        exporting
          filename                      = w_file
         filetype                      = 'ASC'
    *   HAS_FIELD_SEPARATOR           = 'X'
    *   HEADER_LENGTH                 = 0
    *   READ_BY_LINE                  = 'X'
    *   DAT_MODE                      = ' '
    *   CODEPAGE                      = ' '
    *   IGNORE_CERR                   = ABAP_TRUE
    *   REPLACEMENT                   = '#'
    * IMPORTING
    *   FILELENGTH                    =
    *   HEADER                        =
        tables
          data_tab                      = t_data
       exceptions
         file_open_error               = 1
         file_read_error               = 2
         no_batch                      = 3
         gui_refuse_filetransfer       = 4
         invalid_type                  = 5
         no_authority                  = 6
         unknown_error                 = 7
         bad_data_format               = 8
         header_not_allowed            = 9
         separator_not_allowed         = 10
         header_too_long               = 11
         unknown_dp_error              = 12
         access_denied                 = 13
         dp_out_of_memory              = 14
         disk_full                     = 15
         dp_timeout                    = 16
         others                        = 17
      if sy-subrc <> 0.
    * MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
    *         WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
      endif.
      loop at t_data into wa.
        if wa+0(1) eq 'H'.
          shift wa by 2 places left.
          split wa at ',' into itab_header-dbcheck
          itab_header-tname
          itab_header-tdesc
          itab_header-devclass
          itab_header-maintain.
          append itab_header.
          clear itab_header.
          add 1 to w_count.
        else.
          shift wa by 2 places left.
          split wa at ',' into itab_fields-fname
          itab_fields-fkey
          itab_fields-ftype
          itab_fields-flen
          itab_fields-fdesc.
          write w_count to itab_fields-count.
          append itab_fields.
          clear itab_fields.
        endif.
      endloop.
      call function 'BDC_OPEN_GROUP'
       exporting
         client                    = sy-mandt
    *   DEST                      = FILLER8
         group                     = 'PADMA'
    *   HOLDDATE                  = FILLER8
    *   KEEP                      = FILLER1
         user                      = sy-uname
    *   RECORD                    = FILLER1
    *   PROG                      = SY-CPROG
    * IMPORTING
    *   QID                       =
       exceptions
         client_invalid            = 1
         destination_invalid       = 2
         group_invalid             = 3
         group_is_locked           = 4
         holddate_invalid          = 5
         internal_error            = 6
         queue_error               = 7
         running                   = 8
         system_lock_error         = 9
         user_invalid              = 10
         others                    = 11
      if sy-subrc <> 0.
    * MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
    *         WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
      endif.
      loop at itab_header.
        w_table = itab_header-tname.
        w_index = sy-tabix.
        refresh t_bdcdata.
        perform populate_se11.
        call function 'BDC_INSERT'
         exporting
           tcode                  = 'SE11'
    *    POST_LOCAL             = NOVBLOCAL
    *    PRINTING               = NOPRINT
    *    SIMUBATCH              = ' '
    *    CTUPARAMS              = ' '
          tables
            dynprotab              = t_bdcdata
         exceptions
           internal_error         = 1
           not_open               = 2
           queue_error            = 3
           tcode_invalid          = 4
           printing_invalid       = 5
           posting_invalid        = 6
           others                 = 7
        if sy-subrc <> 0.
    * MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
    *         WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
        endif.
        refresh t_bdcdata.
        perform populate_se13.
        call function 'BDC_INSERT'
         exporting
           tcode                  = 'SE13'
    *    POST_LOCAL             = NOVBLOCAL
    *    PRINTING               = NOPRINT
    *    SIMUBATCH              = ' '
    *    CTUPARAMS              = ' '
          tables
            dynprotab              = t_bdcdata
         exceptions
           internal_error         = 1
           not_open               = 2
           queue_error            = 3
           tcode_invalid          = 4
           printing_invalid       = 5
           posting_invalid        = 6
           others                 = 7
        if sy-subrc <> 0.
    * MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
    *         WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
        endif.
        refresh t_bdcdata.
        perform activate.
        call function 'BDC_INSERT'
         exporting
           tcode                  = 'SE11'
    *    POST_LOCAL             = NOVBLOCAL
    *    PRINTING               = NOPRINT
    *    SIMUBATCH              = ' '
    *    CTUPARAMS              = ' '
          tables
            dynprotab              = t_bdcdata
         exceptions
           internal_error         = 1
           not_open               = 2
           queue_error            = 3
           tcode_invalid          = 4
           printing_invalid       = 5
           posting_invalid        = 6
           others                 = 7
        if sy-subrc <> 0.
    * MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
    *         WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
        endif.
      endloop.
      call function 'BDC_CLOSE_GROUP'
        exceptions
          not_open    = 1
          queue_error = 2
          others      = 3.
      if sy-subrc <> 0.
    * MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
    *         WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
      endif.
    *&      Form  POPULATE_SE11
    *    This subroutine is used to populate SE11 transaction data         *
    *     No interface parameters                                          *
    form populate_se11 .
      perform bdc_dynpro      using 'SAPMSRD0' '0102'.
      perform bdc_field       using 'BDC_CURSOR'
                                    'RSRD1-TBMA_VAL'.
      perform bdc_field       using 'BDC_OKCODE'
                                    '=ADD'.
      perform bdc_field       using 'RSRD1-TBMA'
                                    itab_header-dbcheck.
      perform bdc_field       using 'RSRD1-TBMA_VAL'
                                    itab_header-tname.
      perform bdc_dynpro      using 'SAPLSD41' '2200'.
      perform bdc_field       using 'BDC_OKCODE'
                                    '=CHANGE_MAINTFLAG'.
      perform bdc_field       using 'DD02D-DDTEXT'
                                    itab_header-tdesc.
      perform bdc_field       using 'BDC_CURSOR'
                                    'DD02D-MAINFLAG'.
      perform bdc_field       using 'DD02D-CONTFLAG'
                                    itab_header-devclass.
      perform bdc_field       using 'DD02D-MAINFLAG'
                                    itab_header-maintain.
      perform bdc_dynpro      using 'SAPLSD41' '2200'.
      perform bdc_field       using 'BDC_OKCODE'
                                    '=DEF'.
      perform bdc_field       using 'DD02D-CONTFLAG'
                                    'A'.
      perform bdc_field       using 'DD02D-MAINFLAG'
                                    'X'.
      perform bdc_dynpro      using 'SAPLSD41' '2200'.
      perform bdc_field       using 'BDC_OKCODE'
                                    '=FTYP'.
      w_tabix = 0.
      loop at itab_fields where count eq w_index.
        add 1 to w_tabix.
        if w_tabix gt 13.
          perform bdc_dynpro      using 'SAPLSD41' '2200'.
          perform bdc_field       using 'BDC_CURSOR'
                                       w_fname.
          perform bdc_field       using 'BDC_OKCODE'
                                        '=P+'.
          w_tabix = 2.
        endif.
        concatenate 'DD03P-FIELDNAME(' w_tabix ')' into w_fname.
        concatenate 'DD03P-KEYFLAG(' w_tabix ')' into w_fkey.
        concatenate 'DD03D-DATATYPE(' w_tabix ')' into w_ftype.
        concatenate 'DD03P-LENG(' w_tabix ')' into w_flen.
        concatenate 'DD03P-DDTEXT(' w_tabix ')' into w_fdesc.
        perform bdc_dynpro      using 'SAPLSD41' '2200'.
        perform bdc_field       using 'BDC_OKCODE'
                                      '/00'.
        perform bdc_field       using w_fname
                                      itab_fields-fname.
        perform bdc_field       using w_fkey
                                      itab_fields-fkey.
        perform bdc_field       using w_ftype
                                      itab_fields-ftype.
        perform bdc_field       using w_flen
                                        itab_fields-flen.
        perform bdc_field       using w_fdesc
                                      itab_fields-fdesc.
      endloop.
      perform bdc_dynpro      using 'SAPLSD41' '2200'.
      perform bdc_field       using 'BDC_OKCODE'
                                    '=WB_SAVE'.
      perform bdc_dynpro      using 'SAPLSTRD' '0100'.
      perform bdc_field       using 'BDC_OKCODE'
                                    '=ADD'.
      perform bdc_field       using 'KO007-L_DEVCLASS'
                                    'Z1139'.
      perform bdc_field       using 'KO007-L_AUTHOR'
                                    'SAPDEV02'.
      perform bdc_dynpro      using 'SAPLSTRD' '0300'.
      perform bdc_field       using 'BDC_OKCODE'
                                    '=LOCK'.
      perform bdc_field       using 'KO008-TRKORR'
                                    'TR1K900085'.
      perform bdc_dynpro      using 'SAPLSD41' '2200'.
      perform bdc_field       using 'BDC_CURSOR'
                                    'DD03P-DDTEXT(03)'.
      perform bdc_field       using 'BDC_OKCODE'
                                    '=BACK'.
      perform bdc_dynpro      using 'SAPMSRD0' '0102'.
      perform bdc_field       using 'BDC_CURSOR'
                                    'RSRD1-TBMA_VAL'.
      perform bdc_field       using 'BDC_OKCODE'
                                    '=BACK'.
    endform.                    " POPULATE_SE11
    *&      Form  POPULATE_SE13
    *    This subroutine is used to populate SE13 data                     *
    *     No interface parameters                                          *
    form populate_se13 .
      perform bdc_dynpro      using 'SAPMSEDS' '0010'.
      perform bdc_field       using 'DD09V-TABNAME'
                                    w_table.
      perform bdc_field       using 'BDC_OKCODE'
                                    'PFLG'.
      perform bdc_dynpro      using 'SAPMSEDS' '0050'.
      perform bdc_field       using 'BDC_OKCODE'
                                    '=SICH'.
      perform bdc_field       using 'DD09V-TABART'
                                    'APPL0'.
      perform bdc_field       using 'DD09V-TABKAT'
                                    '0'.
      perform bdc_field       using 'ALLOWSTATE-NOT_ALLOWED'
                                    'X'.
      perform bdc_dynpro      using 'SAPMSEDS' '0050'.
      perform bdc_field       using 'BDC_OKCODE'
                                    '=BACK'.
      perform bdc_field       using 'DD09V-TABART'
                                    'APPL0'.
      perform bdc_field       using 'DD09V-TABKAT'
                                    '0'.
      perform bdc_field       using 'ALLOWSTATE-NOT_ALLOWED'
                                    'X'.
      perform bdc_field       using 'BDC_OKCODE'
                                   '=WB_BACK'.
      perform bdc_dynpro      using 'SAPMSEDS' '0050'.
      perform bdc_field       using 'BDC_OKCODE'
                                    '=BACK'.
      perform bdc_dynpro      using 'SAPMSEDS' '0010'.
      perform bdc_field       using 'BDC_OKCODE'
                                    '=BACK'.
    endform.                    " POPULATE_SE13
    *&      Form  ACTIVATE
    *     This subroutine is used to activate the table from SE11          *
    *     No interface parameters.                                         *
    form activate .
      perform bdc_dynpro      using 'SAPMSRD0' '0102'.
      perform bdc_field       using 'RSRD1-TBMA'
                                    'X'.
      perform bdc_field       using 'RSRD1-TBMA_VAL'
                                    w_table.
      perform bdc_field       using 'BDC_OKCODE'
                                    'ACT'.
      perform bdc_dynpro      using 'SAPLSEWORKINGAREA' '0205'.
      perform bdc_field       using 'BDC_OKCODE'
                                    '=WEIT'.
      perform bdc_dynpro      using 'SAPMSRD0' '0102'.
      perform bdc_field       using 'BDC_OKCODE'
                                    '=BACK'.
    endform.                    " ACTIVATE
    *&      Form  bdc_dynpro
    *    This subroutine is used to populate the screen information        *
    *      -->prgname   Program name
    *      -->screenno  Screen number
    form bdc_dynpro  using    value(prgname)
                              value(screenno).
      clear t_bdcdata.
      t_bdcdata-program = prgname.
      t_bdcdata-dynpro = screenno.
      t_bdcdata-dynbegin = 'X'.
      append t_bdcdata.
    endform.                    " bdc_dynpro
    *&      Form  bdc_field
    *     This subroutine is used to populate the field values             *
    *      -->fnam   Field name                                            *
    *      -->fval   Field value                                           *
    form bdc_field  using    value(fnam)
                             value(fval).
      clear t_bdcdata.
      t_bdcdata-fnam = fnam.
      t_bdcdata-fval = fval.
      append t_bdcdata.
    endform.                    " bdc_field
    ******flat file ******
    **H,X,Z1139_REC_30,Recorded Table,A,X*
    **I,mandt,X,clnt,3,Client*
    **I,ENO,X,char,6,Employee Number*
    **I,ENAME, ,Char,20,Employee Name*
    **I,deptno, ,char,10,Department Number*
    **I,salary, ,int4, ,Salary*
    **I,deptno,X,char,10,Department Number*
    **I,dname, ,char,20,Department Name*
    **I,Locate, ,char,20,Location*
    **I,deptno,X,char,10,Department Number*
    **I,dname, ,char,20,Department Name*
    **I,Locate, ,char,20,Location*
    **I,deptno,X,char,10,Department Number*
    **I,dname, ,char,20,Department Name*
    **I,Locate, ,char,20,Location*
    **I,deptno,X,char,10,Department Number*
    **I,dname, ,char,20,Department Name*
    **I,Locate, ,char,20,Location*
    **I,deptno,X,char,10,Department Number*
    **I,dname, ,char,20,Department Name*
    **I,Locate, ,char,20,Location*
    **H,X,Z1139_REC_31,Recorded Table,A,X*
    **I,mandt,X,clnt,3,Client*
    **I,deptno,X,char,10,Department Number*
    **I,dname, ,char,20,Department Name*
    **I,Locate, ,char,20,Location*
    hope the above example would help you and solve your issue.
    Regards
    Narin Nandivada

  • Update database table

    I have 1 million records in application server and I want to update database table from that.
    Is UPDATE statement the best technique to do it.
    Just wanted to know if there is any other better tehcniques.
    Also i want to write the errors to job log. How can we do that?
    Regards,
    DNP

    If they are all new records or all changes, it would be best to use INSERT or UPDATE. You will also want to do mass inserts/changes using an internal table. Since you have so many records, you will probably have to do this in chunks in order to avoid dumping on the rollback area.
    Rob

  • API for updating pay_people_groups table..

    Hi,
    Is there any API for updating pay_people_groups table. I know we can do it using hr_assignment_api.update_emp_asg_criteria but this API updates the assignement with the new pay_group_id. I want to know is there is any API which can only update the pay_people_groups and not the assignment.
    Regards,
    Shabana.

    Hi,
    Technically you want update values for people group. If you remember At the time of definition of people group you created value set and attached people group flex field.
    People group are created on the basis of combination of segments. So you have to update only values not people group.
    I doubt oracle provides API to update key flex field.
    You may get API to update values try out that option.
    Hope this helps.
    Sathish

  • How to call a idoc in abap program and updates catsdb table

    how to call a idoc in abap program and updates catsdb table
    thank you,
    Jagrut BharatKumar Shukla

    Hi Kishan,
    You can refer to following help document,
    http://help.sap.com/saphelp_nw04/helpdata/en/bf/d005244e9d1d4d92b2fe7935556b4c/content.htm
    Regards,
    Meera

  • How to configure ActiveSync for a database table in IdM 7.0

    Hi All,
    Please suggest me the steps to configure ActiveSync in IdM 7.0.
    when i try it by resource-->activeSync wizard it gives
    "The ActiveSync Wizard has been deprecated in Identity Manager 7.0 in favor of using MetaView and the resource action "Edit Synchronization Policy". "
    how to configure ActiveSync for a database table.
    Thanx
    Shant

    Hi,
    You need to a script and run it on os level. Here is an example:-
    emcli relocate_targets -src_agent=agentmachine1.domain:3872
    -dest_agent=agentmachine2.domain:3872 -target_name=RACDB
    -target_type=oracle_database -copy_from_src -force=yes
    -changed_param=MachineName:agentmachine2.domain
    Regards
    Jomon
    Edited by: JohnJomon on Nov 17, 2011 2:27 PM

  • XD02 transaction to change the customer data for updating KNA1 table?

    Hi all,
    How can we use XD02 transaction to change the customer data for updating KNA1 table?
    Give the steps.
    Thanks in advance
    rk

    Hi KR,
    Why don't u use BDC to run XD02.
    With Regards,
    Zafar Ali

  • Add Table maintenance program for custom table to an existing func group

    Hi Guys,
    Can I add Table maintenance program for custom table to an existing function group or I need to create a new
    function group for each custom table.
    Thanks,
    mini

    You can add to an existing function group, there's nothing technically to stop you doing this.  However, consider that this is creating generated function modules in this function group and you would be wise to avoid using a function group containing manually created modules.
    I personally always create a new function group, using the name of the table as the name of the function group.
    Regards,
    Nick

Maybe you are looking for