# Construct Code Generation

**URL:** <https://techcommunity.softwareag.com/t/construct-code-generation/203537>\
**Category:** Forum\
**Tags:** Adabas-Natural, Natural, NaturalONE, Adabas-Natural-Community-Edition\
**Created:** [April 18, 2019, 1:04pm UTC](https://techcommunity.softwareag.com/t/construct-code-generation/203537 "2019-04-18T13:04:33Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![Dougal\_Cunningham1](https://avatars.discourse-cdn.com/v4/letter/d/71c47a/32.png) [@Dougal\_Cunningham1](https://techcommunity.softwareag.com/u/Dougal_Cunningham1)\
**Post date:** [April 18, 2019, 1:04pm UTC](https://techcommunity.softwareag.com/t/construct-code-generation/203537/1 "2019-04-18T13:04:33Z")

</div>

My problem I am experiencing is as follows…

I can generate a Browse Module using the Code Generation Wizard and the source code in my editor needs the user exits to be complete.

I cannot edit the code to put in the user exits.

Well firstly I don’t know where to define my required user exits so the \*\*SAG DEFINE EXIT and \*\*SAG END-EXIT appear in the source code. Where do you set this up?

Secondly, I have set Natural Security to have zero restrictions because I am trying to get a Natural 8.3.8 system into NaturalONE - so why can I not edit the generated code. If I copy and paste the generated code into a New Object (excluding the initial \*\*SAG comments) then I can edit the object and add User exits manually.

I can only imagine this is a setup issue, please assist me in resolving this.

---

<div class="post-metadata">

**Author:** ![Ralph\_Zbrog](https://sea1.discourse-cdn.com/techcommunity/user_avatar/techcommunity.softwareag.com/ralph_zbrog/32/78_2.png) [@Ralph\_Zbrog](https://techcommunity.softwareag.com/u/Ralph_Zbrog)\
**Post date:** [April 18, 2019, 11:48pm UTC](https://techcommunity.softwareag.com/t/construct-code-generation/203537/2 "2019-04-18T23:48:59Z")

</div>

> [@](#):
>
> Well firstly I don’t know where to define my required user exits so the \*\*SAG DEFINE EXIT and \*\*SAG END-EXIT appear in the source code. Where do you set this up?

I haven’t used that wizard in quite some time, but somewhere in there is a list of all the user exits. You select one and an edit window appears for you to provide the source code.

> [@](#):
>
> Secondly, … so why can I not edit the generated code

The first rule of Construct has always been “Don’t edit a generated object.” Go back to the wizard, select a user exit, and update the source code you provided previously. As on the mainframe, all activity is performed under Construct, that is, within the Construct application.

And finally, it’s those \*\*SAG comments that tell the editor that the source code is off-limits.

---

<div class="post-metadata">

**Author:** ![Dougal\_Cunningham1](https://avatars.discourse-cdn.com/v4/letter/d/71c47a/32.png) [@Dougal\_Cunningham1](https://techcommunity.softwareag.com/u/Dougal_Cunningham1)\
**Post date:** [April 23, 2019, 9:11am UTC](https://techcommunity.softwareag.com/t/construct-code-generation/203537/3 "2019-04-23T09:11:19Z")

</div>

Hi Ralph,

Thank you for the quick response. I agree with the rule about not coding outside the user exits. My problem is I do not see the User Exit list.  
E.G. For a new Browse program  
Panel 1 - Object name / GDA / Options (no User Exits)  
Panel 2 - View / Super / Min Max (Common and Map Parameters)  
Panel 3 - Internal External Map and Dynamic attributes  
Panel 4 - #Action parameters  
Panel 5 - Prefix options  
At Panel 5 Next is protected and Finish the only option

Is it perhaps an external setting/preference for the user exit list to appear?

---

<div class="post-metadata">

**Author:** ![Ralph\_Zbrog](https://sea1.discourse-cdn.com/techcommunity/user_avatar/techcommunity.softwareag.com/ralph_zbrog/32/78_2.png) [@Ralph\_Zbrog](https://techcommunity.softwareag.com/u/Ralph_Zbrog)\
**Post date:** [April 23, 2019, 11:51pm UTC](https://techcommunity.softwareag.com/t/construct-code-generation/203537/4 "2019-04-23T23:51:32Z")

</div>

The Natural Construct Generation section of the documentation describes the generation wizards. [http://techcommunity.softwareag.com/ecosystem/documentation/naturalONE/natONE911/cgen/n1codegeneration/cst-generation.htm](http://techcommunity.softwareag.com/ecosystem/documentation/naturalONE/natONE911/cgen/n1codegeneration/cst-generation.htm)

The procedure for each wizard ends with text similar to

> [@](#):
>
> Select Finish. The generation process begins. … Once generation is complete, the code is downloaded to the client. The generated source is displayed in the editor and the available user exits are displayed in the Outline view.

And here is where to read about the user exits.  
[http://techcommunity.softwareag.com/ecosystem/documentation/naturalONE/natONE911/cgen/n1codegeneration/defining-user-exits.htm#defining-user-exits](http://techcommunity.softwareag.com/ecosystem/documentation/naturalONE/natONE911/cgen/n1codegeneration/defining-user-exits.htm#defining-user-exits)

---

<div class="post-metadata">

**Author:** ![Dougal\_Cunningham1](https://avatars.discourse-cdn.com/v4/letter/d/71c47a/32.png) [@Dougal\_Cunningham1](https://techcommunity.softwareag.com/u/Dougal_Cunningham1)\
**Post date:** [April 24, 2019, 9:35am UTC](https://techcommunity.softwareag.com/t/construct-code-generation/203537/5 "2019-04-24T09:35:14Z")

</div>

Ralph, you are an absolute legend! Thank you so much for pointing me in the right direction.

---

<div class="post-metadata">

**Author:** ![system](https://global.discourse-cdn.com/techcommunity/original/3X/c/d/cd19967bb605d28a72d77eb83a1cae22f3df2eb8.svg) [@system](https://techcommunity.softwareag.com/u/system)\
**Post date:** [April 2, 2021, 3:42pm UTC](https://techcommunity.softwareag.com/t/construct-code-generation/203537/6 "2021-04-02T15:42:38Z")

</div>


