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

Similar Messages

  • How to display BAPI return message as a pop up

    Hi,
    I am able to get BAPI return message but my requirement is to display these BAPI return messages as pop up's like alerts in javascript.
    I am using abstract portal component.
    any suggestions.
    Regards
    Praveen

    Hi,
    Place a hidden field in your abstract portal component like this:
    <input type ="hidden" name ="returnedmessage" value=<i>the variable returned from JCO</i>>
    In addition to this:
    <script language = "javascript">
    if (document.<i>formname</i>.returnedmessage.value != null || document.<i>formname</i>.returnedmessage.value != "")
    alert(document.<i>formname</i>.returnedmessage.value);
    </script>
    If you are transferring your code to a JSP it would less cumbersome else you would have to enclose all this in response.write(); statements.
    Regards,
    Prem

  • How to handle rebate returns

    hi,
    sap gurus,
    how to handle rebate returns in the normal process
    for eg:
    my given target to the customer is 1 lac and there is rebate agreement for him
    so by the end of the year he has reached the target and then
    we have settled the agreement thru automatic settlement and then
    after one month he has returned the goods and services back which are in rebate agreement and
    then how to handle that process.
    plz help me on this
    regards,
    balaji.t
    09990019711

    Hi Balaji,
      Raise appropriate debit memo  for that customer based on the client decision.
    Regards,
    kishore.

  • BAPI return message problem

    Hi All,
    I created BAPI for Sale order the order created successfully but the return message S -success  is not coming- but the error message the sale order is already exist. How to solve this. I used the returnmessage for BAPI - BAPIRETURN1.
    Thanks,
    Suresh Maniarasu
    Edited by: suresh maniarasu on May 23, 2009 12:20 PM

    Well S  is not coming because there is no Success. Its giving error that Order already exists in system. Seems like straightforward condition.

  • Popup BAPI return messages

    Hello experts,
    I would like a way to quickly handle the BAPI return table (TYPE TABLE OF bapiret2).  I would like to pass the table into a function module or helper method to popup all the messages at once.  This is the same way MIGO (and many other programs) do a popup of messages with little red, yellow, and green icons to the left.  Currently I am using a series of calls to function module BAL_LOG_... and I feel there has to be a better way.
    I tried searching for the answer to this question, but if the answer exists, it is buried within the noise of a million people saying use 'POPUP_TO_CONFIRM' and other function modules.  To clarify: I do not want buttons to confirm.  I want a popup of a list of messages with red, yellow, and green icons on the left.
    Whoever answers my question correctly will henceforth be referred to by me as "the Magnificent."

    My 2 cents ...
    IF_RECA_MESSAGE_LIST is the most convenient message handler i have used so far So i would use it in this way -
    Get the instance using the factory class CF_RECA_MESSAGE_LIST=>CREATE( ).
    Add the BAPI messages using the method ADD_FROM_BAPI( ).
    Get the handle via GET_HANDLE( ) & display using function BAL_DSP_LOG_DISPLAY.
    DATA(o_msg_list) = cf_reca_message_list=>create( ).
    o_msg_list->add_from_bapi(
      EXPORTING
        it_bapiret = VALUE #( id = 'BC_IBF'
                            ( type = 'I'  number = '008' )
                              type = 'E' ( number = '050' message_v1 = 'AA')
                                         ( number = '051' message_v1 = 'BB')
                                         ( number = '055' message_v1 = 'CC')
    DATA st_log_disp_prof TYPE bal_s_prof.
    CALL FUNCTION 'BAL_DSP_PROFILE_POPUP_GET'
      IMPORTING
        e_s_display_profile = st_log_disp_prof.
    st_log_disp_prof-use_grid   = abap_true.
    st_log_disp_prof-disvariant
      = VALUE #( handle = o_msg_list->get_handle( )
                 report = sy-repid
    CALL FUNCTION 'BAL_DSP_LOG_DISPLAY'
      EXPORTING
        i_s_display_profile  = st_log_disp_prof
      EXCEPTIONS
        profile_inconsistent = 1
        internal_error       = 2
        no_data_available    = 3
        no_authority         = 4
        OTHERS               = 5.
    IF sy-subrc <> 0.
    * Implement suitable error handling here
    ENDIF.
    BR,
    Suhas

  • How to Handle the error message?

    Hi,
    Can any one help me in handling the error messages in application,
    In my application, I am having 2 buttons, one is display button, and the other is reset button. When we enter wrong inputs, it prompts an error message and again we I click on reset button the application goes back to its normal stage i.e. the error message will be disappears. These things will happen in the same page. I have tryed to know the any Id/Name of error message.
    So please help to handle error and skip that error then continue execute raming code.
    Thanks
    Buntty

    A few problems with this question that need clarification:
    You're using a GUI, but we have no way of knowing which one -- Swing? AWT? SWT? other?
    You ask how to fix your program flow and logic but don't show us the current state. Most of us can't read minds so a bit of code would be nice here.
    You mention "Page". What context is this in?
    A great resource that has helped me and will probably help you is an article entitled [How To Ask Questions The Smart Way|http://www.catb.org/~esr/faqs/smart-questions.html] . It will tell you how to formulate your questions so that the folks here will be better able to answer them. Good luck.

  • How to handle the multiple message on the screen

    I am new to j2me. I am trying to write a simple program for instant messaging. I want to write a program that to handle incoming messages. Now I am able to display one message at a time but I dont know how to handle multiple messages. Do anyone can give an example?
    Is that anyway that pop up an indication for new messages in j2me?
    Need yours expertise to help me. Thanks.

    Use a custom canvas to display messages. Then you can do whatever you want with it!

  • BAPI return message

    Hi,
    I am trying to use 'BAPI_INQUIRY_CREATEFROMDATA2' to create Inquiries. It is creating successfully. But if there any pricing errors like 'Pricing error: Mandatory condition SRP5 is missing', it is not giving this return message but instead giving generic return message saying 'The sales document is not yet complete: Edit data'.
    If we use BDC to create the Inquiry, if the same problem happens, it does gives the specific return message ('Pricing error: Mandatory condition SRP5 is missing').
    Is there a way to get this specific return message from the BAPI as well?
    Thanks..
    Swetha.

    Hi Swetha ,
    BAPI is a kind of direct table update and BDC is creation of data thro' screen validation. So SAP take cares of all the validation when you run the BDC, but in case of BAPI, you will always get these kinds of message which are hard to interpreter. Also there is no way to manipulate these messages.
    Thanks,
    Mandar

  • How to display the return message in popup window

    Hi Experts,
    In WDA i want to display the return message through popup window.
    Regards,
    M.Chella Meenal.

    hi Chella Meenal ,
    you can generate the popup using popup factory class also , look at the below sample code for displaying message in a popup , and you can do your own configurating like visible , enable the buttons you want ..
    data:
        lr_component type ref to if_wd_component,
        ls_conf type wdr_popup_to_confirm,
        lt_texts     type string_table.
      ls_conf-window_position = '1'.
      ls_conf-button_1-text = 'OK'.
      ls_conf-button_1-icon = 'ICON_OKAY'.
      ls_conf-button_1-enabled = 'X'.
      ls_conf-button_1-visible = CL_WD_UIELEMENT=>E_VISIBLE-VISIBLE.
      ls_conf-button_2-visible = CL_WD_UIELEMENT=>E_VISIBLE-NONE.
      ls_conf-button_cancel-visible = CL_WD_UIELEMENT=>E_VISIBLE-NONE.
      lr_component = wd_comp_controller->wd_get_api( ).
      append 'some text' to lt_texts.
      cl_wd_popup_factory=>popup_to_confirm(
          component        = lr_component
          text             = lt_texts
          CONFIGURATION    = ls_conf
          window_title     = 'some title' ).
    Regards
    Chinnaiya P

  • How to handle a return statement from a login webservice call

    Hi all,
    I am new to this iPhone apps. I am trying to wirte a webservice call in which I am comparing my username and password details in webservice and getting an boolean statement as a response. By using that response i should display valid or invalid statement on the screen.
    Now i am able to get the response from the webservice, but i am unable to handle that boolean variable present in the xml statement.
    Can any one please suggest me how to handle that boolean value from the xml statement?
    Thanks
    SRI.

    Since you are a registered developer you would be far better off posting this in the developers site, this forum is for users of apps.

  • BAPI return messages.

    Hi,
    When we create a sale order manually using VA01 tcode, we will be getting messages like 'material entered is critical part' or when the customer is on credit hold we will be getting 'Credit check maximum document value exceed'.
    My problem is i am not getting these messages in my return table when i create a sale order using 'SD_SALESDOCUMENT_CREATE'. Whether there is any value we need to pass in the import to get all the messages type S, I, W in our return table.
    Please let me know the solution.
    It's very urgent.
    Thanks,
    Srinath S.

    after my bapi call.
    i gave append <my_ret_table>.
    eg:
      CALL FUNCTION 'SD_SALESDOCUMENT_CREATE'
        EXPORTING
          sales_header_in     = header
        IMPORTING
          salesdocument_ex    = sales_doc
          sales_header_out    = header_out
          sales_header_status = header_status
        TABLES
          return              = bapireturn
          sales_items_in      = sditm
          sales_items_inx     = sditmx
          sales_partners      = parnr
          sales_schedules_in  = sch
          items_ex            = item
          schedule_ex         = schedule
          business_ex         = business.
    APPEND bapireturn..
    but the last message is appended again.

  • How to handle an email message using java mail

    I am facing the problem in handling html mails embedded with images. Can anyone give me some idea about handling these contents or can I convert whole mail content to an mht file? If yes, then how to convert that mail content to an mht file.

    You have no idea? Then look in your JavaMail download and you will find several sample programs that you can use to get started. It would also help to read the JavaMail FAQ (Google will find it easily for you).

  • How to get the return message after running BD20 tranaction ?

    Hi Gurus,
    My requirement is to Post vendor invoice through ALE/IDOC ( Inbound IDOC ).
    - For that I had generated the IDOC using  Function module 'IDOC_INBOUND_WRITE_TO_DB '
    - Then I had processed that generated IDOC by calling the standard program rbdapp01(BD20-Tranaction ) using the below statment
    SUBMIT rbdapp01 WITH SELECTION-TABLE lt_seltab .
    Could any one suggest me how to get the report output of standard program (rbdapp01) to an internal table so that I dispaly as an seperated report like Posted Document number with messages or Error message
    Suggest me any Function module or any other standard program to process the IDOC so that I can fulfill my requirement.
    Regards
    Paul

    Use can read the IDOC status after processing...
    Eg.
      SELECT * FROM edidc INTO TABLE t_idoc_control_tmp
          FOR ALL ENTRIES IN t_update WHERE docnum = t_update-docnum.
    and then add your own logic IF SY_SUBRC EQ 0.
    I hope this will help you.
    Regards,
    Amey

  • How to handle carriage return/linefeed embedded in text field as first char

    Hi,
    I am trying to use sqlldr to import text that is comma-separated and double quote-enclosed, but contains embedded carriage return/linefeed pairs. I have a control file which works for most cases and looks like this:
    LOAD DATA
    INFILE './foo.new'
    APPEND
    CONTINUEIF LAST PRESERVE (<>'"')
    INTO TABLE <tablename>
    FIELDS TERMINATED BY "," ENCLOSED BY '"'
    TRAILING NULLCOLS
    Unfortunately, this fails when the very first character of the text field is a carriage return/linefeed pair, e.g.,:
    "11","22","33","\r\nThis is the fourth field","","","","",""
    In that case, what is actually the opening double-quote for the fourth field, is interpreted by the CONTINUEIF clause as the end of that line. Can anyone please point me to a solution?
    thanks.
    stan.

    Thanks for the suggestion. Unfortunately, I've already tried it, and it doesn't help. I believe the problem is that sqlldr tries to figure out where each record is delimited before it parses out the field. So, any field-level trimming depends on sqlldr first determining that the cr/lf is actually part of that record, and not an indication of the start of a new record (and it's doing the latter right now). Fwiw, Python's csv parser will handle this type of record just fine.
    regards.
    stan.

  • Write BAPI return messages into text

    Dear experts,
                  I want to write error messages into a text file. i tried in many ways like, using GUI_DOWNLOAD i converted messages to non sap but it creates only empty text file. Is there any other function module in sap?

    Thanks Guys, here is my sample code...
    tables:bapimathead,
            bapi_makt,
            bapi_mara,
            bapi_marax,
            bapi_marc,
            BAPI_MARCX.
    data:begin of itab occurs 0,
           MATERIAL type BAPIMATHEAD-MATERIAL,
           IND_SECTOR TYPE BAPIMATHEAD-IND_SECTOR,
           MATL_TYPE type bapimathead-MATL_TYPE,
           PLANT type BAPI_MARC-PLANT,
           MATL_DESC TYPE BAPI_MAKT-MATL_DESC,
           BASE_UOM TYPE bapi_mara-BASE_UOM,
           MATL_GROUP type bapi_mara-MATL_GROUP,
    *      OLD_MAT_NO TYPE BAPI_MARA-OLD_MAT_NO,
    *      DIVISION TYPE BAPI_MARA-DIVISION,
    *      UNIT_OF_WT TYPE BAPI_MARA-UNIT_OF_WT,
    *      NET_WEIGHT TYPE BAPI_MARA-NET_WEIGHT,
    *      DOCUMENT TYPE BAPI_MARA-DOCUMENT,
    *      DOC_TYPE TYPE BAPI_MARA-DOC_TYPE,
           LANGU TYPE BAPI_MAKT-LANGU,
           PUR_GROUP TYPE BAPI_MARC-PUR_GROUP,
           MRP_TYPE TYPE BAPI_MARC-MRP_TYPE,
           MRP_CTRLER TYPE BAPI_MARC-MRP_CTRLER,
           LOTSIZEKEY TYPE BAPI_MARC-LOTSIZEKEY,
           PLND_DELRY TYPE BAPI_MARC-PLND_DELRY,
           SM_KEY TYPE BAPI_MARC-SM_KEY,
           end of itab.
    DATA:    it_RETURN like bapiret2 OCCURS 0 WITH HEADER LINE,
              IT_BAPI LIKE BAPI_MAKT OCCURS 0 WITH HEADER LINE,
              IT_MSG LIKE TLINE OCCURS 0 WITH HEADER LINE.
    parameters:p_file TYPE IBIPPARMS-PATH obligatory.
    at selection-screen on value-request for p_file.
    perform get_f4help.
    start-of-selection.
    perform upload_file_itab.
    perform call_bapi.
    *END-OF-SELECTION.
    *PERFORM ERROR.
    *&      Form  get_f4help
    form get_f4help .
    CALL FUNCTION 'F4_FILENAME'
      EXPORTING
        PROGRAM_NAME        = SYST-CPROG
        DYNPRO_NUMBER       = SYST-DYNNR
      IMPORTING
        FILE_NAME           = P_FILE  .
    endform.                    " get_f4help
    *&      Form  upload_file_itab
    form upload_file_itab .
    DATA:V_FILE TYPE STRING.
    MOVE P_FILE TO V_FILE.
    CALL FUNCTION 'GUI_UPLOAD'
       EXPORTING
        filename                      = V_FILE
        FILETYPE                      = 'ASC'
        HAS_FIELD_SEPARATOR           = 'X'
       TABLES
         data_tab                      = ITAB .
    endform.                    " upload_file_itab
    *&      Form  call_bapi
    form call_bapi .
    loop at itab.
    BAPIMATHEAD-material = itab-MATERIAL.
    bapimathead-IND_SECTOR = itab-IND_SECTOR.
    BAPIMATHEAD-MATL_TYPE = itab-MATL_TYPE.
    BAPIMATHEAD-BASIC_VIEW = 'X'.
    BAPIMATHEAD-PURCHASE_VIEW = 'X'.
    BAPIMATHEAD-MRP_VIEW = 'X'.
    bapi_mara-MATL_GROUP = itab-MATL_GROUP.
    bapi_mara-base_uom = itab-base_uom.
    *BAPI_MARA-OLD_MAT_NO = ITAB-OLD_MAT_NO.
    bapi_marax-MATL_GROUP = 'X'.
    bapi_marax-BASE_UOM = 'X'.
    *BAPI_MARA-DIVISION = ITAB-DIVISION.
    *BAPI_MARA-UNIT_OF_WT = ITAB-UNIT_OF_WT.
    *BAPI_MARA-NET_WEIGHT = ITAB-NET_WEIGHT.
    *BAPI_MARA-DOCUMENT = ITAB-DOCUMENT.
    *BAPI_MARA-DOC_TYPE = ITAB-DOC_TYPE.
    IT_BAPI-LANGU = ITAB-LANGU.
    IT_BAPI-LANGU_ISO = 'EN'.
    IT_BAPI-MATL_DESC = ITAB-MATL_DESC.
    BAPI_MARC-PLANT = ITAB-PLANT.
    BAPI_MARC-PUR_GROUP = ITAB-PUR_GROUP.
    BAPI_MARC-MRP_TYPE = ITAB-MRP_TYPE.
    BAPI_MARC-MRP_CTRLER = ITAB-MRP_CTRLER.
    BAPI_MARC-LOTSIZEKEY = ITAB-LOTSIZEKEY.
    BAPI_MARC-PLND_DELRY = ITAB-PLND_DELRY.
    BAPI_MARC-SM_KEY = ITAB-SM_KEY.
    BAPI_MARCX-PLANT = 'X'.
    BAPI_MARCX-PUR_GROUP = 'X'.
    BAPI_MARCX-MRP_TYPE = 'X'.
    BAPI_MARCX-MRP_CTRLER = 'X'.
    BAPI_MARCX-LOTSIZEKEY = 'X'.
    BAPI_MARCX-PLND_DELRY = 'X'.
    BAPI_MARCX-SM_KEY = 'X'.
    APPEND IT_BAPI.
    clear it_bapi.
    CALL FUNCTION 'BAPI_MATERIAL_SAVEDATA'
       EXPORTING
         headdata                  = BAPIMATHEAD
        CLIENTDATA                 = bapi_mara
        CLIENTDATAX                = bapi_marax
        PLANTDATA                  = BAPI_MARC
        PLANTDATAX                = BAPI_MARCX
        IMPORTING
        RETURN                     = it_RETURN
      TABLES
        MATERIALDESCRIPTION        = IT_BAPI .
    CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'  .
    LOOP AT IT_RETURN.
    CALL FUNCTION 'RPY_MESSAGE_COMPOSE'
       EXPORTING
        LANGUAGE                = SY-LANGU
         MESSAGE_ID              = IT_RETURN-ID
         MESSAGE_NUMBER          = IT_RETURN-NUMBER
      IMPORTING
        MESSAGE_TEXT            = IT_RETURN-MESSAGE
      TABLES
        LONGTEXT                = IT_MSG
    IF SY-SUBRC <> 0.
    * MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
    *         WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    ENDIF.
    ENDLOOP.
    CALL FUNCTION 'GUI_DOWNLOAD'
       EXPORTING
    *   BIN_FILESIZE                    =
        FILENAME                        = 'D:/DEMO.TXT'
        FILETYPE                        = 'ASC'
    *   APPEND                          = ' '
    *   WRITE_FIELD_SEPARATOR           = ' '
    * IMPORTING
    *   FILELENGTH                      =
       TABLES
         DATA_TAB                        = IT_RETURN
    *   FIELDNAMES                      =
      EXCEPTIONS
        FILE_WRITE_ERROR                = 1
        NO_BATCH                        = 2
        GUI_REFUSE_FILETRANSFER         = 3
        INVALID_TYPE                    = 4
        NO_AUTHORITY                    = 5
        UNKNOWN_ERROR                   = 6
        HEADER_NOT_ALLOWED              = 7
        SEPARATOR_NOT_ALLOWED           = 8
        FILESIZE_NOT_ALLOWED            = 9
        HEADER_TOO_LONG                 = 10
        DP_ERROR_CREATE                 = 11
        DP_ERROR_SEND                   = 12
        DP_ERROR_WRITE                  = 13
        UNKNOWN_DP_ERROR                = 14
        ACCESS_DENIED                   = 15
        DP_OUT_OF_MEMORY                = 16
        DISK_FULL                       = 17
        DP_TIMEOUT                      = 18
        FILE_NOT_FOUND                  = 19
        DATAPROVIDER_EXCEPTION          = 20
        CONTROL_FLUSH_ERROR             = 21
        OTHERS                          = 22
    IF SY-SUBRC <> 0.
    * MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
    *         WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    ENDIF.
    WRITE : /1 IT_RETURN-ID, 10 IT_RETURN-TYPE, 20 IT_RETURN-NUMBER, 25 IT_RETURN-MESSAGE.
    ENDLOOP.
    ENDFORM.
    Text file generated and getting message like 0 bytes transferred.

Maybe you are looking for

  • Need help with a SQL qurey that returns multiple rows for one record?

    I have the following query where I use a CASE WHEN clause to determine the date of a shift that begins with "FRLO" on day1 - day14 of the pay period. It works great if a schedule record contains one day that begins "FRLO", but if more than one day is

  • Macbook Air to TV (without HDMI)

    Hi all, I hope you can help on below situation: I have MackBook Air that I want to connect to Television Mitsubishi LCD H32MX5. MackBook Air does not have HDMI cable. Television LCD does not have HDMI cable, it has all other cables (D, RGB, etc.) as

  • How can I make a call to *190*phone number# in c#?

    Hi, I am trying to create an app as shortcut for some requests. I want to make a call to this number: *190*phone number# using c# but it never works. On the phone, I can call this number and I get a reply from my provider. If I try to call it using:

  • MESSAGE_TYPE_X Short dump in CAT2

    Hi, We are receiving a dump in CAT2 while maintaining 'long text'. The dump is at the following source code. Can someone help me understand what is causing this? I see that this is happening in the update mode. Message X030 reads "internal program er

  • Mass updates in CUA via a Batch Input Session

    We are trying to do a mass upload of users in CUA, via SU01. When we come to create the batch input session, by creating a record, we find that the only thing that is not saved is the role data entered on the role tab, everything else gets saved. Can