Confirm PO updated in table before GR

Hi All,
I have program to create PO via BAPI_PO_CREATE and followed by BAPI_GOODSMVT_CREATE to do GR.
When there is little PO line items, after PO created, no problem in create material document through BAPI_GOODSMVT_CREATE  but when PO line items alot (50 ~ 200 lines), even after PO created, BAPI_GOODSMVT_CREATE has error in create GR.
Currently I use key word wait up to few seconds in do loop before BAPI_GOODSMVT_CREATE but i think in the loop to check total line items created in table is more secured.
May I know what table I need to check to confirm all PO line item added in table and PO number created in table then only I proceed with BAPI_GOODSMVT_CREATE.
Thanks
Rgds

Hello,
PO line table is EKPO. But you may try the following:
After PO is created through BAPI_PO_CREATE, you should make a synchronous commit (COMMIT WORK AND WAIT) before calling BAPI_GOODSMVT_CREATE.  This ensures PO has been saved before proceeding to make Goods Receipt.
Thanks,
Venu

Similar Messages

  • BAPI for Purchase Order Confirmation and update EKES table

    Hi all,
    I have a requirement to update the PO confirmation soon after successful creation of PO in an IDOC.
    I have used BAPI_PO_CHANGE function module which didnt serve the purpose as it cannot update confirmations.
    I tried using ME_CONFIRMATION_UPDATE where I was able to add a confirmation entry in EKES table but that is not being reflected in ME23N transaction when I display the PO.
    Please help me out on this.
    Thanks & Regards
    Pavan

    NB: Never use a standard update FM (check attributes of ME_CONFIRMATION_UPDATE) its often only a SQL statement collector without any check, logging of changes or database consistency, if you perform a where-used you should find it is never called alone but with a bunch of other update FM after checks and other update preparation.
    Get back to the BAPI and table parameter POCONFIRMATION, also use BAPI_PO_GETDETAIL1 to get current data for the call of BAPI_PO_CHANGE.
    Regards,
    Raymond
    PS: If it is not in 197958 - BAPIs for purchase orders: Missing functions, you should be able to do it

  • Transfer Order Confirmation not updated in Header level (Table: LTAK)

    Hi,
        We are facing a problem, transfer order header is not updated with confirmation, but TO items are confirmed and resulting these transfer order to display in RF monitor (LRF1 and LRF2 transactions).
    And the other issue is, we are seeing some transfer orders created without item data (in LTAP table) and unable to confirm these TOs since Item data is not available, hence TO header is not updated with confirmation and resulting these TOs to display in LRF1 and LRF2 report.
    I have cleared some transfer orders by updating the confirmation field in LTAK table through debugging. But we see the issue is ongoing and would like to have permanent solution.
    It will be a great help if anyone have solution to these issues.
    Thanks & Regards,
    Nagarjun

    Hi Nagarjun,
    do you have any Z code in-between ?  Did you check OSS notes ?  Did you apply all patches to your system ?
    What you are describing is something usual when Z programs were developed, you should provide more details for analysis.
    Many thanks,
    Enrico

  • How to lock a database Z table before updating it through a report program

    Hi,
    How to lock a database Z table before updating it through a report program and also how to unlock it after my updation.
    The whole process is done through report program.

    Hi,
    Go to SE11, in the option 'Lock object' enter the name of your lock,
    begin with 'E', suppose 'EXXXX' And create. In tab 'Tables' fill the
    table name where the record you want to lock exist and select the
    lock mode. Lock mode can be shared and exclusive. If 'shared',
    when you lock the record, other can also read data, but can not
    modify. If 'exclusive', when you lock the record, other can neither
    read nor modify the record. After save and activate, you will get two
    function module.'ENQUEUE_EXXXX' to lock record,
    'DEQUEUE_EXXXX' to release lock on one record.
    When use this function module it only lock one record at a time. It
    does not lock the table.
    Regards,
    Omkaram.

  • Check before update in table

    Hi Guru's,
    I am a new developper in abap. I have a question concerning the check before the update in a table.
    I uploaded a csv file by the function module GUI_DOWNLOAD but now before to do the update I have to check if the correct value for the controlling area and profit centre are used .
    I don't know where do my test.
    Anyone can help me?
    Regards,
    Mohamed.
    UPDATE
    -          fill table --> check all values of the file and if one error stop processing and do not update anything in the table
    -          check if controlling area is correct
    -          check if profit center is correct
      LOOP AT it_datatab INTO wa_datatab.
        split wa_datatab at ';'  into
                          wa_cepc_segm-KOKRS
                          wa_cepc_segm-PRCTR
                          wa_cepc_segm-DATBI
                          wa_cepc_segm-DATAB
                          wa_cepc_segm-SEGMENT.
        APPEND i_cepc.
        CLEAR i_cepc.
      ENDLOOP.
      END-OF-SELECTION.

    Hi,
    Updating a database table
    Single-line updates
    SELECT * FROM TABLE
    COLUMN-UPDATE STATEMENT
    UPDATE TABLE
    ENDSELECT
    Column updates
    UPDATE TABLE SET COLUMN-UPDATE STATEMENT
    Regards

  • Enqueue and Dequeue before updating Database table

    Hi all,
    We are updating database tables using INSERT, MODIFY and UPDATE statements. Since many people will be running the application at the same time we need to lock the table before updating database table. So we need to use ENQUEUE and DEQUEUE functionality for this purpose.
    Can any plz explain what are the steps we should follow now?
    Thanks in advance.

    Hi,
    Any Database access should carefully handled as multiple applications may be accessing the database at the same time. To read a record from the database you don't need to implement a lock, but to write you need not only locks but also ideally should use the Update Function Modules to comply SAP "All or Nothing" Principle. This will prevent data inconsistency of the database and the data will be proper state. You need to use the COMMIT WORK and ROLLBACK WORK in you code to handle the consistency part of the database.
    The best design approach would be seperate the Database Layer completely from the business layers. This will make your code robust and easy to maintain.
    As, for the Locking Concepts, you will get multiple resources from SDN as how to create Locks and implement the Locking modules in your code. But more than that what matters is why and how to implement the SAP Locking concepts to make your application run better.
    Have a look at the following link
    http://help.sap.com/saphelp_nw70/helpdata/en/cf/21eea5446011d189700000e8322d00/content.htm
    Hope this helps.
    Thanks,
    Samantak.

  • URGENT  update a table with a text that has a single quote in it

    Hello, I am trying to update a table with a text that has a single quote in it. I believe I need to use two singles quotes but I am not sure how.
    For example:
    UPDATE TEST
    SET DESCRLONG='Aux fins d'exportations'
    WHERE etc...
    Should I put 2 singles quotes before the quote in the text?
    UPDATE TEST
    SET DESCRLONG='Aux fins d'''exportations'
    WHERE etc...
    Thank you very much :)

    The best way depends on the version of Oracle.
    But, the quick and universal answer is to use two single quotes
    SQL> connect test/test
    Connected.
    SQL> create table test (descrlong varchar2(128));
    Table created.
    SQL> insert into test values ('This is a string with a '' single quote');
    1 row created.
    SQL> select * from test;
    DESCRLONG
    This is a string with a ' single quote
    SQL> update test set descrlong='Aux fins d''exportations'
      2  where descrlong like 'T%';
    1 row updated.
    SQL> select * from test;
    DESCRLONG
    Aux fins d'exportations
    SQL>                                             

  • How to use one form to update two tables

    How can I do that? HTMLDB wizard or form on table doesn't give me an option to use more than one table in a form or I don't know about it. I created new process which redirects the form to another page after submitting the form. On the second page I created new process which uses the same variables from the previous form page. This process runs on page load before header but it is just not working right.
    So, what is the proper way to update two tables with the same form fields?

    Hello Vikas,
    "The Automatic Row Fetch and Automatic DML processes are a pair, you can't have one without the other."
    Are you sure about that? I have a page, which populate some of the items from TableA, using manual select statement, and after the user input, save some of it in TableB, using Automatic DML. No ARF in this process and it seems to work just fine. Come to think of it, what about a simple form, populated entirely by the user input, and then being saved to the db, using Automatic DML? No ARF here also.
    For the problem in hand, if you can't have more then one Automatic DML per page, I think that the simplest solution will be to define a pl/sql process, with two INSERT statement to the two different tables.
    Regards,
    Arie.

  • Getting "JTA transaction is not present" error while updating db table.

    Hi All,
    In one of my BPEL process, In a loop, I am updating value of database column Flag from 0 to 1. It was working fine in dev environment, but failed in Prod with below errors, Can Any one suggest on this.
    There is a system exception while performing the BPEL instance, the reason is "JTA transaction is not present or the transaction is not in active state. The current JTA transaction is not present or it is not in active state when processing activity or instance "1020112-BpInv7-BpSeq14.87-2". The reason is The execution of this instance "1020112-BpInv7-BpSeq14.87-2" for process "UpdateOrderReqABCS" is supposed to be in a jta transaction, but the transaction is not present or in active state, please turn on the application server transaction debug logs to get more information.. Please consult your administrator regarding this error. ". Please check the error log file for more infromation. Please try to use bpel fault handlers to catch the faults in your bpel process. If this is a system exception, please report this to your system administrator. Administrator could perform manual recovery of the instance from last non-idempotent activity or dehydration point.
    OPMN logs:
    <2010-05-05 01:56:49,395> <ERROR> <gemptp.collaxa.cube.engine> The execution of this instance "1020112-BpInv7-BpSeq14.87-2" for process "UpdateOrderReqABCS" is supposed to be in a jta transaction, but the transaction is not present or in active state, please turn on the application server transaction debug logs to get more information.
    The current JTA transaction is not present or it is not in active state when processing activity or instance "1020112-BpInv7-BpSeq14.87-2". The reason is The execution of this instance "1020112-BpInv7-BpSeq14.87-2" for process "UpdateOrderReqABCS" is supposed to be in a jta transaction, but the transaction is not present or in active state, please turn on the application server transaction debug logs to get more information..
    The current JTA transaction is not present or it is not in active state when processing activity or instance "1020112-BpInv7-BpSeq14.87-2". The reason is The execution of this instance "1020112-BpInv7-BpSeq14.87-2" for process "UpdateOrderReqABCS" is supposed to be in a jta transaction, but the transaction is not present or in active state, please turn on the application server transaction debug logs to get more information..
    The current JTA transaction is not present or it is not in active state when processing activity or instance "1020112-BpInv7-BpSeq14.87-2". The reason is The execution of this instance "1020112-BpInv7-BpSeq14.87-2" for process "UpdateOrderReqABCS" is supposed to be in a jta transaction, but the transaction is not present or in active state, please turn on the application server transaction debug logs to get more information..
    Thanks in advance.

    I can envisage this happening only in a case where the update is taking a longer time than the value of JTA transaction timeout.
    Is this happening for all BPEL instances or some of them get thru succesfully ?
    Are you EVER updating that particular row of your table ( before/after) ?
    -Shishir

  • Can't update master table when creating a materialized view log.

    Hi all,
    I am facing a very strange issue when trying to update a table on which I have created a materialized view log (to enable downstream fast refresh of MV's). The database I am working on is 10.2.0.4. Here is my issue:
    1. I can successfully update (via merge) a dimension table, call it TABLEA, with 100k updates. However when I create a materialized view log on TABLEA the merge statement hangs (I killed the query after leaving it to run for 8 hrs!). TABLEA has 11m records and has a number of indexes (bitmaps and btree) and constraints on it.
    2. I then create a copy of TABLEA, call it TABLEB and re-created all the indexes and constraints that exist on TABLEA. I created a materialzied view log on TABLEB and ran the same update....the merge completed in under 5min!
    The only difference between TABLEA and TABLEB is that the dimension TABLEA is referenced by a number of FACT tables (by FKs on the FACTS) however this surely should not cause a problem. I don't understand why the merge on TABLEA is not completing...even though it works fine on its copy TABLEB? I have tried rebuilding the indexes on TABLEA but this did not work.
    Any help or ideas on this would be most appreciated.
    Kind Regards
    Mitesh
    email: [email protected]

    Thats what I thought, the MVL will only read data that has changed since it was created and wont have the option to load in all the data as though it was made before the table was created.
    From what I have read, the MVL is quicker than a Trigger and I have some free code that prooved to work from a MVL using it as a reference to know what records to update. There is not that much to a MVL, a record ID and type of update, New, Update or Delete.
    I think what I will have to do is work on a the same principle for the MVL but use a Trigger as this way we can do a full reload if required at any point.
    Many thanks for your help.

  • API to update ap_invoices_all table

    Hello all,
    is there any API to update ap_invoices_all table? Please let me know.
    thanks,

    Oracle uses AP_INVOICES_PKG API (Update_Row procedure) internally, but I believe you cannot use this API directly -- http://etrm.oracle.com/pls/et1211d9/etrm_pnav.show_object?c_name=AP_INVOICES_PKG&c_owner=APPS&c_type=PACKAGE
    Please log a SR to confirm this with Oracle Support.
    Thanks,
    Hussein

  • Not Updating Customized Table when System having Performance Issue

    Hi,
    This is actually the same topic as "Not Updating Customized Table when System having Performance Issue" which is posted last December by Leonard Tan regarding the user exit EXIT_SAPLMBMB_001.
    Recently we changed the program function module z_mm_save_hide_qty to update task. However this causes more data not updated. Hence we put back the old version (without the update task).  But now it is not working as it used to be (e.g. version 1 - 10 records not updated, version 2 with update task - 20 records not updated, back to version 1 - 20 records not updated).
    I tried debugging the program, however whenever I debugged, there is nothing wrong and the data is updated correctly.
    Please advise if anyone has any idea why is this happening. Many thanks.
    Regards,
    Janet

    Hi Janet,
    you are right. This is a basic rule not to do any COMMIT or RFC calls in a user exit.
    Have a look at SAP note 92550. Here they say that exit EXIT_SAPLMBMB_001 is called in the update routine MB_POST_DOCUMENT. And this routine is already called in UPDATE TASK from  FUNCTION 'MB_UPDATE_TASKS' IN UPDATE TASK.
    SAP also tells us not to do any updates on SAP system tables like MBEW, MARD, MSEG.
    Before the exit is called, now they call 'MB_DOCUMENT_BADI' with methods MB_DOCUMENT_BEFORE_UPDATE and MB_DOCUMENT_UPDATE. Possibly you have more success implementing the BADI.
    I don't know your situation and goal so this is all I can tell you now.
    Good luck!
    Regards,
    Clemens

  • GenericSoapPort updating DB tables

    Hello! I need to design/implement the following: We are setting up SOA workflows for our Document Management system, and during the workflow actions, SOA will need to directly update UCM tables with the history of actions that users will do on the documents: for example, if the document is Approved, Moved on to the next Approver,  at what time, and the other information.  The general explanation - SOA needs to write the history of what had happened into our UCM/ECM Database. For this, I am thinking to use GenericSoapPort, which will then use the custom UCM service that will trigger the custom Query which will update the tables. Do you think the above is fine? If yes, can you please help with flashing out the details of the custom service and the custom query? For example, here is my custom service:
    <tr>
      <td>EUM_WORKFLOW_UPDATE_ACTIONS</td>
      <td>Service
      3
      null
      null
      null<br>
      null</td>
      <td>2:IdocHistory:::null</td>
    </tr>
    And here is the query:
    <tr>
      <td>IEumWorkflowActions</td>
      <td>NSERT INTO EUM_WORKFLOW_ACTIONS(WORKFLOWACTION, WKFACTIONDATE)
      values("Approve", "20-SEP-13")</td>
      <td></td>
    </tr>
    Something is NOT working correctly - the logs say it is the query syntax, however the message is very general.
    When I try to test the service via EM console, I use this XML to test the service:
    <soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
      <soap:Body xmlns:ns1="http://www.oracle.com/UCM">
        <ns1:GenericRequest webKey="cs">
          <ns1:Service IdcService="EUM_WORKFLOW_UPDATE_ACTIONS">
            <ns1:User></ns1:User>
            <ns1:Document>
            </ns1:Document>
          </ns1:Service>
        </ns1:GenericRequest>
      </soap:Body>
    </soap:Envelope>
    Any thoughts on the above constructs? Perhaps I need to pass some parameters? Thank you for your help! Anya

    Anya,
    first of all, there is a typo: NSERT INTO EUM_WORKFLOW_ACTIONS(WORKFLOWACTION, WKFACTIONDATE)  values("Approve", "20-SEP-13") is missing "I"
    Before you call the service via SOAP, you can do it directly in UCM via ...cs/idcplg?IdcService=EUM_WORKFLOW_UPDATE_ACTIONS
    Finally, I don't quite get the purpose of this exercise:
    a) the service will always insert the same values (I guess this will change in the future)
    b) who, or which program will read the values from the table? Note that you have the full history available in SOA, and now, you are copying a part of it to the UCM database. Why don't you allow UCM users, if they need this information, to get data directly from SOA?

  • Updating internal table with CSV file

    I have a flat file as below:
    aaaa, bbbb, asdc, dfgfhg, sdfsg, sdf, sdf, sdf, dfg, sdf, sgf, drgftfgh, sgf, drgtf, swftgd, sgf,
    'sjhdfjhf','2003-10-11 07:52:37','167','alkjd',NULL,NULL,NULL,NULL,NULL,'MX1',NULL,NULL,'dkjffdj ,',NULL,NULL,NULL,'1',NULL,NULL,'AR, dfkj ',
    Where we can see it is separated by commas.I want to upload this one into onr internal table.I used GUI_UPLOAD and gave the logic as folows:
    TYPES: BEGIN OF ttab,
    rec(1000) TYPE c,
    END OF ttab.
    TYPES: BEGIN OF tdat,
    aaaa type char10
    bbbb type char10,
    asdc  type char10,
    dfgfhg  type char10,
    sdfsg  type char10,
    sdf  type char10,
    sdf  type char10,
    sdf  type char10,
    dfg   type char10,
    sdf    type char10,
    sgf  type char10,
    drgftfgh  type char10,
    sgf  type char10,
    drgtf  type char10,
    swftgd  type char10,
    sgf  type char10,
    END OF tdat.
    DATA: itab TYPE TABLE OF ttab WITH HEADER LINE.
    DATA: idat TYPE TABLE OF tdat WITH HEADER LINE.
    DATA: file_str TYPE string.
    PARAMETERS: p_file TYPE localfile.
    AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_file.
    CALL FUNCTION 'KD_GET_FILENAME_ON_F4'
    EXPORTING
    static = 'X'
    CHANGING
    file_name = p_file.
    START-OF-SELECTION.
    file_str = p_file.
    CALL FUNCTION 'GUI_UPLOAD'
    EXPORTING
    filename = file_str
    TABLES
    data_tab = itab
    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.
    LOOP AT itab.
    CLEAR idat.
    SPLIT itab-rec AT ',' INTO idat-aaaa
    idat-bbbb ,
    idat-asdc  ,
    idat-dfgfhg  ,
    idat-sdfsg  ,
    idat-sdf  ,
    idat-sdf  ,
    idat-sdf  ,
    idat-dfg   ,
    idat-sdf    ,
    idat-sgf  ,
    idat-drgftfgh  ,
    idat-sgf  ,
    idat-drgtf  ,
    idat-swftgd  ,
    idat-sgf  ,
    APPEND idat.
    ENDLOOP.
    Now the issue is when I use the statement SPLIT itab-rec AT ',' this is not updating the table idat properly.Because the flat file contains the value as 'dkjffdj ,', too.
    Can anyone give me some solution to update the internal table.

    hI
    or you delete ' from csv file before uploading it or after uploading it, in this last case u can use statament replace:
    REPLACE ''' WITH SPACE INTO ITAB-FIELD.
    Max

  • PL/SQL Trying to update a table through trigger on the same table

    Hi everyone my name is Edwin and I'm new to this forum. I hope I can learn a lot from this community and over time contribute to it.
    The problem I'm facing at the moment is a tough one. I need to update a table (table a) with a value called block_id. This block_id is generated by a procedure I have written myself, the end result is stored in another table (table b). This block_id needs to be generated after certain rows of table a get updated with a trans_id. The trans_id is all the same for these rows in table a, but the generated block_id isn't. In my code I use an after update on collumn a of table a trigger. So if the the collumn gets updated the trigger fires. The trigger calls the procedure that generates the block_id and the procedure generates table b with all the block_id's. But then I want to update the rows in table a with the generated block_id in table b. The problem is that this self-deadlocks.
    You might think that this would call a recursive trigger, but I have written code in the trigger that checks if the block_id isn't allready filled in on table a.
    Also I really need all the values wich get updated (table a), so I believe a before update is also out of the question.
    And the first update of table a is done through an erp-packet and I can't get at that code, otherwise I would just have run my code from there.
    Message was edited by:
    user625855

    CREATE OR REPLACE TRIGGER block_id_trigger AFTER UPDATE ON unload_details_tab
    DECLARE
    current_transport_id NUMBER;
    check_value NUMBER;
    check_block_id NUMBER;
    PRAGMA AUTONOMOUS_TRANSACTION;
    BEGIN
    current_transport_id := get_curent_trans_id; --function that gets the current transport_id
    check_value := check_site_and_directive(current_transport_id); --function checks if this transport_id should have a block_id
    check_block_id := check_for_block_id(current_transport_id); --function checks if there isn't allready a block_id set.
    IF check_value = 1 AND check_block_id = 0 THEN
    create_blok_id_table(current_transport_id); --this procedure creates the blok_id in temptable
    UPDATE unload_details_tab a SET a.block_id = (SELECT DISTINCT b.blok_id FROM temptable b WHERE b.mark = a.mark_1) WHERE a.transport_id = current_transport_id; --this statement should update the table back, if I leave it out everything works fine, but when I leave it I get the self-deadlock error.
    ELSE
    null;
    END IF;
    END block_id_trigger;
    Ok, I cleaned the code somewhat.
    user625855

Maybe you are looking for

  • Phone video to DVD

    I have videos on my phone and have put them on my computer but I want to make DVD's from them that I can watch on my TV via a DVD player (not the PC). How do I do it? What software do I need? Time is running out for one of the people on the Videos an

  • HT201317 So if photos are deleted after 30 day from icloud

    If photos are deleted after 30 days from icloud, why doesn't my available storage increase if I have had "backup device" turned off for more than 30 days.

  • OT: IIS6 mapped virtual paths trouble

    In IIS5, I have a site with some virtual folders mapped within the directory structure. i.e. site includes config _virtual folder to another location mapped here Which works fine. The same cannot be said for IIS6 which, when browsing the page that re

  • Helpme!

    hi...i'm not know how to do this, i trying to plot a graph,the data from Microsoft access database..i want the graph is move,so i try to use timer..but i'm stuck...this is the example of the coding..what is coding for the timer??? the data involve da

  • Make Enter in cell ( in JTable ) go to right cell not lower cell

    How do I do that? NO matter what editor I am using, everytime I press Enter, I will go to the lower cell. I want to make it go to right cell. Except the most right cell. If that the case, it will go to the lower cell but in the most left column. Than