<?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 User-exit in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/user-exit/m-p/1626316#M279853</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 have a user exit where in the the previous account num ... field ALTKN should be populated as the last seven digits of customer number... I want that after creating customer in XD01 ... immediately the code should work ... so that when I go XD03 or XD02 ... I should see that the field ALTKN is populated...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; Currently what is happening is when I go to XD02 for that customer... the field ALTKN is blank ... and thhen I save ... I get a info message "Changes done were saved"... &amp;amp; I again go inside to see the changes ... I see that the field is getting populated...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The code that I have wrritten is ...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;FIELD-SYMBOLS : &amp;lt;KNB1&amp;gt; TYPE KNB1.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;IF sy-tcode = 'XD01'.&lt;/P&gt;&lt;P&gt;ASSIGN (V_FIELD) TO &amp;lt;KNB1&amp;gt;.&lt;/P&gt;&lt;P&gt;&amp;lt;KNB1&amp;gt;-ALTKN = I_KNA1-KUNNR+3(7).&lt;/P&gt;&lt;P&gt;elseif sy-tcode = 'XD02' or &amp;lt;KNB1&amp;gt;-ALTKN is initial.&lt;/P&gt;&lt;P&gt;ASSIGN (V_FIELD) TO &amp;lt;KNB1&amp;gt;.&lt;/P&gt;&lt;P&gt;&amp;lt;KNB1&amp;gt;-ALTKN = I_KNA1-KUNNR+3(7).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Can anybody tell me how to do the same thing after XD01??&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Sun, 24 Sep 2006 19:09:31 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2006-09-24T19:09:31Z</dc:date>
    <item>
      <title>User-exit</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/user-exit/m-p/1626316#M279853</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 have a user exit where in the the previous account num ... field ALTKN should be populated as the last seven digits of customer number... I want that after creating customer in XD01 ... immediately the code should work ... so that when I go XD03 or XD02 ... I should see that the field ALTKN is populated...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; Currently what is happening is when I go to XD02 for that customer... the field ALTKN is blank ... and thhen I save ... I get a info message "Changes done were saved"... &amp;amp; I again go inside to see the changes ... I see that the field is getting populated...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The code that I have wrritten is ...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;FIELD-SYMBOLS : &amp;lt;KNB1&amp;gt; TYPE KNB1.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;IF sy-tcode = 'XD01'.&lt;/P&gt;&lt;P&gt;ASSIGN (V_FIELD) TO &amp;lt;KNB1&amp;gt;.&lt;/P&gt;&lt;P&gt;&amp;lt;KNB1&amp;gt;-ALTKN = I_KNA1-KUNNR+3(7).&lt;/P&gt;&lt;P&gt;elseif sy-tcode = 'XD02' or &amp;lt;KNB1&amp;gt;-ALTKN is initial.&lt;/P&gt;&lt;P&gt;ASSIGN (V_FIELD) TO &amp;lt;KNB1&amp;gt;.&lt;/P&gt;&lt;P&gt;&amp;lt;KNB1&amp;gt;-ALTKN = I_KNA1-KUNNR+3(7).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Can anybody tell me how to do the same thing after XD01??&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 24 Sep 2006 19:09:31 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/user-exit/m-p/1626316#M279853</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-09-24T19:09:31Z</dc:date>
    </item>
    <item>
      <title>Re: User-exit</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/user-exit/m-p/1626317#M279854</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;Your problem is the customer code is assigned just before saving the data and I don't believe there's an user-exit between to pick up the number and save the data. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So u can't know which code number'll be assigned to new customer.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;U can try to know the data of the range from acc. group and so try to understand which last number was assigned and which the next number (cutomer code), but this solution is not safe&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Max&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 24 Sep 2006 19:48:50 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/user-exit/m-p/1626317#M279854</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-09-24T19:48:50Z</dc:date>
    </item>
    <item>
      <title>Re: User-exit</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/user-exit/m-p/1626318#M279855</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Yes max... I was trying to get the next free num of the customer... by using the FM "number_get_next" ... and here I was passing the values "DEBITOR" for object ... and was hard coding '01' for NR_RANGE_NR... (though the table t077d has 50 values for number_range)... So for '01' ... I get the next free num ... &amp;amp; my code does work the previous account number logic...&lt;/P&gt;&lt;P&gt;For eg .. For number range '01' ... the next free num was 2010000013.. which got captured by FM ... so the logic worked and populated field ALTKN ... but this way I had to take care in 2 places ... &lt;/P&gt;&lt;P&gt;- 1.) I wanted to pass 50 values to number_range (so only I was asking how to capture the account group field value in the T-code XD01)&lt;/P&gt;&lt;P&gt;- 2.) Field ALTKN was coming up as " 0000013" where as the cust num was getting created as 2010000014 ...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;But still my confusion is that once I have saved the customer in XD01 ... the code should work ..and I should be able to see the field populated in XD03 or XD02 ... currently after creating the cust .. I go to XD03 ... nothing comes there ... then I go to XD02 .. save.. come out ... and again go in ... only then I see the changes happening...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Can you please tell me why this is happening ?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank a lot for all your help.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 24 Sep 2006 20:12:57 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/user-exit/m-p/1626318#M279855</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-09-24T20:12:57Z</dc:date>
    </item>
    <item>
      <title>Re: User-exit</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/user-exit/m-p/1626319#M279856</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;U should use a code like this:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DATA: NR_RANGE TYPE INRI-NRRANGENR,&lt;/P&gt;&lt;P&gt;      NEXT_NUMBER TYPE NRLEVEL.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;IF KNA1-KUNNR IS INITIAL.&lt;/P&gt;&lt;P&gt;  SELECT SINGLE * FROM T077D WHERE KTOKD = KNA1-KTOKD.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  NR_RANGE = T077D-NUMKR.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  CALL FUNCTION 'NUMBER_GET_INFO'&lt;/P&gt;&lt;P&gt;    EXPORTING&lt;/P&gt;&lt;P&gt;      NR_RANGE_NR = NR_RANGE&lt;/P&gt;&lt;P&gt;      OBJECT      = 'DEBITOR'&lt;/P&gt;&lt;P&gt;    IMPORTING&lt;/P&gt;&lt;P&gt;      INTERVAL    = NRIV.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  NEXT_NUMBER = NRIV-NRLEVEL + 1.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ENDIF.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I believe the fm number_get_next can burn a number so this can explain why u've stored 0000013 while the customer number was 2010000014. &lt;/P&gt;&lt;P&gt;Infact you called fm number_get_next first time and got 2010000013, the std program called fm number_get_next again and got 2010000014.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Now other problem can be the range stores in the buffer some numbers (for example 5 numbers): so the last number you can see in the range could not be really the last one.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;For ex. you have 2010000014 as last number and 5 numbers in the buffer, this means the system'll use the number from 2010000015 to 2010000020 and only after using all number it'll update the range with 2010000020 as last number.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The user-exit you've used is triggered only if a data is changed, so it can works only with trx XD01/XD02&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Max&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 24 Sep 2006 21:01:46 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/user-exit/m-p/1626319#M279856</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-09-24T21:01:46Z</dc:date>
    </item>
    <item>
      <title>Re: User-exit</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/user-exit/m-p/1626320#M279857</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi max,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; The Select Single * is failing ... any aother way to get the account group and it's number range ??&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;-SB.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 24 Sep 2006 22:10:40 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/user-exit/m-p/1626320#M279857</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-09-24T22:10:40Z</dc:date>
    </item>
  </channel>
</rss>

