OO approach for bapi return

HI ,
I am using the FM BALW_BAPIRETURN_GET2 and i want to know if there OO approach that emulate
this issue .
Regards
Joy
      CALL FUNCTION 'BALW_BAPIRETURN_GET2'
          EXPORTING
            type   = 'E'
            cl     = if_consnts=>gc_m_cl
            number = 25
            par1   = lv_msg
          IMPORTING
            return = ls_return.

Joy,
It really depends on what you're trying to achieve.
In older releases I used a class similar to CL_RECA_MESSAGE_LIST that I built myself, to collect messages for logging purposes. I wouldn't call that an "OO approach" per se, although it uses OO.
An important detail, however, that has nothing to do with OO: if you pass the message details (especially message class and number) to a method as literals, the where-used analysis on the message (from SE91) will not find this spot. So I found it useful to do more or less as follows:
DATA l_msgtext TYPE string.
MESSAGE ID if_consnts=>gc_m_cl TYPE 'E' NUMBER '25'
  WITH lv_msg
  INTO l_msgtext.
CALL FUNCTION 'BALW_BAPIRETURN_GET2'
  EXPORTING
    type   = sy-msgty
    cl     = sy-msgid
    number = sy-msgno
    par1   = sy-msgv1
  IMPORTING
    return = ls_return.
If you do it like this, the where-used analysis will find the spot. And if you replace the function BALW_BAPIRETURN_GET2 with something of your liking or you leave it as-is, that's up to you.
Regards
Rainer

Similar Messages

  • How to create a log file for bapi return structure

    Hi ppl,
         I am using BAPI_PO_CHANGE to mark the delivery of POs as complete after many validations through a classic report now my concern is i have been asked to create a log file which details the errors in the POs which is in the bapi return structure.
       I don't know how to do can any one help at the earliest.
    Regards,
    Bharathy.

    hi
    pls see this thread...
    it may help you...
    /people/kamalkumar.ramakrishnan/blog/2007/01/10/a-primer-on-using-and-creating-sap-application-log
    thx
    pavan
    *pls mark for helpful answers

  • Need  Solution for BAPI return error: E M7 021 Deficit of PU GR quantity

    Hi SAP Gurus,
    Our client got error while executing <b>BAPI_GOODSMVT_CREATE</b>. can you please guide me under <b>which scenario</b> this BAPI will throw this kind error ...your help appreciated.....
    regards
    dinesh.a

    hi reich,
    actually we are following the scenario called intial grn cancel in side of sap custom program where it will reverse the material docs which are created with 101 movement type...it should't do the 102 reversal.....
    regards
    dinesh

  • 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.

  • What are  import parameters for bapi

    please tell me what are the minimum  fields i  has to pass for bapi
    " BAPI_SALESDOCUMENT_CHANGE ".
    if  possible  give me with example
    Moderator message: please (re)search yourself first.
    Edited by: Thomas Zloch on Dec 8, 2010 9:07 AM

    Hello,
    It will all depend on what you need to change in the sales order.
    For example, if you want to change something in the header only, then you need to pass ORDER_HEADER_IN and ORDER_HEADER_INX.
    Similarly, if you want to change something only in the sales items then you need to pass the value in SALESDOCUMENT, ITEM_IN and ITEM_INX.
    So, it will all depend on your need.
    But, always pass a table in RETURN so that you get to know whether BAPI has executed successfully or there is some error in the processing.
    Hope it helps.
    Regards,
    Himanshu

  • Goods Issue for a Return Outbound Delivery for both Sales Returns

    Hi gurus..
    tell me the approch for the following development....
    custom transaction to perform a Goods Issue for a Return Outbound Delivery for both Sales Returns and Consignment Returns (Pickups) process within a lean warehouse in SAP.
    it is vry urgnt
    thnks

    I seem to have found the information I required here:
    http://wiki.sdn.sap.com/wiki/display/Snippets/Simulating+the+Sales+Cycle+with+BAPI's
    I'm going to keep this post active because I'd still like answers to my questions and any advice that you might be willing to share in regards to what I am trying to do.
    Edited by: Mikael Nensén on May 18, 2011 3:52 PM

  • 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

  • How to create purchase order using VA01 for BAPI?

    how to create purchase order using VA01 for BAPI?

    Hi Arun,
    Please check this link
    Example Program for BAPI_PO_CREATE1
    Re: BAPI_PO_CREATE1
    Questions in BAPI_PO_CREATE1
    Problem with BAPI_PO_CREATE1
    *& Report BAPI_PO_CREATE *
    REPORT bapi_po_create.
    Input File Declaration
    TYPES: BEGIN OF ty_input_file,
    column1 TYPE char50,
    column2 TYPE char50,
    column3 TYPE char50,
    column4 TYPE char50,
    column5 TYPE char50,
    column6 TYPE char50,
    column7 TYPE char50,
    column8 TYPE char50,
    column9 TYPE char50,
    column10 TYPE char50,
    column11 TYPE char50,
    column12 TYPE char50,
    column13 TYPE char50,
    column14 TYPE char50,
    column15 TYPE char50,
    column16 TYPE char50,
    column17 TYPE char50,
    column18 TYPE char50,
    END OF ty_input_file.
    DATA: i_input_file TYPE STANDARD TABLE OF ty_input_file,
    wa_input_file TYPE ty_input_file.
    CONSTANTS: c_path TYPE char20 VALUE 'C:\',
    c_mask TYPE char9 VALUE ',.,..',
    c_mode TYPE char1 VALUE 'O',
    c_filetype TYPE char10 VALUE 'ASC',
    c_x TYPE char01 VALUE 'X'.
    PARAMETERS : p_fname LIKE rlgrap-filename.
    AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_fname.
    Browse Presentation Server
    PERFORM f4_presentation_file.
    START-OF-SELECTION..
    Read presentation server file
    PERFORM f1003_upload_file.
    IF NOT i_input_file[] IS INITIAL.
    PERFORM split_data.
    ENDIF.
    *& Form f4_presentation_file
    *& F4 Help for presentation server
    FORM f4_presentation_file .
    CALL FUNCTION 'WS_FILENAME_GET'
    EXPORTING
    def_path = c_path
    mask = c_mask
    mode = c_mode
    title = text-001
    IMPORTING
    filename = p_fname
    EXCEPTIONS
    inv_winsys = 1
    no_batch = 2
    selection_cancel = 3
    selection_error = 4
    OTHERS = 5.
    IF sy-subrc 0.
    MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
    WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
    ENDIF.
    ENDFORM. " f4_presentation_file
    *& Form f1003_upload_file
    *& Upload File
    FORM f1003_upload_file .
    DATA: lcl_filename TYPE string.
    lcl_filename = p_fname.
    CALL FUNCTION 'GUI_UPLOAD'
    EXPORTING
    filename = lcl_filename
    filetype = c_filetype
    has_field_separator = c_x
    TABLES
    data_tab = i_input_file
    EXCEPTIONS
    file_open_error = 1
    file_read_error = 2
    no_batch = 3
    gui_refuse_filetransfer = 4
    invalid_type = 5
    no_authority = 6
    unknown_error = 7
    bad_data_format = 8
    header_not_allowed = 9
    separator_not_allowed = 10
    header_too_long = 11
    unknown_dp_error = 12
    access_denied = 13
    dp_out_of_memory = 14
    disk_full = 15
    dp_timeout = 16
    OTHERS = 17.
    IF sy-subrc 0.
    MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
    WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
    EXIT.
    ENDIF.
    ENDFORM. " f1003_upload_file
    *& Form split_data
    Collect data for creating Purchase Order
    FORM split_data .
    DATA: i_poitem TYPE STANDARD TABLE OF bapimepoitem,
    i_poitemx TYPE STANDARD TABLE OF bapimepoitemx,
    i_poitem_sch TYPE STANDARD TABLE OF bapimeposchedule,
    i_poitem_schx TYPE STANDARD TABLE OF bapimeposchedulx,
    i_acct_*** TYPE STANDARD TABLE OF bapimepoaccount,
    i_acct_assx TYPE STANDARD TABLE OF bapimepoaccountx,
    i_services TYPE STANDARD TABLE OF bapiesllc ,
    i_srvacc TYPE STANDARD TABLE OF bapiesklc,
    i_return TYPE STANDARD TABLE OF bapiret2,
    wa_header TYPE bapimepoheader,
    wa_headerx TYPE bapimepoheaderx,
    wa_poitem TYPE bapimepoitem,
    wa_poitemx TYPE bapimepoitemx,
    wa_poitem_sch TYPE bapimeposchedule,
    wa_poitem_schx TYPE bapimeposchedulx,
    wa_acct_*** TYPE bapimepoaccount,
    wa_acct_assx TYPE bapimepoaccountx,
    wa_services TYPE bapiesllc,
    wa_srvacc TYPE bapiesklc,
    wa_return TYPE bapiret2,
    ws_po TYPE bapimepoheader-po_number.
    break gbpra8.
    wa_services-pckg_no = 10.
    wa_services-line_no = 1.
    wa_services-outl_no = '0'.
    wa_services-outl_ind = c_x.
    wa_services-subpckg_no = 20.
    APPEND wa_services TO i_services.
    wa_srvacc-pckg_no = 10.
    wa_srvacc-line_no = 1.
    wa_srvacc-serno_line = 01.
    wa_srvacc-serial_no = 01.
    wa_srvacc-percentage = 100.
    APPEND wa_srvacc TO i_srvacc.
    LOOP AT i_input_file INTO wa_input_file.
    IF wa_input_file-column2 EQ 'HD'.
    wa_header-doc_type = wa_input_file-column3.
    wa_header-creat_date = sy-datum.
    wa_header-created_by = sy-uname.
    wa_header-vendor = wa_input_file-column4.
    PERFORM conversion_output USING wa_header-vendor
    CHANGING wa_header-vendor.
    wa_header-comp_code = 'DE03'.
    wa_header-purch_org = 'DE03'.
    wa_header-pur_group = 'DE1'.
    wa_header-vper_start = wa_input_file-column9.
    wa_header-vper_end = wa_input_file-column10.
    wa_headerx-comp_code = c_x.
    wa_headerx-doc_type = c_x.
    wa_headerx-creat_date = c_x.
    wa_headerx-created_by = c_x.
    wa_headerx-vendor = c_x.
    wa_headerx-purch_org = c_x.
    wa_headerx-pur_group = c_x.
    wa_headerx-vper_start = c_x.
    wa_headerx-vper_end = c_x.
    ENDIF.
    IF wa_input_file-column2 EQ 'IT'.
    wa_poitem-po_item = wa_input_file-column3.
    wa_poitem-short_text = wa_input_file-column6.
    wa_poitem-plant = wa_input_file-column8.
    wa_poitem-quantity = '1'.
    wa_poitem-tax_code = 'V0'.
    wa_poitem-item_cat = 'D'.
    wa_poitem-acctasscat = 'K'.
    wa_poitem-matl_group = wa_input_file-column7.
    wa_poitem-pckg_no = '10'.
    APPEND wa_poitem TO i_poitem .
    wa_poitemx-po_item = wa_input_file-column3.
    wa_poitemx-po_itemx = c_x.
    wa_poitemx-short_text = c_x.
    wa_poitemx-plant = c_x.
    wa_poitemx-quantity = c_x.
    wa_poitemx-tax_code = c_x.
    wa_poitemx-item_cat = c_x.
    wa_poitemx-acctasscat = c_x.
    wa_poitemx-matl_group = c_x.
    wa_poitemx-pckg_no = c_x.
    APPEND wa_poitemx TO i_poitemx.
    wa_poitem_sch-po_item = wa_input_file-column3.
    wa_poitem_sch-delivery_date = sy-datum.
    APPEND wa_poitem_sch TO i_poitem_sch.
    wa_poitem_schx-po_item = wa_input_file-column3.
    wa_poitem_schx-po_itemx = c_x.
    wa_poitem_schx-delivery_date = c_x.
    APPEND wa_poitem_schx TO i_poitem_schx.
    wa_acct_***-po_item = 10.
    wa_acct_***-serial_no = 01.
    wa_acct_***-gl_account = '0006360100'.
    wa_acct_***-co_area = '1000'.
    wa_acct_***-costcenter = 'KC010000'.
    APPEND wa_acct_*** TO i_acct_***.
    wa_acct_***-po_item = 10.
    wa_acct_***-serial_no = 02.
    wa_acct_***-gl_account = '0006360100'.
    wa_acct_***-co_area = '1000'.
    wa_acct_***-costcenter = 'KC010000'.
    APPEND wa_acct_*** TO i_acct_***.
    wa_acct_assx-po_item = 10.
    wa_acct_assx-serial_no = 01.
    wa_acct_assx-po_itemx = c_x.
    wa_acct_assx-serial_nox = c_x.
    wa_acct_assx-gl_account = c_x.
    wa_acct_assx-co_area = c_x.
    wa_acct_assx-costcenter = c_x.
    APPEND wa_acct_assx TO i_acct_assx.
    wa_acct_assx-po_item = 10.
    wa_acct_assx-serial_no = 02.
    wa_acct_assx-po_itemx = c_x.
    wa_acct_assx-serial_nox = c_x.
    wa_acct_assx-gl_account = c_x.
    wa_acct_assx-co_area = c_x.
    wa_acct_assx-costcenter = c_x.
    APPEND wa_acct_assx TO i_acct_assx.
    wa_services-pckg_no = 20.
    wa_services-line_no = 2.
    wa_services-service = wa_input_file-column9.
    wa_services-quantity = '100'.
    wa_services-gr_price = '100'.
    wa_services-userf1_txt = wa_input_file-column13.
    APPEND wa_services TO i_services.
    wa_srvacc-pckg_no = 20.
    wa_srvacc-line_no = 1.
    wa_srvacc-serno_line = 02.
    wa_srvacc-serial_no = 02.
    wa_srvacc-percentage = 100.
    APPEND wa_srvacc TO i_srvacc.
    ENDIF.
    ENDLOOP.
    CALL FUNCTION 'BAPI_PO_CREATE1'
    EXPORTING
    poheader = wa_header
    poheaderx = wa_headerx
    POADDRVENDOR =
    TESTRUN =
    MEMORY_UNCOMPLETE =
    MEMORY_COMPLETE =
    POEXPIMPHEADER =
    POEXPIMPHEADERX =
    VERSIONS =
    NO_MESSAGING =
    NO_MESSAGE_REQ =
    NO_AUTHORITY =
    NO_PRICE_FROM_PO =
    IMPORTING
    exppurchaseorder = ws_po
    EXPHEADER =
    EXPPOEXPIMPHEADER =
    TABLES
    return = i_return
    poitem = i_poitem
    poitemx = i_poitemx
    POADDRDELIVERY =
    poschedule = i_poitem_sch
    poschedulex = i_poitem_schx
    poaccount = i_acct_***
    POACCOUNTPROFITSEGMENT =
    poaccountx = i_acct_assx
    POCONDHEADER =
    POCONDHEADERX =
    POCOND =
    POCONDX =
    POLIMITS =
    POCONTRACTLIMITS =
    poservices = i_services
    posrvaccessvalues = i_srvacc
    POSERVICESTEXT =
    EXTENSIONIN =
    EXTENSIONOUT =
    POEXPIMPITEM =
    POEXPIMPITEMX =
    POTEXTHEADER =
    POTEXTITEM =
    ALLVERSIONS =
    POPARTNER =
    break gbpra8.
    LOOP AT i_return INTO wa_return.
    ENDLOOP.
    ENDFORM. " split_data
    *& Form conversion_output
    Conversion exit input
    FORM conversion_output USING p_ip
    CHANGING p_op.
    CALL FUNCTION 'CONVERSION_EXIT_ALPHA_INPUT'
    EXPORTING
    input = p_ip
    IMPORTING
    output = p_op.
    ENDFORM. " conversion_output
    Best regards,
    raam

  • What are the best approaches for mapping re-start in OWB?

    What are the best approaches for mapping re-start in OWB?
    We are using OWB repository 10.2.0.1.0 and OWB client 10.2.0.1.31. The Oracle version is 10 G (10.2.0.3.0). OWB is installed on Linux.
    We have number of mappings. We built process flows for mappings as well.
    I like to know, what are the best approches to incorportate re-start options in our process. ie a failure of mapping in process flow.
    How do we re-cycle failed rows?
    Are there any builtin features/best approaches in OWB to implement the above?
    Does runtime audit tables help us to build re-start process?
    If not, do we need to maintain our own tables (custom) to maintain such data?
    How did our forum members handled above situations?
    Any idea ?
    Thanks in advance.
    RI

    Hi RI,
    How many mappings (range) do you have in a process flows?Several hundreds (100-300 mappings).
    If we have three mappings (eg m1, m2, m3) in process flow. What will happen if m2 fails?Suppose mappings connected sequentially (m1 -> m2 -> m3). When m2 fails then processflow is suspended (transition to m3 will not be performed). You should obviate cause of error (modify mapping and redeploy, correct data, etc) and then repeat m2 mapping execution from Workflow monitor - open diagram with processflow, select mapping m2 and click button Expedite, choose option Repeat.
    In re-start, will it run m1 again and m2 son on, or will it re-start at row1 of m2?You can specify restart point. "at row1 of m2" - I don't understand what you mean (all mappings run in Set based mode, so in case of error all table updates will rollback,
    but there are several exception - for example multiple target tables in mapping without corelated commit, or error in post-mapping - you must carefully analyze results of error).
    What will happen if m3 fails?Process is suspended and you can restart execution from m3.
    By having without failover and with max.number of errors=0, you achieve re-cycle failed rows to zero (0).This settings guarantee existence only two return result of mapping - SUCCSES or ERROR.
    What is the impact, if we have large volume of data?In my opinion for large volume Set based mode is the prefered processing mode of data processing.
    With this mode you have full range enterprise features of Oracle database - parallel query, parallel DML, nologging, etc.
    Oleg

  • Approach for Inter Organisational BPM

    Hi All,
    I am doing Masters Dissertation in Collaborative BPM. My research topic is the evaluation of three approached for collaborating BPM across value chain.
    Explanation of these approaches:
    Centralise CBPM: Ownership of Collaborative System is with one Central Organisation and Other Partners Participate in this collaboration through various UI such as portal. Example, Collaboration between the automobile manufacturer and dealer were automobile manufacturer provides portal for dealer to place order, manage its customer and handle warranty and recalls.
    Decentralise CBPM: In this approach every partner provides communication technology like Web Services for its Business Partner for collaboration. The ownership is decentralise and more flexible
    Peer-to-Peer CBPM: In ideal condition in this approach every Partner should have the same technology which is developed for handling collaborative Business Processes. In this case the same modelling facility is available across the value chain.
    I found below critical aspects for evaluating these three approaches:
    1] Autonomy
    2] Collaborative process Modelling
    3] Monitoring, Controlling, and Analysis
    4] “Plug and Play” based Platform for Collaboration (Includes Security, Web Service and various adapters for communication and Language Support like Java for easy custom enhancement)
    5] Governance
    I kindly request you all to post your views about pros and cons for evaluating these approaches from the aforementioned critical aspects.
    I welcome your questions and appreciate your valuable guidance.
    Thank you ,
    Regards,
    Ganesh Sawant

    PROS:
    Using the Webservices you can trigger the BPM Process and pass the values from the web dypro component which will available for the end user and pass it on to the BPM Proess.
    We can use EJB as a webservice, where the automated activity in the BPM can output the value based on the logic in the EJB Function. We can manage the automated activity which runs in the back ground of the process as per our logic and returns the value to the next task.
    CONS
    Using Webservices in the various activity with fewer data is not advisable as it takes longer time to deploy the process. And any change in the data in the webservices requires regularly re importing of the web services.

  • Peer-to-Peer approach for Cross Organisation BPM

    What are the pros and cons of using Peer-to-Peer based decentralise approach for managing Inter-Organisational BPM?
    ( Peer-to-Peer CBPM: In ideal condition in this approach every Partner should have the same technology which is developed for handling collaborative Business Processes.  In this case the same modelling, monitoring, and implementation technology is available across the value chain. )
    What are the challenges and what are the benefits from the aspects like autonomy, governance, security, modelling, monitoring, and process ownership?
    Thanks you
    Regards
    Ganesh Sawant
    Edited by: ganesh sawant on Jul 16, 2011 8:45 PM

    PROS:
    Using the Webservices you can trigger the BPM Process and pass the values from the web dypro component which will available for the end user and pass it on to the BPM Proess.
    We can use EJB as a webservice, where the automated activity in the BPM can output the value based on the logic in the EJB Function. We can manage the automated activity which runs in the back ground of the process as per our logic and returns the value to the next task.
    CONS
    Using Webservices in the various activity with fewer data is not advisable as it takes longer time to deploy the process. And any change in the data in the webservices requires regularly re importing of the web services.

  • 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.

  • 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.

  • 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 the field checkbox for bapi parameter ?

    Dear All,
    Now, i find some code as below.
    The BAPI is uesd to create or update the sales order; but checkbox for bapi parameter have not been give values 'X'. why?
    take the first bapi for example, i think table order_items_inx (table parameter) should be given value 'X' for the field which will be update.
    Could you teach what happed?
    case gt_all_hd-sd_doc_cat.
    when 'C'.
    call function 'BAPI_SALESORDER_CREATEFROMDAT2'
    exporting
    order_header_in = gs_order_hd
    importing
    salesdocument = gv_vbeln
    tables
    return = gt_return
    order_items_in = gt_items
    order_partners = gt_partners
    order_schedules_in = gt_schedules
    order_conditions_in = gt_conditions.
    when others.
    call function 'BAPI_SALESDOCU_CREATEFROMDATA1'
    exporting
    sales_header_in = gs_order_hd1
    importing
    salesdocument_ex = gv_vbeln
    tables
    return = gt_return
    sales_items_in = gt_item1
    sales_partners = gt_part1
    sales_schedules_in = gt_sch1
    sales_conditions_in = gt_cond1.
    endcase.

    If you want to change a value, you need to pass the value in the 'order_items_in = gt_items' structure.
    You also need to add an 'X' in the 'order_items_inx = gt_itemsx'  structure for the same field.
    If you do not pass the 'X' then the value will not be updated...
    It looks like you are not passing the required '...x' structures.
    For more info see the documentation:
    Notes                                                                               
    1.  Mandatory entries:                                                                               
    ORDER_HEADER_IN : DOC_TYPE     Sales document type                      
                        SALES_ORG    Sales organization                       
                        DISTR_CHAN   Distribution channel                     
                        DIVISION     Division                                                                               
    ORDER_PARTNERS..: PARTN_ROLE   Partner role, SP sold-to party           
                        PARTN_NUMB   Customer number                                                                               
    ORDER_ITEMS_IN..: MATERIAL     Material number                                                                               
    2.  Ship-to party:                                                                               
    If no ship-to party is entered, use the following: Ship-to party =  
          sold-to party.                                                                               
    3.  Commit control:                                                     
          The BAPI does not have a database commit. This means that the       
          relevant application must leave the commit, in order that can be    
          carried out on on the database. The BAPI BAPI_TRANSACTION_COMMIT is 
          available for this.                                                                               
    4.  German key words:                                                   
          The following key words must be entered in German, independantly of 
          the logon language:                                                 
          DOC_TYPE     Sales document type, for example: TA for standard order
          PARTN_ROLE   Partner role, for example: WE for ship-to party                                                                               
    Further information                                                                               
    You can find further information in the OSS. The note 93091 contains    
      general information on the BAPIs in SD.

Maybe you are looking for

  • SBWP message send to external mail instead of user id

    Hallo, in SBWP you can send a message to sap useres (internal) or to external users when using eMail Adress. So we can use e.g. ADOETSCH as user id to send the message internal or a.doetsch@...... to send the message external. What we want is to send

  • Too long export to PDF from Indesign CS6

    When I exporting PDF from InDesign CS6 takes too long. For example, a few minutes (5minutes). In InDesign CS3, which I used earlier, the file is exported immediately (few seconds). It is a problem in setting or higher hardware requirements? I use lap

  • Synching multiple ipods to 2 computers

    my children have an i-tunes account that they share and their ipods are all linked to that account and synched on their computer...my husband and I recently bought i-phones...can we all be linked to the same i-tunes account/music library and share al

  • Purchase order header text in ME21n upgrade from 4.6c to ecc6

    We had changed the nomenclature of the header text from SAP standard to the way we required as per our business needs in Purchase order. Now we have done technical upgrade form 4.6c to Ecc6.0.However, the nomenclature of the header text is reset to o

  • Calendar Not Working on iPhone

    My phone appointments stopped syncing to Outlook.  I played with the settings and now the Calendar app will not work at all.  How can I get Calendar working and how can I start syncing again.  I sync with iTunes.