<?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 Method redefinition with differen Returning (Exporting) Parameters in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/method-redefinition-with-differen-returning-exporting-parameters/m-p/11814485#M1955324</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi all,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;please cut me some slack, if this is really basic and I'm missing out on something.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have a requirement to generate a security code (actually a voucher ID like on a gift card).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;For gift card type A the ID should look like this: XXXX-XXXX-XXXX-XXXX-XXXX&lt;/P&gt;&lt;P&gt;For gift card type B the ID should look like this: XXXXX-XXXXX-XXXXX-XXXXX&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Now I want to tackle this with ABAP OO. I was thinking of an (abstract?) super class "ZCL_SEC_CODE" with two subclasses "ZCL_SEC_CODE_A" and "ZCL_SEC_CODE_B". There should be a method "get_voucher_id" which should return Voucher Type A when called from "&lt;SPAN style="font-size: 13.3333px;"&gt;ZCL_SEC_CODE_A" and Voucher Type B when called from "&lt;SPAN style="font-size: 13.3333px;"&gt;ZCL_SEC_CODE_B".&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I know (not saying to be an expert) about facade, factory and the like, but am still having problems with this:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ABAP OO doesn't allow me to create the methods with a different signature for "&lt;SPAN style="font-size: 13.3333px;"&gt;ZCL_SEC_CODE_A" and "&lt;SPAN style="font-size: 13.3333px;"&gt;ZCL_SEC_CODE_B". But I actually want (from a client perspective) the methods to be returning say a Char24 for Type A and a Char23 for Type B. Of course I could just use a Char24 for both and write the shorter Type B into that, but that's not my point.&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks and cheers&lt;/P&gt;&lt;P&gt;Jens&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 03 Aug 2016 18:34:18 GMT</pubDate>
    <dc:creator>JaySchwendemann</dc:creator>
    <dc:date>2016-08-03T18:34:18Z</dc:date>
    <item>
      <title>Method redefinition with differen Returning (Exporting) Parameters</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/method-redefinition-with-differen-returning-exporting-parameters/m-p/11814485#M1955324</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi all,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;please cut me some slack, if this is really basic and I'm missing out on something.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have a requirement to generate a security code (actually a voucher ID like on a gift card).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;For gift card type A the ID should look like this: XXXX-XXXX-XXXX-XXXX-XXXX&lt;/P&gt;&lt;P&gt;For gift card type B the ID should look like this: XXXXX-XXXXX-XXXXX-XXXXX&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Now I want to tackle this with ABAP OO. I was thinking of an (abstract?) super class "ZCL_SEC_CODE" with two subclasses "ZCL_SEC_CODE_A" and "ZCL_SEC_CODE_B". There should be a method "get_voucher_id" which should return Voucher Type A when called from "&lt;SPAN style="font-size: 13.3333px;"&gt;ZCL_SEC_CODE_A" and Voucher Type B when called from "&lt;SPAN style="font-size: 13.3333px;"&gt;ZCL_SEC_CODE_B".&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I know (not saying to be an expert) about facade, factory and the like, but am still having problems with this:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ABAP OO doesn't allow me to create the methods with a different signature for "&lt;SPAN style="font-size: 13.3333px;"&gt;ZCL_SEC_CODE_A" and "&lt;SPAN style="font-size: 13.3333px;"&gt;ZCL_SEC_CODE_B". But I actually want (from a client perspective) the methods to be returning say a Char24 for Type A and a Char23 for Type B. Of course I could just use a Char24 for both and write the shorter Type B into that, but that's not my point.&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks and cheers&lt;/P&gt;&lt;P&gt;Jens&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 03 Aug 2016 18:34:18 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/method-redefinition-with-differen-returning-exporting-parameters/m-p/11814485#M1955324</guid>
      <dc:creator>JaySchwendemann</dc:creator>
      <dc:date>2016-08-03T18:34:18Z</dc:date>
    </item>
    <item>
      <title>Re: Method redefinition with differen Returning (Exporting) Parameters</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/method-redefinition-with-differen-returning-exporting-parameters/m-p/11814486#M1955325</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;PRE&gt;&lt;CODE&gt;
&lt;P style="font-size: 12px; color: #333333; background: #ffffff;"&gt;ABAP OO doesn't allow me to create the methods with a different signature for "&lt;SPAN style="font-weight: inherit; font-style: inherit; font-size: 13.3333px; font-family: inherit; background: transparent;"&gt;ZCL_SEC_CODE_A" and "&lt;SPAN style="font-weight: inherit; font-style: inherit; font-size: 13.3333px; font-family: inherit; background: transparent;"&gt;ZCL_SEC_CODE_B".&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;Is it actually allowed in the other programming languages? (pardon my ignorance)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;My 2 cents:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;OL&gt;&lt;LI&gt;Can you not use type STRING for the RETURNING param? As a matter of fact you can also use a data reference (TYPE REF TO data), if you may!&lt;/LI&gt;&lt;LI&gt; You can use an EXPORTING param instead with the generic type &lt;EM&gt;csequence&lt;/EM&gt;. Please note RETURNING params cannot be generic! (refer: &lt;A href="http://help.sap.com/abapdocu_750/en/abentyping.htm" title="http://help.sap.com/abapdocu_750/en/abentyping.htm"&gt;Typing - ABAP Keyword Documentation&lt;/A&gt;)&lt;/LI&gt;&lt;/OL&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 03 Aug 2016 18:49:03 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/method-redefinition-with-differen-returning-exporting-parameters/m-p/11814486#M1955325</guid>
      <dc:creator>SuhaSaha</dc:creator>
      <dc:date>2016-08-03T18:49:03Z</dc:date>
    </item>
  </channel>
</rss>

