How to extract TEXT for archived Purchase Orders ?

Hi Friends,
Can any one tell me how to extract TEXT for archived Purchase Orders ?
I have used READ_TEXT but that is not fetching texts for archived PO's. Whenever I am trying to fetch data from STXH against archived PO, no value is coming and resulting SY_SUBRC <> 0.
Any demo code will be highly appreciated.
Thanks in advance..
Sivaji

Hi,
You can see that table STXH is linked to archiving object MM_EKKO (you can see it in tcode DB15).
My suggest is that you must get the data. See the demo object BC_SBOOK in tcode AOBJ. You can see the report to reload data. The object is get the data in an internal table. So for report SBOOKR you can see this function module:
*   get data records from the data container
*   SBOOK
    CALL FUNCTION 'ARCHIVE_GET_TABLE'
      EXPORTING
        archive_handle        = lv_handle
        record_structure      = 'SBOOK'
        all_records_of_object = 'X'
      TABLES
        table                 = lt_sbook_tmp
      EXCEPTIONS
        end_of_object         = 0.         "not entries of this type
*   check lt_sbook_tmp entries against selections. Delete not
*   requested entries
    LOOP AT lt_sbook_tmp ASSIGNING <ls_sbook>
                         WHERE carrid IN s_carrid
                           AND connid IN s_connid
                           AND fldate IN s_fldate.
      APPEND <ls_sbook> TO lt_sbook.
    ENDLOOP.
    REFRESH lt_sbook_tmp.
The idea is that you get the same data that you handle in READ_TEXT (because you don't have the data in database) and recovery the text.
I hope this helps you
REgards
Eduardo

Similar Messages

  • How to creat deadlock for the purchase order in SAP Workflow

    How to creat deadlock for the purchase order in SAP Workflow

    Hi Ben,
    Are you using FM "CONVERT_DATE_TO_EXTERNAL" before passing delivery date?  If not, use FM like this, before passing the date to BAPI_PO_CREATE1 and it might work
      DATA: vf_doc_date(10),
                 internal_date TYPE d.
         vf_doc_date = sy-datum.              "Document date.
         internal_date = vf_doc_date.
      CALL FUNCTION 'CONVERT_DATE_TO_EXTERNAL'
        EXPORTING
          date_internal            = internal_date
        IMPORTING
          date_external            = vf_doc_date
        EXCEPTIONS
          date_internal_is_invalid = 1
          OTHERS                   = 2.
    Regards,
    Vivek

  • Archiving purchase orders of a specific order-type

    hello,
    does anyone have a simple-doc or plan for archiving purchase orders. archiving for dummy's as I have never done this?
    points to be taken into consideration:
    - order of a specific type (ZRL0)
    - order must be older then 10 days
    thanks,

    Hi,
    In order to archive PO's , there are a number of considerations that must be taken into account.
    The archiving program SARA -> MM_EKKO , Write , does a large number of checks before archiving can be done.
    The first step is to go to SARA -> MM_EKKO , customizing. In here , you can specifiy what kind of documents you want to archive and specify the retention period (document life) for each type of document.
    For example :
    Go to C MM-PUR : Reorganization PO
    You will find several type of PO Doc types
    DB     Dummy purchase order           Standard
    NB     Standard PO           Standard
    NB     Standard PO     K     Consignment
    NB     Standard PO     L     Subcontracting
    NB     Standard PO     S     Third-party
    NB     Standard PO     D     Service
    UB     Stock transport ord.     U     Stock transfer
    Suppose you want to archive Standard PO's  , go into the customizing option and then set the residence time 1 and residence time 2.
    Res time 1 is the number of days which must elapse after which a deletion indicator can be set for the document. The elapsed days are calculated from the last change date of the document record in EKKO table.
    Res time 2 is the number of days which must elapse after which a document with a deletion indicator can be actually deleted out of the EKKO table.
    Once the customizing is finished , then you should run the SARA Preprocessing job (which sets the deletion indicators for the selected set of documents) , then the write job (which will write the DLT status documents to an archive file) and then the delete step (which will remove documents from the EKKO and other related Purchasing tables. TO get a trailer of what gets archived and deleted , run the archive write job in "Test" Mode , rather than "Production" mode.
    Hope this helps.
    -Chandra

  • How we enter text for materials in purchase order smartform

    hi guru
    how we enter text for materials in purchase order smartform
    my requirement is create smartform for purchase order.
    in this i have to create item-text, by using which tcode we can give item data
    plz give more expalnation for this plzzzzzzzzz

    Hi,
           You can use read_text function module for readind text of material and store this value in internal table later pass this internal table to smartform will solve your problem.
    otherwise there is direct option for text element property that is include text u can use that also
    Regards
    Gagan

  • How to set up automatic payment for the purchase order

    Hi, All,
    I have one question how to set up automatically payment for the Rent Office purchase Order?
    There is the requirement from the client. They want to create one kind of purchase order for the Office Rent, then pay the fees in the certain time of every month to the vendor for the rent fees without any invoice. Whatu2019s the normal solution for this kind of purchase order? Is it ERS? Or something else?
    Please give me the details and business flow. Also please tell me how to setup in the SAP and T-code.
    Thanks in advance

    Either you can set up ERS or you can pay directly from the FI side.
    Prerequisites
    Evaluated receipt settlement must be flagged in the purchase order item.
    The vendor must be flagged as being subject to ERS in the vendor master record.
    The goods receipt must refer to a purchase order.
    Goods-receipt-based Invoice Verification must be defined for the purchase order item.
    A tax code must have been maintained in the purchase order item.
    The order price of the materials may not be an estimated price.
    If you flag a vendor as being subject to ERS, the system sets the ERS indicator as a default in each item when you create a purchase order for the vendor. You can prevent this happening for certain vendors by flagging the info record for the material and the vendor as not being subject to ERS.
    In Purchasing, you can delete the default ERS indicator in a purchase order item.
    Choose Logistics Invoice Verification ® Automatic Settlement ® Evaluated Receipt Settlement (ERS).
    The selection screen appears.
    You can use the following criteria to narrow down selection of the transactions to be settled:
    Company code
    Plant
    Goods receipt posting date
    Goods receipt document
    Fiscal year of the goods receipt
    Vendor
    Purchase order and order item
    You can define the selection criteria for the invoice documents by:
    Delivery
    Purchase order
    Purchase order item
    Goods receipt document
    Credit memo
    Invoice
    Currency
    Choose  Execute.
    The system issues a log for Evaluated Receipt Settlement, which displays the following:
    Settled
    In line with your selection criteria, the system displays all the order items that were settled (or if you are working in test mode, which would have been settled).
    Could not be settled
    In line with your selection criteria, the system displays all order items for which ERS is defined but could not be settled. It also lists the reasons.
    If the system reports being unable to invoice a transaction, you should exclude the transaction from ERS to avoid it being included in the log the next time ERS is run.
    Select the item and choose Exclude from ERS.
    The system also generates and possibly sends a message to inform the vendor(s) about the transaction settled, depending on the settings in Customizing.
    You can display the following environment information for the order items selected. To do this, choose Goto ®:
    Display purchase order
    Display invoice
    Display material document
    Display long text

  • Urgent - How to change Item category for Open Purchase Order

    Hi Team,
    Lil bit tricky issue.
    My client has asked us to change the existing Item Category values, Combinations, Category Set etc. Its been changed and uploaded successfully.
    The question here is how we need to handle the category for Open Purchase Order. How to update the same.
    Do we need to do manually or any other way ?
    Please advice
    Regarads,
    John

    Hi John,
    This is reallly a tricky issue!
    I guess you cannot change the category of an existing PO's.
    This field will be greyed out once we save the form...there were no profiles/other setups to enable this field.
    For all new PO's since you have changed the new category value that should not be a issue.
    Lets wait for some of our colleuges opinion.
    I guess PO cancel should be the final option if we dont hear any new work arounds.
    Thanks
    -Arif.

  • How to change material component for a Purchase Order?

    How to change material component for a Purchase Order?
    I need FM .
    PLEASE help

    Dear ,
    Create PO with item category L....There in Item detail you will get tab for material.
    There click in component Button, it will take you to the component screen there you can assign and deassign components.
    Hope this helps.
    Regards
    Utsav

  • How to Park the single invoice for multiple purchase orders

    Hi,
    How to Park the single invoice for multiple purchase orders?

    brother this is possible to enter one Invoice fro multiple purchase order.
    call transaction MIR7, select " purchase order/Scheduling Agreement" from the PO refernce Tab. then click on arrow. give your purchase orders here.
    Thanks

  • How to find the supplying plant for a purchase order

    Hi Guru,
    My requirement is to dispaly the suppling plant and some other fields for the purchase orders using ALV report.
    Could any one help me how to find the supplying palnt for a purchase order.
    Suggest me any function module or with sample coding
    Regards
    Paul

    Hi Ravi,
    You are solution is right but in that table the supplying plant is not updated
    Could you suggest me any other tables
    Regards
    Paul

  • How to prevent Output to be generated for Return Purchase Order.

    Hi All,
               while creating a return Purchase Order the output is getting triggered. Now for Return Purchase Order the business does not want the output to be generated.
    So is there a way by which we can have the automatic output generated for normal Purcahse Order but not for Return Purchase Order.
    The system uses standard Output Type NEU for message. And condition record maintained for generating output (print/email) while saving.
    Is there a way by which this issue can be addressed.  if so how ?
    Thanks.

    Dear all ,
    a material goes storage location to client  through pr ,in client site i get faulty material
    i want to retorn that to my plant or storage location
    that basis how to make retorn po and what are the procedure ?
    what is movement type ?
    Regards
    shiv

  • How to create a service entry sheet for a purchase order acct assmt = U

    I need to create a service entry sheet using bapi BAPI_ENTRYSHEET_CREATE for a purchase order with account assignment category as 'unknown' (U).I am able to create SE sheet for a purchase order if account assignment is maintained in PO but our requirement is susch that at the tme of PO creation they dont assign Acct assgnment cat but want SE sheet to be entered with category 'P' and WBS elemnt . I tried to pass the asscount assgnment category in the header data as 'P' and entered WBS element in table it_services. I am getting error message
    'No account assignment exists for serviceu2019. any help in this regard is highly appreciated.

    can u create it SE entry  manually  without A/c assignment  ?.
    regards
    Prabhu

  • Data Migration for Open Purchase Order

    Hi, All,
    Is there anyone know how to Count the volume for Open Purchase Order. What's the normal strategy for the Data Migration and Cut-over stage?
    My client want to know how many Open Purchase Order in the legacy system and then determine manual or automatic data migration. If manual, how to do? If automatic, how to do? Because all materials and vendors, plants are different number. How to track? How to find out to match between new and old?
    Thank you very much

    JC,
    Sounds a bit early to be making decisions about the realization phase.  It doesn't sound like you have finished the Blueprinting phase yet, much less the testing phase.
    Anyhow, in my experience I typically use LSMW (Legacy system migration workbench) to load MM master data (material masters), Inventory (WIP, RM, FG, etc) Purchasing Master data (Vendors, Purchase Info Records, Source Lists, Quota Arrangements), and Purchasing transactional documents (POs, PurReqs, Scheduling Agreements, etc).  Depending on the complexity and volume of data, it  may be necessary to write custom programs to load the data.  You will find this out during your requirements gathering.
    It is uncommon but possible to load all of these data manually.  I have never run across a client that wants to pay a consultant's hourly rate to sit at a terminal to peck away loading master data, so if the client intends to have his own users enter the data manually, the project manager should make provision that there will be qualified TRAINED client employees available for this data entry.  I did help with a portion of a conversion once manually; of Sales Credits, but there were only about 30 SD docs to load.   I did this the evening before go-live day, while I was waiting for some of my LSMW projects to complete in the background.
    A good opportunity to 'practice' your data loads is right after you have completed your development and customization, and you have gotten the approval from the client to proceed from the pilot build to the full test environment.  Once you have moved your workbench and customization into the client's test environment, but before integration testing, you can mass load all, or a substantial portion of your conversion data into the qual system.  You can treat it like a dry run for go-live, and fine tune your processes, as well as your LSMW projects.
    Yes, it is good practice to generate comparisons between legacy and SAP even if the client doesn't ask for it. For Purchase orders on the SAP side, you could use any of the standard SAP Purchasing reports, such as ME2W, ME2M, ME2C, ME2L, ME2N.  If these reports do not meet the requirements of the client, you could write a query to display the loaded data, or have an ABAPer write a custom report.
    You didn't ask, but you should also do comparisons of ALL loaded data - including master data.
    It sounds like you are implying that the client wants YOU to extract the legacy data.  For an SAP consultant, this is not very realistic (unless the legacy system is another SAP system).  Most of us do not understand the workings of the myriad legacy systems.  The client is usually expected to produce one or more legacy system technical experts for you to liase with.  You normally negotiate with the technical expert about every facet of of the data migration.  In addition, you will liase with business users, who will help you and the implementation team to logically validate that the final solution (turnkey SAP production system, fully loaded with data) will meet the client's business needs.
    Finally, you mentioned how do you track the mapping of master data between legacy and SAP.  There are many ways to do this.  I normally try to get the legacy person do the conversion on his end, eg, when he gives you the load file, you would like to have already translated the master data and inserted the SAP relevant values into the file.  If this is not possible, I usually use MS Access databases to maintain a master map, and I perform the mapping on a PC.  If your data package is small, you can probably get by using MS Excel or similar.
    Good Luck,
    DB49

  • Make short text field in Purchase order creation only display..

    Sir,
    Yeah my requirement is quite unusual, but such is the situation.
    I want to make the short text field in purchase order creation "only disply". what is happening is that user while creating PO is able to change the text of material in short text column. I want to make it only for display.
    Can it done on document type level, since for service type, and Text type of account assignment cat, only text field is filled up. so how to do it.
    Please assist...
    Rahul

    Dear Rahul,
    If you want to have the short text display only for standard item but not service item, you may check below customizing.
    Transaction SPRO:
    MM-PUR-PO
    -> Define screen layout at document level
    Field Selection group: Basic Data, Item
    Field Selection Key:  PT0F Standard item purchase order
    Field: Short text -> set as display
    Hope this help.
    Ian Wong Loke Foong

  • How to print Sequential  Numbers like purchase order?

    I ma new to mac and Numbers 09 and have a quick question. How do I print sequential numbers? I have my own MS Excel purchase order number with macro and I want to use Iwork Numbers to print the numbers. For example, Purchase Order: 70085-1 is in my form. When I ask to print 20 copies, it will print 70085-1, 70085-1, 70085-3, etc.
    Thanks in advance

    Here is a modified version of my original script which was posted in :
    http://discussions.apple.com/thread.jspa?messageID=12679002
    This time, with a single run, we may define the number of consecutive invoices to create.
    --[SCRIPT openAndNameInvoiceWithAnumber]
    Enregistrer le script en tant que Script : openAndNameInvoiceWithAnumber.scpt
    déplacer le fichier créé dans le dossier
    <VolumeDeDémarrage>:Utilisateurs:<votreCompte>:Bibliothèque:Scripts:Applications:Pages:
    Il vous faudra peut-être créer le dossier Pages et peut-être même le dossier Applications.
    aller au menu Scripts , choisir Pages puis choisir openAndNameInvoiceWithAnumber
    crée un nouveau document à partir du modèle personnel prédéfini
    et renomme le document avec un nouveau numéro.
    Il insère également le numéro de facture au début du document.
    --=====
    L'aide du Finder explique:
    L'Utilitaire AppleScript permet d'activer le Menu des scripts :
    Ouvrez l'Utilitaire AppleScript situé dans le dossier Applications/AppleScript.
    Cochez la case "Afficher le menu des scripts dans la barre de menus".
    +++++++
    Save the script as Script, Application or Application Bundle: openAndNameInvoiceWithAnumber.xxx
    Move the newly created file into the folder:
    <startup Volume>:Users:<yourAccount>:Library:Scripts:Applications:Pages:
    Maybe you would have to create the folder Pages and even the folder Applications by yourself.
    go to the Scripts Menu, choose Pages, then choose openAndNameInvoiceWithAnumber
    will create a new document from the defined user template
    and name it with a new number.
    It also insert the invoice number at the very beginning of the document.
    --=====
    The Finder's Help explains:
    To make the Script menu appear:
    Open the AppleScript utility located in Applications/AppleScript.
    Select the "Show Script Menu in menu bar" checkbox.
    --=====
    Yvan KOENIG (Vallauris, FRANCE)
    2010/11/30
    2010/12/20 edited to apply if the template is a flatfile one.
    2011/01/11 added ability to build several invoices in a single call
    property theApp : "Pages"
    property theExt : ""
    property myTemplate : "ma_facture.template" (*
    Adapter à vos besoins
    Put your preferred template name *)
    property fichierNum : "le_numéro.txt" (*
    Adapter à vos gouts
    Put your preferred text file name *)
    --=====
    on run
    if theApp is "Pages" then
    set theExt to "pages"
    else
    if my parleAnglais() then
    error "The application “" & theApp & "” is not supported !"
    else
    error "L’application « " & theApp & " » n’est pas gérée"
    end if
    end if
    if my parleAnglais() then
    set nombredefactures to my askAnumber("Enter the number of consecutive invoices needed", 1, "i")
    else
    set nombredefactures to my askAnumber("Saisir le nombre de factures consécutives demandé", 1, "i")
    end if
    repeat nombredefactures times
    my buildaninvoice()
    end repeat
    end run
    --=====
    on buildaninvoice()
    set {p2myTemplate, numero} to my prepare()
    set numero to text -5 thru -1 of ("0000" & numero) (* pour numéro de 5 chiffres *)
    set UNTITLED_loc to my getLocalizedFrameWorksName(theApp, "Untitled")
    tell application "Pages"
    activate
    try
    close document UNTITLED_loc
    end try
    end tell -- to Pages
    tell application "Pages"
    activate
    open p2myTemplate
    set theDoc to numero & "." & theExt
    set name of document 1 to theDoc
    tell document 1
    tell body text
    if my parleAnglais() then
    set paragraph 1 to "invoice #" & numero & return & paragraph 1
    else
    set paragraph 1 to "facture n°" & numero & return & paragraph 1
    end if
    end tell
    end tell
    end tell
    end buildaninvoice
    --=====
    on getLocalizedFrameWorksName(theApp, x)
    local p2bndl
    set p2bndl to (path to application support as text) & "iWork '09:Frameworks:SFApplication.framework:Versions:A:Resources:"
    set x_loc to my getLocalizedName(theApp, x, p2bndl)
    return x_loc
    end getLocalizedFrameWorksName
    --=====
    on getLocalizedFunctionName(theApp, x)
    local p2bndl
    set p2bndl to (path to application support as text) & "iWork '09:Frameworks:SFTabular.framework:Versions:A:Resources:"
    set x_loc to my getLocalizedName(theApp, x, p2bndl)
    return x_loc
    end getLocalizedFunctionName
    --=====
    on getLocalizedName(aa, tt, ff)
    tell application aa to return localized string tt from table "Localizable" in bundle file ff
    end getLocalizedName
    --=====
    on prepare()
    local d1, d2, p2d, containerOfTemplates, pathToTheTemplate, p2n, nn
    tell application theApp
    set d1 to localized string "Templates" (* nom local du dossier "Modèles" *)
    set d2 to localized string "My Templates" (* nom local du dossier "Mes Modèles" *)
    end tell -- theApp
    set p2d to (path to application support from user domain) as Unicode text
    set containerOfTemplates to p2d & "iWork:" & theApp & ":" & d1 & ":" & d2 & ":"
    set pathToTheTemplate to containerOfTemplates & myTemplate & ":"
    try
    set pathToTheTemplate to pathToTheTemplate as alias
    on error
    if my parleAnglais() then
    error "The template “" & pathToTheTemplate & "” is unavailable! Please make sure the template file “" & myTemplate & "” is installed in Numbers “Templates:My Templates” folder, then rerun this script."
    else
    error "Le modèle « " & pathToTheTemplate & " » est introuvable! Veuillez installer le fichier modèle « " & myTemplate & " » dans le dossier « Modèles:Mes modèles » de Numbers avant de relancer ce script."
    end if
    end try
    tell application "System Events"
    if class of disk item (pathToTheTemplate as text) is file then
    (* flat file *)
    set p2n to containerOfTemplates & fichierNum
    if not (exists file p2n) then
    make new file at end of folder containerOfTemplates with properties {name:fichierNum}
    write "100" to file p2n (* mettez le numéro de départ de votre choix *)
    end if -- not…
    else
    (* package *)
    set p2n to "" & pathToTheTemplate & fichierNum
    if not (exists file p2n) then
    make new file at end of pathToTheTemplate with properties {name:fichierNum}
    write "100" to file p2n (* mettez le numéro de départ de votre choix *)
    end if -- not…
    end if
    end tell -- System Events
    set nn to read file p2n
    set nn to ((nn as integer) + 1) as text
    write nn to file p2n starting at 1
    return {pathToTheTemplate, nn}
    end prepare
    --=====
    on parleAnglais()
    local z
    try
    tell application theApp to set z to localized string "Cancel"
    on error
    set z to "Cancel"
    end try
    return (z is not "Annuler")
    end parleAnglais
    --=====
    Asks for an entry and checks that it is an floating number
    set myInteger to my askAnumber(Prompt, DefaultValue, "i")
    set myFloating to my askAnumber(Prompt, DefaultValue, "f")
    on askAnumber(lPrompt, lDefault, IorF)
    local lPrompt, lDefault, n
    tell application (path to frontmost application as string)
    if IorF is in {"F", "f"} then
    set n to text returned of (display dialog lPrompt & " (" & (1.2 as text) & ")" default answer lDefault as text)
    try
    set n to n as number (* try to convert the value as an number *)
    return n
    on error
    if my parleAnglais() then
    display alert "The value needs to be a floating number." & return & "Please try again."
    else
    display alert "La valeur saisie doit être un nombre décimal." & return & "Veuillez recommencer."
    end if
    end try
    else
    set n to text returned of (display dialog lPrompt default answer lDefault as text)
    try
    set n to n as integer (* try to convert the value as an integer *)
    return n
    on error
    if my parleAnglais() then
    display alert "The value needs to be an integer." & return & "Please try again."
    else
    display alert "La valeur saisie doit être un nombre entier." & return & "Veuillez recommencer."
    end if
    end try -- 1st attempt
    end if -- IorF…
    end tell -- application
    Here if the first entry was not of the wanted class
    second attempt *)
    tell application (path to frontmost application as string)
    if IorF is in {"F", "f"} then
    set n to text returned of (display dialog lPrompt & " (" & (1.2 as text) & ")" default answer lDefault as text)
    try
    set n to n as number (* try to convert the value as an number *)
    return n
    on error
    end try
    else
    set n to text returned of (display dialog lPrompt default answer lDefault as text)
    try
    set n to n as integer (* try to convert the value as an integer *)
    return n
    on error
    end try -- 1st attempt
    end if -- IorF…
    end tell -- application
    if my parleAnglais() then
    error "The value you entered was not numerical !" & return & "Goodbye !"
    else
    error "La valeur saisie n’est pas numérique !" & return & "Au revoir !"
    end if
    end askAnumber
    --=====
    --[/SCRIPT]
    Yvan KOENIG (VALLAURIS, France) mardi 11 janvier 2011 09:30:37

  • Archive Purchase Order on SRM

    Hi experts,
    I'm working on the SRM archive process. I'm in extended classic scenario so my purchase order is created on SRM and duplicated on ECC. I only want to archive purchase order on SRM and not on ECC.
    When the user is looking for the purchase order on ECC how does he know that the order is archived on SRM ?
    Thank you for your help.
    Regards,
    Mikaël.

    Hi Peter,
    Thank you for your answer.
    I will used a cutomer field on the ECC purchase order and create a specific program to update this customer field from SRM data and tables ZARIX...
    Thanks,
    Mikaël.

Maybe you are looking for