0% found this document useful (0 votes)
312 views

How Implement The WHERE-USED LIST Functionality in Program

Como implementar a funcionalidade WHERE USED em programa Z.

Uploaded by

Thiago Stefanini
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
312 views

How Implement The WHERE-USED LIST Functionality in Program

Como implementar a funcionalidade WHERE USED em programa Z.

Uploaded by

Thiago Stefanini
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 13

09/04/2019 how implement the WHERE-USED LIST functionality in program ???

(http://w
ww.sap.c
Products
om/) (https://www.sap.com/products.html)

Industries (https://www.sap.com/industries.html)

upport
Services and Support (https://www.sap.com/support.html)

Training (https://www.sap.com/training-certi cation.html)

Community (https://www.sap.com/community.html)

Developer (https://developers.sap.com/index.html)

Partner (https://www.sap.com/partner.html)

About (https://www.sap.com/corporate/en.html)

 
Ask a Question (https://answers.sap.com/questions/ask.html) Write a Blog Post (https://blogs.sap.com/wp-admin/post-new.p

Archived discussions are read-only. Learn more about SAP Q&A


(https://go.sap.com/community/about/questions-and-answers.html)

how implement the WHERE-USED


LIST functionality in program ???
This question is answered

Hello Experts,

https://archive.sap.com/discussions/message/13380273#13380273 1/13
09/04/2019 how implement the WHERE-USED LIST functionality in program ???

I am trying to implement the WHERE-USED LIST's functionality in my program, i got few FMs also while
debugging the where-used list. But i want that if i enter say name of data element then program checks in
database where this data element is used. And i want this without any screen or pop-up like its
happening in background.

Please give me suggestion, i need to implement this in program.

Thanks and Regards,

Ankur Sharma

Tags: where_used_list, data_element

Former Member
July 10, 2012 at 07:32 AM
2 Likes

Correct Answer

(https://people.sap.com/sharath.yaralkattimath)

Sharath Yaralkattimath (https://people.sap.com/sharath.yaralkattimath) replied July 09, 2012 at 07:46 AM

Hi Ankur,

I have written a program which may serve your purpose, You can implement the code from that.

Please find the attached code for your reference.

Regards,

Sharath

1
View this answer in context (/discussions/message/13380273#13380273)

Helpful Answer by
Kesavadas Thekkillath (/discussions/message/13381071#13381071) , Kesavadas Thekkillath
(/discussions/message/13381292#13381292)

ng for? View more on this topic (https://go.sap.com/community/tag.html?


61924709785639136) or

//answers.sap.com/questions/ask.html?primaryTagId=833755570260738661924709785639136)

https://archive.sap.com/discussions/message/13380273#13380273 2/13
09/04/2019 how implement the WHERE-USED LIST functionality in program ???

19 replies

(https://people.sap.com/kumar.saurav)

Kumar Saurav (https://people.sap.com/kumar.saurav)replied July 06, 2012 at 15:45 PM

Hi Ankur,

You may check FM RS_EU_CROSSREF and go through the Documentation for that
same as it contains one example.

Hope this may be helpful.

Thanks.

Kumar Saurav.

(https://people.sap.com/subrahmanyashyamkumar.pindiproli)

Subrahmanya (Shyam) Pindiproli


(https://people.sap.com/subrahmanyashyamkumar.pindiproli)replied

July 06, 2012 at 15:49 PM

Check out this function module ..

Copy Code

1. CALL FUNCTION 'RS_TOOL_ACCESS'.


2. EXPORTING
3. OPERATION = 'CROSSREF'
4. OBJECT_NAME = prog_name
5. OBJECT_TYPE = 'INCL'

Regards,

Shyam

Former Member replied July 09, 2012 at 07:21 AM

https://archive.sap.com/discussions/message/13380273#13380273 3/13
09/04/2019 how implement the WHERE-USED LIST functionality in program ???

Thanks Kumar Saurav and @Subrahmanya Pindiproli


(https://people.sap.com/subrahmanyashyamkumar.pindiproli) for the reply and suggestions.

I know these FMs and am trying to find solution with it, but the problem is that pop up
screen are coming asking what to find or where to find. I do not want any screens or
pop-ups.

Please suggest me something.

Correct Answer

(https://people.sap.com/sharath.yaralkattimath)

Sharath Yaralkattimath (https://people.sap.com/sharath.yaralkattimath)replied

July 09, 2012 at 07:46 AM


Hi Ankur,

I have written a program which may serve your purpose, You


can implement the code from that.

Please find the attached code for your reference.

Regards,

Sharath

ZWHEREUSEDLIST.txt.zip (/attachment/46724)(1456 B)

(https://people.sap.com/kesavadas.thekkillath)

Kesavadas Thekkillath (https://people.sap.com/kesavadas.thekkillath)replied

July 09, 2012 at 07:49 AM

Refer program RSHDCF00 and also go through this wiki post SAP
Community Network Wiki - ABAP Development - ABAP program to
read where-used lists
(http://wiki.sdn.sap.com/wiki/display/ABAP/ABAP+program+to+read+
where-used+lists)

https://archive.sap.com/discussions/message/13380273#13380273 4/13
09/04/2019 how implement the WHERE-USED LIST functionality in program ???

If you are using RS_EU_CROSSREF, pass option no_dialog = X for no


popup's.

Former Member replied July 09, 2012 at 07:50 AM

Thanks @Kesavadas Thekkillath (https://people.sap.com/kesavadas.thekkillath) for reply. but


even this program is using 'RS_EU_CROSSREF' which is being used to find domain.
And still pop up is coming.

Any suggestions???

(https://people.sap.com/kesavadas.thekkillath)

Kesavadas Thekkillath (https://people.sap.com/kesavadas.thekkillath)replied

July 09, 2012 at 08:09 AM

Pass parameter no_dialog = X

Former Member replied July 09, 2012 at 10:38 AM

Thanks Kesavadas and Sharath, i got the info of where the data element is being use,
can you help me in one more thing?

how to rename the data element in the programs found in It ?

according to me: while looping at IT to WA i can use FM to scan the prog and apply
fuzzy logic to change the name in prog.

Any suggestions on that?

Please help me.

https://archive.sap.com/discussions/message/13380273#13380273 5/13
09/04/2019 how implement the WHERE-USED LIST functionality in program ???

(https://people.sap.com/kesavadas.thekkillath)

Kesavadas Thekkillath (https://people.sap.com/kesavadas.thekkillath)replied

July 09, 2012 at 11:26 AM

You can read the f1 help on "Replace in table". But after this you
have to save & activate the changed program programatically. It

goes on

Former Member replied July 09, 2012 at 11:38 AM

@Kesavadas Thekkillath (https://people.sap.com/kesavadas.thekkillath), I found two FM, but not


getting how to use it as per my need.

I am sharing with you, see if you can give nay idea.

FMs : FM RS_FIND_REPLACE_GLOBAL and RS_EDTR_SEARCH.

 Helpful Answer

(https://people.sap.com/kesavadas.thekkillath)

Kesavadas Thekkillath (https://people.sap.com/kesavadas.thekkillath)replied

July 09, 2012 at 11:47 AM

Hope this helps

CALL FUNCTION 'RS_FIND_REPLACE_GLOBAL'

EXPORTING

objecttype = Pass R/M/O/U/E/Y/T/F/G

findstring = Search string ... for ex data element name

findstring_length = Length of DE name

exact_spelling = 'X'
https://archive.sap.com/discussions/message/13380273#13380273 6/13
09/04/2019 how implement the WHERE-USED LIST functionality in program ???

replacestring = SPACE "Text to be replaced newly

i_find_or_replace = 'FIND'" Check what has to be passed for


REPLACE from the FM code

IMPORTING

actual_incl_modified = " s38e-buf_varied

actual_changed_min = " sy-tabix

actual_changed_max = " sy-tabix

TABLES

objecttab = pass the object names to be scanned

EXCEPTIONS

NOT_FOUND = 2

Please search for the where used list of the FM.

Former Member replied July 09, 2012 at 11:59 AM

i am trying to test run this FM from past half an hour but all time i get is 'No occurences
found'.

pls suggest.

 Helpful Answer

(https://people.sap.com/kesavadas.thekkillath)

Kesavadas Thekkillath (https://people.sap.com/kesavadas.thekkillath)replied

July 09, 2012 at 12:43 PM

Here it is... I am replacing the word MATNR with EBELN in


program YREPLACE. It displays a popup in which you have hit
the button to replace everything. You can refer the program
RSAGLSYM for help.

Copy Code

https://archive.sap.com/discussions/message/13380273#13380273 7/13
09/04/2019 how implement the WHERE-USED LIST functionality in program ???

1. data: OBJECT_TYPE(3) type c,


2. KFIND(79) type c,
3. FINDSTRINGLEN type SY-FDPOS,
4. REPLACESTRINGLEN type SY-FDPOS,
5. KREPLACE type RSEUR-TDREPLACE.
6. types: BEGIN OF ty,
7. MARK(1) type c,
8. PROGRAM type SY-REPID,
9. NAME(61) type c,
10. DYNNR(4) type c,
11. PROGTYPE(1) type c,
12. OBJ_STATE(1) type c,
13. END OF ty.
14. data:it type table of ty,
15. wa type ty.
16.
17.
18. wa-MARK = wa-PROGTYPE = 'X'.
19. wa-PROGRAM = 'YREPLACE'.
20. append wa to it.
21.
22. OBJECT_TYPE = 'R'.
23. kfind = 'MATNR'.
24. FINDSTRINGLEN = '5'.
25. KREPLACE = 'EBELN'.
26. REPLACESTRINGLEN = '5'.
27.
28. LOOP AT it into wa.
29. CALL FUNCTION 'RS_ACCESS_PERMISSION'
30. EXPORTING
31. MODE = 'FREE'
32. OBJECT = wa-PROGRAM
33. OBJECT_CLASS = 'ABAP'.
34. ENDLOOP.
35.
36. CALL FUNCTION 'RS_FIND_REPLACE_GLOBAL'
37. EXPORTING
38. OBJECTTYPE = OBJECT_TYPE
39. FINDSTRING = KFIND
40. FINDSTRING_LENGTH = FINDSTRINGLEN
41. METHOD = 'STRING'
42. EXACT_SPELLING = 'X'
43. REPLACESTRING = KREPLACE
44. REPLACESTRING_LENGTH = REPLACESTRINGLEN
45. I_FIND_OR_REPLACE = 'REPLACE'
46. MONITOR_ACTIVATION = 'X'
47. TABLES

https://archive.sap.com/discussions/message/13380273#13380273 8/13
09/04/2019 how implement the WHERE-USED LIST functionality in program ???

48. OBJECTTAB = it
49. EXCEPTIONS
50. NOT_FOUND = 01
51. NOT_EXECUTED = 04.
52.

Former Member replied July 09, 2012 at 13:39 PM

@Kesavadas Thekkillath, (https://people.sap.com/kesavadas.thekkillath) This FM is not finding the


name of data element which i have defined min my program.

My objective is to find the name of data element in program and replace it with new name.

SO what should i do now, pls suggest.

(https://people.sap.com/kesavadas.thekkillath)

Kesavadas Thekkillath (https://people.sap.com/kesavadas.thekkillath)replied

July 09, 2012 at 13:51 PM

I tested my program and is working fine. What type of program


are you using report, module pool etc. ?

Instead of checking it from SE37, try writing two sample


programs and check it once. Might be the problem of case
sensitivity.

Did you try executing my code ? In the second program


YREPLACE just put some declarations related to MATNR.

Please note that the program to be changed must be is disabled


mode and not in editable mode.

https://archive.sap.com/discussions/message/13380273#13380273 9/13
09/04/2019 how implement the WHERE-USED LIST functionality in program ???

Former Member replied July 10, 2012 at 06:23 AM

@Kesavadas Thekkillath, Thanks (https://people.sap.com/kesavadas.thekkillath)for help .

This is what i did. I just changed the program name and data element name.

DATA: OBJECT_TYPE(3) TYPE C,

KFIND(79) TYPE C,

FINDSTRINGLEN TYPE SY-FDPOS,

REPLACESTRINGLEN TYPE SY-FDPOS,

KREPLACE TYPE RSEUR-TDREPLACE.

TYPES: BEGIN OF TY,

MARK(1) TYPE C,

PROGRAM TYPE SY-REPID,

NAME(61) TYPE C,

DYNNR(4) TYPE C,

PROGTYPE(1) TYPE C,

OBJ_STATE(1) TYPE C,

END OF TY.

DATA:IT TYPE TABLE OF TY,

WA TYPE TY.

WA-MARK = WA-PROGTYPE = 'X'.

WA-PROGRAM = 'Y_WARERR22'.

APPEND WA TO IT.

OBJECT_TYPE = 'R'.

KFIND = 'ULINE'.

FINDSTRINGLEN = '6'.

KREPLACE = 'ABC'.

REPLACESTRINGLEN = '3'.

LOOP AT IT INTO WA.

CALL FUNCTION 'RS_ACCESS_PERMISSION'

EXPORTING

MODE = 'FREE'

OBJECT = WA-PROGRAM

https://archive.sap.com/discussions/message/13380273#13380273 10/13
09/04/2019 how implement the WHERE-USED LIST functionality in program ???

OBJECT_CLASS = 'ABAP'.

ENDLOOP.

CALL FUNCTION 'RS_FIND_REPLACE_GLOBAL'

EXPORTING

OBJECTTYPE = OBJECT_TYPE

FINDSTRING = KFIND

FINDSTRING_LENGTH = FINDSTRINGLEN

METHOD = 'STRING'

EXACT_SPELLING = 'X'

REPLACESTRING = KREPLACE

REPLACESTRING_LENGTH = REPLACESTRINGLEN

I_FIND_OR_REPLACE = 'REPLACE'

MONITOR_ACTIVATION = 'X'

TABLES

OBJECTTAB = IT

EXCEPTIONS

NOT_FOUND = 01

NOT_EXECUTED = 04.

IF SY-SUBRC EQ 0.

WRITE:'SUCCESS.'.

ENDIF.

(https://people.sap.com/kesavadas.thekkillath)

Kesavadas Thekkillath (https://people.sap.com/kesavadas.thekkillath)replied

July 10, 2012 at 06:43 AM


Pass FINDSTRINGLEN = '5'.

https://archive.sap.com/discussions/message/13380273#13380273 11/13
09/04/2019 how implement the WHERE-USED LIST functionality in program ???

Former Member replied July 10, 2012 at 07:28 AM

Hi Kesavadas, the problem was i was giving the program which is in some other
package. It searches in same package only.

But anyway, for now its ok for me.

Thanks All If i get problem in this i will ask in NEW POST.

Former Member replied July 10, 2012 at 07:32 AM

Special Thanks to Kesavadas for replying me quickly everytime.

https://archive.sap.com/discussions/message/13380273#13380273 12/13
09/04/2019 how implement the WHERE-USED LIST functionality in program ???

Share & Follow

(https://www.facebook.com/sapcommunity) (https://twitter.com/SAPCommunity)

(https://www.youtube.com/c/SAPCommunities) (https://www.linkedin.com/company/sap)

(http://www.slideshare.net/SAP) (https://instagram.com/sap/) ()

Privacy (http://sap.com/about/legal/privacy.html) Terms of Use (http://sap.com/corporate/en/legal/terms-of-

use.html)

Legal Disclosure (http://sap.com/about/legal/impressum.html) Copyright (http://sap.com/about/legal/copyright.html)

Trademark (http://sap.com/about/legal/trademark.html) Preferências de cookies

Sitemap (http://www.sap.com/sitemap/index.html) Newsletter (https://sap.com/registration/newsletter.html)

https://archive.sap.com/discussions/message/13380273#13380273 13/13

You might also like