2012 Jul 19 12:05 PM
i wanted to update the class component ie change the data element, and i am able to do it. But now the problem is, if i try to change the 2nd time, it will not get changed as it will not get caught in where used list.
That is, i wanted to rename the DE name, so after see if its used in class i can change but if i try to again change the DE in same class it is not shown in where used list. So how to solve this problem ?
Please suggest.
Regards,
Ankur Sharma.
2012 Jul 19 1:30 PM
TABLES : RSRD1.
* Types declaration.
TYPES : BEGIN OF LT_WHERE,
TABNAME TYPE TABNAME,
FIELDNAME TYPE FIELDNAME,
ROLLNAME TYPE ROLLNAME,
END OF LT_WHERE,
BEGIN OF LT_INPUT,
ELEMENT TYPE RSRD1-DDTYPE_VAL,
END OF LT_INPUT,
BEGIN OF LT_TABLE,
TABNAME TYPE TABNAME,
END OF LT_TABLE.
* Internal tables declaration.
DATA : LT_FOUNDS TYPE TABLE OF RSFINDLST,
LT_WHERE TYPE TABLE OF LT_WHERE,
LT_INPUT TYPE TABLE OF LT_INPUT,
LT_STR TYPE TABLE OF RSFINDLST,
LT_TAB TYPE TABLE OF RSFINDLST.
* Work areas declaration.
DATA : LS_WHERE TYPE LT_WHERE,
LS_STR TYPE RSFINDLST,
LS_FOUNDS TYPE RSFINDLST,
LS_INPUT TYPE LT_INPUT,
LS_TAB TYPE RSFINDLST.
* Selection screen.
SELECTION-SCREEN BEGIN OF BLOCK B WITH FRAME .
PARAMETERS: OLD_NAME TYPE STRING. " Enter old DE name which is to be changed.
PARAMETERS: NEW_NAME TYPE STRING. " Enter new active DE name.
SELECTION-SCREEN END OF BLOCK B.
* Where used functionality.
PERFORM GET_TABLENAMES.
*&---------------------------------------------------------------------
*& Form GET_TABLENAMES
*&---------------------------------------------------------------------
FORM GET_TABLENAMES.
* Consolidating selection inputs into an internal table.
LS_INPUT-ELEMENT = OLD_NAME.
APPEND LS_INPUT TO LT_INPUT.
* Getting the programs having the input data elements.
CALL FUNCTION 'RS_EU_CROSSREF'
EXPORTING
I_FIND_OBJ_CLS = 'DTEL'
NO_DIALOG = 'X'
TABLES
I_FINDSTRINGS = LT_INPUT
O_FOUNDS = LT_FOUNDS
EXCEPTIONS
NOT_EXECUTED = 1
NOT_FOUND = 2
ILLEGAL_OBJECT = 3
NO_CROSS_FOR_THIS_OBJECT = 4
BATCH = 5
BATCHJOB_ERROR = 6
WRONG_TYPE = 7
OBJECT_NOT_EXIST = 8
OTHERS = 9.
IF SY-SUBRC <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
SORT LT_FOUNDS BY ENCL_OBJEC USED_OBJ.
DELETE ADJACENT DUPLICATES FROM LT_FOUNDS COMPARING ENCL_OBJEC USED_OBJ.
LOOP AT LT_FOUNDS INTO LS_FOUNDS.
CASE LS_FOUNDS-OBJECT_CLS.
WHEN 'DSF'.
* PERFORM AT_STRUCTURE.
WHEN 'DTF'.
* PERFORM AT_TABLE.
WHEN 'P'.
* PERFORM at_prog.
WHEN 'OM'.
PERFORM at_clif.
* WHEN OTHERS.
* ls_str = ls_founds.
* APPEND ls_str to lt_str.
** WRITE: ls_str.
* PERFORM at_structure.
* ls_tab = ls_founds.
* APPEND ls_tab to lt_tab.
** WRITE: ls_tab.
* PERFORM at_table.
ENDCASE.
ENDLOOP.
ENDFORM. " GET_TABLENAMES
FORM at_clif.
DATA: lt_attrib type TABLE OF VSEOATTRIB,
ls_attrib TYPE VSEOATTRIB.
SELECT * FROM VSEOATTRIB into TABLE lt_attrib WHERE type = OLD_NAME.
IF sy-subrc = 0.
LOOP AT lt_attrib INTO ls_attrib.
ls_attrib-type = NEW_NAME.
* MODIFY lt_attrib FROM ls_attrib.
CALL FUNCTION 'SEO_ATTRIBUTE_CHANGE_F_DATA'
EXPORTING
SAVE = ' ' "SEOX_TRUE
* NO_TYPE_SOURCE_CHANGES = SEOX_FALSE
CHANGING
ATTRIBUTE = ls_attrib
EXCEPTIONS
NOT_EXISTING = 1
DELETED = 2
IS_METHOD = 3
IS_EVENT = 4
IS_TYPE = 5
NOT_CHANGED = 6
DB_ERROR = 7
OTHERS = 8
.
IF SY-SUBRC <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
else.
WRITE: 'TEST'.
ENDIF.
ENDLOOP.
ENDIF.
DATA: lt_param TYPE TABLE OF VSEOPARAM,
ls_param TYPE VSEOPARAM.
SELECT * FROM VSEOPARAM INTO TABLE lt_param WHERE type = OLD_NAME.
IF sy-SUBRC = 0.
LOOP AT lt_param INTO ls_param.
ls_param-type = NEW_NAME.
CALL FUNCTION 'SEO_PARAMETER_CHANGE_F_DATA'
* EXPORTING
* SAVE = SEOX_TRUE
CHANGING
PARAMETER = ls_param
EXCEPTIONS
NOT_EXISTING = 1
DELETED = 2
IS_EXCEPTION = 3
NOT_CHANGED = 4
DB_ERROR = 5
COMPONENT_NOT_EXISTING = 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.
ELSE. WRITE: 'TEST2'.
ENDIF.
ENDLOOP.
ENDIF.
ENDform.
this is the code, it will update the data element once, but run it 2dn time, you will not be able to find it.
PLEASE SUGGEST.
2012 Jul 19 1:30 PM
TABLES : RSRD1.
* Types declaration.
TYPES : BEGIN OF LT_WHERE,
TABNAME TYPE TABNAME,
FIELDNAME TYPE FIELDNAME,
ROLLNAME TYPE ROLLNAME,
END OF LT_WHERE,
BEGIN OF LT_INPUT,
ELEMENT TYPE RSRD1-DDTYPE_VAL,
END OF LT_INPUT,
BEGIN OF LT_TABLE,
TABNAME TYPE TABNAME,
END OF LT_TABLE.
* Internal tables declaration.
DATA : LT_FOUNDS TYPE TABLE OF RSFINDLST,
LT_WHERE TYPE TABLE OF LT_WHERE,
LT_INPUT TYPE TABLE OF LT_INPUT,
LT_STR TYPE TABLE OF RSFINDLST,
LT_TAB TYPE TABLE OF RSFINDLST.
* Work areas declaration.
DATA : LS_WHERE TYPE LT_WHERE,
LS_STR TYPE RSFINDLST,
LS_FOUNDS TYPE RSFINDLST,
LS_INPUT TYPE LT_INPUT,
LS_TAB TYPE RSFINDLST.
* Selection screen.
SELECTION-SCREEN BEGIN OF BLOCK B WITH FRAME .
PARAMETERS: OLD_NAME TYPE STRING. " Enter old DE name which is to be changed.
PARAMETERS: NEW_NAME TYPE STRING. " Enter new active DE name.
SELECTION-SCREEN END OF BLOCK B.
* Where used functionality.
PERFORM GET_TABLENAMES.
*&---------------------------------------------------------------------
*& Form GET_TABLENAMES
*&---------------------------------------------------------------------
FORM GET_TABLENAMES.
* Consolidating selection inputs into an internal table.
LS_INPUT-ELEMENT = OLD_NAME.
APPEND LS_INPUT TO LT_INPUT.
* Getting the programs having the input data elements.
CALL FUNCTION 'RS_EU_CROSSREF'
EXPORTING
I_FIND_OBJ_CLS = 'DTEL'
NO_DIALOG = 'X'
TABLES
I_FINDSTRINGS = LT_INPUT
O_FOUNDS = LT_FOUNDS
EXCEPTIONS
NOT_EXECUTED = 1
NOT_FOUND = 2
ILLEGAL_OBJECT = 3
NO_CROSS_FOR_THIS_OBJECT = 4
BATCH = 5
BATCHJOB_ERROR = 6
WRONG_TYPE = 7
OBJECT_NOT_EXIST = 8
OTHERS = 9.
IF SY-SUBRC <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
SORT LT_FOUNDS BY ENCL_OBJEC USED_OBJ.
DELETE ADJACENT DUPLICATES FROM LT_FOUNDS COMPARING ENCL_OBJEC USED_OBJ.
LOOP AT LT_FOUNDS INTO LS_FOUNDS.
CASE LS_FOUNDS-OBJECT_CLS.
WHEN 'DSF'.
* PERFORM AT_STRUCTURE.
WHEN 'DTF'.
* PERFORM AT_TABLE.
WHEN 'P'.
* PERFORM at_prog.
WHEN 'OM'.
PERFORM at_clif.
* WHEN OTHERS.
* ls_str = ls_founds.
* APPEND ls_str to lt_str.
** WRITE: ls_str.
* PERFORM at_structure.
* ls_tab = ls_founds.
* APPEND ls_tab to lt_tab.
** WRITE: ls_tab.
* PERFORM at_table.
ENDCASE.
ENDLOOP.
ENDFORM. " GET_TABLENAMES
FORM at_clif.
DATA: lt_attrib type TABLE OF VSEOATTRIB,
ls_attrib TYPE VSEOATTRIB.
SELECT * FROM VSEOATTRIB into TABLE lt_attrib WHERE type = OLD_NAME.
IF sy-subrc = 0.
LOOP AT lt_attrib INTO ls_attrib.
ls_attrib-type = NEW_NAME.
* MODIFY lt_attrib FROM ls_attrib.
CALL FUNCTION 'SEO_ATTRIBUTE_CHANGE_F_DATA'
EXPORTING
SAVE = ' ' "SEOX_TRUE
* NO_TYPE_SOURCE_CHANGES = SEOX_FALSE
CHANGING
ATTRIBUTE = ls_attrib
EXCEPTIONS
NOT_EXISTING = 1
DELETED = 2
IS_METHOD = 3
IS_EVENT = 4
IS_TYPE = 5
NOT_CHANGED = 6
DB_ERROR = 7
OTHERS = 8
.
IF SY-SUBRC <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
else.
WRITE: 'TEST'.
ENDIF.
ENDLOOP.
ENDIF.
DATA: lt_param TYPE TABLE OF VSEOPARAM,
ls_param TYPE VSEOPARAM.
SELECT * FROM VSEOPARAM INTO TABLE lt_param WHERE type = OLD_NAME.
IF sy-SUBRC = 0.
LOOP AT lt_param INTO ls_param.
ls_param-type = NEW_NAME.
CALL FUNCTION 'SEO_PARAMETER_CHANGE_F_DATA'
* EXPORTING
* SAVE = SEOX_TRUE
CHANGING
PARAMETER = ls_param
EXCEPTIONS
NOT_EXISTING = 1
DELETED = 2
IS_EXCEPTION = 3
NOT_CHANGED = 4
DB_ERROR = 5
COMPONENT_NOT_EXISTING = 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.
ELSE. WRITE: 'TEST2'.
ENDIF.
ENDLOOP.
ENDIF.
ENDform.
this is the code, it will update the data element once, but run it 2dn time, you will not be able to find it.
PLEASE SUGGEST.
2012 Jul 19 3:14 PM
Hi,
Well, not really used to those functions, but it looks like your changes are first updated in some buffer and commited when you leave and restart your program? So, maybe a COMMIT could be usefull? Or maybe the function SEO_CLIF_SAVE_ALL can do the commitment for you?
Just suggesting thought, never used those FMs...
Cheers,
Manu.
2012 Jul 20 5:47 AM