2019 May 21 2:12 PM
Hi Team,
I want to make use of this FM to modify the custom program in certain cases. For e.g. - if there is a statement "Break-point" then need to comment that and get this change in the Transport request.
Have anyone used this FM for this requirement?changing custom program through custom program (programatically)
Can anyone please send me sample code if its available as this is urgent
thanks
Madhuri
2019 May 21 3:02 PM
I've updated the tag of your question to "ABAP Development" as this would be more accurate. You might check how abapGit does export and import programs, classes and function groups.
2019 May 21 3:58 PM
You could configure Code Inspector to prevent BREAK-POINT keyword, and configure the transport to check Code Inspector at release time.
If you want to change a source code, use the ABAP statement INSERT REPORT ("for internal use only").
2019 May 21 4:02 PM
Programmatically changing programs in the background in this way is a bad idea. Far better to highlight it as an error and make the programmer change it.
2019 May 22 2:06 AM
That function module purpose is:
General interface for all tools of the Abap Development Workbench
so, if you send operations 'EDIT', it will call SE38 to show your program in edit mode only.
Suggestion: instead of develop a new program to edit others program, you can use SCI, which is standard transaction, to scan them and do the manual work, it easier and quicker.
If you still want to do it with your own program, using READ REPORT to load program source code, change it and use GENERATE SUBROUTINE POOL, INSERT REPORT...read more in F1 help
2019 May 22 8:00 AM
Hi thanks all for the reply.
Hi Quynh Doan Manh,My purpose basically is during s4 hana migration. ( if not wrong during brownfield implementation)to auto change the previous program to make it compatible with S4 HANA.For eg. if somewhere, matnr has been declared as char18 then change it to declare as with data element matnr to match up with the char40 declartion. like that.so my approach is, first scan the custom program, fill up some table with the "wrong" or "incompatible" tags and the line number and through this FM, go to that line and change that line. or comment the line and copy the "compatible" line and get all this in one TR.I will try your approach and get back 🙂2019 May 22 8:05 AM