Skip to Content

how to update database table using table control with wizard???

Dear Experts

I have created a module pool using table control with wizard....

Now i want to modify my database table using this table control with wizard....

i.e.

when i run my module pool it displays a table with data in it...

now i want to update database table through this table control...

kindly guide me how can i do this...

Thanks in advance

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

1 Answer

  • Best Answer
    author's profile photo Former Member
    Former Member
    Posted on Jan 24, 2014 at 05:53 AM

    hi sehgal,

    in pai

    loop at <table control> into <wa>.

    append <wa> into <itab>.

    endloop.

    place one button into ur screen

    ex: case sy-ucomm.

    when 'SAVE'.

    MODIFY <DBNAME> FROM TABLE <ITAB> ACCEPTING DUPLICATE KEYS.

    ENDCASE.

    Thanks@Regards,

    R.Naveen.

    Add a comment
    10|10000 characters needed characters exceeded

    • Dear Sir

      my requirement is dat whenever i get output in my table control wizard i want to give user option to modify dat data which in turn effect database table ZTEMP.

      m using button "PROCESS" for this thing...i want u to give me code for "PROCESS".

      e.g. there is field in table ZTEMP named ORDERDATE...

      my program give output value in this field of table wizard 27.01.2014.

      i want to give user option to change this date to 28.01.2014 or any date whenever he press "PROCESS" pushbutton...

      Can u plz give me ur mail id so dat i can elaborate u my requirement....

      m using following code

      Kindly guide me where i m lacking.

      TABLES: ZTEMP.

      CONTROLS: TABD TYPE TABLEVIEW USING SCREEN 0100.

      DATA: G_TABD_ITAB TYPE T_TABD OCCURS 0,

      G_TABD_WA TYPE T_TABD. "work area

      DATA:BEGIN OF ITAB OCCURS 0.

      INCLUDE STRUCTURE ZTEMP.

      DATA END OF ITAB.

      DATA:WA_ZTEMP LIKE LINE OF ITAB.

      MODULE TABD_INIT OUTPUT.

      IF G_TABD_COPIED IS INITIAL.

      *&SPWIZARD: COPY DDIC-TABLE 'ZTEMP'

      *&SPWIZARD: INTO INTERNAL TABLE 'g_TABD_itab'

      SELECT * FROM ZTEMP

      INTO CORRESPONDING FIELDS

      OF TABLE G_TABD_ITAB

      WHERE ORDERNUMBER IN ORDNMBR

      AND ORDERDATE IN ORDDATE.

      G_TABD_COPIED = 'X'.

      SORT G_TABD_ITAB BY ORDERNUMBER ORDERDATE.

      REFRESH CONTROL 'TABD' FROM SCREEN '0100'.

      ENDIF.

      ENDMODULE.

      MODULE USER_COMMAND_0100 INPUT.

      CASE sy-ucomm.

      WHEN 'PROCESS'.

      READ TABLE G_TABD_ITAB INTO G_TABD_WA WITH KEY MARK = 'X'.

      SELECT * FROM ZTEMP INTO ITAB WHERE ORDERNUMBER = G_TABD_WA-ORDERNUMBER.ENDSELECT.

      Loop at ITAB into WA_ZTEMP.

      ENDLOOP.

      MODIFY ZTEMP FROM WA_ZTEMP.

      COMMIT WORK.

      CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'

      ENDCASE.

      ENDMODULE.

      Thanks

      Sehgal

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.