BAPI Message

Hi ,
Im trying to use the BAPI : BAPI_ADDRESSEMP_CHANGE to change the address. But it saying the message :
184Employee/applicant is not locked yet
Pls specify what is it and how to correct it .

hi,
before using the BAPI, lock the Employee by calling FM,
Lock the employee for processing infotype 9004
    CALL FUNCTION 'HR_EMPLOYEE_ENQUEUE'
      EXPORTING
        number = v_pernr.
after changing the Employee address through BAPI, unlock the emploee by calling FM
Unlock the employee
    CALL FUNCTION 'HR_EMPLOYEE_DEQUEUE'
      EXPORTING
        number = v_pernr.
hope this will solve your problem.
reward points if it is useful.
Regards,
Srilatha.

Similar Messages

  • Plz help me out bapi message (urgent)

    hi
    i need help. i m passing values in bapi n taking message from table in bapi to print in out put.
    requirment is..
    a)     Pass the following parameters:
    NUMBER = NETWORK
    Tables: I_COMPONENTS_CHANGE
         COMPONENT = IT_COMP-COMPONENT
         BATCH = P_CHARG
    Tables: I_COMPONENTS_CHANGE_UPDATE
         COMPONENT = IT_COMP-COMPONENT
         BATCH = “X”
    b)     The components that failed update are provided in table, E_MESSAGE_TABLE. If MESSAGE_TYPE = “E”, get EXTERNAL_OBJECT_ID and MESSAGE_TEXT. Remove spaces from EXTERNAL_OBJECT_ID and then match against IT_COMP-COMPONENT to get MATERIAL, PLANT and NETWORK and write MATERIAL, PLANT and NETWORK and MESSAGE_TEXT to the job log.
    so for that i m doing coding like (this is part of my program)
    LOOP AT i_temp_comp.
        CLEAR : i_comp_change,i_comp_upd,i_e_msg.
        REFRESH : i_comp_change,i_comp_upd,i_e_msg.
        LOOP AT i_comp WHERE network = i_temp_comp-network.
          l_number = i_comp-network.
          i_comp_change-component = i_comp-component.
          i_comp_change-batch = p_charg.
          APPEND i_comp_change.
          i_comp_upd-component = i_comp-component.
          i_comp_upd-batch = c_x.
          APPEND i_comp_upd.
        ENDLOOP.
        CALL FUNCTION 'BAPI_NETWORK_COMP_CHANGE'
          EXPORTING
            number                     = l_number
          TABLES
            i_components_change        = i_comp_change
            i_components_change_update = i_comp_upd
            e_message_table            = i_e_msg.
        IF NOT i_e_msg[] IS INITIAL.
          LOOP AT i_e_msg.
            IF i_e_msg-message_type = c_e.
              READ TABLE i_comp WITH KEY network = l_number
         component = i_e_msg-external_object_id.       "#EC *
                IF sy-subrc IS INITIAL.
                  i_output-material = i_comp-material.
                  i_output-plant = i_comp-plant.
                  i_output-network = i_comp-network.
                  i_output-message = i_e_msg-message_text.
                  APPEND i_output.
                ENDIF.
              ENDIF.
            ENDIF.
          ENDLOOP.
        ELSE.
          CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'.
        ENDIF.
      ENDLOOP.
    problem is it is not showing message in i_output.
    so no data is printing.
    plz help me out

    There are several IFs in your code here.
    IF NOT i_e_msg[] IS INITIAL.
      LOOP AT i_e_msg.
        IF i_e_msg-message_type = c_e.
          READ TABLE i_comp WITH KEY network = l_number
              component = i_e_msg-external_object_id. "#EC *
          IF sy-subrc IS INITIAL.
            i_output-material = i_comp-material.
            i_output-plant = i_comp-plant.
            i_output-network = i_comp-network.
            i_output-message = i_e_msg-message_text.
            APPEND i_output.
          ENDIF.
        ENDIF.
      ENDLOOP.
    ELSE.
      CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'.
    ENDIF.
    It can be any IF failure. Check in debugging and see how this "i_e_msg" internal table is filled. May be the return table is giving the component number in external format and you have it in internal format or vice-versa in the READ statement "component = i_e_msg-external_object_id".

  • SQL to BAPI  Message Mapping Issue

    This is my datatype for source, which refered by resultset
    <?xml version="1.0" encoding="UTF-8"?>
    <mt_PhysCountInfo>
       <row>
          <PROCESSED/>
          <TRANS_ID/>
          <TRANS_RFC/>
          <SAPABX_STATUS/>
          <SIGN/>
          <OPTION1/>
          <LOW/>
          <HIGH/>
       </row>
    </mt_PhysCountInfo>
    When  JBDC Sender Adapter polls SQL Database, SQL select statement is written in such way that its picks data from 5 tables among them datatypes in 4 tables is same(SIGN, OPTION1, LOW, HIGH) with different values....which in turn will be mapped to 4 corresponding tables in BAPI.
    Here is my souce once JDBC adapter picks from SQL tables:
    <?xml version="1.0" encoding="utf-8"?>
    <mt_PhysCountInfo>
         <row>
              <PROCESSED>N</PROCESSED>
                    <TRANS_ID>1847201</TRANS_ID>
                    <TRANS_RFC>BAPI_MATPHYSINV_GETITEMS () <b>plant_ra, stge_loc_ra, count_status_ra, phys_inv_no_ra</b>, items, headers, return</TRANS_RFC>
                    <SAPABX_STATUS>x</SAPABX_STATUS>
                    <SIGN><b>I</b></SIGN>
                    <OPTION1><b>EQ</b></OPTION1>
                    <LOW> </LOW>
                    <HIGH></HIGH>
                    <SAPABX_STATUS>x</SAPABX_STATUS>
                    <SIGN><b>I</b></SIGN>
                    <OPTION1><b>BT</b></OPTION1>
                    <LOW></LOW>
                    <HIGH><b>ZZZZZZZZZZZZZZZZ</b></HIGH>
                    <SAPABX_STATUS>x</SAPABX_STATUS>
                    <SIGN><b>I</b></SIGN>
                    <OPTION1><b>EQ</b></OPTION1>
                    <LOW><b>WOIL</b></LOW>
                    <HIGH></HIGH>
                    <SAPABX_STATUS>x</SAPABX_STATUS>
                    <SIGN><b>I</b></SIGN>
                    <OPTION1><b>BT</b></OPTION1>
                    <LOW>    </LOW>
                    <HIGH><b>ZZZZ</b></HIGH>
         </row>
    </mt_PhysCountInfo>
    This is how my target stucture looks like now. But I am not getting right mapping here. If you see values for SIGN, OPTION1, LOW and HIGH they all are same for all tables...means its mapping first set values from source to all tables in target.
    <?xml version="1.0" encoding="UTF-8"?>
    <ns0:BAPI_MATPHYSINV_GETITEMS xmlns:ns0="urn:sap-com:document:sap:rfc:functions">
       <b><COUNT_STATUS_RA></b>
          <item>
             <SIGN><b>I</b></SIGN>
             <OPTION><b>EQ</b></OPTION>
             <LOW> </LOW>
             <HIGH/>
          </item>
       <b></COUNT_STATUS_RA></b>
       <HEADERS/>
       <ITEMS/>
       <b><PHYS_INV_NO_RA></b>    
          <item> 
             <SIGN><b>I</b></SIGN>
             <OPTION><b>EQ</b></OPTION>
             <LOW> </LOW>
             <HIGH/>
          </item>
       <b></PHYS_INV_NO_RA></b>  
       <b><PLANT_RA></b>
          <item>
             <SIGN><b>I</b></SIGN>
             <OPTION><b>EQ</b></OPTION>
             <LOW> </LOW>
             <HIGH/>
          </item>
       <b></PLANT_RA></b>
       <RETURN/>
       <b><STGE_LOC_RA></b>
          <item>
             <SIGN><b>I</b></SIGN>
             <OPTION><b>EQ</b></OPTION>
             <LOW> </LOW>
             <HIGH/>
          </item>
       <b></STGE_LOC_RA></b>
    </ns0:BAPI_MATPHYSINV_GETITEMS>
    But target should look like this after mapping:
    <?xml version="1.0" encoding="UTF-8"?>
    <ns0:BAPI_MATPHYSINV_GETITEMS xmlns:ns0="urn:sap-com:document:sap:rfc:functions">
       <b><COUNT_STATUS_RA></b>     
           <item>
             <SIGN><b>I</b></SIGN>
             <OPTION><b>EQ</b></OPTION>
             <LOW> <b>WOIL</b></LOW>
             <HIGH/>
          </item>
       <b></COUNT_STATUS_RA></b>
       <HEADERS/>
       <ITEMS/>
       <b><PHYS_INV_NO_RA></b>
          <item>
             <SIGN><b>I</b></SIGN>
             <OPTION><b>BT</b></OPTION>
             <LOW> </LOW>
             <HIGH><b>ZZZZ</b></HIGH>
          </item>
       <b></PHYS_INV_NO_RA></b>
       <b><PLANT_RA></b>
          <item>
             <SIGN><b>I</b></SIGN>
             <OPTION><b>EQ</b></OPTION>
             <LOW> </LOW>
             <HIGH/>
          </item>
       <b></PLANT_RA></b>
       <RETURN/>
       <b><STGE_LOC_RA></b>
          <item>
             <SIGN><b>I</b></SIGN>
             <OPTION><b>BT</b></OPTION>
             <LOW> </LOW>
             <HIGH><b>ZZZZZZZZZZZZZZZZ</b></HIGH>
          </item>
       <b></STGE_LOC_RA></b>
    </ns0:BAPI_MATPHYSINV_GETITEMS>
    Can I achieve this by using Message Mapping??? or If I have to do with XSLT or JAVA can anybody provide me code.
    Thank You
    Indrasena

    Hi,
    >>>Can I achieve this by using Message Mapping???
    it depends:)
    do you always get 4 values (one for each target table?)
    if so then you create a few user advanced functions
    that will return values in direct order:
    first function:
    result.addValue(a[0]);
    sencond one:
    result.addValue(a[1]);
    and so on
    then you can use those functions
    to map values to different tables
    if you have more then you can do some if conditions
    in the user advanced function
    Regards,
    michal

  • Bapi message type e

    I am trying to execute the following program.i am getting an exception here:
    I am using crm5.2
    I AM GETTING BAPI_MTYPE AS E.
    JCO.Structure returnStructure =
    function.getExportParameterList().getStructure("RETURN");
    JCO.Structure returnStructure =
    function.getExportParameterList().getStructure("RETURN");
    if (! (returnStructure.getString("TYPE").equals("") ||
    returnStructure.getString("TYPE").equals("S")) ) {
    System.out.println(returnStructure.getString("MESSAGE"));
    System.out.println("TYPE");
    System.exit(1);
    y am i not getting type as S or " ".
    I am working with jco for the first time.please help.
    how to resolve this?
    regards
    shilpi
    import com.sap.mw.jco.*;
    public class Bapi1 extends Object{
    JCO.Client mConnection;
    JCO.Repository mRepository;
    public Bapi1() {
    try {
    // Change the logon information to your own system/user
    mConnection =
    JCO.createClient("002", // SAP client
    "training3", // userid
    "welcome", // password
    null, // language
    "usaboses01.ad.infosys.com", // application server host name
    "00"); // system number
    mConnection.connect();
    mRepository = new JCO.Repository("SAPJCo", mConnection);
    catch (Exception ex) {
    ex.printStackTrace();
    System.exit(1);
    JCO.Function function = null;
    JCO.Table codes = null;
    try {
    function = this.createFunction("BAPI_BANK_GETLIST");
    if (function == null) {
    System.out.println("BAPI_BANK_GETLIST" +
    " not found in SAP.");
    System.exit(1);
    mConnection.execute(function);
    JCO.Structure returnStructure =
    function.getExportParameterList().getStructure("RETURN");
    if (! (returnStructure.getString("TYPE").equals("") ||
    returnStructure.getString("TYPE").equals("S")) ) {
    System.out.println(returnStructure.getString("MESSAGE"));
    System.out.println("TYPE");
    System.exit(1);
    codes =
    function.getTableParameterList().getTable("BANK_LIST");
    for (int i = 0; i < codes.getNumRows(); i++) {
    codes.setRow(i);
    System.out.println(codes.getString("BANK_KEY") + '\t' +
    codes.getString("BANK_NAME"));
    catch (Exception ex) {
    ex.printStackTrace();
    System.exit(1);
    try {
    codes.firstRow();
    for (int i = 0; i < codes.getNumRows(); i++, codes.nextRow()) {
    function = this.createFunction("BAPI_BANK_GETDETAIL");
    if (function == null) {
    System.out.println("BAPI_COMPANYCODE_GETDETAIL" +
    " not found in SAP.");
    System.exit(1);
    function.getImportParameterList().
    setValue(codes.getString("BANK_KEY"), "BANKKEY");
    function.getExportParameterList().
    setActive(false, "BANK_CTRY");
    mConnection.execute(function);
    JCO.Structure returnStructure =
    function.getExportParameterList().getStructure("RETURN");
    if (! (returnStructure.getString("TYPE").equals("") ||
    returnStructure.getString("TYPE").equals("S") ||
    returnStructure.getString("TYPE").equals("W")) ) {
    System.out.println(returnStructure.getString("MESSAGE"));
    JCO.Structure detail =
    function.getExportParameterList().
    getStructure("BANK_DETAIL");
    System.out.println(detail.getString("BANK_KEY") + '\t' +
    detail.getString("BANK_CTRY") + '\t' +
    detail.getString("CITY"));
    catch (Exception ex) {
    ex.printStackTrace();
    System.exit(1);
    mConnection.disconnect();
    public JCO.Function createFunction(String name) throws Exception {
    try {
    IFunctionTemplate ft =
    mRepository.getFunctionTemplate(name.toUpperCase());
    if (ft == null)
    return null;
    return ft.getFunction();
    catch (Exception ex) {
    throw new Exception("Problem retrieving JCO.Function object.");
    public static void main (String args[]) {
    Bapi1 app = new Bapi1();

    "E" stands for error. Check the input parameters you are passing to SAP to make sure you set all parameters correctly. Additionally, you can test the Function Module directly by setting the same data that you try setting through JCo and then see what happens.
    Under "Message" in the return table, you should be able to see a more detailed reason for the error.
    T00th

  • 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

  • PI 7.0 SP15 alerts JMS Duplicate message error

    Hi all,
    We have a scenario where in we  receive BAPI calls to R/3 from web through MQ and XI.
    WEB -> MQ->XI->R/3 (Request / Response send back similarly)
    We have modular configuration in the channel.
    All these BAPI messages are queries needed to build an order for example product information / customer information etc.
    We have PI 7.0 SP15
    Sometimes we receive the error ' Duplicate JMS message with JMS ID##### detected.Duplicate will be ignored' in the sender JMS channel.Because of this error XI is not able to process subsequent messages and the channel keeps on throwing the same error.We need to clear the queue and then restart the channel to make it work.
    Can any one please tell me what is the reason for occurence of this error..?
    Is this ID generated in JMS or in XI?If so how this could be handled without clearing the queue's..?
    When we analyzed the messages in the queue we found out same xml messages been send twice which i would imagine the query been send twice(which is a possiblity from the web) would that have caused this JMS duplcate message error??!!
    Also because of this error XI is throwing multiple alert messages at the rate of 3 per second which is causing the huge performance hit as the alert inbox gets filled up..We did put the suppress multiple alert check..but before somebody reacts to these alerts there are numerous of them created..any suggestions on this is much appreciated..
    Thanks for your help in advance
    Larry

    Larry,
    Is that alert rule is generic or interface specific? If it is generic then please make it interface specific.
    Thanks,
    Sunil

  • IDOC -to -BAPI -to -BAPI scenario

    Hi ,
       my scenario is   IDOC - to - BAPI - and BAPI(Response) -to - BAPI (Req) .
    I think a bit confusion  . Actually I'm getting the data from  MDM system through an IDOC  into XI system  and I want to post this data into an ECC system by using RFC. so, up to this level scenario is simple IDOC - to - RFC. but  i want to post the RFC response message to MDM system  . for posting this reponse in MDM system they created a simple BAPI and  that BAPI will post the data into a ZTABLE in MDM system . so  i want to pass the BAPI(ECC system) response message to  BAPI(MDM  system).
    So, please suggest me  the steps and how can we achive this..
    Because for creating the Out bound interface as synchronous  system is not accepting one IDOC message and and one BAPI message.
    Regards
    Jain

    Hello,
    You can achieve this using BPM
    Async Rec - transfortm  - sync send (Req/Response)- transform - send response
    Regards,
    Sreenivas.

  • RFC adapter for two BAPIs

    Hello,
    I need help to call two BAPIs in RFC Adapter. My scenario is I am getting message from third party system. By default I call a BapiX to create a deal, Then I have to call another BapiZ for commision.The thing is first I have to create it by calling BapiX and BapiZ from one message which I am getting to XI.
    What is best way to do it. In XI is there any way to do this.
    I am not sure do i need to use DB lookup in the mapping.
    Or do i need to use RFC wrapper to put these two BAPIs.
    Thanks,
    Srinivas

    Hello Amit,
    I am just confused. I am using RFC adpter on reciever side.
    You mean You want to use BAPI message type for the interface and create ABAP Server Proxy.
    Now how can i define other RFC message type OR you want me to call other BAPI (Pasting the BAPI code)in the Server Proxy Code.
    By the way i am using synchrnous call.
    Thanks,
    Srinivas

  • Data tranfer using bapi(lsmw)

    please explain the steps that are used to upload legacy data into sap using lsmw (bapi method)
    Message was edited by:
            neela renganathan

    Hi,
      is step by step process .
    Step-by-Step Guide for using BAPI in LSMW
    Note! The screen prints in this article are from ECC 5.0. They may differ slightly in other versions.
    Introduction:
    This document details the usage of BAPI in LSMW. We have used the example of migration of the purchase order data into SAP.
    Pre-requisites:
    It is assumed that the reader of this article has the minimum knowledge required on the Business Object, BAPI, Message Types and IDoc Types.
    Step-by-Step Procedure:
    Details of the BAPI used in this scenario:
    Business Object: BUS2012
    Method: CreateFromData
    Details of Message Type and Basic IDoc Type:
    Message Type: PORDCR
    Basic IDoc Type: PORDCR02
    Let’s have a look at the BAPI first, before proceeding to the LSMW:
    1. Go to Transaction BAPI
    2. Click on Search Button
    3. Enter the value “BUS2012” and select “Obj.type(Technical Object Name”
    4. Press ENTER
    5. Following screen appears:
    6. On the left side of the screen, Expand the “PurchaseOrder”.
    7. Select “PurchaseOrder” and double-click on the same for details.
    Building LSMW using BAPI:
    1. Go to Transaction LSMW.
    2. Enter the Project, Subproject and Object information and click on CREATE.
    3. Enter the descriptions for Project, Subproject and Object as prompted.
    4. Now select Settings à IDoc Inbound Processing
    5. “IDoc Inbound Processing” screen appears. Enter the required details as shown below:
    6. Click on “Activate IDoc Inbound Processing”.
    7. Click on “Yes” when prompted for “Activate IDoc Inbound?”
    8. Hit on “Back” to return to the main screen.
    9. Click on Continue (F8). Following Screen appears:
    10. Select the Step 1 “Maintain Object Attributes” and select “Execute”.
    11. Select the radio button “Business Object Method” and enter the following details:
    Business Object: BUS2012
    Method: CreateFromData
    Hit ENTER
    12. Save and click on BACK button. Following information message is displayed.
    13. Now select step 2 “Maintain Source Structures” and click “Execute”.
    14. In this step, we need to maintain the source structure. In our example, lets consider the example of a file with 2 structures Head and Item data as shown below:
    Click on Create and name the source structure as HEADERDATA. Now select HEADERDATA and click on “Create” again to create the child structure. Following popup appears:
    Select “Lower Level” and click on Continue. Enter the Item data structure name.
    Click Save and hit BACK button to go to the main screen.
    15. Select step 3 “Maintain Source Fields” and hit execute.
    16. Enter the fields as shown below:
    17. Click SAVE and return to main screen.
    18. Select step 4 “Maintain Structure Relations” and click Execute.
    Select E1PORDCR and click on CREATE RelationShip. Following screen appears:
    Select HEADERDATA and hit ENTER
    Similarly do the same for the structure E1BPEKKOA, E1BPEKPOC and E1BPPEKET.
    Click Save and return to main screen.
    19. Select the step “Maintain Field Mapping and Conversion Rules” and click on execute. Maintain the Field Mapping as seen below:
    20. Select step 7 “Maintain Source Files” and provide the link for the test file created. (Create a test file with the same structure as defined earlier).
    Save and return to main screen.
    21. Select the step “Assign Files” and click on Execute.
    Assign the file provided to the source structure. Here the same file is provided for both the structures.
    Save and return to the main screen.
    22. Select the step “Read Data” and click on Execute.
    Click on Execute.
    Return to the main screen.
    23. Select the step “Display read data” and click on execute.
    Click on the structure name to get the field level values.
    24. Return to main screen and now select “Convert Data”.
    25. Return to the main screen and select “Display Converted data”.
    26. Return to main screen and select “Start IDoc generation”.
    27. Now select the step “Start IDoc Processing” on the main screen.
    28. Return to main screen and click on “Create IDoc overview”. Here the data record and status records of the IDoc could be viewed:
    Please Go through these Links ,
    BAPI with LSMW
    http://esnips.com/doc/ef04c89f-f3a2-473c-beee-6db5bb3dbb0e/LSMW-with-BAPI
    For document on using BAPI with LSMW, I suggest you to visit:
    http://www.****************/Tutorials/LSMW/BAPIinLSMW/BL1.htm
    http://myweb.dal.ca/hchinni/sap/lsmw_home.htm
    http://sapabap.iespana.es/sapabap/manuales/pdf/lsmw.pdf
    Regards

  • BAPI or RFC for item level updation in BOM

    Hi ,
    I need to mass update the operation lead time offset in all the items in the BOM.
    First i am downloading the BOM components and its existign operation lead time offset in the form of excel file. Then i am modifying the excel file and the same is uploaded to update the operation lead time offset.
    I need a BAPI or RFC to update the item level details in the BOM. Please help.
    Thanks
    S.Srinivasan

    Hi,
    Please refer the below thread to find BAPI
    How to find related BAPIs
    You can also use tcode BAPI
    Message was edited by:
            Kannan S

  • Validation for a extension field in the BAPI ( BAPI_ACC_DOCUMENT_CHECK)

    Hi,
    I am working on an in terface for upload of data in journal ledger(FB50)
    Actually i need to validate a field which has been included in transaction FB50 as an enhancement based on customer need .
    a function module was created as suggested in note 487722 earlier but now we require to validate that field(transaction type) as i am using this BAPI in an interface for journal ledger posting FB50 for data validation of the file data.
    this field has been populated as a part of the extension parameter in the bapi -
    (( BAPI_ACC_DOCUMENT_CHECK)
    field values for this field have been passed in the business transaction.
    but i am not sure where to code the validation for this field .
    could anybody suggest if we need to do it in include ZXACCU15 .
    if so then how do we populate the values for the return parameter.
    i am post ing document using IDOC and need to generate the for the errors generated.
    it already shows for all the standard fields of the transaction.
    Its a bit urgent,
    help wud be appreciated
    jy

    Hello Jy
    The following coding shows how to evaluate the existence of the transaction type in table T856 and how to create the corresponding BAPI message (using function module <b>BALW_BAPIRETURN_GET2</b>):
    *& Report  ZUS_SDN_BAPIRETURN_GET2
    REPORT  zus_sdn_bapireturn_get2.
    START-OF-SELECTION.
      " Call BTE function within BAPI (actually OPEN_FI_PERFORM_RWBAPI01_P
      " calls the z-function module)
    **  CALL FUNCTION 'Z_FI_INTERFACE_RWBAPI01'
    **    TABLES
    **      c_accit           =
    **      c_acccr           =
    **      c_return          =
    **      c_extension       =
    **      c_accwt           =
    **    changing
    **      c_acchd           =
      " Coding within your BTE function module:
      DATA:
        ls_return    TYPE bapiret2.
    * transaction type
      READ TABLE it_accit INTO ls_accit
           WITH KEY posnr = ld_posnr.
      CHECK ( sy-subrc EQ 0 ).
      ld_tabix = sy-tabix.
      ls_accit-posnr = ld_posnr.
      ls_accit-rmvct = ls_bapi_extension-field3.
      MODIFY it_accit FROM ls_accit INDEX ld_tabix.
    " Validate existence of transaction type
      SELECT SINGLE * FROM  t856 into ls_t856
             WHERE  trtyp  = ls_accit-rmvct.
      if ( syst-subrc ne 0 ).
        " Note: the following IF condition looks apparently strange yet its primary
        "         use is to ensure that the Where-Used-List for message 014(GC)
        "         will find our function module
        if 1 = 2.  MESSAGE e014(gc) WITH ls_accit-rmvct.  endif.
    *   Transaction type & is not defined
        clear: ls_return.
        ls_return-message_v1 = ls_accit-rmvct.  " type conversion
        CALL FUNCTION 'BALW_BAPIRETURN_GET2'
          EXPORTING
            type             = 'E'
            cl               = 'GC'
            number           = '814'
            PAR1             = ls_return-message_v1
    *       PAR2             = ' '
    *       PAR3             = ' '
    *       PAR4             = ' '
    *       LOG_NO           = ' '
    *       LOG_MSG_NO       = ' '
    *       PARAMETER        = ' '
    *       ROW              = 0      " ld_tabix
    *       FIELD            = ' '    " RMVCT
          IMPORTING
            RETURN           = ls_return.
        APPEND ls_return TO c_return.
      ENDIF.
    END-OF-SELECTION.
    The advantage of using the function module over directly filling the BAPIRET2 message variable is that the function module generated the message text (field BAPIRET2-message = 'Transaction type '<type>' is not defined').
    Regards
      Uwe

  • IDoc object filter of BAPI

    Dear all,
       I want to add several fields in object filter of BD64, but there are some confusions due to I used a BAPI message type 'PROJECT'. It seems like different from normal message type. After i add items in BD59 for the message type 'PROJECT', i can not find these fields when i create filter group in BD64.
    Please give a guidance. Thanks a lot.

    Hi, thanks and still some puzzles. Normally I can config some fields in BD59 and when create a filter group in BD64 these fields will be shown one by one. But sometimes at last line a special part 'dependent on class membership' will be displayed, this logon seems like a table. I mean how to control this portion in BD59? Thanks.

  • How to tranfer IDOC and BAPI through LSMW

    Hi friends,
    I need documents regarding processing of IDOC and BAPi through LSMW,
    Thanks In advance,
    Regards,
    charan

    Hi
    LSMW-BAPI
    Step-by-Step Guide for using BAPI in LSMW
    Note! The screen prints in this article are from ECC 5.0. They may differ slightly in other versions.
    Introduction:
    This document details the usage of BAPI in LSMW. We have used the example of migration of the purchase order data into SAP.
    Pre-requisites:
    It is assumed that the reader of this article has the minimum knowledge required on the Business Object, BAPI, Message Types and IDoc Types.
    Step-by-Step Procedure:
    Details of the BAPI used in this scenario:
    Business Object: BUS2012
    Method: CreateFromData
    Details of Message Type and Basic IDoc Type:
    Message Type: PORDCR
    Basic IDoc Type: PORDCR02
    Let’s have a look at the BAPI first, before proceeding to the LSMW:
    1. Go to Transaction BAPI
    2. Click on Search Button
    3. Enter the value “BUS2012” and select “Obj.type(Technical Object Name”
    4. Press ENTER
    5. Following screen appears:
    6. On the left side of the screen, Expand the “PurchaseOrder”.
    7. Select “PurchaseOrder” and double-click on the same for details.
    Building LSMW using BAPI:
    1. Go to Transaction LSMW.
    2. Enter the Project, Subproject and Object information and click on CREATE.
    3. Enter the descriptions for Project, Subproject and Object.
    4. Now select Settings à IDoc Inbound Processing
    5. “IDoc Inbound Processing” screen appears. Enter the required details as shown below:
    6. Click on “Activate IDoc Inbound Processing”.
    7. Click on “Yes” when prompted for “Activate IDoc Inbound?”
    8. Hit on “Back” to return to the main screen.
    9. Click on Continue (F8). Following Screen appears:
    10. Select the Step 1 “Maintain Object Attributes” and select “Execute”.
    11. Select the radio button “Business Object Method” and enter the following details:
    Business Object: BUS2012
    Method: CreateFromData
    Hit ENTER
    12. Save and click on BACK button. Following information message is displayed.
    13. Now select step 2 “Maintain Source Structures” and click “Execute”.
    14. In this step, we need to maintain the source structure. In our example, lets consider the example of a file with 2 structures Head and Item data as shown below:
    Click on Create and name the source structure as HEADERDATA. Now select HEADERDATA and click on “Create” again to create the child structure. Following popup appears:
    Select “Lower Level” and click on Continue. Enter the Item data structure name.
    Click Save and hit BACK button to go to the main screen.
    15. Select step 3 “Maintain Source Fields” and hit execute.
    16. Enter the fields as shown below:
    17. Click SAVE and return to main screen.
    18. Select step 4 “Maintain Structure Relations” and click Execute.
    Select E1PORDCR and click on CREATE RelationShip. Following screen appears:
    Select HEADERDATA and hit ENTER
    Similarly do the same for the structure E1BPEKKOA, E1BPEKPOC and E1BPPEKET.
    Click Save and return to main screen.
    19. Select the step “Maintain Field Mapping and Conversion Rules” and click on execute. Maintain the Field Mapping as seen below:
    20. Select step 7 “Maintain Source Files” and provide the link for the test file created. (Create a test file with the same structure as defined earlier).
    Save and return to main screen.
    21. Select the step “Assign Files” and click on Execute.
    Assign the file provided to the source structure. Here the same file is provided for both the structures.
    Save and return to the main screen.
    22. Select the step “Read Data” and click on Execute.
    Click on Execute.
    Return to the main screen.
    23. Select the step “Display read data” and click on execute.
    Click on the structure name to get the field level values.
    24. Return to main screen and now select “Convert Data”.
    25. Return to the main screen and select “Display Converted data”.
    26. Return to main screen and select “Start IDoc generation”.
    27. Now select the step “Start IDoc Processing” on the main screen.
    28. Return to main screen and click on “Create IDoc overview”. Here the data record and status records of the IDoc could be viewed
    It is given in screen shot.
    http://www.****************
    LSMW-IDOC
    see this and do accordingly
    http://esnips.com/doc/1cd73c19-4263-42a4-9d6f-ac5487b0ebcb/LSMW-with-Idocs.ppt
    Go through the steps
    Hi please go through the following steps for IDOC method
    Step 1. Run the transaction ( /nlsmw ) you will reach to the screen
    Here you have to specify
    Project : 060_BUS_TRANS
    Subproject : SERVICE_TICKET
    Object : SRV_TICKET_ZSVT
    click on the execute button .you will reach the screen :
    The screen shows the 15 steps to Run the lsmw
    Step 2) select the first step ( Maintain object attributes) and click the execute button.After clicking on the execute button you will reach at. the screen
    Here you have to specify ( MEssage type and basic type)
    click on the BACK button
    Step 3) select the 2nd step ( Maintain source structures) and click the execute button
    Here you have to specify the source structures.
    Step 4) Select the 3rd step ( Maintain source fields) and click on the execute button :
    Here you have to specify the fields present in the source structure
    Step 5) select the 4th step ( Maintain structure relationship ) and click on the execute button :
    Here you have to specify relationship between source and target structures
    Step 6) select the 5th step ( Maintain field mapping ) and click on the exécute button :
    Here you have to map the fields between source and target structure. Also you have to apply conversion rules here if any
    STEP 7) select the 6th step and click on the exécute button
    Here you can define any fixed value or user define routines
    Step 8) select the 7th step ( Specify files) and click on the exécute button :
    At This screen we have to specify the files for This we should be in change mode .So please click on the button shown in the above screen. After clicking on This button you will be in change mode and will be able to specify the files :
    Step 9) select the 8th step ( Assign files) and click on the exécute button
    For assigning files yoy should be in change mode do the same thing click on the button as shown in the above screen :
    Then assign the files to different structures.
    Step 10 ) select the 9th step ( Read Data) and click on the exécute button :
    After clicking on the exécute button you will reach to the screen
    Again click on the exécute button . After clicking on the exécute button you will reach to the next screen
    Here you will see data is read.
    Step 11) select the 10th step ( Display read data) and click on the exécute button :
    Here you can see your test data present in test files assign to source sturcture
    Step 12 ) select the 11th step ( Convert data) and click on the exécute button :
    After clicking on the exécute button you will reach to the screen
    Click on the exécute button as shown on the : After click on the exécute button you will reach to the next screen
    Data is converted
    Step 12th ( Display converted data is same as Display read data )
    Step 13 ) select the 13th step ( Start idoc generation) and click on the exécute
    button :
    At this step Idoc is generated using converted data
    Step 14) select the 14th step ( Start idoc processing ) and click on the exécute button :
    After clicking on the exécute button you will reach to the screen :
    And then click on the exécute button : After clicking on the exécute button you will reach to the final processive screen
    If data is processed correctly you will see ( 53 Status message with green sign)
    http://esnips.com/doc/1cd73c19-4263-42a4-9d6f-ac5487b0ebcb/LSMW-with-Idocs.ppt
    http://esnips.com/doc/ef04c89f-f3a2-473c-beee-6db5bb3dbb0e/LSMW-with-BAPI.ppt
    Reward points for useful Answers
    Regards
    Anji

  • Methods of BAPI

    Does BAPI have any methods? Few askd me which method of BAPI did u use? I didnt get it what does it mean?

    Hi Prashanth,
    According to me, a BAPI is the method in itself. When you view a standard BO from SWO1 transaction and view the methods, you will see many of them are implemented using BAPIs. The methods with a green light alongside implies that. Basically a BAPI is a function module which is RFC enabled and is used to implemented methods of business objects or can be called independently.
    Hope this helps. Viewing SWO1 for e.g. BUS2012 will give u a good idea.
    Regards,
    Aditya
    p.s. The person that asked u the question might have meant Business Object instead of BAPI
    Message was edited by:
            Aditya Laud

  • LSMW : BAPI vs IDOC

    hi xperts
    In LSMW, given the choices between Idoc and BAPI,which processing method is good and why? And when to opt one of the methods?
    thkx
    Prabhu

    Hi
    See the links
    http://esnips.com/doc/1cd73c19-4263-42a4-9d6f-ac5487b0ebcb/LSMW-with-Idocs.ppt
    http://esnips.com/doc/ef04c89f-f3a2-473c-beee-6db5bb3dbb0e/LSMW-with-BAPI.ppt
    Step-by-Step Guide for using BAPI in LSMW
    Note! The screen prints in this article are from ECC 5.0. They may differ slightly in other versions.
    Introduction:
    This document details the usage of BAPI in LSMW. We have used the example of migration of the purchase order data into SAP.
    Pre-requisites:
    It is assumed that the reader of this article has the minimum knowledge required on the Business Object, BAPI, Message Types and IDoc Types.
    Step-by-Step Procedure:
    Details of the BAPI used in this scenario:
    Business Object: BUS2012
    Method: CreateFromData
    Details of Message Type and Basic IDoc Type:
    Message Type: PORDCR
    Basic IDoc Type: PORDCR02
    Let’s have a look at the BAPI first, before proceeding to the LSMW:
    1. Go to Transaction BAPI
    2. Click on Search Button
    3. Enter the value “BUS2012” and select “Obj.type(Technical Object Name”
    4. Press ENTER
    5. Following screen appears:
    6. On the left side of the screen, Expand the “PurchaseOrder”.
    7. Select “PurchaseOrder” and double-click on the same for details.
    Building LSMW using BAPI:
    1. Go to Transaction LSMW.
    2. Enter the Project, Subproject and Object information and click on CREATE.
    3. Enter the descriptions for Project, Subproject and Object.
    4. Now select Settings à IDoc Inbound Processing
    5. “IDoc Inbound Processing” screen appears. Enter the required details as shown below:
    6. Click on “Activate IDoc Inbound Processing”.
    7. Click on “Yes” when prompted for “Activate IDoc Inbound?”
    8. Hit on “Back” to return to the main screen.
    9. Click on Continue (F8). Following Screen appears:
    10. Select the Step 1 “Maintain Object Attributes” and select “Execute”.
    11. Select the radio button “Business Object Method” and enter the following details:
    Business Object: BUS2012
    Method: CreateFromData
    Hit ENTER
    12. Save and click on BACK button. Following information message is displayed.
    13. Now select step 2 “Maintain Source Structures” and click “Execute”.
    14. In this step, we need to maintain the source structure. In our example, lets consider the example of a file with 2 structures Head and Item data as shown below:
    Click on Create and name the source structure as HEADERDATA. Now select HEADERDATA and click on “Create” again to create the child structure. Following popup appears:
    Select “Lower Level” and click on Continue. Enter the Item data structure name.
    Click Save and hit BACK button to go to the main screen.
    15. Select step 3 “Maintain Source Fields” and hit execute.
    16. Enter the fields as shown below:
    17. Click SAVE and return to main screen.
    18. Select step 4 “Maintain Structure Relations” and click Execute.
    Select E1PORDCR and click on CREATE RelationShip. Following screen appears:
    Select HEADERDATA and hit ENTER
    Similarly do the same for the structure E1BPEKKOA, E1BPEKPOC and E1BPPEKET.
    Click Save and return to main screen.
    19. Select the step “Maintain Field Mapping and Conversion Rules” and click on execute. Maintain the Field Mapping as seen below:
    20. Select step 7 “Maintain Source Files” and provide the link for the test file created. (Create a test file with the same structure as defined earlier).
    Save and return to main screen.
    21. Select the step “Assign Files” and click on Execute.
    Assign the file provided to the source structure. Here the same file is provided for both the structures.
    Save and return to the main screen.
    22. Select the step “Read Data” and click on Execute.
    Click on Execute.
    Return to the main screen.
    23. Select the step “Display read data” and click on execute.
    Click on the structure name to get the field level values.
    24. Return to main screen and now select “Convert Data”.
    25. Return to the main screen and select “Display Converted data”.
    26. Return to main screen and select “Start IDoc generation”.
    27. Now select the step “Start IDoc Processing” on the main screen.
    28. Return to main screen and click on “Create IDoc overview”. Here the data record and status records of the IDoc could be viewed
    It is given in screen shot.
    http://www.****************
    Regards,
    Padmam.

Maybe you are looking for

  • Why is it not possible to attach more then one photo on email

    i tried to send several photos with the email app but there is no way... did I miss something? it works with gmail app but not with the Ipad. regards

  • Safe to use MacBook with lid closed?

    So my MacBook (early 2009) was in sleep mode when I put it on my desk, plugged it in, then plugged in my monitor. The monitor turned on and my desktop appeared, with the menu bar and dock on it. When I normally use a monitor with my MB, the MN screen

  • Export histogram to Excel

    Hi. I'm trying to export a histogram in LabView to Excel with the MS Office Report VI. However, when exported to excel the histogram doesn't show objects in bins. Rather, it displays the histogram as a continous graph. Please help! Pictures are attac

  • Stock Transport Order - Issuing Storage Location

    Hi gurus - When raising a Stock Transport Order (UB type) and Issuing Storage Location is populated manually with an SLoc not extended for material in supplying plant, will system give an error or allow STO to be saved/created without throwing an err

  • Digital Camera Raw Update

    TUAW reports there's a new update to support more digital cameras. I didn't see a thread here, so I thought I'd share in case some of you were waiting for support. Apple has released Digital Camera Raw Compatibility Update 3.1 via Software Update. Th