05-17-2005 2:24 PM
Hello. I need a way to insert an include module into every "Z" report we have. Does anyone know of a way to do this?
Thanks,
Jim
05-17-2005 2:34 PM
Hi Jim,
It is possible. But the approach I'm suggesting is to be used with extreme caution.
The algorithm would something like this -
1. Select * from D010SINF where program name like 'Z*' and program type ne 'I' (excluding Include programs) into an internal table (say ITAB_REPORTS).
2.
LOOP AT ITAB_REPORTS.
READ REPORT ITAB_REPORTS INTO ITAB_SOURCE_CODE.
* itab_source_code will now contain the code of the program.
* Insert you include statement into this internal table.
* May be at the second line or the third line or whatever
* you think is appropriate.
INSERT REPORT ITAB_REPORTS from ITAB_SOURCE_CODE.
ENDLOOP.
This is just the idea. you can develop on this. You may also want to do a syntax check etc., programmatically. Get back if you face any specific problems.
regards,
anand mandalika.
05-17-2005 2:34 PM
Hi Jim,
It is possible. But the approach I'm suggesting is to be used with extreme caution.
The algorithm would something like this -
1. Select * from D010SINF where program name like 'Z*' and program type ne 'I' (excluding Include programs) into an internal table (say ITAB_REPORTS).
2.
LOOP AT ITAB_REPORTS.
READ REPORT ITAB_REPORTS INTO ITAB_SOURCE_CODE.
* itab_source_code will now contain the code of the program.
* Insert you include statement into this internal table.
* May be at the second line or the third line or whatever
* you think is appropriate.
INSERT REPORT ITAB_REPORTS from ITAB_SOURCE_CODE.
ENDLOOP.
This is just the idea. you can develop on this. You may also want to do a syntax check etc., programmatically. Get back if you face any specific problems.
regards,
anand mandalika.
05-17-2005 2:45 PM
Hi Jim,
you can do this with a batch input program:
-> transaction recorder (TA SHDB) for transaction SE38:
- insert a line at line nr. 2 with abap-command
include "ZI123".
- generate program and assign all programs to 1
workbench request.
so you play it safe and you've an error log,
if changes failed.
regards Andreas
05-17-2005 4:42 PM
Anand pointed out the way to make the mass change and he is correct in pointing out that you need to be extremely cautious. Here are certain things you need to keep in mind before you embark on that effort.
1. Keep selection criteria in such a way that you include only your Z objects not SAP delivered ones. One way to achieve that would be by specifying the <b>development classes</b> you are interested in. Another criteria could be program type(only executables if you are interested in only report programs).
2. Make sure that you don't actually update the report until you find out the list that you got is absolutely accurate.
3. <b> Above all, I am not sure how you are going to take care of versioning and transporting these changes.</b> If you change the program through normal SE38, SAP keeps track of the versions and also requires you to create a transport request(for transportable development classes of course), to be able to transport the changes to test and production environments. But if you do this mass change, how are you planning on keeping this intact? This will be particularly an issue, if you have tighter audit controls and change management controls.
Srinivas