<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Dynamic  ABAP pattern in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/dynamic-abap-pattern/m-p/6914312#M1483342</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Why r u getting the dump and what the dump says? If it is from pattern, then you will get read from buffer option when you enter to editor in change mode (Say program/FM) for next time.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Vinod.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 07 May 2010 11:55:29 GMT</pubDate>
    <dc:creator>vinod_vemuru2</dc:creator>
    <dc:date>2010-05-07T11:55:29Z</dc:date>
    <item>
      <title>Dynamic  ABAP pattern</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/dynamic-abap-pattern/m-p/6914308#M1483338</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am working on creating a dynamic ABAP pattern. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have called it  Y_TEST - entered one line with the value *$&amp;amp;$MUSTER - and I have created the function module called Y_TEST_EDITOR_EXIT.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Now I can allow the user of the pattern to enter some data and create the pattern based on these data. This works very fine, but I would like to validate the user input against the current source code. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Not against the saved source code that can be read READ REPORT ..., but against the source code currently active in the editor.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Can I access this source code?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I know after that after a dump,  this current source code is sometimes stored in a buffer somewhere, and when I try to open the source in the ABAP editor, I get the option to load the source from this buffer instead of reading it from the database   - but can I read this buffer in my function module?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Best regards&lt;/P&gt;&lt;P&gt;Thomas Madsen Nielsen&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 07 May 2010 09:19:20 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/dynamic-abap-pattern/m-p/6914308#M1483338</guid>
      <dc:creator>TMNielsen</dc:creator>
      <dc:date>2010-05-07T09:19:20Z</dc:date>
    </item>
    <item>
      <title>Re: Dynamic  ABAP pattern</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/dynamic-abap-pattern/m-p/6914309#M1483339</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I think that the code in buffer is stored some where in the application server.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;After the Dump, go to SE38, enter your program name and enter /h in command prompt. Now change. From menu place break point at statement ÖPEN DATA SET. In the popup select the option load from buffer and enter. Control should stop at OPEN DATA SET statement. You can read the code in the same way in your FM also. Just check how the file name is populated in the same code just above the OPEN DATA SET statement.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Vinod.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 07 May 2010 10:27:13 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/dynamic-abap-pattern/m-p/6914309#M1483339</guid>
      <dc:creator>vinod_vemuru2</dc:creator>
      <dc:date>2010-05-07T10:27:13Z</dc:date>
    </item>
    <item>
      <title>Re: Dynamic  ABAP pattern</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/dynamic-abap-pattern/m-p/6914310#M1483340</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;SPAN __jive_emoticon_name="happy"&gt;&lt;/SPAN&gt; - but I don't have a dump with the option re-read the source from buffer.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 07 May 2010 10:37:44 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/dynamic-abap-pattern/m-p/6914310#M1483340</guid>
      <dc:creator>TMNielsen</dc:creator>
      <dc:date>2010-05-07T10:37:44Z</dc:date>
    </item>
    <item>
      <title>Re: Dynamic  ABAP pattern</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/dynamic-abap-pattern/m-p/6914311#M1483341</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Not sure what kind of editor you're reffering to, but if it's in the screen then surely you must be able to get it from the memory.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 07 May 2010 11:47:03 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/dynamic-abap-pattern/m-p/6914311#M1483341</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2010-05-07T11:47:03Z</dc:date>
    </item>
    <item>
      <title>Re: Dynamic  ABAP pattern</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/dynamic-abap-pattern/m-p/6914312#M1483342</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Why r u getting the dump and what the dump says? If it is from pattern, then you will get read from buffer option when you enter to editor in change mode (Say program/FM) for next time.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Vinod.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 07 May 2010 11:55:29 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/dynamic-abap-pattern/m-p/6914312#M1483342</guid>
      <dc:creator>vinod_vemuru2</dc:creator>
      <dc:date>2010-05-07T11:55:29Z</dc:date>
    </item>
    <item>
      <title>Re: Dynamic  ABAP pattern</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/dynamic-abap-pattern/m-p/6914313#M1483343</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;The editor is of course the ABAP editor from where a programmer press the Pattern push button.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I do not have any dump, and the dump info seems to be confusing - so please forget  what I mentioned about a dump.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This is the situation:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I'm writing a dynamic ABAP pattern function module. ( You can find the create pattern option in the ABAP editor under Utilities-&amp;gt;More Utilities-&amp;gt;Edit Pattern).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Now, when a programmer want to use my dynamic ABAP pattern, he opens an ABAP source in change mode - then he positions the cursor in the source, somewhere he wants to insert the pattern code and press the Pattern push button - in the popup he then choose "Other pattern" and type in the name of my pattern (Y_TEST) - and now my function module (Y_TEST_EDITOR_EXIT) is started.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So far so good - now my requirement is that I want to add functionality to my function module based on what ABAP source the programmer was editing when he pressed the Pattern push button.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;And of course the source code is somewhere in memory, but can I access it from my function module?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Best regards&lt;/P&gt;&lt;P&gt;Thomas Madsen Nielsen&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 07 May 2010 16:08:29 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/dynamic-abap-pattern/m-p/6914313#M1483343</guid>
      <dc:creator>TMNielsen</dc:creator>
      <dc:date>2010-05-07T16:08:29Z</dc:date>
    </item>
    <item>
      <title>Re: Dynamic  ABAP pattern</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/dynamic-abap-pattern/m-p/6914314#M1483344</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You can use the addition STATE with READ REPORT (Provided you have saved the code (Not activated) before calling the pattern)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;DATA itab TYPE TABLE OF string.

READ REPORT 'Z756941' INTO itab STATE 'I'. "I for inactive version, A for active version (By default)&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You can check the repository tables for finding the status of the object.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Note: As per F1 help, STATE addition is for internal use only. Even though this works, SAP won't gurantee the change in functionality in future.&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Vinod.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 07 May 2010 16:23:17 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/dynamic-abap-pattern/m-p/6914314#M1483344</guid>
      <dc:creator>vinod_vemuru2</dc:creator>
      <dc:date>2010-05-07T16:23:17Z</dc:date>
    </item>
    <item>
      <title>Re: Dynamic  ABAP pattern</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/dynamic-abap-pattern/m-p/6914315#M1483345</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thomas,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I understand that you stay working with memory. Your need be sure about this, because you have the SAP Memory(Server Memory) and ABAP Memory.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;When you work with SAP Memory is basicly when you work with ABAP certain sentences like export, import. When you work with any Function modules, your need be sure that this funcion module is called, this FM open other ABAP Memory independing of your program and other FM called. So... I think this a problem for your case.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 07 May 2010 16:45:40 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/dynamic-abap-pattern/m-p/6914315#M1483345</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2010-05-07T16:45:40Z</dc:date>
    </item>
    <item>
      <title>Re: Dynamic  ABAP pattern</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/dynamic-abap-pattern/m-p/6914316#M1483346</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Vinod,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks for your info about the State addition. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;It is an interesting option, although it is not really the solution i'm looking for. I hope somehow to be able to read the source even if the code is not saved.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Best regards&lt;/P&gt;&lt;P&gt;Thomas&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 07 May 2010 17:35:18 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/dynamic-abap-pattern/m-p/6914316#M1483346</guid>
      <dc:creator>TMNielsen</dc:creator>
      <dc:date>2010-05-07T17:35:18Z</dc:date>
    </item>
    <item>
      <title>Re: Dynamic  ABAP pattern</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/dynamic-abap-pattern/m-p/6914317#M1483347</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Thomas,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Here an untested recipe (unfortunately no time for testing), which might work: Use function module &lt;STRONG&gt;GET_EDITOR_HANDLE&lt;/STRONG&gt; to get a reference to class &lt;STRONG&gt;CL_WB_EDITOR&lt;/STRONG&gt;. Within the class call method &lt;STRONG&gt;GET_SOURCE_INSTANCE&lt;/STRONG&gt; to get a reference to &lt;STRONG&gt;CL_WB_SOURCE&lt;/STRONG&gt; (note that you also have a method GET_CURSOR to read the current cursor position). From CL_WB_SOURCE call method &lt;STRONG&gt;GET_SOURCE_TAB&lt;/STRONG&gt;. Ideally you now have the information you're looking for.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;As I couldn't test it, it would be nice to hear if that approach worked...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Cheers, harald&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;p.s.: Out of curiosity - how do you trigger your custom function module after the pattern is chosen?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 07 May 2010 20:12:10 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/dynamic-abap-pattern/m-p/6914317#M1483347</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2010-05-07T20:12:10Z</dc:date>
    </item>
    <item>
      <title>Re: Dynamic  ABAP pattern</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/dynamic-abap-pattern/m-p/6914318#M1483348</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks Harald &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This is great - your solution works perfect.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;  data: editor_handle TYPE REF TO  CL_WB_EDITOR.

  CALL FUNCTION 'GET_EDITOR_HANDLE'
    IMPORTING
      HANDLE = editor_handle.

  data: FIRST_LINE    type sy-tabix
      , CURSOR_LINE   type sy-tabix
      , CURSOR_OFFSET type sy-tabix.

  CALL METHOD EDITOR_HANDLE-&amp;gt;GET_CURSOR
    IMPORTING
      FIRST_LINE    = first_line
      CURSOR_LINE   = cursor_line
      CURSOR_OFFSET = cursor_offset.

  data: source_handle TYPE REF TO CL_WB_SOURCE.

  CALL METHOD EDITOR_HANDLE-&amp;gt;GET_SOURCE_INSTANCE
    IMPORTING
      SOURCE_OBJECT = source_handle.

  data: source type RSWSOURCET.

  CALL METHOD SOURCE_HANDLE-&amp;gt;GET_SOURCE_TAB
    IMPORTING
      SOURCE        = source.

*Now the program is in the source table 
*and the cursor_line contains the position in the source.
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Best regards&lt;/P&gt;&lt;P&gt;Thomas Madsen Nielsen&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;PS. How to create a custom dynamic pattern:&lt;/P&gt;&lt;P&gt;1) In the ABAP editor choose function Utilities-&amp;gt;More Utilities-&amp;gt;Edit Pattern-&amp;gt;Create Pattern&lt;/P&gt;&lt;P&gt;2) In the pop-up screen enter a name for the pattern starting with Y_ or Z_    (in my example y_test)&lt;/P&gt;&lt;P&gt;3) next step an editor comes up. In this editor you can enter a static pattern or if you want to create a dynamic pattern you enter one line with this content: *$&amp;amp;$MUSTER&lt;/P&gt;&lt;P&gt;4) Create a function module named PatternName+_EDITOR_EXIT   (in my example Y_TEST_EDITOR_EXIT) &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;*$&amp;amp;$MUSTER is a trigger that automatic starts the function module.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Try to search sdn for *$&amp;amp;$MUSTER&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 08 May 2010 09:20:41 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/dynamic-abap-pattern/m-p/6914318#M1483348</guid>
      <dc:creator>TMNielsen</dc:creator>
      <dc:date>2010-05-08T09:20:41Z</dc:date>
    </item>
  </channel>
</rss>

