‎2008 May 12 9:01 AM
Hi All.
Can anyone please tell me how can I update my z table using table controls.
My Z table will have 4 fields. My program will fetch & display 3 fields from std tables. The user will input the 4th field. How I can do this??
Regards
Sathar
‎2008 May 12 9:08 AM
Hi,
Please check this sample code for table control.
SAVE_OK = OK_CODE.
CLEAR OK_CODE.
CASE SAVE_OK.
...
WHEN 'INSERT'.
READ TABLE TC-COLS INTO COL WITH KEY SCREEN-INPUT = '1'.
IF SY-SUBRC = 0.
LOOP AT I_BINLOC INTO ZMBINLOC WHERE ZMARK = 'X'.
CLEAR ZMBINLOC.
INSERT ZMBINLOC INTO I_BINLOC INDEX SY-TABIX.
ENDLOOP.
DESCRIBE TABLE I_BINLOC LINES TC-LINES.
ENDIF.
WHEN 'SAVE'.
SORT I_BINLOC ASCENDING BY WERKS LGORT ZBINLOC.
DELETE ADJACENT DUPLICATES FROM I_BINLOC.
IF NOT I_DELETE[] IS INITIAL.
DELETE ZMBINLOC FROM TABLE I_DELETE.
ENDIF.
MODIFY ZMBINLOC FROM TABLE I_BINLOC.
IF SY-SUBRC = 0.
MESSAGE S899(BD) WITH TEXT-002.
ENDIF.
WHEN OTHERS.
ENDCASE.
...
Also please demo program RSDEMO02.
check these links.
http://sap.niraj.tripod.com/id29.html
http://help.sap.com/saphelp_sm32/helpdata/en/9f/dbac9f35c111d1829f0000e829fbfe/frameset.htm
Regards
KUmar
‎2008 May 12 9:05 AM
Hi,
Create an internal table with four fields and on the screen create table control with reference table from program and give the internal table name to it...
In the PBO of the screen update the internal table with the data fetched for the three fields from data base table and capture the input from the fourth field from user in PAI of the screen and update the data base.
Regards,
Ramesh
‎2008 May 12 9:07 AM
Hi,
Refer to the folowing link:
http://www.esnips.com/doc/48bd95e8-facc-4932-b923-465ba59bad24/Table-Control.pdf
Hope this helps.
Reward if helpful.
Regards,
Sipra
‎2008 May 12 9:08 AM
Hi,
Please check this sample code for table control.
SAVE_OK = OK_CODE.
CLEAR OK_CODE.
CASE SAVE_OK.
...
WHEN 'INSERT'.
READ TABLE TC-COLS INTO COL WITH KEY SCREEN-INPUT = '1'.
IF SY-SUBRC = 0.
LOOP AT I_BINLOC INTO ZMBINLOC WHERE ZMARK = 'X'.
CLEAR ZMBINLOC.
INSERT ZMBINLOC INTO I_BINLOC INDEX SY-TABIX.
ENDLOOP.
DESCRIBE TABLE I_BINLOC LINES TC-LINES.
ENDIF.
WHEN 'SAVE'.
SORT I_BINLOC ASCENDING BY WERKS LGORT ZBINLOC.
DELETE ADJACENT DUPLICATES FROM I_BINLOC.
IF NOT I_DELETE[] IS INITIAL.
DELETE ZMBINLOC FROM TABLE I_DELETE.
ENDIF.
MODIFY ZMBINLOC FROM TABLE I_BINLOC.
IF SY-SUBRC = 0.
MESSAGE S899(BD) WITH TEXT-002.
ENDIF.
WHEN OTHERS.
ENDCASE.
...
Also please demo program RSDEMO02.
check these links.
http://sap.niraj.tripod.com/id29.html
http://help.sap.com/saphelp_sm32/helpdata/en/9f/dbac9f35c111d1829f0000e829fbfe/frameset.htm
Regards
KUmar