Hi i am working with bapi BAPI_ACTIVITYCRM_CREATEMULTI

hi,
i am working with BAPI_ACTIVITYCRM_CREATEMULTI this bapi create a activity and all the things are ok, but my problem is by using this bapi how can i handle attachment ple help me on this issue.
Regards,
Tanveer

Shravani28 wrote:
Thanks.
But this is not the solution.Your following description says that Rewriter IS the solution.
I have written many pattern satisfying different conditions. and this pattern will be one of them.
When I give any input ,it will iterate all the pattern loop and find out the exact pattern to which its getting matched.
There will be one specific format difined for each pattern in which we wanna a get string reformatted.
Suppose xyz matching pattern1 , its associated output format will be defined in some property file. it wil grab this and reformat the string.
If it doesn't match any pattern , it will give error message.
So like this way. my concern is to find out the spaces present in a string. It can be anyhwere.
Can I acheive this through regexpUsing Rewriter - yes!
Of course I could be misunderstanding your requirement. Maybe a few examples might clarify the problem.

Similar Messages

  • Performance issues with Bapi BAPI_MATERIAL_AVAILABILITY...

    Hello,
    I have a Z program to check ATP which is working with Bapi BAPI_MATERIAL_AVAILABILITY....
    As I am in the retail system we have performance issues with this bapi due the huge amount of articles in the system we need to calculate the ATP.
    any  way to  improve  the  performance?
    Thanks and best regards
    L

    The BAPI appears to execute for only one plant/material, etc., at a time, so I would have to concentrate on making data retrieval and post-bapi processing as efficient as possible.  In your trace output, how much of your overall time is consumed by the BAPI?  How much by the other code?  You might find improvements there...

  • Create automatically Activity (type E-Mail) with BAPI?

    Hello Experts,
    we have an requirement that we have to create automatically an activity of type E-Mail (for expample transaction type CX03) and then sent this E-Mail to an User which is outside of the company. It will be a contact person of the client we have.
    I think I can create the document (using the BAPI tables header, partner and texts). In header I will put the general data, in partner the parter-specific data and the E-Mail Adress) and in the texts table the text which will receive the contact person of the company.
    Now my questions are:
    1. Is it possible to create an E-Mail of transaction type CX03 with BAPI:  'BAPI_ACTIVITYCRM_CREATEMULTI'.
    2. Do I have to use the transaction SCOT to send this document of do I have to use Groupware?
    3. Why the document in Web-Client looks exactly like an E-Mail but in GUI the same transaction type looks like an
        normal Activity?
    4. To add texts i need to fill the BAPI Structure: BAPIBUS20001_TEXT_INS. The problem is, we need to write
        a welcome letter to our new clients. Is it possible to use this structure to put into the message to the clients and
        how?
    Please let me know which is the best strategy to implment that kind of functionality.
    Best Regards
    Oliver Schultze

    1. Is it possible to create an E-Mail of transaction type CX03 with BAPI: 'BAPI_ACTIVITYCRM_CREATEMULTI'.
    yes, it's possible.
    2. Do I have to use the transaction SCOT to send this document of do I have to use Groupware?
    This is done by scot.
    3. Why the document in Web-Client looks exactly like an E-Mail but in GUI the same transaction type looks like an
    normal Activity?
    because e-mail is activity which has category 401 (e-mail). in web ui they created new form type for e-mail and in sap gui not.
    4. To add texts i need to fill the BAPI Structure: BAPIBUS20001_TEXT_INS. The problem is, we need to write
    a welcome letter to our new clients. Is it possible to use this structure to put into the message to the clients and
    how?
    you would prbably have to use mail tempalte for that but i never tried this
    regards.

  • Reg: Mandatory fields updation with BAPI

    Hi..
    We are working on BDC using BAPI. In this if flat files contians only 4 fields and the mandatory fields in the application are seven then system needs to through error message. But with BAPI the program is updating the database without throwing error eventhough all mandatory fileds are not filled up with data.. Where exactly we need to do modifications to get error message when mandatory fields are not filled up with input.
    Regards

    Hi Verendra
    Sometimes the function modules/BAPI's used by SAP do a direct update on the database tables. In such scnearios the entries are created in the system even though if the mandatory entries are not filled.
    If the number of mandatory fields are small, then before the BAPI call,  check if all the mandatory fields are filled or not;throw error in case of empty fields & bypass the BAPI call.
    In case the mandatory fields are too high, then in that case, please use BDC recording to update the data.
    Regards
    Chetan
    PS:Reward points if you find this helpful.

  • Problem in lock Sales order create with BAPI BAPI_SALESORDER_CREATEFROMDAT2

    Hi All,
    i have the z program to create the sales order with reff  quotation in SD With BAPI BAPI_SALESORDER_CREATEFROMDAT2.
    this program will  excute every 30 mins .
    Problem: Some times if i excute the program in background it is taking morethan 30mins so second batch excution also gets starting to create the sales order for same quotation then it is creating 2 sales orders at atime with 1 quotation.
    here i am getting duplicate sales orders so i want to lock the creation of duplicate sales order.

    Some solutions
    - Just lock (ENQUEUE) any object at the start of the job(*), if not locked, you can exit or wait in a loop, will be released at end of job (use a _SCOPE '3' so commit work wont release the lock)
    -> This will insure the job runs only once at a time
    - Lock the quotation before calling the BAPI, will be released by the COMMIT_WORK (from where do you fetch the quotation, if it is a customer Z_table, you can use the lock object that you have surely created ?) (use a _scope '2')
    -> This will insure that at most one job will convert a quotation (i suppose you set a "done" flag or status  in the quotation record)
    Read [SAP Locks |http://help.sap.com/abapdocu_70/en/ABENSAP_LOCK.htm] if you are not familiar with the concept of lock in SAP.
    Regards,
    Raymond
    (*) E_TABLEE for table, E_TRDIR for program, anything not required by another process

  • Process flow with BAPIs

    Hi experts,
    as we will try to built the Travel management in SAP CE, we want to trigger the whole travel management flow with BAPIs.
    The following already works:
    - Creation of trip BAPI_TRIP_CREATE_FROM_DATA
    - Approval of trip via BAPI_TRIP_APPROVE
    But now I don't know how to proceed.
    As I've seen in PR05, the status has then be changed to settled.
    Afterwards it can be sent to FI via transaction  PRFI.
    And then the posting in FI can be done in PRRW.
    Is that flow correct?
    What are the BAPIs to use for that?
    Is it BAPI_ACC_TRAVEL_POST?
    DoI also need BAPI_PAYROLLTRAVELEXPNSESPOST?
    Could please somebody of you give me an example for calling those functions?
    Unfortunately you have to specify a lot of parameters and I don't find much about it on SDN.
    Is there a way to retrieve this data first using only personnel number and trip number?
    Thanks in advance!

    Hi Eddie,
    For settling and posting the travel cost into the system, you can use t-code - PREC, PRFI and PRRW.
    Best Regards,
    Raj

  • LSMW - Upload purchase contracts (ME31K) with BAPI

    I'm trying to upload some contracts from the legacy to SAP ECC 6.0 using LSMW.
    I've already worked with Direct Input and Batch Input record with LSMW but never with BAPI.
    I found business object BUS2014 / Message Type - PURCONTRACT_CREATE but I don't know how to continue the process. Could you give me some suggestions?
    Thanks in advance,
    Guiza

    Hi,
    I saw some examples but I'm still with the same problem. At step 4 Maintain Structure Relations I have this error: "No target structures could be found - Message no. /SAPDMC/LSMW_OBJ_030001".
    What could be?
    Step 1 - Business Object Method -
    BUS2014
    Method: Create
    Step 2 - I've create 2 structures
    Header and Item
    Step 3 - I associate the fields that I want to upload.
    I don't know but could the error be because the Idoc Inbound Processing?
    Thanks,
    Guiza

  • Anything wrong with Bapi of FB60

    Hi friends ,
    i m developing a prog with bapi of FB60 it always fire the error no 014
    i.e.
    FI/CO interface: Line item entered several times 
    i am feeding the data which is given below in the BAPI .
    Please help me if anybody has worked on this BAPI
    w_item = w_item + 1 .
       t_headerdata-COMP_CODE  = 'BAI' .
       t_headerdata-PSTNG_DATE  = sy-datum.
       t_headerdata-BUS_ACT = 'RFBU' .
       t_headerdata-USERNAME = sy-uname .
       t_headerdata-HEADER_TXT = 'ABCsk123' .
       t_headerdata-COMP_CODE = 'BAI' .
       t_headerdata-DOC_DATE = sy-datum .
       t_headerdata-PSTNG_DATE = sy-datum .
       t_headerdata-FISC_YEAR = '2007' .
       t_headerdata-DOC_TYPE = 'KG' .
       t_headerdata-REF_DOC_NO = 'ABCsk123' .
      append t_headerdata .
    t_currency-itemno_acc = w_item  .
    t_currency-CURRENCY = 'IDR' .
    t_currency-AMT_DOCCUR = '1000' .
    t_currency-curr_type = '00'.
    append t_currency .
    t_accntgl-ITEMNO_ACC = w_item .
    t_accntgl-GL_ACCOUNT = '0000619999' .
    t_accntgl-COMP_CODE = 'BAI' .
    t_accntgl-BUS_AREA = 'JA01' .
    t_accntgl-PLANT = 'JA01'  .
    t_accntgl-doc_type     = 'KG' .
    t_accntgl-FISC_YEAR = '2007' .
    t_accntgl-PSTNG_DATE  = sy-datum.
    append t_accntgl .
    t_ACCOUNTPAYABLE-ITEMNO_ACC = w_item .
    t_ACCOUNTPAYABLE-VENDOR_NO = '0000108521' .
    append t_ACCOUNTPAYABLE.

    I don't know if this will help or not:
    w_item = w_item + 1 .
    t_headerdata-comp_code = 'BAI' .
    t_headerdata-pstng_date = sy-datum.
    t_headerdata-bus_act = 'RFBU' .
    t_headerdata-username = sy-uname .
    t_headerdata-header_txt = 'ABCsk123' .
    t_headerdata-comp_code = 'BAI' .
    t_headerdata-doc_date = sy-datum .
    t_headerdata-pstng_date = sy-datum .
    t_headerdata-fisc_year = '2007' .
    t_headerdata-doc_type = 'KG' .
    t_headerdata-ref_doc_no = 'ABCsk123' .
    APPEND t_headerdata .
    t_currency-itemno_acc = w_item .
    t_currency-currency = 'IDR' .
    t_currency-amt_doccur = '1000' .
    t_currency-curr_type = '00'.
    APPEND t_currency .
    t_accntgl-itemno_acc = w_item .
    t_accntgl-gl_account = '0000619999' .
    t_accntgl-comp_code = 'BAI' .
    t_accntgl-bus_area = 'JA01' .
    t_accntgl-plant = 'JA01' .
    t_accntgl-doc_type = 'KG' .
    t_accntgl-fisc_year = '2007' .
    t_accntgl-pstng_date = sy-datum.
    APPEND t_accntgl .
    w_item = w_item + 1 .           "<============
    t_accountpayable-itemno_acc = w_item .
    t_accountpayable-vendor_no = '0000108521' .
    APPEND t_accountpayable
    Rob

  • Create a new routing with BAPI BAPI_ROUTING_CREATE via JCo

    I try to create a new routing with BAPI BAPI_ROUTING_CREATE via JCo.
    I filled all necessary parameters. I also realized a commit_work. I get in the RETURN parameter of the BAPI the Message "S 000 Routing N/50001641/01". But the routing isn't in the database. Other JCo programs I wrote (create material master or costumer order) are working very well.
    Have anyone an idea?
    Thanks Jörg
    Here's my coding:
    public void createArbeitsplan() {
              doLogin();
    //          connectionAttributes();
              Plan plan = new Plan();
              for (int i = 0; i < planList.size(); i++)
                   plan = (Plan) planList.get(i);
                   //Ein Function-Objekt erzeugen
                   String bapi = "BAPI_ROUTING_CREATE";
                   JCO.Function savePlan = null;          
                   try { savePlan = this.createFunction(bapi); }
                   catch(Exception ex) { ex.printStackTrace(); System.exit(1); }
                   if(savePlan == null) { System.err.println(bapi + " not found in SAP"); System.exit(1); }
                   //Import und Tabellen füllen
                   // Plankopf
                   JCO.Table headData = savePlan.getTableParameterList().getTable("TASK");
                   headData.appendRow();
                   headData.setValue(plan.kurztext,"DESCRIPTION");
                   headData.setValue("1","TASK_LIST_USAGE");
                   headData.setValue(werks,"PLANT");
                   headData.setValue("4","TASK_LIST_STATUS");
                   headData.setValue("ST","TASK_MEASURE_UNIT");
                   headData.setValue("001","RESP_PLANNER_GROUP");
                   headData.setValue("20070101","VALID_FROM");
                   headData.setValue("20991231","VALID_TO_DATE");
                   headData.setValue("1","LOT_SIZE_FROM");
                   headData.setValue("99999999","LOT_SIZE_TO");
                   // Materialzuordnung
                   JCO.Table materialAlloc = savePlan.getTableParameterList().getTable("MATERIALTASKALLOCATION");
                   materialAlloc.appendRow();
                   materialAlloc.setValue(plan.material,"MATERIAL");
                   materialAlloc.setValue(werks,"PLANT");
                   materialAlloc.setValue("20070101","VALID_FROM");
                   materialAlloc.setValue("20991231","VALID_TO_DATE");
                   materialAlloc.setValue("1","GROUP_COUNTER");
                   // Vorgänge
                   JCO.Table operationData = savePlan.getTableParameterList().getTable("OPERATION");
                   for (int j = 0; j < plan.getAnzahl(); j++) {
                        operationData.appendRow();
                        operationData.setValue(plan.getVorgang(j).vorgang,"ACTIVITY");
                        operationData.setValue(plan.getVorgang(j).steuschl,"CONTROL_KEY");
                        operationData.setValue(plan.getVorgang(j).arbplatz,"WORK_CNTR");
                        operationData.setValue("1111","WORK_CNTR");
                        operationData.setValue(plan.getVorgang(j).text,"DESCRIPTION");
                        operationData.setValue(plan.getVorgang(j).basismenge,"BASE_QUANTITY");
                        operationData.setValue(plan.getVorgang(j).vw1,"STD_VALUE_01");
                        operationData.setValue(plan.getVorgang(j).vw2,"STD_VALUE_02");
                        operationData.setValue(plan.getVorgang(j).vw3,"STD_VALUE_03");
                        operationData.setValue(plan.getVorgang(j).ze1,"STD_UNIT_01");
                        operationData.setValue(plan.getVorgang(j).ze2,"STD_UNIT_02");
                        operationData.setValue(plan.getVorgang(j).ze3,"STD_UNIT_03");
                        operationData.setValue("1","DENOMINATOR");
                        operationData.setValue("1","NOMINATOR");
                        operationData.setValue("20070101","VALID_FROM");
                        operationData.setValue("20991231","VALID_TO_DATE");
                        operationData.setValue("ST","OPERATION_MEASURE_UNIT");
                   // Testflag
                   JCO.Structure test = savePlan.getImportParameterList().getStructure("TESTRUN");
                   test.setValue(" ","BAPIFLAG");
                   //BAPI ausführen (incl. Commit)
                   mConnection.execute(savePlan);
                   JCO.Function commit = null;
                   try {commit = this.createFunction("BAPI_TRANSACTION_COMMIT"); }
                   catch (Exception ex) { ex.printStackTrace();System.exit(1); }
                   JCO.ParameterList input = commit.getImportParameterList();
                   input.setValue("X","WAIT");
                   mConnection.execute(commit);
                   //Messages vom SAP-System holen
                   JCO.Table jcoReturn = savePlan.getTableParameterList().getTable("RETURN");
                   for (int k = 0; k < jcoReturn.getNumRows(); k++)
                        jcoReturn.setRow(i);
    //                    System.out.println(jcoReturn.getField("MESSAGE").getValue());
                        System.out.println(jcoReturn.getField("TYPE").getValue());
                        System.out.println(jcoReturn.getField("NUMBER").getValue());
                        System.out.println(jcoReturn.getField("MESSAGE_V1").getValue());
                        System.out.println(jcoReturn.getField("MESSAGE_V2").getValue());
                        System.out.println(jcoReturn.getField("MESSAGE_V3").getValue());
                        System.out.println(jcoReturn.getField("MESSAGE_V4").getValue());
                   JCO.Structure output = commit.getExportParameterList().getStructure("RETURN");;
                   System.out.println(output.getString("MESSAGE"));
                   System.out.println(output.getString("TYPE"));
                   System.out.println(output.getString("NUMBER"));
                   System.out.println(output.getString("MESSAGE_V1"));
              closeConnectionToSAP();
              System.exit(1);

    Hi,
    perhaps you could use
    BAPI_HRMASTER_SAVE_REPL_MULT
    Regards
    Bernd

  • Why BDC when we can do the same with Bapi's

    Hiii
    Plz tell me why BDC when we can do the same with Bapi...
    plz list out the differences clearly
    Thanks & Regards
    krishna

    If the same functionality can be achieved by BAPI then we generally go for BAPI instead of BDC. The main reason is that the screen no can change in the next version and in that case the BDC code will not work. But if no BAPI is available then we go for BDC.
    Sometimes we need to handle a large amount of data in BDC/BAPI in which it is not preferable to use 'CALL TRANSACTION' command. If the corresponding BAPI internally use 'CALL TRANSACTION'  command. Then instead of that BAPI we create a BDC with SESSION METHOD.
    Ex: IDOC_INPUT_ORDERS internally use CALL TRANSACTION. So if we need to use a large amount of data we create a BDC with session method instead of using IDOC_INPUT_ORDERS.

  • Help - Problem with BAPI confirmation (co11n)

    Hi gurus,
    Please , i need some help with some problems i am having with BAPIs for confirmations.
    I have found this one : BAPI_PRODORDCONF_GET_TT_PROP, to get the propose data, but i i can't figured out how to fill the goodmovements table. I need to do this, because i want to know the proposal of goodmovements, just exactly that sap's does when i enter to the tx CO11N, enter the YIELD quantity and then press "goods movements" button.
    Please, is there some trick or something to make this work? ( i have already put "X" in the import "PROPOSE - GOODMOVEMENTS" , but still is not working).
    If get this, i could put this values in BAPI_PRODORDCONF_CREATE_TT and that's it... i suppose.
    Please help me
    Thanks a lot!

    Hi ,
    Before going into BAPI's , Auto goods movement happens in two ways.
    1. check whether Auto goods receipt is checked in T.code OPKP.
    2. The other way is to assign a Control Key to the operation which has a Auto GR checked.
    Please check these two and then trigger confirmation using your BAPI.
    Hope this helps.
    Best Regards.

  • Engineering change management working with parameter effectivity

    In Engineering change management
    i have activated parameter effectivity &
    defined parameter profile for DATE,SERNR,Kombi1-Customer(combination of Date & Customer name- Kunnr) in IMG settings
    i am able to work with Date & SERNR But when i choose kombi1
    i am getting the following error message
    "No entries in database for object KUNDE_LO table AEEF"
    i checked with table AEEF thier is no field KUNDE_LO
    How to customize effectivity type Customer
    is there any thing i have missed ....

    Hi Srinivas,
    KUNDE_LO is a data element , what ever kombi1 is defined i think that does not have any values maintained in the system.
    or
    Check whether any user exits or BAPI's used bringing the customer specifications.
    You can also check the data element existence u might have done that .....
    Reward if useful
    Thanks,

  • From dialog user to service user & BAPI BAPI_ACTIVITYCRM_CREATEMULTI

    Hello all,
    I have a question. When being a<b> dialog</b> user, running the fm BAPI BAPI_ACTIVITYCRM_CREATEMULTI creates no problems. E.g., the number of partners added to the activity is correctly stored in the internal table. However, since I want to prevent that I have to update the password every x days, I want to use a <b>system</b> or <b>service</b> type of user.
    The problem now is that the function modules returns with an <b>error</b>. Because a certain partner now is NOT added/available anymore.
    To sum, running the fm with dialog user gives a good, desired result. Chaning the user the system gives an erroneous result.
    What changes do I have to make so that it correctly adds the desired partner type to my activity?
    Mehmet

    Thanks RENE for your answer.
    The problem is solved, it seems that i was passing fields that i didn´t have to pass, so instead of passing all the fields of the partner, now i just pass:
      wa_partner_bapi-ref_guid
      wa_partner_bapi-ref_kind
      wa_partner_bapi-partner_no
      wa_partner_bapi-partner_fct
      wa_partner_bapi-ref_partner_handle
      wa_partner_bapi-no_type
      wa_partner_bapi-display_tyype
    Regards,
    Filipe

  • Steps to work with LSMW

    Hi all,
    Please guid me how to work on LSMW using BAPIs.If any of u have an example please explain me step by step process and also where we can do the validation part.If any of you have any material forward to my mail .
    [email protected]
    Regards
    Pavan

    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

  • Issue with BAPI & Commit

    Dear All,
    I have been working with an assignment and facing a strange issue.
    I have used the 'BAPI_SALESORDER_CHANGE' to modify sales order and then I call 'BAPI_TRANSACTION_COMMIT' with wait = X. So, this bapi modifies the sales order schedule lines and also in turn updates the info structure linked to it (In our case, say it is S800)
    Immediately after this I have a select statement on S800 to fetch the records.
    On debug, if I break at select statement, I get correct records from S800  but If i break one step after select it gives me different records.
    I think there is some delay in updation of infostructure, hence, If i use wait statement before select for 1 sec, it works fine, but cause performance issues.
    for over 15000 order items, it will wait for around 8 hours, hence, i would like to know is there any way I can avoid wait and also read the infostructure for correct records.
    << Moderator message - Everyone's problem is important. Please do not ask for help quickly. >>
    Edited by: Rob Burbank on Feb 24, 2011 9:45 PM

    Hi Chandanrs,
    with COMMIT WORK (or BAPI_TRANSACTION_COMMIT) with WAIT addition, processing is continued after all high-priority ("VB1") update function modules are executed in the order of their registration and in a shared database LUW.
    That means that the info structures are probably updated in low-priority ("VB2") update.
    I never faced this situation but I think that the info structure should still be locked. Try to find the corresponding lock object, in a (test) run, locks may be visible shortly in SM12 lock overview.
    If possible, after commit work, try to call the enqueue function with the same arguments as it is done within the BAPI processing. You should get a foreign lock error until the end of the second level update process.
    while lv_locked is initial.
      call function 'ENQUEUE...
      IF sy-subrc = 0.
        lv_locked = 'X'.
      endif.
    endwhile.
      call function 'DEQUEUE...
      clear lv_locked.
    This lets your program wait until the info structure update is complete. Sorry I do not really know which lock object is used here. Anyway, I still do not know why you have to read the S900 directly after update.
    You may also process all orders to the to set the order quantity to delivered qty, COMMIT every 1000 or so orders, put the original quantity to internal table. Then do the same for restoring.
    BAPI processes run a great deal faster if you do not COMMIT after every single document. But you can't take too many because than you risk a lock table overflow.
    Hope it is some help anyway.
    Regards,
    Clemens

Maybe you are looking for