Deleting Equipment Usage List - Table EQUZ, Field DATAB
Hi Gurus,
An equipment was inadvertently uninstalled from a location and then resinstalled again. This resulted in a new Valaidity Date being created.
We have a third part tool, that uses the Validity From date for its calculation. It seems unlikely that the Validity From date can be changed as this tracks the usage of equipment.
The option I have is to delete the entry from the EQUZ table. The challenege is that Validity To can not be modified as it seems to be a primary key in the table.
How advisable is to delete the entries from the EQUZ table and insert a single entry into the EQUZ table.
To Illiustrate the point:
Desired State - Equipment A:
Validity From - 31.11.2007 Validity To: 31.12.9999
Current State:
Validity From - 31.11.2007 Validity To: 20.05.2010
Validity From - 20.05.2010 Validity To: 31.12.9999
Proposal
Delete from EQUZ
Validity From - 31.11.2007 Validity To: 20.05.2010
Validity From - 20.05.2010 Validity To: 31.12.9999
Insert into EQUZ
Validity From - 31.11.2007 Validity To: 31.12.9999
Your suggestions are highly appreciated.
Regards,
Nisha
Hi,
It is probably best to adjust the latest EQUZ record (validity to 31.12.9999), change the valid from field back to original 31.11.2007 date. Then delete the earlier EQUZ records.
It is not an ideal way to fix the situation so ensure you document and keep copies of these records as they are now.
-Paul
Similar Messages
-
Dear PM Guys,
Is there is any standard report in which I can see the equipment usage list for sub equipments.Because the scenario is FL-MAIN EQUIPMENT-SUB EQUIPMENTS.They always keep on move sub equipments from one main equipment to other main equipment inside the same FL.In IE07 report,it shows usage list based on FL.Eg. Equipment KL322567(in my case its sub-equipment) from XX.XX.XXXX date to YY.YY.YYYY date one FL and like that.But I want both Main equipment and FL.Is it possible in standard?
URGENT PL
Regards
ISWARIhi iswari
in standard report IE07 you have to trace back only from functional location only ,i dont think there will be any standard report for sub equipment.try to create a custom report with the help of abaper
regards
thyagarajan -
Delete row from internal table using field symbol.
Hi friends,
I created dynamic internal table using field symbol. I want to delete some data using where clause.
for example. i want to use like,
DELETE <FS> WHERE KUNNR = WA_KNA1-KUNNR.
Like the above statment it won't work. How i can use delete with where clause in field symbols.
Hope any one can help me.
Thanks and regards
Srikanth. Shi Srikanth,
I think you have to LOOP through the whole internal table and check each line and decide to delete or not:
LOOP at <itab> INTO <wa>.
ASSIGN COMPONENT 'KUNNR' OF STRUCTURE <wa> TO <field>.
CHECK <field> IS ASSIGNED.
IF <field> EQ WA_KNA1-KUNNR.
DELETE ...
ENDIF.
UNASSIGN <field>.
ENDLOOP.
hope this helps
ec -
How to delete the row in table control with respect to one field in module pool programming?
Hi,
Can I know the way to delete the row in table control with respect to one field in module pool programming
Regards
Darshan MSHI,
I want to delete the row after the display of table control. I have created push button as delete row. If I click on this push button, the selected row should get deleted.
I have written this code,
module USER_COMMAND_9000 input.
DATA OK_CODE TYPE SY-UCOMM.
OK_CODE = SY-UCOMM.
CASE OK_CODE.
WHEN 'DELETE'.
LOOP AT lt_source INTO ls_source WHERE mark = 'X'.
APPEND LS_SOURCE TO LT_RESTORE.
DELETE TABLE LT_SOURCE FROM LS_SOURCE.
SOURCE-LINES = SOURCE-LINES - 1.
ENDLOOP.
But I'm unable to delete the selected rows, It is getting deleted the last rows eventhough I select the other row.
So I thought of doing with respect to the field. -
Dear all,
Any one please tell me,
In IH08, deleted & active equip. list display, but i want to see active equipment list & deleted equipment list separatly (Deleted equipment should not display in that list)
What i have do for this?hi
while executing the T code IH08 specify the system status deletion indicator in the status excluded and execute ,you will get the available equipments
regards
thyagarajan -
Delete multiple rows from table/list control
Hi,
I want to have a table control in which a user can enter different entries, like this:
My program would read each entry at a time and do something.
However, I would like to give the user ability to delete multiple entries at once, like in an Excel spreadsheet - that is, the user selects multiple rows and presses "Delete" key and those entries get deleted. The Labview table does not allow this it seems - I can only delete one entry at a time - or I have to right-click and select Data Operations->Cut Data, which is awkward.
Is there a control better suited to what I want to do? I tried a Llist control, but it behaves in the same manner.
Thanks in advance!
Solved!
Go to Solution.You could write your own routine. Use an Event Structure with a Key Down event. If the delete key was pressed and the table has focus delete the elements that are selected.
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines -
List of system fields like sy-index, sy-srow......
can any one give me list of system fields with there use. i would b very thankful.
hi Amjad,
Please find below the request fields, from table SYST.
INDEX Loops, number of current pass
PAGNO List creation, current page
TABIX Internal table, current line index
TFILL Internal tables, current number of lines
TOCCU Internal tables, initial main memory requirements
DBCNT DB operations, number of table lines processed
FDPOS Character strings, offset in character string
COLNO List creation, current column of list
LINCT List processing, page length of list
LINNO List creation, current line
LINSZ List creation, width of list
MACOL Print list, columns from SET MARGIN statement
MAROW List printing, lines from SET MARGIN statement
TLENG Internal tables, line width
LILLI List processing, current list line
SUBRC Return value, return value after ABAP statements
CUCOL Screens, horizontal cursor position at PAI
CUROW Screens, vertical cursor position at PAI
LSIND List processing, details list index
LISTI List processing, index of current list
STEPL Screens, current table line index
SROWS Screens, numbers of lines
SCOLS Screens, number of columns
LOOPC Screens, number of lines visible in table
TZONE Date and time, time difference from Greenwich Mean Time
DAYST Date and time, Daylight savings time flag
FDAYW Date and time, factory calendar weekday
LANGU R/3 System, current language
MODNO R/3 System, external modes index
BATCH Program running in background
BINPT Batch input, program running under batch input
CALLD ABAP program, ABAP program call mode
DYNNR ABAP program, number of current screen
DYNGR ABAP program, screen group of current screen
WTITL List creation, flag for standard page header
CPAGE List processing, current page number
DBNAM ABAP program, related logical database
MANDT R/3 System, client number from logon
PEXPI Print parameters, spool retention period
PRIMM Print parameters, print immediately
PRREL Print parameters, delete after printing
PRBIG Print parameters, selection cover page
PRNEW Print parameters, new spool request
PDEST Print parameters, output device
PLIST Print parameters, name of spool request
PRDSN Print parameters, name of spool dataset
CALLR Print list, ID for print dialog function
RTITL Print parameters, title of print program
PRREC Print parameters, recipient
PRTXT Print parameters, text for cover page
PRABT Print parameters, department on cover page
PAART Print parameters, print formatting
PRCOP Print parameters, number of copies
DBSYS R/3 System, name of central database system
SYSID R/3 System, name of R/3 System
OPSYS R/3 System, operating system of application server
PFKEY Screens, current GUI status
SAPRL R/3 System, system release
TCODE ABAP program, current transaction code
UCOMM Screens, function code triggered by PAI
SPONO Print list, spool number
DATUM Date and time, current (application server) date
SLSET Selection screens, name of variant
UZEIT Dat and time, current application server time
REPID ABAP program, current main program
UNAME R/3 System, user logon name
LSTAT List processing, list level IDs
ABCDE Constant: Alphabet (A,B,C,...)
MSGLI Messages, message line
TITLE Screens, title text
LISEL List processing, contents of selected line
ULINE Constants, horizontal line with length 255
CPROG ABAP program, caller in external procedures
LDBPG ABAP program, logical database program
TVAR0 List creation, text variable for headers
TVAR1 List creation, text variable for headers
TVAR2 List creation, text variable for headers
TVAR3 List creation, text variable for headers
TVAR4 List creation, text variable for headers
TVAR5 List creation, text variable for headers
TVAR6 List creation, text variable for headers
TVAR7 List creation, text variable for headers
TVAR8 List creation, text variable for headers
TVAR9 List creation, text variable for headers
MSGID Messages, message class
MSGTY Messages, message type
MSGNO Messages, message number
MSGV1 Messages, message variables
MSGV2 Messages, message variables
MSGV3 Messages, message variables
MSGV4 Messages, message variables
VLINE Constants, vertical bar
STACO List processing, initial column displayed
STARO List processing, first line displayed at top
DATAR Screens, display user entry
HOST R/3 System, Name of application server
DATLO Date and time, local date of user
TIMLO Date and time, local time for user
ZONLO Date and time, time zone of user
Hope this helps,
Sajan Joseph. -
CAN SOME ONE GIVE ME THE LIST OF SYSTEM FIELDS THAT WE CAN USE IN TEH PROGEAM.
LIKE SY-DATUM...
vjhi VJ,
Please find below the request fields, from table SYST.
INDEX Loops, number of current pass
PAGNO List creation, current page
TABIX Internal table, current line index
TFILL Internal tables, current number of lines
TOCCU Internal tables, initial main memory requirements
DBCNT DB operations, number of table lines processed
FDPOS Character strings, offset in character string
COLNO List creation, current column of list
LINCT List processing, page length of list
LINNO List creation, current line
LINSZ List creation, width of list
MACOL Print list, columns from SET MARGIN statement
MAROW List printing, lines from SET MARGIN statement
TLENG Internal tables, line width
LILLI List processing, current list line
SUBRC Return value, return value after ABAP statements
CUCOL Screens, horizontal cursor position at PAI
CUROW Screens, vertical cursor position at PAI
LSIND List processing, details list index
LISTI List processing, index of current list
STEPL Screens, current table line index
SROWS Screens, numbers of lines
SCOLS Screens, number of columns
LOOPC Screens, number of lines visible in table
TZONE Date and time, time difference from Greenwich Mean Time
DAYST Date and time, Daylight savings time flag
FDAYW Date and time, factory calendar weekday
LANGU R/3 System, current language
MODNO R/3 System, external modes index
BATCH Program running in background
BINPT Batch input, program running under batch input
CALLD ABAP program, ABAP program call mode
DYNNR ABAP program, number of current screen
DYNGR ABAP program, screen group of current screen
WTITL List creation, flag for standard page header
CPAGE List processing, current page number
DBNAM ABAP program, related logical database
MANDT R/3 System, client number from logon
PEXPI Print parameters, spool retention period
PRIMM Print parameters, print immediately
PRREL Print parameters, delete after printing
PRBIG Print parameters, selection cover page
PRNEW Print parameters, new spool request
PDEST Print parameters, output device
PLIST Print parameters, name of spool request
PRDSN Print parameters, name of spool dataset
CALLR Print list, ID for print dialog function
RTITL Print parameters, title of print program
PRREC Print parameters, recipient
PRTXT Print parameters, text for cover page
PRABT Print parameters, department on cover page
PAART Print parameters, print formatting
PRCOP Print parameters, number of copies
DBSYS R/3 System, name of central database system
SYSID R/3 System, name of R/3 System
OPSYS R/3 System, operating system of application server
PFKEY Screens, current GUI status
SAPRL R/3 System, system release
TCODE ABAP program, current transaction code
UCOMM Screens, function code triggered by PAI
SPONO Print list, spool number
DATUM Date and time, current (application server) date
SLSET Selection screens, name of variant
UZEIT Dat and time, current application server time
REPID ABAP program, current main program
UNAME R/3 System, user logon name
LSTAT List processing, list level IDs
ABCDE Constant: Alphabet (A,B,C,...)
MSGLI Messages, message line
TITLE Screens, title text
LISEL List processing, contents of selected line
ULINE Constants, horizontal line with length 255
CPROG ABAP program, caller in external procedures
LDBPG ABAP program, logical database program
TVAR0 List creation, text variable for headers
TVAR1 List creation, text variable for headers
TVAR2 List creation, text variable for headers
TVAR3 List creation, text variable for headers
TVAR4 List creation, text variable for headers
TVAR5 List creation, text variable for headers
TVAR6 List creation, text variable for headers
TVAR7 List creation, text variable for headers
TVAR8 List creation, text variable for headers
TVAR9 List creation, text variable for headers
MSGID Messages, message class
MSGTY Messages, message type
MSGNO Messages, message number
MSGV1 Messages, message variables
MSGV2 Messages, message variables
MSGV3 Messages, message variables
MSGV4 Messages, message variables
VLINE Constants, vertical bar
STACO List processing, initial column displayed
STARO List processing, first line displayed at top
DATAR Screens, display user entry
HOST R/3 System, Name of application server
DATLO Date and time, local date of user
TIMLO Date and time, local time for user
ZONLO Date and time, time zone of user
Hope this helps,
Sajan Joseph. -
How to delete a row from table control
I have created a push button on the screen for delete.
its getting stored in ok_code.
'FLAG' is the name of the mark on the table control.
I am getting probs in this line.
I am not getting anything in mark_field.
ASSIGN COMPONENT p_mark_name OF STRUCTURE <wa> TO <mark_field>.
The code is:
MODULE tablctrl2_user_command INPUT.
PERFORM user_ok_tc USING 'TABLCTRL2'
'I_ZSKILLEMP'
'FLAG'
CHANGING ok_code.
ENDMODULE.
FORM user_ok_tc USING p_tc_name TYPE dynfnam
p_table_name
p_mark_name
CHANGING p_ok LIKE sy-ucomm.
-BEGIN OF LOCAL DATA----
DATA: l_ok TYPE sy-ucomm,
l_offset TYPE i.
-END OF LOCAL DATA----
Table control specific operations *
evaluate TC name and operations *
SEARCH p_ok FOR p_tc_name.
IF sy-subrc <> 0.
EXIT.
ENDIF.
l_offset = strlen( p_tc_name ) + 1.
l_ok = p_ok+l_offset.
execute general and TC specific operations *
CASE l_ok.
WHEN 'INSR'. "insert row
PERFORM fcode_insert_row USING p_tc_name
p_table_name.
CLEAR p_ok.
WHEN 'DELE'. "delete row
PERFORM fcode_delete_row USING p_tc_name
p_table_name
p_mark_name.
CLEAR p_ok.
FORM fcode_delete_row
USING p_tc_name TYPE dynfnam
p_table_name
p_mark_name .
-BEGIN OF LOCAL DATA----
DATA l_table_name LIKE feld-name.
FIELD-SYMBOLS <tc> TYPE cxtab_control.
FIELD-SYMBOLS <table> TYPE STANDARD TABLE.
FIELD-SYMBOLS <wa>.
FIELD-SYMBOLS <mark_field>.
-END OF LOCAL DATA----
ASSIGN (p_tc_name) TO <tc>.
get the table, which belongs to the tc *
CONCATENATE p_table_name '[]' INTO l_table_name. "table body
ASSIGN (l_table_name) TO <table>. "not headerline
delete marked lines *
DESCRIBE TABLE <table> LINES <tc>-lines.
LOOP AT <table> ASSIGNING <wa>.
access to the component 'FLAG' of the table header *
ASSIGN COMPONENT p_mark_name OF STRUCTURE <wa> TO <mark_field>.
IF <mark_field> = 'X'.
DELETE <table> INDEX syst-tabix.
IF sy-subrc = 0.
<tc>-lines = <tc>-lines - 1.
ENDIF.
ENDIF.
ENDLOOP.
ENDFORM.Hi...
i got the same prob...but got the solution too...
you have to take an internal table of same type of dbase table..and maintain a flag in it...which will be get filled automatically with 'X'.
here is the code..go throug it..
REPORT YH642_DIALOG_TABLECONTROL.
CALL SCREEN 999.
DATA:
W_INDEX TYPE I.
DATA:
W_UCOMM LIKE SY-UCOMM.
***&SPWIZARD: DATA DECLARATION FOR TABLECONTROL 'TAB'
*&SPWIZARD: DEFINITION OF DDIC-TABLE
TABLES: YH642_RAM.
DATA:
BEGIN OF DDTAB,
TAB_FLAG TYPE C,
MANDT LIKE YH642_RAM-MANDT,
EID LIKE YH642_RAM-EID,
ENAME LIKE YH642_RAM-ENAME,
MOBILE LIKE YH642_RAM-MOBILE,
END OF DDTAB.
*&SPWIZARD: TYPE FOR THE DATA OF TABLECONTROL 'TAB'
TYPES: BEGIN OF T_TAB,
TAB_FLAG TYPE C,
MANDT LIKE YH642_RAM-MANDT,
EID LIKE YH642_RAM-EID,
ENAME LIKE YH642_RAM-ENAME,
MOBILE LIKE YH642_RAM-MOBILE,
END OF T_TAB.
*&SPWIZARD: INTERNAL TABLE FOR TABLECONTROL 'TAB'
DATA: G_TAB_ITAB TYPE T_TAB OCCURS 0,
H_TAB_ITAB TYPE T_TAB OCCURS 0,
G_TAB_WA TYPE T_TAB. "work area
DATA: G_TAB_COPIED. "copy flag
*&SPWIZARD: DECLARATION OF TABLECONTROL 'TAB' ITSELF
CONTROLS: TAB TYPE TABLEVIEW USING SCREEN 0999.
*&SPWIZARD: LINES OF TABLECONTROL 'TAB'
DATA: G_TAB_LINES LIKE SY-LOOPC.
DATA: OK_CODE LIKE SY-UCOMM.
*&SPWIZARD: OUTPUT MODULE FOR TC 'TAB'. DO NOT CHANGE THIS LINE!
*&SPWIZARD: COPY DDIC-TABLE TO ITAB
MODULE TAB_INIT OUTPUT.
IF G_TAB_COPIED IS INITIAL.
*&SPWIZARD: COPY DDIC-TABLE 'YH642_RAM'
*&SPWIZARD: INTO INTERNAL TABLE 'g_TAB_itab'
SELECT * FROM YH642_RAM
INTO CORRESPONDING FIELDS
OF TABLE G_TAB_ITAB.
G_TAB_COPIED = 'X'.
H_TAB_ITAB[] = G_TAB_ITAB[].
REFRESH CONTROL 'TAB' FROM SCREEN '0999'.
ENDIF.
ENDMODULE. "TAB_INIT OUTPUT
*&SPWIZARD: OUTPUT MODULE FOR TC 'TAB'. DO NOT CHANGE THIS LINE!
*&SPWIZARD: MOVE ITAB TO DYNPRO
MODULE TAB_MOVE OUTPUT.
MOVE-CORRESPONDING G_TAB_WA TO DDTAB.
ENDMODULE. "TAB_MOVE OUTPUT
*&SPWIZARD: OUTPUT MODULE FOR TC 'TAB'. DO NOT CHANGE THIS LINE!
*&SPWIZARD: GET LINES OF TABLECONTROL
MODULE TAB_GET_LINES OUTPUT.
G_TAB_LINES = SY-LOOPC.
ENDMODULE. "TAB_GET_LINES OUTPUT
*&SPWIZARD: INPUT MODULE FOR TC 'TAB'. DO NOT CHANGE THIS LINE!
*&SPWIZARD: MODIFY TABLE
MODULE TAB_MODIFY INPUT.
MOVE-CORRESPONDING DDTAB TO G_TAB_WA.
MODIFY G_TAB_ITAB
FROM G_TAB_WA
INDEX TAB-CURRENT_LINE.
ENDMODULE. "TAB_MODIFY INPUT
*&SPWIZARD: INPUT MODULE FOR TC 'TAB'. DO NOT CHANGE THIS LINE!
*&SPWIZARD: PROCESS USER COMMAND
MODULE TAB_USER_COMMAND INPUT.
OK_CODE = SY-UCOMM.
PERFORM USER_OK_TC USING 'TAB'
'G_TAB_ITAB'
'TAB_FLAG'
CHANGING OK_CODE.
SY-UCOMM = OK_CODE.
ENDMODULE. "TAB_USER_COMMAND INPUT
INCLUDE TABLECONTROL_FORMS *
*& Form USER_OK_TC *
FORM USER_OK_TC USING P_TC_NAME TYPE DYNFNAM
P_TABLE_NAME
P_MARK_NAME
CHANGING P_OK LIKE SY-UCOMM.
&SPWIZARD: BEGIN OF LOCAL DATA----
DATA: L_OK TYPE SY-UCOMM,
L_OFFSET TYPE I.
&SPWIZARD: END OF LOCAL DATA----
*&SPWIZARD: Table control specific operations *
*&SPWIZARD: evaluate TC name and operations *
SEARCH P_OK FOR P_TC_NAME.
IF SY-SUBRC <> 0.
EXIT.
ENDIF.
L_OFFSET = STRLEN( P_TC_NAME ) + 1.
L_OK = P_OK+L_OFFSET.
L_OK = 'DELE'.
*&SPWIZARD: execute general and TC specific operations *
CASE L_OK.
WHEN 'INSR'. "insert row
PERFORM FCODE_INSERT_ROW USING P_TC_NAME
P_TABLE_NAME.
CLEAR P_OK.
WHEN 'DELE'. "delete row
MESSAGE 'Are you really going to delete??' type 'I'.
PERFORM FCODE_DELETE_ROW USING P_TC_NAME
P_TABLE_NAME
P_MARK_NAME.
CLEAR P_OK.
WHEN 'P--' OR "top of list
'P-' OR "previous page
'P+' OR "next page
'P++'. "bottom of list
PERFORM COMPUTE_SCROLLING_IN_TC USING P_TC_NAME
L_OK.
CLEAR P_OK.
WHEN 'L--'. "total left
PERFORM FCODE_TOTAL_LEFT USING P_TC_NAME.
WHEN 'L-'. "column left
PERFORM FCODE_COLUMN_LEFT USING P_TC_NAME.
WHEN 'R+'. "column right
PERFORM FCODE_COLUMN_RIGHT USING P_TC_NAME.
WHEN 'R++'. "total right
PERFORM FCODE_TOTAL_RIGHT USING P_TC_NAME.
WHEN 'MARK'. "mark all filled lines
PERFORM FCODE_TC_MARK_LINES USING P_TC_NAME
P_TABLE_NAME
P_MARK_NAME .
CLEAR P_OK.
WHEN 'DMRK'. "demark all filled lines
PERFORM FCODE_TC_DEMARK_LINES USING P_TC_NAME
P_TABLE_NAME
P_MARK_NAME .
CLEAR P_OK.
WHEN 'SASCEND' OR
'SDESCEND'. "sort column
PERFORM FCODE_SORT_TC USING P_TC_NAME
l_ok.
ENDCASE.
ENDFORM. " USER_OK_TC
*& Form FCODE_INSERT_ROW *
FORM FCODE_INSERT_ROW
USING P_TC_NAME TYPE DYNFNAM
P_TABLE_NAME .
&SPWIZARD: BEGIN OF LOCAL DATA----
DATA L_LINES_NAME LIKE FELD-NAME.
DATA L_SELLINE LIKE SY-STEPL.
DATA L_LASTLINE TYPE I.
DATA L_LINE TYPE I.
DATA L_TABLE_NAME LIKE FELD-NAME.
FIELD-SYMBOLS <TC> TYPE CXTAB_CONTROL.
FIELD-SYMBOLS <TABLE> TYPE STANDARD TABLE.
FIELD-SYMBOLS <LINES> TYPE I.
&SPWIZARD: END OF LOCAL DATA----
ASSIGN (P_TC_NAME) TO <TC>.
*&SPWIZARD: get the table, which belongs to the tc *
CONCATENATE P_TABLE_NAME '[]' INTO L_TABLE_NAME. "table body
ASSIGN (L_TABLE_NAME) TO <TABLE>. "not headerline
*&SPWIZARD: get looplines of TableControl *
CONCATENATE 'G_' P_TC_NAME '_LINES' INTO L_LINES_NAME.
ASSIGN (L_LINES_NAME) TO <LINES>.
*&SPWIZARD: get current line *
GET CURSOR LINE L_SELLINE.
IF SY-SUBRC <> 0. " append line to table
L_SELLINE = <TC>-LINES + 1.
*&SPWIZARD: set top line *
IF L_SELLINE > <LINES>.
<TC>-TOP_LINE = L_SELLINE - <LINES> + 1 .
ELSE.
<TC>-TOP_LINE = 1.
ENDIF.
ELSE. " insert line into table
L_SELLINE = <TC>-TOP_LINE + L_SELLINE - 1.
L_LASTLINE = <TC>-TOP_LINE + <LINES> - 1.
ENDIF.
*&SPWIZARD: set new cursor line *
L_LINE = L_SELLINE - <TC>-TOP_LINE + 1.
*&SPWIZARD: insert initial line *
INSERT INITIAL LINE INTO <TABLE> INDEX L_SELLINE.
<TC>-LINES = <TC>-LINES + 1.
*&SPWIZARD: set cursor *
SET CURSOR LINE L_LINE.
ENDFORM. " FCODE_INSERT_ROW
*& Form FCODE_DELETE_ROW *
FORM FCODE_DELETE_ROW
USING P_TC_NAME TYPE DYNFNAM
P_TABLE_NAME
P_MARK_NAME .
&SPWIZARD: BEGIN OF LOCAL DATA----
DATA L_TABLE_NAME LIKE FELD-NAME.
FIELD-SYMBOLS <TC> TYPE CXTAB_CONTROL.
FIELD-SYMBOLS <TABLE> TYPE STANDARD TABLE.
FIELD-SYMBOLS <WA>.
FIELD-SYMBOLS <MARK_FIELD>.
&SPWIZARD: END OF LOCAL DATA----
ASSIGN (P_TC_NAME) TO <TC>.
*&SPWIZARD: get the table, which belongs to the tc *
CONCATENATE P_TABLE_NAME '[]' INTO L_TABLE_NAME. "table body
ASSIGN (L_TABLE_NAME) TO <TABLE>. "not headerline
*&SPWIZARD: delete marked lines *
DESCRIBE TABLE <TABLE> LINES <TC>-LINES.
LOOP AT <TABLE> ASSIGNING <WA>.
*&SPWIZARD: access to the component 'FLAG' of the table header *
ASSIGN COMPONENT P_MARK_NAME OF STRUCTURE <WA> TO <MARK_FIELD>.
IF <MARK_FIELD> = 'X'.
W_INDEX = SYST-TABIX.
DELETE <TABLE> INDEX SYST-TABIX.
IF SY-SUBRC = 0.
<TC>-LINES = <TC>-LINES - 1.
ENDIF.
ENDIF.
ENDLOOP.
READ TABLE H_TAB_ITAB INDEX W_INDEX INTO G_TAB_WA.
IF SY-SUBRC EQ 0.
MOVE-CORRESPONDING G_TAB_WA TO YH642_RAM.
DELETE YH642_RAM.
ENDIF.
ENDFORM. " FCODE_DELETE_ROW
*& Form COMPUTE_SCROLLING_IN_TC
text
-->P_TC_NAME name of tablecontrol
-->P_OK ok code
FORM COMPUTE_SCROLLING_IN_TC USING P_TC_NAME
P_OK.
&SPWIZARD: BEGIN OF LOCAL DATA----
DATA L_TC_NEW_TOP_LINE TYPE I.
DATA L_TC_NAME LIKE FELD-NAME.
DATA L_TC_LINES_NAME LIKE FELD-NAME.
DATA L_TC_FIELD_NAME LIKE FELD-NAME.
FIELD-SYMBOLS <TC> TYPE CXTAB_CONTROL.
FIELD-SYMBOLS <LINES> TYPE I.
&SPWIZARD: END OF LOCAL DATA----
ASSIGN (P_TC_NAME) TO <TC>.
*&SPWIZARD: get looplines of TableControl *
CONCATENATE 'G_' P_TC_NAME '_LINES' INTO L_TC_LINES_NAME.
ASSIGN (L_TC_LINES_NAME) TO <LINES>.
*&SPWIZARD: is no line filled? *
IF <TC>-LINES = 0.
*&SPWIZARD: yes, ... *
L_TC_NEW_TOP_LINE = 1.
ELSE.
*&SPWIZARD: no, ... *
CALL FUNCTION 'SCROLLING_IN_TABLE'
EXPORTING
ENTRY_ACT = <TC>-TOP_LINE
ENTRY_FROM = 1
ENTRY_TO = <TC>-LINES
LAST_PAGE_FULL = 'X'
LOOPS = <LINES>
OK_CODE = P_OK
OVERLAPPING = 'X'
IMPORTING
ENTRY_NEW = L_TC_NEW_TOP_LINE
EXCEPTIONS
NO_ENTRY_OR_PAGE_ACT = 01
NO_ENTRY_TO = 02
NO_OK_CODE_OR_PAGE_GO = 03
OTHERS = 0.
ENDIF.
*&SPWIZARD: get actual tc and column *
GET CURSOR FIELD L_TC_FIELD_NAME
AREA L_TC_NAME.
IF SYST-SUBRC = 0.
IF L_TC_NAME = P_TC_NAME.
*&SPWIZARD: et actual column *
SET CURSOR FIELD L_TC_FIELD_NAME LINE 1.
ENDIF.
ENDIF.
*&SPWIZARD: set the new top line *
<TC>-TOP_LINE = L_TC_NEW_TOP_LINE.
ENDFORM. " COMPUTE_SCROLLING_IN_TC
*& Form FCODE_TC_MARK_LINES
marks all TableControl lines
-->P_TC_NAME name of tablecontrol
FORM FCODE_TC_MARK_LINES USING P_TC_NAME
P_TABLE_NAME
P_MARK_NAME.
&SPWIZARD: EGIN OF LOCAL DATA----
DATA L_TABLE_NAME LIKE FELD-NAME.
FIELD-SYMBOLS <TC> TYPE CXTAB_CONTROL.
FIELD-SYMBOLS <TABLE> TYPE STANDARD TABLE.
FIELD-SYMBOLS <WA>.
FIELD-SYMBOLS <MARK_FIELD>.
&SPWIZARD: END OF LOCAL DATA----
ASSIGN (P_TC_NAME) TO <TC>.
*&SPWIZARD: get the table, which belongs to the tc *
CONCATENATE P_TABLE_NAME '[]' INTO L_TABLE_NAME. "table body
ASSIGN (L_TABLE_NAME) TO <TABLE>. "not headerline
*&SPWIZARD: mark all filled lines *
LOOP AT <TABLE> ASSIGNING <WA>.
*&SPWIZARD: access to the component 'FLAG' of the table header *
ASSIGN COMPONENT P_MARK_NAME OF STRUCTURE <WA> TO <MARK_FIELD>.
<MARK_FIELD> = 'X'.
ENDLOOP.
ENDFORM. "fcode_tc_mark_lines
*& Form FCODE_TC_DEMARK_LINES
demarks all TableControl lines
-->P_TC_NAME name of tablecontrol
FORM FCODE_TC_DEMARK_LINES USING P_TC_NAME
P_TABLE_NAME
P_MARK_NAME .
&SPWIZARD: BEGIN OF LOCAL DATA----
DATA L_TABLE_NAME LIKE FELD-NAME.
FIELD-SYMBOLS <TC> TYPE CXTAB_CONTROL.
FIELD-SYMBOLS <TABLE> TYPE STANDARD TABLE.
FIELD-SYMBOLS <WA>.
FIELD-SYMBOLS <MARK_FIELD>.
&SPWIZARD: END OF LOCAL DATA----
ASSIGN (P_TC_NAME) TO <TC>.
*&SPWIZARD: get the table, which belongs to the tc *
CONCATENATE P_TABLE_NAME '[]' INTO L_TABLE_NAME. "table body
ASSIGN (L_TABLE_NAME) TO <TABLE>. "not headerline
*&SPWIZARD: demark all filled lines *
LOOP AT <TABLE> ASSIGNING <WA>.
*&SPWIZARD: access to the component 'FLAG' of the table header *
ASSIGN COMPONENT P_MARK_NAME OF STRUCTURE <WA> TO <MARK_FIELD>.
<MARK_FIELD> = SPACE.
ENDLOOP.
ENDFORM. "fcode_tc_mark_lines
*& Module STATUS_0999 OUTPUT
text
MODULE STATUS_0999 OUTPUT.
SET PF-STATUS 'SS_STD'.
SET TITLEBAR 'TITLE'.
ENDMODULE. " STATUS_0999 OUTPUT
*& Module USER_COMMAND_0999 INPUT
text
MODULE USER_COMMAND_0999 INPUT.
DATA:
H_TAB_WA LIKE G_TAB_WA.
CASE W_UCOMM.
WHEN 'BACK'.
LEAVE PROGRAM.
WHEN 'TAB_MODI' OR 'SAVE'.
LOOP AT G_TAB_ITAB INTO G_TAB_WA.
FORMAT INPUT OFF.
MOVE-CORRESPONDING G_TAB_WA TO YH642_RAM.
READ TABLE H_TAB_ITAB WITH KEY EID = G_TAB_WA-EID INTO H_TAB_WA.
IF SY-SUBRC EQ 0.
IF G_TAB_WA NE H_TAB_WA.
MODIFY YH642_RAM.
ENDIF.
ELSE.
INSERT YH642_RAM.
ENDIF.
ENDLOOP.
SORT G_TAB_ITAB.
ENDCASE.
*CALL SCREEN 700.
ENDMODULE. " USER_COMMAND_0999 INPUT -
Usage of Company code field in the Change Request for Company
Hi,
Would like to know the usage of - Company code field in the UI for Change request for Company.
1. If a new Company is created, can i assign the company code directly in the UI, will the assignment also replicated to backend in this case?
2. In case of new Company creation, is it possible for multiple company code assignments?
3. Is it possible to to pick the existing Company from the F4 list in the CR and assign the company code in the CR? How about the replication work in this case?
Please share your comments, Thank you.Thanks Sanjay.
Just to summarize and a bit more specific, here is my understanding:
1. (a). You have mentioned that we can assign new company code also - does this mean i can select a company code which is not in the F4 list? In such case, how will be the assignment replicated? It should ideally create a company code in the backend before the assignment is processed.
(b). Usually, if a new company code is created in backend, i need to load that in to MDG tables such that it will be active in MDG F4 list, for Company assignments in the Change request.
2. Understood
3. In the Change request, if i pick existing company from F4 values and edit company related data, it will be replicated accordingly.
In the same CR, if i give some value in the company code data, the replication will result in one more assignment added to the company, so as on date, SAP has given the option of only additional assignments to the existing assignments. -
Equipment task list operation view by LSMW
Hi Experts,
We are uploading equipment task list and operation view and characteristic thru LSMW, .
I want to create LSMW for Equipment task list operation view and characteristic view.
Can anybody explain the step by step process involved in this.
STHi,
Execute the transaction LSMW. Create Project, sub project and object which your company following with naming convention
Click F8, in the next screen Under MAINTAIN OBJECT ATTRIBUTES, Choose Radio button Standard Batch/Direct Input
and enter following
This is one method you can do
Or
you can also use RECORDING method
create Recording, system will prompt for Transaction code, enter IE01 and execute
system will lead to IE01 transaction where you have to enter some test data ( dummy data ) for all your operations and characteristic view and save it
This data is save under Recording as default data.
Whatever the fields you have populated should be your source fields and you have to relate them with standard Fields and their lengths from ITOB table
Specific the field either as Excel or Text field
and try to proceed further
please execute the above and let forum know if you held up at any step
regards,
santosh -
Reg:How to delete the column in table control also from database table.
Hi Experts,
Once again thank u all for giving the responses.
one more doubt is how to delete the columns of table control and also the record shold delete from ztable.
With Regards,
Saroja.P.Hi,
If you want to delete the rows in the table control and simultaneously delete it from the database table, then you can implement a 'DELETE' functionality specific to your table control. Have a MARK field (you will find that in the screen attributes of the table control -> give a name for the MARK field, you will find an additional MARK column at the beginning of your table control). You can check whatever rows you want to delete from the table control, call the delete module.
"This portion of code inside the LOOP...ENDLOOP.
IF sy-ucomm eq 'F_DELETE'.
gt_itab2-check = mark. " Store the MARK field status into your internal table's correspoding field 'check'
MODIFY gt_itab INDEX tabcontrol-current_line.
ENDIF.
iF sy-ucomm eq 'DELETE1'.
DELETE gt_itab WHERE check eq 'X'. "Your internal table does not have rows that you want to delete
ENDIF.
Now you can modify your database table using the MODIFY statement.
MODIFY ZDB FROM TABLE gt_itab. -
Deleting the values from table control
HI,
I need to remove the selected line from the Table control on my screen.
The point is that the Internal table does not have any records,.
for example in the Customer Create screen,
while entering the bank details we will enter it in a tbale contraol.
but the records doesnt exist in the database. but the record gets deleted from the table control only if we press delete button.
please guide me.
please note : I want to delete the record from Table Control on the screen and I dont have any corresponding database records..
regardsHi..
The solution to your problem - deleting values from table control.
Here: it_wizard is the internal table which is holding the value of table control.
wa_wizard is the work are of the internal table it_wizard.
it_delete is the internal table which holds the deleted record of table control.
wa_delete is the work area of the internal table it_delete
Also here the field ZSEL is the character field which is used to select the entire record in the table control.
LOOP AT it_wizard into wa_wizard WHERE zsel = 'X'.
MOVE-CORRESPONDING wa_wizard TO wa_delete.
APPEND wa_delete TO it_delete.
delete table it_wizard from wa_wizard.
DELETE FROM zfin_goods WHERE ZFG = WA_delete-ZFG.
ENDLOOP
if sy-subrc eq 0.
Message 'Delete Successful' type 'S'.
endif.
The above code will delete the record from both the table control.internal table and the database table.
I think this will help you to great extent.
Ward regards,
Bhuvaneswari
Edited by: BHUVANESWARI THIRUNAVUKKARASU on Jan 7, 2009 10:39 AM -
How to trigger a 'delete' across different related tables in ABAP?
Hello All,
I am creating database tables for storing different values of features coming under different countries. I have eight tables in my design and there are fields repeating in different tables, which i am connecting through foreign key relationship.
After entering values to all my tables, if i need to delete a particular field value which is repeating in more than two tables, is it possible to trigger a delete event by which if am deleting the field value in a particular table, all the related field values also get deleted from the respective tables?
For example, if i have a PRODUCT field in three tables, and if one of the PRODUCT is deleted from a particular table, can i trigger a delete event by which i can delete all the values related to that particular PRODUCT from all the related tables? The PRODUCT is a primary keyfield, and i have maintained proper foreign key relations also.
I have tried deleting entries using the views and using the database table itself, but only that particular table value is being deleted.
Is there any function module for triggering a delete?
Can anyone help me with some solution?Sample code will be helpful.
Thanks in Advance,
ShinoHi,
My friend it is not advisable to delete any field from a database table bcoz it's creats incosistance data for all the other related tables, but there r few Function Modules that provide u this functionality.
Such As:
G_REPORT_DELETE_ADDFLD_ENTRY
G_CATT_DELETE_TABLE_ENTRY
RKE_DELETE_FIELDS_FROM_TABLE
Regards -
How can i add a drop down list to a fields using BHTML( displaying on its)
Please help me to add a drop down list to a field while displaying on ITS using BHTML or javscript. List should show all the values from value table or search help.
Hi Sandeep,
in ABAP, read the table (keys and values) and write it to the ITS context, e.g. with field names KEY and VALUE.
On the ITS template, write code like this:
`if (KEY.dim > 1);
repeat with i from 1 to KEY.dim;
keys1[ i ] = KEY[ i ];
contents1[ i ] = VALUE[ i ];
if (KEY[ i ] == SELECTED_KEY);
selIndex = i;
end;
end,
SAP_TemplatePulldownField("field1", fieldLabel=#label, name="KEY", key="keys1", content="contents1", selIndex=selIndex);
end`
(I had to add blanks between the brackets to get the code displayed correctly here.)
HTH & best regards,
Carlo
Maybe you are looking for
-
Messages and facetime complain about incorrect ID and password
I have an issue after upgrading to Mountain Lion - Messages and Facetime dont sign in? Is anyone facing this problem and if anyone found a fix for it, please reply back to this post.... Thanks Krish
-
Thin client connection to Unix with RMI
Hi All and thanks for reading this. I am trying to run an application with a swing user interface on the client - a Windows box, and the work engine on the server - a unix box. I am trying to use rmi to communicate between the two. When I stay in the
-
My wife is currently an N97 owner, but since she bought an Android tablet (tethers through N97 Joikuspot) she finds that she doesn't use most of the advanced features of the N97 much. The N97 lock-switch just broke so she's in the market for a new ph
-
I can´t see the content of my emails
My Ipad3 is receiving my emails, but i can't see its content on the right side of the screen. Appears only "From, to and subject" and then a blank page. I have already tried to reinstall my yahoo account but it didn't work. I also tried with my gma
-
Will iMovie 08 work in my old G4 ?
I have iMovie 5.0.2 installed with many problems on uploading/downloading, and thought about upgrading the iLife package for solving it. My question is if I install iLife 08 - will it work properly with the resources available at my G4 ? I use only i