<?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: String Error in API Method!! in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/string-error-in-api-method/m-p/3647567#M878439</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I am getting following error again.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Data type CHAR255 cannot be used for methods.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;BAPI : Method does not define a RETURN parameter.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 16 Apr 2008 11:04:12 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2008-04-16T11:04:12Z</dc:date>
    <item>
      <title>String Error in API Method!!</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/string-error-in-api-method/m-p/3647565#M878437</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I created below BAPI, Passing User Name in import Parameter&lt;/P&gt;&lt;P&gt;and exporting et_return as string&lt;/P&gt;&lt;P&gt;                     et_return.&lt;/P&gt;&lt;P&gt;Hi Experts!!&lt;/P&gt;&lt;P&gt;While added in API Method Its giving me error as API Method String can be recognised....&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Please help me out. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks &lt;/P&gt;&lt;P&gt;Anee&lt;/P&gt;&lt;P&gt;                  &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;FUNCTION ZBAPI_URL_PASSING .
*"----------------------------------------------------------------------
*"*"Local Interface:
*"  IMPORTING
*"     VALUE(P_USERNAME) TYPE  SYST-UNAME OPTIONAL
*"  EXPORTING
*"     VALUE(ET_URLNAME) TYPE  STRING
*"     VALUE(ET_RETURN) LIKE  BAPIRETURN STRUCTURE  BAPIRETURN
*"----------------------------------------------------------------------
DATA: BEGIN OF message,
        msgty LIKE sy-msgty,
        msgid LIKE sy-msgid,
        msgno LIKE sy-msgno,
        msgv1 LIKE sy-msgv1,
        msgv2 LIKE sy-msgv2,
        msgv3 LIKE sy-msgv3,
        msgv4 LIKE sy-msgv4,
      END OF message.


IF P_USERNAME IS NOT INITIAL.

CONCATENATE 'http://90.0.4.100:8080/emp_dev/eva_quiz_user1.jsp?username=' P_USERNAME INTO ET_URLNAME.
else.
    clear: message.
    message-msgty = 'E'.
    message-msgid = 'ZZ'.
    message-msgno = '000'.
    message-msgv1 = 'Username shouldnot be blank'.

PERFORM set_return_message USING message
                               CHANGING et_return.
 ENDIF.
ENDFUNCTION.

FORM set_return_message USING value(p_message) LIKE message
                        CHANGING p_return LIKE bapireturn.

  CHECK message IS NOT INITIAL.
  CALL FUNCTION 'BALW_BAPIRETURN_GET'
    EXPORTING
      type                             = p_message-msgty
      cl                               = p_message-msgid
      number                           = p_message-msgno
      par1                             = p_message-msgv1
      par2                             = p_message-msgv2
      par3                             = p_message-msgv3
      par4                             = p_message-msgv4
*     LOG_NO                           = ' '
*     LOG_MSG_NO                       = ' '
    IMPORTING
      bapireturn                       =  p_return
    EXCEPTIONS
      only_2_char_for_message_id       = 1
      OTHERS                           = 2.

ENDFORM.                    "set_return_message

&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 16 Apr 2008 10:56:54 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/string-error-in-api-method/m-p/3647565#M878437</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-04-16T10:56:54Z</dc:date>
    </item>
    <item>
      <title>Re: String Error in API Method!!</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/string-error-in-api-method/m-p/3647566#M878438</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Try with a CHAR255 instead of string.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Ravi kanth talagana&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 16 Apr 2008 10:59:26 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/string-error-in-api-method/m-p/3647566#M878438</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-04-16T10:59:26Z</dc:date>
    </item>
    <item>
      <title>Re: String Error in API Method!!</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/string-error-in-api-method/m-p/3647567#M878439</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I am getting following error again.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Data type CHAR255 cannot be used for methods.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;BAPI : Method does not define a RETURN parameter.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 16 Apr 2008 11:04:12 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/string-error-in-api-method/m-p/3647567#M878439</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-04-16T11:04:12Z</dc:date>
    </item>
    <item>
      <title>Re: String Error in API Method!!</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/string-error-in-api-method/m-p/3647568#M878440</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello Anee&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I assume that you have registered your BAPI as method in the BOR and therefore you get these error messages.&lt;/P&gt;&lt;P&gt;Why data element CHAR255 is rejected I cannot tell you.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;However, The second error message implies that you either have to rename your RETURN parameter (into RETURN) or you have not defined this EXPORTING parameter as RETURN parameter in the BOR settings. Each BAPI must have such a RETURN parameter.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Final remark: change the naming of the BAPI parameter to make their structure and function more transparent.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
FUNCTION ZBAPI_URL_PASSING .
*"----------------------------------------------------------------------
*"*"Local Interface:
*"  IMPORTING
*"     VALUE(ID_USERNAME) TYPE  SYST-UNAME OPTIONAL
*"  EXPORTING
*"     VALUE(ED_URLNAME) TYPE  STRING
*"     VALUE(ES_RETURN) LIKE  BAPIRETURN STRUCTURE  BAPIRETURN
*"----------------------------------------------------------------------

" NOTE: 
" ID_ : I=importing, D=single data field
" ED_: E=exporting, D=single data field
" ES_:E=exporting, S=structure

&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;  Uwe&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 16 Apr 2008 11:51:20 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/string-error-in-api-method/m-p/3647568#M878440</guid>
      <dc:creator>uwe_schieferstein</dc:creator>
      <dc:date>2008-04-16T11:51:20Z</dc:date>
    </item>
    <item>
      <title>Re: String Error in API Method!!</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/string-error-in-api-method/m-p/3647569#M878441</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;While adding in API Method its giving me following warning.&lt;/P&gt;&lt;P&gt;where as i added return as export.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; BAPI &amp;amp;1: BAPI function module &amp;amp;2 has no return parameter.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;when i proceed into next step.following error popup is coming.&lt;/P&gt;&lt;P&gt;ERROR: &lt;/P&gt;&lt;P&gt;Data type CHAR255 cannot be used for methods.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;BAPI : Method does not define a RETURN parameter&lt;/P&gt;&lt;P&gt;complete revised code as&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;DATA: BEGIN OF message,
        msgty LIKE sy-msgty,
        msgid LIKE sy-msgid,
        msgno LIKE sy-msgno,
        msgv1 LIKE sy-msgv1,
        msgv2 LIKE sy-msgv2,
        msgv3 LIKE sy-msgv3,
        msgv4 LIKE sy-msgv4,
      END OF message.

FORM set_return_message USING value(p_message) LIKE message
                        CHANGING p_return LIKE bapireturn.

  CHECK message IS NOT INITIAL.
  CALL FUNCTION 'BALW_BAPIRETURN_GET'
    EXPORTING
      type                             = p_message-msgty
      cl                               = p_message-msgid
      number                           = p_message-msgno
      par1                             = p_message-msgv1
      par2                             = p_message-msgv2
      par3                             = p_message-msgv3
      par4                             = p_message-msgv4
*     LOG_NO                           = ' '
*     LOG_MSG_NO                       = ' '
    IMPORTING
      bapireturn                       =  p_return
    EXCEPTIONS
      only_2_char_for_message_id       = 1
      OTHERS                           = 2.

ENDFORM.                    "set_return_message &lt;/CODE&gt;&lt;/PRE&gt;&lt;PRE&gt;&lt;CODE&gt;FUNCTION ZBAPI_URL_PASSING .
*"----------------------------------------------------------------------
*"*"Local Interface:
*"  IMPORTING
*"     VALUE(ID_USERNAME) TYPE  SYST-UNAME OPTIONAL
*"  EXPORTING
*"     VALUE(ED_URLNAME) TYPE  CHAR255
*"     VALUE(ES_RETURN) LIKE  BAPIRETURN STRUCTURE  BAPIRETURN
*"----------------------------------------------------------------------
IF ID_USERNAME IS NOT INITIAL.

CONCATENATE 'http://90.0.4.100:8080/emp_dev/eva_quiz_user1.jsp?username=' ID_USERNAME INTO ED_URLNAME.
else.
    clear: message.
    message-msgty = 'E'.
    message-msgid = 'ZZ'.
    message-msgno = '000'.
    message-msgv1 = 'Username shouldnot be blank'.

PERFORM set_return_message USING message
                               CHANGING ES_RETURN.
 ENDIF.
ENDFUNCTION.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 16 Apr 2008 12:16:25 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/string-error-in-api-method/m-p/3647569#M878441</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-04-16T12:16:25Z</dc:date>
    </item>
    <item>
      <title>Re: String Error in API Method!!</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/string-error-in-api-method/m-p/3647570#M878442</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello Anee&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Please validate your settings against the recommendations of the long text for message S&amp;amp;(537):&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;


 NA S&amp;amp;537

 ____________________________________________________

 Short Text

     BAPI &amp;amp;1: BAPI function module &amp;amp;2 has no return parameter

 Diagnosis

     The system checks that the RETURN parameter has been defined in both the
     BOR and in the function module. The parameter must refer to one of the
     BAPI return structures (all planned reference structures can be used for
     BAPIs up to and including Release 4.6B; but from Release 4.6C only
     BAPIRET2 can be used).

     The BOR parameter must be type EXPORT (one line or multi-line) and the
     function module parameter must be type EXPORT (if one line) or type
     TABLE (if multi-line).

 Procedure

     Create a RETURN parameter for the function module. Also define the
     reference of the BOR parameters to the function module parameter in the
     BOR ("Name in function module").

     Note that only incompatible changes can be made to BAPIs already
     released and delivered.

     Find out about enhancing or modifying BAPIs that have already been
     delivered by calling the BAPI Explorer (Tools -&amp;gt; BusinessFramework -&amp;gt;
     BAPI Explorer) and reading the project form "Project to change an
     existing BAPI".

 Further notes

     For more information see the BAPI Programming Guide in the SAP Library
     under CA-BFA.
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;  Uwe&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 16 Apr 2008 12:27:02 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/string-error-in-api-method/m-p/3647570#M878442</guid>
      <dc:creator>uwe_schieferstein</dc:creator>
      <dc:date>2008-04-16T12:27:02Z</dc:date>
    </item>
  </channel>
</rss>

