Bapi RETURN Parameter

All,
  I'm calling the BAPI, which returns the Error via Return Parameter. Can anyone tell me how can i show it Message interface?
Thanks..
BM

Go thru this document - Page no 29. This will show in the message area only.
https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/docs/library/uuid/d352a790-0201-0010-5082-b1a608d22b6c
If you wants show in a specific area on the view, use a Label Control, bind this label with a context variable(showErrorMsg), bind ur error message in that context variable like,
wdContext.setShowErrorMsg("This is the error");
Regards,
Sridhar
Message was edited by:
        Sridhar kanchanapalli

Similar Messages

  • Regarding BAPI Return Parameter.

    Hi All,
              I want to create Bapi Return Message with Variable values like : ' Sales Order 1876738267 is not created, please try again.' and want to create a log of this after BAPI calling in Calling FM. How can I do this. Please guide me.
    Thanks in Advance.

    Hi,
    CALL FUNCTION 'BAPI_SALESORDER_CREATEFROMDAT1'
      EXPORTING
        ORDER_HEADER_IN           = sd_header
      WITHOUT_COMMIT            = ' '
      CONVERT_PARVW_AUART       = ' '
    IMPORTING
       SALESDOCUMENT             = sd_doc_num
      SOLD_TO_PARTY             =
      SHIP_TO_PARTY             =
      BILLING_PARTY             =
       RETURN                    = return_it
      TABLES
        ORDER_ITEMS_IN            = itemin_it
        ORDER_PARTNERS            = partnr_it
      ORDER_ITEMS_OUT           =
      ORDER_CFGS_REF            =
      ORDER_CFGS_INST           =
      ORDER_CFGS_PART_OF        =
      ORDER_CFGS_VALUE          =
      ORDER_CCARD               =
      ORDER_CFGS_BLOB           =
      ORDER_SCHEDULE_EX         =
    WRITE : / 'sy-subrc = ' , SY-SUBRC.
    IF NOT SD_DOC_Num IS INITIAL.
    WRITE : / 'Sales Order ' , SD_DOC_Num, 'Created'.
    ELSE.
    WRITE : / 'incorrect'.
    WRITE : / RETURN_it-TYPE , RETURN_it-MESSAGE.
    WRITE : / RETURN_it-LOG_NO, RETURN_it-LOG_MSG_NO,
              RETURN_it-MESSAGE_V1.
    ENDIF.
    Hope this helps you.
    Thanks,
    Ruthra

  • Multiline BAPI return structure  and RFC Adapter

    Since SP14 RFC Adapter check return structure of RFC function.
    But how it works if BAPI returns multiline BAPIRET2?
    Will adapter loop all elements and perfom commit only if <b>all</b> alements don't have errors.

    I'am about this:
    <i>As of SP 14 support for commit handling for single BAPI calls was added to the RfcAdapter receiver channel. If activated in the receiver channel setting, the received XI message will be executed as synchronous RFC (sRFC) in the receiving system. This is also true for asynchronous (QoS EO) XI messages to receive and analyze the execution result by the RfcAdapter.
                   The received response is parsed by the RfcAdapter to get the BAPI return parameter with name "RETURN". This return parameter can be of BAPIRETURN, BAPIRET1 or BAPIRET2 types. The "RETURN" parameter is checked for the response status (field TYPE) which can take following values:
                  1. 'S' : Success
                  2. 'I' : Information
                  3. 'W' : Warning
                  4. ''  : Empty String
                  5. 'A' : Abort
                  6. 'E' : Error
                   If the response contains one amongst the first four response status then it implies that the BAPI was successful. If the response contains one amongst the last two response then the BAPI failed. If the BAPI "RETURN" parameter is of not of type ABAP structure rather of type ABAP table, a empty table is also considered as successful execution result.
                   In case of a successful execution the BAPI function module "BAPI_TRANSACTION_COMMIT" is called within the same context to trigger the commit of the BAPI. In case of a failure the BAPI function module "BAPI_TRANSACTION_ROLLBACK" is executed by RFC Adapter which rolls back the changes.</i>

  • How to use Return parameter of BAPI in DOE

    Hello all,
    I have a question on Return parameter of BAPI wrappers written in backend. When we use the BAPI in DOE there i do not see any table which stores these Return parameters then what is the use of writting it in BAPI wrappers.
    Can anyone please clarify??
    Thanks & Best Regards,
    Abhishek

    Hi,
    BAPIRET are stored in log tables during delta download(You can check it in logs and traces of backend integration).
    In case of upload, the bapiret is returned in message error list to the devices. Its also stored in message error list table which you can see it in message monitoring.
    In upload scenario case all the BAPIRET returned by backend are captured ,where as in case of delta load or push the BAPIRET of type 'A' and 'E' are captured by default and other message types are captured when trace setting is higher.(SMMW_TRC_SETTING).
    Regards,
    Dhana

  • Return Parameter in BAPI

    can any one tell me...... what is the purpose of Return parameter in BAPI ?

    it return all the Message's  ,Exceptions  ,etc
    it  is  a  kind  of
    Catch ..... endcatch & Try & endtry   what ever  message's  (S,E,A,I,W)it will capture and   maintain in the strucuture called  BAPIRETURN (or)BAPIRETURN2.
    Reward points  if it is usefull ..
    Girish

  • Is it necessary to pass RETURN parameter in bapi function module

    Hai All,
                Is it necessary to pass structure to RETURN parameter in bapi_transaction_rollback function module. If it is not necessary then how can it gives return value. Please give me the answer for this one. some sample code below...
    CALL FUNCTION 'BAPI_TRANSACTION_ROLLBACK'
    IMPORTING
       RETURN        = i_return.
            LOOP AT i_return into wa_return WHERE type EQ c_error.
              wa1_out-postdoc = wa_return-message.
            ENDLOOP.
    Thanks & Regards.
    Laxman.P

    hi
    bapi should never throw an error as it might be called for mass data proceessing
    and it is prefferred not to hault the proceess bcoz of one or two errors.
    that's why the error or success messages are caught and returned in return table.
    in bapi_transaction_rollback the return parameter is not necessary as it will work without that as well.
    the purpose of rollback bapi is just to undo whatever done before that.
    regards
    vijay
    <b>reward points if helpful</b>
    Message was edited by:
            vijay sharma

  • BAPI return

    Hi all,
    I am working on an SOAP to RFC scenario:
    I am able to execute the scenario. I am testing it using SOAP test tool.But i am facing a problem. when we give valid inputs to the BAPi, the BAPI return structure returns correct values, which is mapped to the response msg and the response is also fine, in the testing tool.
    But when i give non-valid values to the BAPI, the BAPI returns an error msg like "partner does not exist" and for some reason i am not able to see this msg in my response msg, instead i get an "XI Exception error in my
    testing tool display. How can i achieve, the BAPI return value to be displayed in my response msg for invalid values?
    Thanks in advance

    Hi,
    I had also faced the same problem in one of my scenarios. What you can do is, you can check the length of the parameter returned by BAPI. If it is zero, it means that non valid value has been passed to BAPI. In this case you have to map some constant to the target field during mapping.
    If the length is not zero, you can map it as it is.
    For finding the length of the field, you can use the standard text function: length. Hope this helps.
    Regards,
    Divija.

  • How to handle BAPI RETURN message?

    Hi ,
    I developed a bapi ,it is calling from java  application . i don't konw how to send the return message to java application .Pl any one help out this problem.
    Thanks&Regards,
    Pratap

    bapi's normally have a return parameter of type BAPIRETURN (structure) or BAPIRET (internal table) that contain the result messages from a bapi. So if you develop your own bapi you should add this kind of export parameter.
    regards,
    Hans

  • BAPI-RETURN CODE INF

    Hi everybody what is the main purpose of return code.
    Data dictionary structures
    -BAPIRETURN
    -BAPIRETURN1
    -BAPIRET1
    -BAPRET2.
    THANKS IN ADVANCE.

    Each BAPI has a return parameter that is either an export parameter or an export table.
    A BAPI should be able to record and classify all possible errors that may occur.
    You have to create a parameter named Return for every BAPI. This parameter returns exception messages or success messages to the calling program.
    BAPIs themselves must not trigger any messages (such as MESSAGE xnnn) in the coding. In particular they must not generate terminations or display dialog boxes. Instead, all messages must be intercepted internally and reported back to the calling program in the Return parameter. Otherwise the BAPI will not be processed correctly and control may not be given back to the calling program.
    The export parameter Return can be implemented as follows:
    As a structure, whereby it must be defined in the function module as an export parameter, as well as in the method in the BOR.
    As a table, whereby it must be defined in the function module as a table parameter, as well as in the method in the BOR as an export parameter.
    Before filling the Return parameter you should either initialize the structure with CLEAR or the table with REFRESH and CLEAR.
    If the return parameter is not set or is set to an initial value this means that no error has occurred.
    The Return parameter may be based on the following reference structures:
    BAPIRET2
    You must use this reference structure when developing new BAPIS.
    BAPIRET1, BAPIRETURN
    These reference structures are still partly used in old BAPIs.
    Both structures must be filled in the logon language.
    Have a look at return parameters in below link.
    http://help.sap.com/saphelp_nw04/helpdata/en/a5/3ec9f74ac011d1894e0000e829fbbd/frameset.htm
    Best Regards,
    Vibha
    *Please mark all the helpful answers

  • URGENT--Converting the BAPI return structure to XML

    Hi,
    I need to convert the return structure(export parameter) from a BAPI call to XML but not able to make out how to do that.
    Before this I was required to convert the BAPI return table(export table) to XML and I did that by first converting it to the AdoDataTable, added it to a dataset and then used the builtin function to return the dataset in XML format. But here I am not able to make out how can I do the same with the Export structure.
    Any help would be appreciated.
    You may also mail on [email protected]
    regards,
    Ankit Bhansali

    If the XML schema that you find as Xml attributes on the fields of the structure is good for you, you can just use the XML serializer to serialize it out:
    XmlSerializer ser = new XmlSerializer(typeof(BRFCKNA1));
    ser.Serialize(...);

  • How to read ABAP return parameter into java code

    Hi all,
    How JAVA environment can trap an error returned from abap code?
    E.g.:
    From a BAPI wrapper written like this:
    "function zpm_gi_create .
    ""Interfaccia locale:
    *"  IMPORTING
    *"     VALUE(ZBAPIGOODSMVT) TYPE  ZBAPIGOODSMVT
    *"  EXPORTING
    *"     VALUE(RETURN) TYPE  BAPIRET2
    *"     VALUE(PO_NUMBER_ES) TYPE  ZBAPIEKKO-PO_NUMBER
    *"  TABLES
    *"      GOODSMVT_ITEM STRUCTURE  ZGOODSMVT_ITEM
      data: goodsmvt_header type bapi2017_gm_head_01,
            return2         type bapiret2 occurs 0 with header line,
      call function 'BAPI_GOODSMVT_CREATE'
        exporting
          goodsmvt_header             = goodsmvt_header
          goodsmvt_code               = zbapigoodsmvt-gm_code
          testrun                     = 'X'
    importing
      GOODSMVT_HEADRET   GM         =
        materialdocument              = matdoc
        matdocumentyear               = matyear
    tables
        goodsmvt_item                 = gm_item
      GOODSMVT_SERIALNUMBER       =
          return                      = return2.
    Our return (for istance is):
    "EBM                  312The (internal) unit xx has not been maintained in
    the unit table"
    How JAVA environment can trap this error or interpret the BAPIRET2 structure?
    Is there something to do in the corresponding syncBO?
    regards,
    eliana

    Hi elina ,
    these topic is already discussed in forum.
    Jo has replied to this doubt in these links.
    Re: Return messages in SyncBo
    Can't see RETURN parameter in SyncBO
    Return messages in SyncBo
    just note this..
    have to change like this , when u follow the help.
    if (messageReply.getType() == MessageReplyType.SYNC_BEGIN) {
              if (messageReply.getType() == MessageReplyType.SYNC_END) {
                Regards
                  Kishor Gopinathan

  • Error in BAPI RETURN for Service Contract

    Hi,
      I get an error in the BAPI Return for the Uploading the Service Contracts by LSMW. The Error Message is E BS No status object is available for &.Also want to know can we upload multiple line of header text for a Contract by this BAPI. If so then how would I do this , as the BAPI structure BAPISDTEXT has textline upto 132 characters. And I am take only one file in LSMW where the header & details come alongwith text. Or could also tell me the file structure of for the data upload. The legacy system sends multiple text in the header for a Contract.For Eg.
    Header1 Detail1 Text1
    HEader1 Detail2 Text2
    Header1 Detail3 Text3
    So I would need this text1TEXT2text3 in the Header Text of the Contracts. Or do I need the change the file structure. Many thanks for your time and help.

    Thanks Nablan, I could do that for multiple header coming in file. But I have a question for you on BAdI ALM_ME_006_GOODSMVT. I have implemented this BAdI , and this BAdI is called by a function Module ALM_MEREP_006_CREATE. When I test this FM giving the Material , Orderid and Movement type entries, this BAdI is triggered when giving a breakpoint. I've given this code for changing the movement type to 961. Cause the stanadrd scenario does not maintain Movement type 961 in Mobile Asset Management. The Movement type 961 for unplanned Materials comes to SAP and changes to 261 as maiantained by TCOKO table. To bypass this & retain the movement type 961 in SAP I'm using this BAdI. Currently this is what I'm doing and am stuck in the method interface how do I call the method.
    method IF_EX_ALM_ME_006_GOODSMVT~CREATE .
    break-point.
    *DATA : i_ce_goodsmovement TYPE REFERENCE
              ALM_ME_CUSTOMER_ENHANCEMENT.
    DATA : lr_badi_goods_movement TYPE REF TO if_ex_alm_me_006_goodsmvt.
    DATA : ls_user_data TYPE ALM_ME_USER_DATA-USERID.
    *DATA : goods_movement TYPE ALM_ME_MATERIAL_MOVEMENT.
    CALL METHOD lr_badi_goods_movement->create
      EXPORTING
           ce_goodsmovement = ce_goodsmovement
      IMPORTING
           user_data        = ls_user_data
           custom_user_data = ls_ce_user_data
           goods_movement   = goods_movement
      changing
           return           = return[].
    CALL FUNCTION 'ALM_ME_COMMIT_OR_ROLLBACK'
           TABLES
                return = return.
    endmethod.
    Please help me to get the data in this method. How do I call this.

  • The type of RETURNING parameter must be fully specified

    Hello,
    I want to program a locall class, a method to return a table of a local type:
    TYPES:
    BEGIN OF ty_line,
       id   TYPE char10,
       txt  TYPE string,
    END OF ty_line,
    ty_line_tt type standard table of ty_line.
    CLASS cl_html DEFINITION FINAL CREATE PRIVATE.
      PUBLIC SECTION.
        CLASS-METHODS parse importing fdata        type string_table
                            returning value(fmeta) type ty_line_tt.
    ENDCLASS.                    "cl_rep DEFINITION
    Got an error as in the subject. Does that mean that the table type MUST be declared in the ABAP dictionary?
    Regards,
    Michal

    Hello Michal
    Since your static method is PUBLIC you cannot use local types in its interface. The type of the RETURNING parameter must be public as well. Thus, you have to define it in the DDIC.
    Alternatively, you could switch to the more flexible EXPORTING parameters. Or you could return you itab as data reference, e.g.:
    *& Report  ZUS_LOCAL_CLASS                                             *
    REPORT  zus_local_class                                             .
    TYPES:
    BEGIN OF ty_line,
    id TYPE char10,
    txt TYPE string,
    END OF ty_line,
    ty_line_tt TYPE STANDARD TABLE OF ty_line.
    *       CLASS cl_html DEFINITION
    CLASS cl_html DEFINITION FINAL CREATE PRIVATE.
      PUBLIC SECTION.
        CLASS-METHODS parse IMPORTING fdata TYPE string_table
    *    RETURNING value(fmeta) TYPE ty_line_tt.
        RETURNING value(data_obj) TYPE REF TO data.
    ENDCLASS. "cl_rep DEFINITION
    *       CLASS cl_html IMPLEMENTATION
    CLASS cl_html IMPLEMENTATION.
      METHOD parse.
    *   define local data
        DATA:
          lt_line_tt    TYPE ty_line_tt.
        APPEND INITIAL LINE TO lt_line_tt.
        GET REFERENCE OF lt_line_tt INTO data_obj.
      ENDMETHOD.                    "parse
    ENDCLASS.                    "cl_html IMPLEMENTATION
    Regards
      Uwe

  • RFC function module without RETURN parameter thows error in XI. Please help

    Hi Experts,
       I have a File to RFC scenario in XI. The RFC function module that I am using at the receiving end does not have "RETURN" parameter. So when I test my scenario I get "RETURN" parameter not found error on SXMB_MONI.
    So is it mandatory that RFC function module must have RETURN parameter when used in XI?
    Is there any work around to avoid the error without changing the RFC function module?
    Please help!
    Thanks
    Gopal

    In my senario the QOS is best effort because it is a Sync.
    But the function module is sync in nature as it is returning a parameter called SO_Docs and Ret_Msg. The Ret_Msg contains the error info but it not of BAPIRET2 type.
    So is there any way to avoid this error when my QOS is best effort?
    Please help!
    Gopal

  • Function or bapi returning customers or vendors with open items  per plant

    Dear experts.
    may you please tell me which function or bapi can i use that will return all customers or vendors with open items per given plant. i have tried to use BAPI_AR_ACC_GETOPENITEMS and BAPI_AP_ACC_GETOPENITEMS but they return open items for a given customer and vendor respectively per given company code.

    ok but those 2 BAPIs return open items after providing the customer or vendor. what i need is a BAPI which returns a list of customers or vendors with open items

Maybe you are looking for