Fail safe logic needed for purchase order upload program

Hello all,
i am working on creating PO's by reading data from a text file. I need to implement fail safe logic in it, which is to make sure this program uploads all the records in the text file successfully. For example, i have 1000 records in my text file and while running the upload program if the program times out while creating the 500th PO or if SAP is down at that time, then we have 499 PO's created and 501 yet to be created. But if we run the same program again, we will generate duplicate PO's for 499 again. I want to avoid this kind of problem.
How do i implement this idea?
Kindly guide me on this.
Thanks.

Ok ..
Then I would suggest you use Application Log to keep the success and error messages of PO processing.
You can check trsnaction SLG0 and create your own application log object.
Then you need to use FMs BAL_LOG_* to crate and add messages to it.
This way you will have a facility to check as which of your records are converted to PO for a run.
In case SAP gets down in between , still you can find the details using Xn SLG1 and then accordingly remove the records from your file which are already converted to PO.
Thanks,
Ram

Similar Messages

  • Regarding bdc upload for purchase order

    hi friends,
    here i got a problem in purchase order upload.the format in excel sheet data is in this format mentioned bellow
    lifnr      ekorg  ekgrp   werks   lgort         ematn       menge netpr
    142     1000     1000     1000     1000     <b>100-100      10      150
                                               100-100     15     100
                                                100-100     10     140
                                                100-100     12     56
                                                100-100      8      40</b>
    here to identify items which r in bold and to write code for this is my problem. if the iteams r separated with  ' , '  i can use split at , and between loop and end loop i executed the code earlier. but now my flat file containing 1000+ records and to convert that in my mode of program is a problem. so can any one suggest me how to proceed and code the above mentioned flat file structure to be uploaded in one record.
    <b>this program is very urgent.............so take it as a request and help me in futher proceddings.......</b>
    thaning you all........
    i wait for replay...............

    Hi,
    I hope earlier you are comma seperated file, and you are easily spliting the values using SPLIT command.
    Now you are using flat file (fixed length) Using offset values you need map the fields manually in loop ... endloop control statement. (takes long time to find total lengh of record although you have to).
    If you using TABDELIMITED, use the same SPLIT command , instead of 'comma' use 'CL_ABAP_CHAR_UTILITIES=>TAB_DELIMITED' attribute.
    If you can maintain hierarchy. I hope it will be easy.
    see below structure if want to do in hierarchy mode. Write logic determine the detail record and map it. It is easy rather than direct offset mapping.
    <b>indicator ifnr ekorg ekgrp werks lgort
    indicator  ematn menge netpr
    1 142 1000 1000 1000 1000
    <i>2 100-100 10 150
    2 100-100 15 100
    2 100-100 10 140
    2 100-100 12 56
    2 100-100 8 40</i></b>
    Please let me know what type of file  i.e. reason i have given all three types.
    If it helps.Plz reward points.
    Regards
    Bhupal Reddy.

  • Need a field  for purchase order quantity

    We need a field that is fixed once the PO is created and is never updated even if the qty is changed later on.

    Hi Chandra
      Not clear with your query...
      Are you looking for a field to act as a constant where you can store the PO Item Quantity which was initially created???
      If so, not really sure on the reason but you can get the orginal qty value from Change Documents.
      OBJECTID for Purchase Orders is <b>EINKBELEG</b>.
    Kind Regards
    Eswar

  • Need help regarding payment terms f4 for purchase order

    hello everyone,
                im currently workin on smartform for purchase order so transaction code is me23n in dat 1st tab delivery/invoice can u see payment terms field its technical field name is ZTERM in dat if u click on f4 ull find tht value along with description say eg 0001 payable immediately due net lik dis it comes so i need to display ths text i.e payable imm... lik dis in my smartforms field im unable to retrieve tht text element i gt 1 function module also ie Fi_F4_ZTERM here im gettin whole record i wnt only 1st record i.e 0001 payable if u click on f4 thr r many records...so whn u go to me23n ie for display u shd hav value tht is alrdy stored lik dis u check ulll understand..  thnx in advance fr ur help...

    Hi,
    The text of payment terms is stored in table T052U.
    You can get the payment terms of a PO in table EKKO and field ZTERM.
    Pass the value of this field i.e. EKKO-ZTERM to T052U-ZTERM  and T052U-SPRAS as SY-LANGU .
    You will get the description of the payment terms maintained in the PO.
    Regards,
    Vinod

  • Need the SMARTFORM name for Purchase Order in ECC 6.0

    Hi experts,
              I have been working on ECC 6.0 version and I need your help in finding out the name of the SMARTFORM for Purchase Order. Please let me know the SmartForm name if anybody knows. Waiting for your replies.
    Regards,
    Ravi

    HI,
    We have the Smartforms in the Service.sap.com, you need to download from this one. in our SAP we do not have these smartforms .
    smartform name is /smb40/mmpo_l. Look at the SAP Note 695891
    Look at the below link
    Re: PURCHASE ORDER SMARTFORM   IN ECC 6.0
    <i>Mark all the helpful answers</i>
    Regards
    Sudheer

  • Rounding value for purchase order quantity

    Hi Guru ,
    i need help for logic LOT SIZE MRP.
    In particolar i need of use the parameters of rounding for create the planned order multiple of the value.
    Example for a requirement of 3800 pz whit a value rounding of 500 i  vould want that the system create a planned order of the 4000pz.
    I have  tried insert this value 500 in the field "Rounding value for purchase order quantity" in the view MRP1 but after run MRP the system create a planned order of the same quantity of the requirement.
    Thanks a lot for help
    Daniele
    PP TEAM

    Dear,
    OMI4, for lot size select Lot for lot order qty with rounding.
    Either you can use the Rounding Value or you can use a Rounding profile in MRP2 view to round of your order qty and rouding value in MRP1 view.
    Further you can check
    Check FM MD_ROUNDING_VALUE
    Regards,
    R.Brahmankar

  • Updating Batch classification data from MIGO for Purchase order

    Hi,
    I need to update batch classification data (in MSC3n) from MIGO for purchase order. The logic needed for this is as below,
    1) Pass material and batch to MCH1 table to get CUOBJ_BM.
    2) Pass CUOBJ_BM to INOB table to get INOB-OBJEK.
    3) Pass INOB-OBJEK to CLAF_CLASSIFICATION_OF_OBJECTS to get class name & characteristic name.
    4) Pass INOB-OBJEK, CLASS name and characteristic name to BAPI_OBJCL_CHANGE to update batch classification data.
    I created implicit enhancement at the bottom of FM "CLVF_VB_INSERT_CLASSIFICATION". But the problem is, the return parameter of BAPI_OBJCL_CHANGE is giving the following error.
    Class type 023, object type MCH1, object RAW-6             0000001151
    Object is currently locked by user
    The assignment was not changed
    Please let me know how to do it. Is there any BADI or User Exit?

    Hi,
    As you said the break point is not triggering did you activate your exit and activated even the project to which your exit is assigned.
    I hope you missed activating your project in CMOD transaction. Please verify it once and if it is not activated then immediately activate it and try debugging again.
    Regards,
    Rafi

  • Creating an IDOC for purchase order

    Hello gurus,
    I want to generate an IDOC for purchase order.
    The Logical System, RFC connection, ports definition is already defined.
    In my system i have 800 client as source/sender and 100 client as target/reciever.
    On Outbound side-> In Partner profile
    I defined-
    1. Partner No.- devclnt100
    2.Type- US (User)
    3. Agent - SAPUSER
    In Outbound parameters-
    I created message type as Orders.
    One thing to note that my partner system is LS i.e. Logical System
    Then in Outbound Options-
    I mentioned Reciver Port - 800Port
    Output Mode- I selected "Transfer Idocs immediately"
    & "Do not start subsystem"
    In Idoc type-
    I gave following information-
    Basic Type - Orders05
    In Message Control tab i mentioned-
    Application - EF
    Message Type - NEU
    Process Code - ME10
    In NACE Transaction Code-
    I selected EF Purchase Order as my condition for output control
    In that- In output types-
    I selecte NEU and double clicked. I checked whether Access to Conditions check box is checked and multiple issuing is checked.
    In Dialog structure-Processing routines I checked that -
    For Output type - NEU
    Application - EF
    Processing routines are defined-
    medium-Distribution ALE
    Program -RSNASTED
    Form Routine - ALE_PROCESSING
    I think these are the very basic settings that need to be done for creation of Idoc.
    Now when i create a PO and then SAVE it an IDOC must be generated.
    But when i go to transaction Code WE02. It shows me message "No Idocs genereated".
    What is the problem? Where am i going wrong?

    Hi Yayati,
    Here are all the settings that you need to do. I am not sure which all settings are present so kindly confirm.
    Sending side Client800:
    1. WE20 - under LS - Outbound parameters - message type = Orders , basic type = Orders05
    2. BD64 - message type - sender = client800, receiver = client100, message type = Orders
    3. NACE - App = EF - Output Types - Processing Routines - Add medium = A (Distribution (ALE)) , Program = RSNASTED, Routine = ALE_PROCESSING.
    4.  NACE - App = EF - Output Types - Partner Functions - Add medium = Distribution (ALE), Funct = VN.
    5. Name - App = EF - Condition Records - Output type = NEU , Choose ur combination (Mine is DocType/Purc Grp)
         Pur.Doc Type = NB (Execute) , Add row Medium = A ,Function = VN and other details u choose.
    Receiving side Client100:
    1. WE20 - under LS - Inbound parameters - message type : Orders ; Process Code : ORDE
    2. BD64 - message type - sender = client800, receiver = client100, message type = Orders
    For the PO which you have created, go to the PO in ME23N, click on messages .
    There should be a line : Output = NEU, Medium = Distribution (ALE)... etc.
    If its present then the configuration was correct.
    If it has a yellow triangle means it was not processed.
    Regards,
    Jovito.
    Edited by: dsouzajovito on Dec 30, 2010 10:24 AM

  • Error:-document is in transfer for purchase order..creation is not possible

    Hello,
    While doing confirmation of PO I am getting this error, saying "document is in transfer for purchase order..creation is not possible".
    can anyone please suggest me solution on this type of error?

    Hi,
    Is the PO in ORDERED status? Is there any confirmation posted for this PO which might be stuck (idoc failed to reach back end)?
    If it is a case of idoc failure, then reprocess the idoc and then do the next confirmation.
    regards,
    MRao

  • Goods Receipts for Purchase Order using BAPI_GOODSMVT_CREAT

    Hi experts,
    I am working on the a program where am generating Goods Receipts for Purchase Order. the BAPI_GOODSMVT_CREAT returns an error saying "Material 6003022 not maintained in plant 1001"
    Can any one assist? is there a field I may be missing?
    Here is a sample code.
    DATA: gm_header TYPE bapi2017_gm_head_01.
    DATA: gm_code TYPE bapi2017_gm_code.
    DATA: gm_headret TYPE bapi2017_gm_head_ret.
    DATA: gm_item TYPE TABLE OF bapi2017_gm_item_create WITH HEADER LINE.
    DATA: gm_return TYPE bapiret2 OCCURS 0 WITH HEADER LINE.
    DATA: gm_retmtd TYPE bapi2017_gm_head_ret-mat_doc.
    CLEAR: gm_return, gm_retmtd.
    REFRESH gm_return.
    Setup BAPI header
    "data
    gm_header-pstng_date = sy-datum.
    gm_header-doc_date = sy-datum.
    gm_code-gm_code = '02'.
    " MB1A * Write 971 movement to table CLEAR GM_ITEM.
    MOVE '101' TO gm_item-move_type .
    " MOVE 'Q' TO GM_ITEM-SPEC_STOCK.
    MOVE '6003022' TO gm_item-material.
    MOVE '10' TO gm_item-entry_qnt.
    MOVE 'EA' TO gm_item-entry_uom.
    MOVE '1001' TO gm_item-plant.
    MOVE '' TO gm_item-stge_loc.
    MOVE '0901' TO gm_item-move_reas.
    "  MOVE '4500006877' TO GM_ITEM-WBS_ELEM.
    "  MOVE '0020' TO GM_ITEM-VAL_WBS_ELEM.
    MOVE '0020' TO gm_item-deliv_numb.
    MOVE '4500006881' TO gm_item-po_number.
    MOVE '0010' TO gm_item-po_item.
    APPEND gm_item.
    Call goods movement BAPI
    CALL FUNCTION 'BAPI_GOODSMVT_CREATE'
      EXPORTING
        goodsmvt_header  = gm_header
        goodsmvt_code    = gm_code
      IMPORTING
        goodsmvt_headret = gm_headret
        materialdocument = gm_retmtd
      TABLES
        goodsmvt_item    = gm_item
        return           = gm_return.
    IF NOT gm_retmtd IS INITIAL.
      COMMIT WORK AND WAIT.
      CALL FUNCTION 'DEQUEUE_ALL'.
    ELSE.
      COMMIT WORK AND WAIT.
      CALL FUNCTION 'DEQUEUE_ALL'.
    ENDIF.

    >
    Spark842 wrote:
    > Hi experts,
    > I am working on the a program where am generating Goods Receipts for Purchase Order. the BAPI_GOODSMVT_CREAT returns an error saying "Material 6003022 not maintained in plant 1001"
    >  Can any one assist? is there a field I may be missing?
    >
    > Here is a sample code.
    >
    > DATA: gm_header TYPE bapi2017_gm_head_01.
    > DATA: gm_code TYPE bapi2017_gm_code.
    > DATA: gm_headret TYPE bapi2017_gm_head_ret.
    > DATA: gm_item TYPE TABLE OF bapi2017_gm_item_create WITH HEADER LINE.
    > DATA: gm_return TYPE bapiret2 OCCURS 0 WITH HEADER LINE.
    > DATA: gm_retmtd TYPE bapi2017_gm_head_ret-mat_doc.
    > CLEAR: gm_return, gm_retmtd.
    > REFRESH gm_return.
    > * Setup BAPI header
    > "data
    > gm_header-pstng_date = sy-datum.
    > gm_header-doc_date = sy-datum.
    > gm_code-gm_code = '02'.
    >
    >
    > " MB1A * Write 971 movement to table CLEAR GM_ITEM.
    > MOVE '101' TO gm_item-move_type .
    > " MOVE 'Q' TO GM_ITEM-SPEC_STOCK.
    > MOVE '6003022' TO gm_item-material.
    > MOVE '10' TO gm_item-entry_qnt.
    > MOVE 'EA' TO gm_item-entry_uom.
    > MOVE '1001' TO gm_item-plant.
    > MOVE '' TO gm_item-stge_loc.
    > MOVE '0901' TO gm_item-move_reas.
    > "  MOVE '4500006877' TO GM_ITEM-WBS_ELEM.
    > "  MOVE '0020' TO GM_ITEM-VAL_WBS_ELEM.
    > MOVE '0020' TO gm_item-deliv_numb.
    > MOVE '4500006881' TO gm_item-po_number.
    > MOVE '0010' TO gm_item-po_item.
    > APPEND gm_item.
    >
    > * Call goods movement BAPI
    >
    > CALL FUNCTION 'BAPI_GOODSMVT_CREATE'
    >   EXPORTING
    >     goodsmvt_header  = gm_header
    >     goodsmvt_code    = gm_code
    >   IMPORTING
    >     goodsmvt_headret = gm_headret
    >     materialdocument = gm_retmtd
    >   TABLES
    >     goodsmvt_item    = gm_item
    >     return           = gm_return.
    >
    > IF NOT gm_retmtd IS INITIAL.
    >
    >   COMMIT WORK AND WAIT.
    >   CALL FUNCTION 'DEQUEUE_ALL'.
    > ELSE.
    >   COMMIT WORK AND WAIT.
    >
    >   CALL FUNCTION 'DEQUEUE_ALL'.
    > ENDIF.
    My guess, is that this material is not really maintained in the Plant '1001', to be on the safer side, get the exact values from EKPO itself, also check if this material exists in the table MARC for the plant and storage location.
    MOVE '1001' TO gm_item-plant.   "<< Hard coded
    MOVE '' TO gm_item-stge_loc.
    Replace the above hardcodes to something like this to get the actual value from EKPO.
    select werks lgort into (gm_item-plant, gm_item-stge_loc) from ekpo
       where ebeln = gm_item-po_number
            and ebelp = gm_item-po_item.

  • IDoc Error "" No goods receipt possible for purchase order"

    Hi All
    I am getting IDoc failed with the error massaeg " No goods receipt possible for purchase order I510954-02 00010
    Message type :MBGMCR
    Basic type : MBGMCR03
    Message no. M7036
    Status : 51
    Please suggest on this
    Thanks
    Ajit

    Hi
    Please go through thid link i think it will help you..
    No goods receipt possible in PO
    Error - E 036 No goods receipt possible for purchase order
    No goods receipt possible for purchase order
    Regards
    Sharada

  • No (suitable) item found for purchase order

    Dear All,
    The order is stock transfer order (STO) item category U. i saw GR is already create. GI  and also DCGR. i want to do DCIR which is invoice receipt in tcode mr01, the error "No (suitable) item found for purchase order" is coming out. What would be the cause of this situation? i check with old last PO it is same set with the one that having in problem. i also double click the item to see the detail and what i can see tick option for del completed and no tick on final del.
    no GR-based-4 or invoice receipt option to tick. means no tick option for this. but when i see previous po also same. but there is history on DCIR.
    Really need to know what should i do? is bug?
    Regards
    Aishah

    In case of out company it was SA(schudule agrement) PO we try on the Credit memo by MIRO t-code through IV
    but we met the same error message
    The problem cause of not exist delivery schedule quantiry we have put in the qty to there by manually after than this issue cleared.
                                                                       Hoil.

  • Problem in using output type for purchase order

    Hi experts,
         I am using output type for first time so may be i have done wrong configuration for po output type.The steps i have done are :-
    1) Going to  tcode NACE->Selected  the row u201CEF Purchase Orderu201D and clicked on u201CProcedures".
    2) In procedures there are 2 procedures for the application EF (Purchase Order). To proceed further, we would need to find out the procedure that is currently active.Gone to transaction SPRO. In this, navigate as Materials management -> Purchasing ->Messages -> Output control -> Message Determination Schemas ->Define Message Schema for Purchase Order
    3) Clicking on u201CAssign Schema to Purchase Orderu201D. So, the procedure RMBEF1 is active for EF (Purchase Order) . 
    4) Go back to transaction NACE. Select u2018EFu2019 and click on u201COutput typesu201D.
    5)  Let us use the output type u201CNEU name purchase orderu201D for this purpose. Double-click on NEU.
    6) Ensured  that the checkboxes u201CAccess to conditionsu201D and u201Cmultiple issuingu201D are checked and the access sequence is 0001(DocType/PurchOrg/Vendor).Only 0001 and 0002 is available in f4 help for this.
    7) Now clicked on u201CProcessing Routinesu201D on the left hand side. Ensured that there is an entry for Medium u2018Au2019 (Distribution ALE).
    8) After that going back to the main screen of NACE. Select EF (Purchase Order) and clicked on u201CCondition Recordsu201D.
    Select NEU and clicked on u201CCondition recordsu201D. The pop-up box appears that gives three radio button option :-
      1) Purchasing output determination :purchasing org / vendor for EDI
      2) Purchasing output determination :doc. type / purchasing org /vendor
      3) Purchasing output determination :document type
          but it is not having option only for purchasing organisation through which we can send idoc for changes or creation of PO in that particular pur.org now if i choose 2) i have to give doc type and purchasing org both bcoz they are mandatory fields and value for vendor.
    9)  Also i  have done the necessary ALE configuration (not covered in this document). In the partner profiles, use the message type u201CORDERSu201D and the IDOC type u201CORDERS05u201D.In the tab u201CMessage Controlu201D, used the process codes u201CME10u201D and u201CME11u201D for u201CPO Createu201D and u201CPO Changeu201D respectively.
    but the idoc is not generated many times when po is changed and when once it is generated it is giving error
    Please suggest solution.
    Thanks in advance
    nehavt

    In me22n in messages tab after looking into  processing log it is giving->No recipient found for message type ORDCHG in the
    ALE model ,next time giving error as no idoc items belonging to purchasing document found,when i changed message type to ORDCHG the  status is green in messages tab it is giving-> error occured while idoc xyz is sent and in WE02 status is red 02
    error passing data to port(could not find code page for receiving system)

  • Document is in transfer for purchase order.Creation not possible

    Dear All,
    We did partial confirmation in EBP and later when trying to do confiramtion for the remaining quantiy getting the message"document is in transfer for purchase order.Creation not possible"
    We are taking this problem in production as well as in quality systems also.
    What are possible reason and how to solve it.
    kindly share your views.
    Thank you.

    Hi yshu,
    use tcode bd87 in SRM to check for failed confirmation IDOC (type MBGMCR).
    The double click the status record to see the exact cause of the failure.
    Rectify the error. Then try to execute the IDOC from BD87 tcode.
    For a few errors you may not be able to execute the IDOC but to create a new confirmation in SRM. In such cases, follow the below procedure..
    There should be an entry for the confirmation in the transfer table BBP_DOCUMENT_TAB in SRM. Display the details.
    Then run FM "BBP_DELETE_FROM_DOCUMENT_TAB" to delete the entry from the doc tab table.
    Then post a new confirmation in SRM.
    There is also a FM in SRM using which you can change the status of thefailed IDOC from 51 to 68 or 31.
    Rgds,
    MJ

  • Activating conditions for Purchase Order workflows in EBP

    Dear SRMer's,
    I am facing the following problem:
    System Info :SRM Server 5.5, ECC 6.0
    Scenario 1:
    All start conditions for Purchase Order in SAP Business Workflow are activated.
    I created a direct procurement shopping cart (DP)  in SRM browser and ordered it, then I logged in as proffessional purchaser, changed the Price and processed the DP PO.
    When Ordering, the follow on Documents are created, but says the PO is waiting for approval.  When I check for this PO in the Backend R/3 system in the Me22n (Display PO changes), I don't see the PO.
    Scenario 2:
    All Start conditions for Purchase Order in SAP Business Workflow are de-activated
    I created  another direct procurement shopping cart (DP2)  in SRM browser and ordered it, then I logged in as proffessional purchaser, changed the Price and processed the DP2 PO (Status is held). 
    When Ordering, I get the Warning message, no workflow found, contact system administrator.
    Please advice what needs to be configured for the PO to be ordered successfully.
    Thanks in advance
    Raj

    Hi,
    In your scenario 1, if system is saying that there the PO has to be approved, it means that you have managed the user that will receive the workitem..
    Activating all PO WF is not a solution as in standard there are two many cases activated (amount, role, limit...)
    I propose you to first activate only the 0 step WF and to overwrite the code inside
    Just code that every PO modification should trigger O step WF thus it will be more simple to test it.
    Later on, if you want to implement more complex starting conditions, you just have to modify the WF content...
    Kind regards,
    Yann

Maybe you are looking for

  • How do I setup Airport Express to extend my CISCO router's wifi range?

    Hi, I am using CISCO EA4500 router for internet connection via wifi. I have Airport Express with me, which I want to use as extender of the wifi network. I setup the Airport Express as "Extend the wireless network", provided same base station name (C

  • Link lines in Adobe forms

    Dear Experts, how can i link lines so that the line break cant happen between them ? Thanks a lot.

  • Shuffled Playlist Question

    Instead of having to navigate back and fourth between the Settings menu and the Music menus, is it possible to create a Playlist (or SPL) that contains the majority of my collection but shuffles the music? I've tried a variety of set ups that look li

  • How do I re-download Lightroom 5

    I have the disk of Lightroom 4 but bought the upgrade to Lightroom 5 and want to install it on a new computer.  How do I do that?

  • Will ICM version 8.0 work with an Avaya PBX/AES version 6.x?

    In planning the upgrade of our ICM platform to version 8.0, we discovered we will first need to upgrade our Avaya AES/PBX. We would like to upgrade to Avaya version 6.x, but the latest ICM compatibility chart only goes to Avaya version 5.2.2.  Does a