0% found this document useful (0 votes)
378 views5 pages

Step by Step To Generate ABAP Code Automaticall..

Step by Step to Generate ABAP Code Automatically

Uploaded by

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

Step by Step To Generate ABAP Code Automaticall..

Step by Step to Generate ABAP Code Automatically

Uploaded by

abhilash
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF or read online on Scribd
You are on page 1/ 5
erano1s ‘Step by Stop to gverate ABAP code stomatcall.| SCN Products Senoes & Support ‘rout son Downloads Inausties ‘ang 4 Evcaton Parmessnip beveoper Centr Aatwty —Commniesons Actos nes of Business Univers aances vena Webinar Innovaton rows Step by Step to generate ABAP code automatically using Code Composer [Ee] & lone) (toon) ume G Today | am going through the SAP help for BRFplus stuff and come across with ‘some introduction about ABAP code composer. | would like to share with you a very simple example to demonstrate its logic. Example: Implementation of Code Generation sirae How to find the above help document in a quick way? Just google with key word “ABAP CODE COMPOSER” and click the first ht. bipisen sp.com/commurtylabepblo! 2015091 istp-by-stp-to-gnerale-abap-code-avlomalicaly-wsing-code-composer 46 erano1s ‘Step by Stop to gverate ABAP code stomatcall.| SCN Cooke +o Inclucing resus for SAP CODE COMPOSER Seacheny fr ABAP CODE COMPOSER Compo th BE spe A wh las wing CL_CMP_COMPOSER SAP INTERNAL USAGE: Code. ‘friend uveapeseonsos eo ong_eompocer im = CoH OK TEMPLATES A AAP Rape ‘And here below are steps how to generate ABAP codes which contains a singleton pattern using ABAP code composer. 1. Create a new program with type "INCLUDE" ‘And paste the following source code to include and activate it: 2, | + GLASSS1_PARANTclass$ DEFINTION fs. | CLASS PaRAM-Iosc3 DEFRITION or PARAM-GLOBAL ginstoel @. | gens 48. | \FINAL CREATE PRIVATE, 8) | ‘Pusu section, 2. | “SLpARAMnatacas ae | classiMeTso0s se) RET RUNG "7 Value f_sance) TYPE REF TOSI PARAMnnoceS 38. | @iparaitencepton anatnital RANG SLPARAW-xceptont ona CLASS.DATA 'art_enghton TYPE REF TOSL PARAMnrna6, TASS METHODS: hipsen sap.com/commurtylabopblog/2018081 ist by-stop-to-gonerate-abap-code-automalically-using-code-compaser erano1s ‘Step by Stop to gverate ABAP code stomatcall.| SCN 2», Value’ ft sacs) TYPE REF TOSI PARAM assé 2 SLPARAMexcoptont 33. | one Ss. | eNootass, "SI PARAM iss $ DEFINITION NETHOO 5 creases, elias) TYPE REF TOSL PARANCISS6 + “SL PARAMesceptons 2. | qulctotjectconsiucion 2. | * Constuton ote abject which can eas a SL PARAWLsxcepbons. > | “ENDMETHoo teroie_stance TOSLPARAMnnaceS 7. | + “SLPARAM exceptions fo. | areranghon =a. coat_ inant) at, |e tetintance rot snleton, te. | enpeuass, *3| PARA lee8 MPLEMENTATION The string wrapped with a pair of @, for example, the string "$|_PARAM-classS' acts as a importing parameter of code composer, which means during the code generation, you must tell code composer what is the actual class name in generated code, by passing the actual name to this parameter. This activated include will act as a code generation template. We now have the following importing parameter: + SL panantass + SIPARANE slots + SLPARAMnteaces + SI PARanoxcopions 2, create another driver program which will call code composer API to generate the code with the help of the template include created in step1. The complete source code of this program could be found from attachment, hipsen sap.com/commurtylabopblog/2018081 ist by-stop-to-gonerate-abap-code-automalically-using-code-compaser ‘Step by Stop to gverate ABAP code stomatcall.| SCN seve oF euecrot 11st hard coo the classname, interface name and “ncoptian name woud like ta have inthe genaretad coda 2. And than | just tll Coda composer my couse’). gatings by calling ade var method, © STEER) ot cape ERETESEY eat ett - ssc 3 earch rok to Ix ron | The generated source code Ie stored in BSE ines. if ae | just use the cl_demo_output=>display_data( t_tab_code ) to simply print out the source code, In the output we see all of the placeholder ( $XXXX$ ) in the template have been replaced with the hard coded value we specify in the driver program. stance pation: SINGLETON as EREbereeron ma one pave PUBUC SECTION TPRWATE SECTON. CLASS DATA singleton TPE REF TOPPER} cLASS.METODS: stat Although the google result shows the code composer API is marked as for SAP internal use only and thus could not be used in application code, however | think we can still leverage it to design some tool which can improve our daily work efficiency. Including results for SAP CODE COMPOSER ‘Search only for ABAP CODE COMPOSER Example: Implementation of Code Generation - SAP Help nelp-sap.comverp2005_enp_Osineipdatalen4../eontent nim ~ "You generate the code forthe Create Business Parner Contact expression using Code Composer ith BRFplu- specie APIS, hich faeitates working wth CL_CMP_COMPOSER SAP INTERNAL USAGE: Code vwvisea0 3 uusapelssescel gl emp composennin = Sh? cL_CuP-COMECSER deal {RPTTERREERSREE ode Comper bipisen sp.com/commurtylabepblo! 2015091 istp-by-stp-to-gnerale-abap-code-avlomalicaly-wsing-code-composer erano1s ‘Step by Stop to gverate ABAP code stomatcall.| SCN tiver_seurea_cae lt zn(S78 bys) [Exe] © [on weet a 0. Comments hipsen sap.com/commurtylabopblog/2018081 ist by-stop-to-gonerate-abap-code-automalically-using-code-compaser

You might also like