Problem to print Purchase Order created in RFC module function

Hi
I created a specific RFC function module for using in a BSP application. In this specific function module, I have created a Purchase Order (PO) thanks to the standard module "BAPI_PO_CREATE". The PO is well created but I don't manage to print immediately this PO but the spool is queued. Whereas using SE37, the PO is well created and printed.
But the customer wants to find the PO immediately in the printer
Do you know a simply way to solve my problem? I have the feeling that something is lost using RFC module function and the standard module function.
Thank a lot of for your reply
Regards
Francois

The issue may be because, its used in BSP application.
may be you need to implement whats explained in this weblog.
/people/thomas.jung3/blog/2005/08/23/bsp-server-side-printing-for-tableviews
Regards
Raja

Similar Messages

  • Problem Purchase order created in SAP R/3 sent in to File XI?

    Hi all,
    I am new to XI, learning it myself.
    I am trying to "send purchase order created in SAP R/3 into XI". For that I am following the document titled as <b>"A Beginner’s Guide to SAP XI
    Settings, Part I "</b>. But I am getting problem in connecting R/3 system to XI system.
    I am stuck at very first step in the documentation which says:
           <b>Setting Communication ports:</b> in this it asks for "<b>RFC Destination</b>"
    Please suggest me the step by step procedure to get through it.
    Thanks and Regards,
    Ravi

    Hi,
    go through these links...
    1. /people/prateek.shah/blog/2005/06/08/introduction-to-idoc-xi-file-scenario-and-complete-walk-through-for-starters
    2. IDOC to File
    3. /people/michal.krawczyk2/blog/2005/03/29/configuring-the-sender-rfc-adapter--step-by-step
    4. /people/prateek.shah/blog/2005/06/08/introduction-to-idoc-xi-file-scenario-and-complete-walk-through-for-starters
    5. Re: Idoc to File Scenario
    regads,
    Ansar.

  • Email Sending of Purchase Order Created versus Print Output

    Dear All,
    I have been successful in sending the Purchase Order created as a PDF Attachment in email.
    The problem i am facing is in the formatting of the attached output.
    The attachment has different bold characters as compared to the print output of the PO , though both the outputs are using the same sapscript.
    I am not able to find the reason for the difference.
    Only because of this reason, my delivery is on hold.
    Please guide me on how to find where the difference could be and how to rectify it.
    Thanks & Regards,
    Bhavika

    Could you tell us which fonts you tried?
    What device type did you choose? (SPAD transaction, select your output device to determine the device type)
    Could you upload TrueType fonts (one normal, one bold) with RSTXPDF2 program (do not tick "do not embed font in PDF" option so that the font is embedded in the PDF file)?
    Did you make sure that your font is not converted to another one? (SE73, printer font, choose your device type, click conversion button, and check what is the converted font)

  • Purchase order created by "Procurement Document" is not printed automatical

    Hi all experts,
    After and upgrade to 8.81 (from 2005A)  some funcionality was lost.
    In Print Preferences it is set that the document Purchase Order shall be printed automatically when adding document.
    This works if you add the document directly in Purchase module.
    But, if you add the document via a Sales Order
    - on the Logistics tab, mark the field Procurement Document to create the PO -
    the Purchase order is not printed.
    Has anyone seen any changes regarding this functionality or is it a bug?
    Thank you!
    Kind regards,
    Susanna

    Hi all!
    Just F Y I - this is an error in this version that is a candidate for future versions:
    "After detailed investigation of the Business Impact and the Product Strategy we came to the decision that the correction of the system behaviour is not feasible in the currently supported versions of SAP Business One. Theerror has been recorded and is a candidate to be fixed in a future version.
    Please see note 968358 and note 1644710 for further information.
    Like a workaround please use the document printing option to print all the purchase order created using the procurement wizard."
    Thank you for all help!
    //Susanna

  • Printed Purchase Order Report gives no output

    hello,
    The standard report "Printed Purchase Order Report(Landscape)" gives a a zero size output file for a certain po . Although i have checked the tables PO_HEADERS_ALL and PO_LINES_ALL and that purchase order has all the data entered in the tables above.
    what can the problem possibbly be and how can i fix it?
    please help...

    hello,
    as an update i found that the specified purchase orders has 9 lines entered and in PO_LINES_ALL only 5 are there !!!

  • Issues with printing purchase order

    Dear friends,
    I'm having some issues with printing purchase orders.
    Normally when I create a purchase order via ME21N and then when I save the purchase order it then gets automatically printed.
    Suddenly it is not anymore working. I have created a purchase order this morning and it did not get printed. I get the message "frontend is not available"when i check the spool in SP01
    The funny think is if i call up the spool nr via SP01and then do a reprint then i'm able to reprint.
    What can be possibly the issue that I can't print the purchase order when I create the purchase order via ME21 when I save the purchase order? Can you help me with any guide on where I need to check why the PO is not printing immediatelly when i create the PO via ME21N?
    kind regards,
    Camilla

    hello all,
    thanks so far for your reply.
    i have checked today my user settings and that shows that my prints should go to LOCL (local default printer)
    The output conditions fpr purchase order have also LOCL (local printer)
    The weird thing is that I can print other reports to the default printer without any issues. The issue arise when I create a purchase order via ME21N. Normally when I save the PO it automatically prints. So no manual print instructions are required from my side. Because if I give manual instructions then I'm able to print the purchase order.
    Is it possible that the automatic printing is switched off and that it only prints when I hit manually the print button?
    Is the automatic printing something that is maintained in SPAD?
    kind regards and thanks for your help sofar

  • Pasta 3.0 - Printing Purchase Order Forms using Pasta

    Has everyone successfully gotten the Pasta utility using the PrintForm functionality to work for printing Purchase Orders in a 11.5.8 environment. We have applied the latest Pasta patches for 3.0.4 and has created a postscript file from a msword document, transferred to a True64 unix machine and converted it to the PrintForm (.pf) file. We have followed all of the setup steps for the print drivers and has run the concurrent job. It appears to have merge the text base report into a postscript file but it will not print out on the printer. When we view the output via the application you can see the data from the report but you do not see the logo image from the printform file. We are under a time constraint so any feedback would be appreciated.
    Bettye

    Has everyone successfully gotten the Pasta utility using the PrintForm functionality to work for printing Purchase Orders in a 11.5.8 environment. We have applied the latest Pasta patches for 3.0.4 and has created a postscript file from a msword document, transferred to a True64 unix machine and converted it to the PrintForm (.pf) file. We have followed all of the setup steps for the print drivers and has run the concurrent job. It appears to have merge the text base report into a postscript file but it will not print out on the printer. When we view the output via the application you can see the data from the report but you do not see the logo image from the printform file. We are under a time constraint so any feedback would be appreciated.
    Bettye

  • Printing Purchase Order from ME9F using custom program and smartform

    I was able to use my custom program which calls a smartform to print purchase orders from transaction ME9F. I did this using transaction NACE.
    However, when I call "Output Message" from ME9F, the output always fails (shown by an 'X' icon after the checkbox). When I try to put back the standard program in NACE, it does not show an 'X' but a check which indicates that the printing was successful.
    Do you know why this happens? What did I miss?
    Here's my call to my smartform from my custom driver program:
        " Change Smartform ZP_MMSF_P01_PURCHASE_ORDER
        " to internal Function module name
        CALL FUNCTION 'SSF_FUNCTION_MODULE_NAME'
            EXPORTING
                FORMNAME   = 'ZP_MMSF_P01_PURCHASE_ORDER'
            IMPORTING
                FM_NAME    = fmname
        wa_cparam-no_dialog = 'X'.
        wa_output-tddest = 'LOCL'. "or 'LP01'.  "Spool: Output device
        CALL FUNCTION fmname
            EXPORTING
                control_parameters         = wa_cparam
                output_options             = wa_output
                i_data                     = i_data
                wa_lookup                  = wa_data_lookup
                goods_amt                  = goods_amt
                discount_amt               = discount_amt
                vat                        = vat
                total_amt                  = total_amt
                total_amt_inwords          = total_amt_inwords

    Vijaya,
    I have this problem though,
    Whenever I try to provide values for CONTROL_PARAMETERS and OUTPUT_OPTIONS to the sapscript call in your code, the PO printing (even the preview) does not proceed. I do this because I wanted to suppress the printer dialog.
    here is a fragment of the code:
    " code I added
    LS_COMPOSER_PARAM-tddest = 'LOCL'. "or 'LP01'.  "Spool: Output device
    LS_COMPOSER_PARAM-bcs_langu = sy-langu.
    LS_CONTROL_PARAM-preview = 'X'.
    LS_CONTROL_PARAM-no_open = 'X'.
    LS_CONTROL_PARAM-no_close = 'X'.
    LS_CONTROL_PARAM-device = 'PRINTER'.
    LS_CONTROL_PARAM-no_dialog = 'X'.
    DO NAST_ANZAL TIMES.
    *--In case of repetition only one time archiving
    * if sy-index > 1 and nast-tdarmod = 3.
    * nast_tdarmod = nast-tdarmod.
    * nast-tdarmod = 1.
    * ls_composer_param-tdarmod = 1.
    * endif.
    IF SY-INDEX NE 1 AND REPEAT IS INITIAL.
    REPEAT = 'X'.
    ENDIF.
    CALL FUNCTION LF_FM_NAME
    EXPORTING
    ARCHIVE_INDEX = TOA_DARA
    ARCHIVE_PARAMETERS = ARC_PARAMS
    CONTROL_PARAMETERS = LS_CONTROL_PARAM
    MAIL_RECIPIENT = LS_RECIPIENT
    MAIL_SENDER = LS_SENDER
    OUTPUT_OPTIONS = LS_COMPOSER_PARAM
    USER_SETTINGS = SPACE
    IS_NAST = NAST
    IS_REPEAT = REPEAT
    I tried to trace it to the function module generated by smartform. The error propagates this way: From the function module, there is a call to function SSFCOMP_PROCESS_DOCUMENT. Then inside that function, there is a perform operation to tr_ssfcomp_process_doc
    perform tr_ssfcomp_process_doc using startpage docstruc
                                           header.
    Inside that form, it calls the macro tr_active which checks the value of ssfcstat-trlevel (tracelevel) against c_trlevel_document. In the macro, if ssfcstat-trlevel is less than c_trlevel_document, the smartform will fail. c_trlevel_document is 15 and ssfcstat-trlevel is 0, and so the smartform fails.
    (you can see the macro tr_active in include LSTXBCMAC and the form tr_ssfcomp_process_doc is in the include LSTXBCFTR)
    When I do not put values in CONTROL_PARAMETERS and OUTPUT_OPTIONS, everything is ok.
    Do you know why this happens?
    Thanks in advance!
    Edit: I have found out about transaction SFTRACE, but this is disabled.
    Kyle

  • Capture DocEntry of purchase order created by Proc. Confirmation Wizard

    Dear all,
    in SAP B1 2007 I developed a UI DI API addon to read the docentry of all purchase orders created by Procurement Confirmation Wizard.
    I used the et_FORM_DATA_ADD  event created by the wizard when I confirmed the creation of the purchase order.
    In this event, the BusinessObjectInfo.ObjectKey string contained the DocEntry of the new purchase order.
    But now, with SAP 8.81 PL 06, this event is not raised anymore.
    So... now... how can I know the DocEntry  (not DocNum) of the new purchase orders created by Procurement Confirmation Wizard?
    Can someone help me, please?
    Regards
        Emanuele

    Dear all,
    I solved the problem analyzing the event raised by SAP B1 8.81 Proc. Confirmation Wizard.
        Const CONFIRM_PURCHASE_ORDER_FORM_TYPE As String = "540010007"
        Const ERROR_STRING As String = "ERRORE: "
        Const WIZARD_MATRIX_PO_DOCNUM_MESSAGE As String = "540010007-36]"
        Const WIZARD_MATRIX_FORMID As String = "540000036"
        Const WIZARD_LINK_COLUMN_ID As String = "540000005"
        Const WIZARD_VALIDATE_COLUMN_ID As String = "540000003"
    Private Sub SBO_Application_ItemEvent(ByVal FormUID As String, ByRef pVal As SAPbouiCOM.ItemEvent, _
                                              ByRef BubbleEvent As Boolean) Handles SBO_Application.ItemEvent
            Try
                If pVal.FormType = CONFIRM_PURCHASE_ORDER_FORM_TYPE Then
                    ' event activated by the matrix element
                    If pVal.ItemUID = WIZARD_MATRIX_FORMID And pVal.BeforeAction = True Then
                        ' if event is "matrix link pressed" or "form/matrix validate"
                        If (pVal.EventType = SAPbouiCOM.BoEventTypes.et_MATRIX_LINK_PRESSED And pVal.ColUID = WIZARD_LINK_COLUMN_ID) Or _
                            (pVal.EventType = SAPbouiCOM.BoEventTypes.et_VALIDATE And pVal.ColUID = WIZARD_VALIDATE_COLUMN_ID) Then
                            Dim recordsetTemp As SAPbobsCOM.Recordset = Nothing
                            Dim recordsetTemp2 As SAPbobsCOM.Recordset = Nothing
                            Dim recordsetTemp3 As SAPbobsCOM.Recordset = Nothing
                            Dim oform As SAPbouiCOM.Form
                            Try
                                oform = SBO_Application.Forms.GetForm(CONFIRM_PURCHASE_ORDER_FORM_TYPE, 1)
                                Dim sQuery As String
                                Dim oMatrix As SAPbouiCOM.Matrix = oform.Items.Item(WIZARD_MATRIX_FORMID).Specific
                                Dim ocolumn As SAPbouiCOM.Column = oMatrix.Columns.Item(WIZARD_LINK_COLUMN_ID) ' ("540000005")
                                If oMatrix.RowCount > 0 Then
                                    For iRow As Integer = 1 To oMatrix.RowCount
                                        Dim oEditText As SAPbouiCOM.EditText
                                        oEditText = ocolumn.Cells.Item(iRow).Specific ' pVal.Row
                                        If Not oEditText.Value.Contains(WIZARD_MATRIX_PO_DOCNUM_MESSAGE) Then
                                            Continue For
                                        End If
                                        Dim DocNum As Integer = 0
                                        Dim stemp As String = oEditText.Value
                                        Dim stemp2 As String = ""
                                        Dim iterRow As Integer = 0
                                        ' loop in the string searching for the purchase order docnum
                                        While 1 = 1
                                            If stemp.Contains(" ") Then
                                                stemp2 = stemp.Substring(0, stemp.IndexOf(" "))
                                                Try
                                                    DocNum = CInt(stemp2)
                                                    Exit While
                                                Catch ex As Exception
                                                    stemp = stemp.Substring(stemp.IndexOf(" ") + 1)
                                                    DocNum = 0
                                                End Try
                                            Else
                                                Exit While
                                            End If
                                        End While
                                        If DocNum = 0 Then
                                            Continue For
                                        End If
                                        Dim PO_DocEntry As String = ""
                                        recordsetTemp2 = oCompany.GetBusinessObject(SAPbobsCOM.BoObjectTypes.BoRecordset)
                                        sQuery = "SELECT MAX(DocEntry) As MaxDocEntry from OPOR where DocNum = " & DocNum
                                        ' execute SQL query
                                        recordsetTemp2.DoQuery(sQuery)
                                        If recordsetTemp2 IsNot Nothing Then
                                            If recordsetTemp2.RecordCount = 0 Then
                                                Continue For
                                            End If
                                            recordsetTemp2.MoveFirst()
                                            PO_DocEntry = recordsetTemp2.Fields.Item("MaxDocEntry").Value
                                        End If
                                        If PO_DocEntry <> "" Then
                                            ' check if this Purchase Order has already some textlines
                                            ' If it already has text lines, then we don't need to add them to it
                                            recordsetTemp3 = oCompany.GetBusinessObject(SAPbobsCOM.BoObjectTypes.BoRecordset)
                                            sQuery = "SELECT count(*) As ExistYN from POR10 where DocEntry = " & PO_DocEntry
                                            recordsetTemp3.DoQuery(sQuery)
                                            If recordsetTemp3 IsNot Nothing Then
                                                If recordsetTemp3.RecordCount > 0 Then
                                                    recordsetTemp3.MoveFirst()
                                                    Dim numOfTextLinesForThis_PO As Integer = CInt(recordsetTemp3.Fields.Item("ExistYN").Value)
                                                    If numOfTextLinesForThis_PO > 0 Then
                                                        Continue For
                                                    End If
                                                End If
                                            End If
                                        End If
                                        ' if this PO still hasn't any texlines, then we try to add to it reading the textlines of Sales Order
                                        ' reopen the purchase order
                                        Dim oPurchaseOrder As SAPbobsCOM.Documents
                                        oPurchaseOrder = oCompany.GetBusinessObject(BoObjectTypes.oPurchaseOrders)
                                        oPurchaseOrder.GetByKey(CInt(PO_DocEntry))
                                        ' loop on every lines
                                        For i As Integer = 0 To oPurchaseOrder.Lines.Count - 1
                                            oPurchaseOrder.Lines.SetCurrentLine(i)
                                            ' if purchase order line was generetated from a sales order
                                            If oPurchaseOrder.Lines.BaseType = 17 Then
                                                recordsetTemp = oCompany.GetBusinessObject(SAPbobsCOM.BoObjectTypes.BoRecordset)
                                                ' search the text lines in the sales order
                                                sQuery = "SELECT t11.LineText As LineText "
                                                sQuery &= " from RDR10 t11 "
                                                sQuery &= " Where t11.DocEntry = '" & oPurchaseOrder.Lines.BaseEntry & "' "
                                                sQuery &= "  AND t11.AftLineNum = " & oPurchaseOrder.Lines.BaseLine
                                                sQuery &= "  AND t11.LineType = 'T' and t11.ObjType = " & oPurchaseOrder.Lines.BaseType
                                                sQuery &= " order by t11.LineSeq "
                                                ' execute SQL query
                                                recordsetTemp.DoQuery(sQuery)
                                                If recordsetTemp IsNot Nothing Then
                                                    If recordsetTemp.RecordCount = 0 Then
                                                        Continue For
                                                    End If
                                                    recordsetTemp.MoveFirst()
                                                    ' loop on each text lines found
                                                    While recordsetTemp.EoF = False
                                                        If recordsetTemp.Fields.Item("LineText").Value <> String.Empty Then
                                                            oPurchaseOrder.SpecialLines.LineType = BoDocSpecialLineType.dslt_Text
                                                            oPurchaseOrder.SpecialLines.LineText = recordsetTemp.Fields.Item("LineText").Value
                                                            oPurchaseOrder.SpecialLines.AfterLineNumber = oPurchaseOrder.Lines.LineNum
                                                            oPurchaseOrder.SpecialLines.Add()
                                                        End If
                                                        recordsetTemp.MoveNext()
                                                    End While ' recordsetTemp.EoF = False
                                                End If ' recordsetTemp IsNot Nothing
                                            End If ' oPurchaseOrder.Lines.BaseType = 17
                                        Next ' end-loop on every lines
                                        ' update the purchase order
                                        oPurchaseOrder.Update()
                                    Next
                                End If
                            Catch ex As Exception
                            Finally
                                recordsetTemp = Nothing
                                recordsetTemp2 = Nothing
                                recordsetTemp3 = Nothing
                            End Try
                        End If
                    End If
                End If
            Catch ex As Exception
            End Try
        End Sub
    Regards
        Emanuele
    Edited by: Emanuele Croci on Aug 29, 2011 5:05 PM

  • Customizing 'Print Purchase Order' Report

    Hi All,
    We need to customize the 'Print Purchase Orders' report, for communicating the PO to supplier. But the Fax commnds, and the output format we have to change accordingly. Also we need to move the generated output file to another directory.
    Please let me know the recommended customizing procedure for the above.
    Thans,
    Gowri.

    Hi,
    If you want to modify Print PO Report (POXPOPDF), refer to the following document.
    Note: 305307.1 - How To Modify Print PO Report POXPOPDF With Custom Template
    https://metalink2.oracle.com/metalink/plsql/ml2_documents.showDocument?p_database_id=NOT&p_id=305307.1
    Regards,
    Hussein

  • Customize printed purchase order report

    Hi all
    i need to customize Printed purchase order report
    i need to add supplier item number to printed purchase order report
    where(group) i need to add item number i think it g_lines right?
    item number is sengment from tml_system_items_b is it correct
    ple reply it is urgent
    ashok

    Ashok,
    Try to get a sample and understand the concern from your users. See if that is already customized to not show the supplier item number (as far as I remember I don't think there are any conditions in the standard report that qulify the printing of the supplier item number, it should print as long as it is entered in the supplier item number field in the PO lines). So see where your users are entering this in PO lines.
    Yes it is vendor_product_num in PO lines table.
    Thanks
    Nagamohan

  • Printed Purchase Order Report  R12

    Hi,
    I'm looking for Oracle Printed Purchase Order Report rdf file POXPRPOL
    Could you let me know the path to get this rdf.
    Thanks.

    got it.

  • Printed Purchase Order Report Custom version FAX enabling

    Hi All,
    We customized Printed Purchase Order Report(Landscape) 'POXPRPOL' and is runnig fine. Our client want FAX enabled to the output of custom report.
    Is there any option like print option for this. Or do we need to write and code for this.
    Please help.
    Thanks

    Hi;
    Please see below which could be helpful for your issue:
    http://blogs.oracle.com/xmlpublisher/entry/faxing_from_ebs
    http://www.strsoftware.com/blog/oracle-ebs-r12-1-3-submit-request-delivery-options-button-fax-4-of-6/
    Also see <a href=https://forums.oracle.com/forums/search.jspa?threadID=&q=fax&objID=c3&dateRange=all&userID=&numResults=15
    this search</a>Regard
    Helios

  • Printed Purchase order Report

    Hi all
    i need to customize Printed purchase order report(Lanadsacp)
    i need to add supplier item number to printed purchase order report
    where(group) i need to add item number i think it is g_lines right?
    item number is sengment1 from tml_system_items_b is it correct?
    ple reply it is urgent
    ashok

    Ashok,
    Try to get a sample and understand the concern from your users. See if that is already customized to not show the supplier item number (as far as I remember I don't think there are any conditions in the standard report that qulify the printing of the supplier item number, it should print as long as it is entered in the supplier item number field in the PO lines). So see where your users are entering this in PO lines.
    Yes it is vendor_product_num in PO lines table.
    Thanks
    Nagamohan

  • Mass display or print Purchase Order History

    Instead of checking your Purchase Order History one at a time, you can now mass display or print them with this customized abap report.
    Mass display or print Purchase Order History
    You can request report by :
    1.  Change date
    2.  User Name
    3.  Purchase Order Number
    4.  Vendor Code
    Written by : SAP Basis, ABAP Programming and Other IMG Stuff
                 http://www.sap-img.com
    REPORT ZPOCHANGE LINE-SIZE 132 NO STANDARD PAGE HEADING
                     LINE-COUNT 065(001)
                     MESSAGE-ID VR.
    TABLES: DD04T,
            CDHDR,
            CDPOS,
            DD03L,
            DD41V,
            T685T,
            VBPA,
            TPART,
            KONVC,
            EKKO.
    SELECT-OPTIONS: XUDATE FOR CDHDR-UDATE,
                    XNAME  FOR CDHDR-USERNAME,
                    XEBELN FOR EKKO-EBELN,
                    XLIFNR FOR EKKO-LIFNR.
    SELECTION-SCREEN SKIP.
    TEXT-001 - Sorting Sequence
    SELECTION-SCREEN BEGIN OF BLOCK BLK1 WITH FRAME TITLE TEXT-001.
    PARAMETERS: SUDATE RADIOBUTTON GROUP R1,
                SNAME  RADIOBUTTON GROUP R1,
                SOBID  RADIOBUTTON GROUP R1.
    SELECTION-SCREEN END OF BLOCK BLK1.
    DATA: WFLAG,
          WCHANGENR LIKE CDHDR-CHANGENR.
    DATA: INDTEXT(60) TYPE C.
    DATA: BEGIN OF ICDHDR OCCURS 50.
            INCLUDE STRUCTURE CDHDR.
    DATA: END OF ICDHDR.
    DATA: BEGIN OF ICDSHW OCCURS 50.
            INCLUDE STRUCTURE CDSHW.
    DATA: END OF ICDSHW.
    DATA: BEGIN OF EKKEY,
            EBELN LIKE EKET-EBELN,
            EBELP LIKE EKET-EBELP,
            ETENR LIKE EKET-ETENR,
          END OF EKKEY.
    DATA: BEGIN OF ITAB OCCURS 50,
            BEGIN OF EKKEY,
              EBELN LIKE EKET-EBELN,
              EBELP LIKE EKET-EBELP,
              ETENR LIKE EKET-ETENR,
            END OF EKKEY,
            CHANGENR LIKE CDHDR-CHANGENR,
            UDATE    LIKE CDHDR-UDATE,
            UTIME    LIKE CDHDR-UTIME,
            USERNAME LIKE CDHDR-USERNAME,
            CHNGIND  LIKE CDSHW-CHNGIND,
            FTEXT    LIKE CDSHW-FTEXT,
            OUTLEN   LIKE CDSHW-OUTLEN,
            F_OLD    LIKE CDSHW-F_OLD,
            F_NEW    LIKE CDSHW-F_NEW,
          END OF ITAB.
    DATA: OLD_OBJECTID LIKE CDHDR-OBJECTID.
    FIELD-SYMBOLS: <F_OLD>, <F_NEW>.
    SELECT * FROM EKKO WHERE EBELN IN XEBELN AND
                             LIFNR IN XLIFNR.
      CLEAR CDHDR.
      CLEAR CDPOS.
      CDHDR-OBJECTCLAS = 'EINKBELEG'.
      CDHDR-OBJECTID   = EKKO-EBELN.
      PERFORM GETCHGDOCS.
    ENDSELECT.
    IF SUDATE = 'X'.
      SORT ITAB BY UDATE EKKEY-EBELN CHANGENR EKKEY-EBELP
                   EKKEY-ETENR.
    ELSEIF SNAME = 'X'.
      SORT ITAB BY USERNAME EKKEY-EBELN CHANGENR EKKEY-EBELP
                   EKKEY-ETENR.
    ELSE.
      SORT ITAB BY EKKEY-EBELN CHANGENR EKKEY-EBELP EKKEY-ETENR.
    ENDIF.
    LOOP AT ITAB.
      CLEAR: INDTEXT, EKKEY.
      CASE ITAB-CHNGIND.
        WHEN 'U'.
            INDTEXT(50) = ITAB-FTEXT.
            INDTEXT+51  = TEXT-020.
            CONDENSE INDTEXT.
        WHEN 'D'.
            INDTEXT = TEXT-021.
        WHEN 'E'.
            INDTEXT(5) = ITAB-FTEXT.
            INDTEXT+51 = TEXT-021.
            CONDENSE INDTEXT.
          WHEN 'I'.
            INDTEXT = TEXT-022.
        ENDCASE.
        RESERVE 4 LINES.
        IF WCHANGENR NE ITAB-CHANGENR.
          WCHANGENR = ITAB-CHANGENR.
          EKKEY = ITAB-EKKEY.
          WRITE:/ ITAB-UDATE UNDER 'Change Date',
                  ITAB-UTIME UNDER 'Time',
                  ITAB-USERNAME UNDER 'User Name',
                  ITAB-EKKEY-EBELN UNDER 'PO No',
                  ITAB-EKKEY-EBELP UNDER 'Item',
                  ITAB-EKKEY-ETENR UNDER 'Sch No',
                  INDTEXT     UNDER 'Changes'.
        ELSEIF ITAB-EKKEY NE EKKEY.
          WRITE:/ ITAB-EKKEY-EBELP UNDER 'Item',
                  ITAB-EKKEY-ETENR UNDER 'Sch No',
                  INDTEXT     UNDER 'Changes'.
        ENDIF.
        CASE ITAB-CHNGIND.
          WHEN 'U'.
            ASSIGN ITAB-F_OLD(ITAB-OUTLEN) TO <F_OLD>.
            ASSIGN ITAB-F_NEW(ITAB-OUTLEN) TO <F_NEW>.
            WRITE: / TEXT-023  UNDER 'Changes',
                     <F_OLD>.
            WRITE: / TEXT-024 UNDER 'Changes',
                     <F_NEW>.
          WHEN 'E'.
            ASSIGN ITAB-F_OLD(ITAB-OUTLEN) TO <F_OLD>.
            WRITE: TEXT-023 UNDER 'Changes',
                   <F_OLD>.
        ENDCASE.
        SKIP.
    ENDLOOP.
    TOP-OF-PAGE.
    WRITE:/ SY-DATUM,SY-UZEIT,
           50 'P U R C H A S E  O R D E R   H I S T O R Y',
          120 'Page', SY-PAGNO.
    WRITE: / SY-REPID,
             60 'Purchase Orders Changes'.
    SKIP.
    ULINE.
    IF SUDATE = 'X'.
      WRITE:/001 'Change Date',
             014 'Time',
             024 'User Name',
             038 'PO No',
             050 'Item',
             057 'Sch No',
             065 'Changes'.
    ELSEIF SOBID = 'X'.
      WRITE:/001 'PO No',
             013 'Item',
             020 'Sch No',
             028 'Change Date',
             041 'Time',
             051 'User Name',
             065 'Changes'.
    ELSE.
      WRITE:/001 'User Name',
             015 'Change Date',
             028 'Time',
             038 'PO No',
             050 'Item',
             057 'Sch No',
             065 'Changes'.
    ENDIF.
    ULINE.
    FORM GETCHGDOCS.
      CALL FUNCTION 'CHANGEDOCUMENT_READ_HEADERS'
           EXPORTING
                DATE_OF_CHANGE    = CDHDR-UDATE
                OBJECTCLASS       = CDHDR-OBJECTCLAS
                OBJECTID          = CDHDR-OBJECTID
                TIME_OF_CHANGE    = CDHDR-UTIME
                USERNAME          = CDHDR-USERNAME
           TABLES
                I_CDHDR           = ICDHDR
           EXCEPTIONS
                NO_POSITION_FOUND = 1
                OTHERS            = 2.
      CHECK SY-SUBRC EQ 0.
      DELETE ICDHDR WHERE CHANGE_IND EQ 'I'.
      CHECK NOT ICDHDR[] IS INITIAL.
      LOOP AT ICDHDR.
        CHECK ICDHDR-UDATE IN XUDATE.
        CHECK ICDHDR-USERNAME IN XNAME.
        CALL FUNCTION 'CHANGEDOCUMENT_READ_POSITIONS'
                     EXPORTING  CHANGENUMBER       = ICDHDR-CHANGENR
                     IMPORTING  HEADER             = CDHDR
                     TABLES     EDITPOS            = ICDSHW
                     EXCEPTIONS NO_POSITION_FOUND  = 1
                                OTHERS             = 2.
        CHECK SY-SUBRC EQ 0.
        LOOP AT ICDSHW.
          CHECK ICDSHW-TEXT_CASE EQ SPACE.
          MOVE-CORRESPONDING ICDSHW TO ITAB.
          MOVE-CORRESPONDING ICDHDR TO ITAB.
          MOVE ICDSHW-TABKEY+3 TO ITAB-EKKEY.
          APPEND ITAB.
        ENDLOOP.
      ENDLOOP.
    ENDFORM.
    END OF PROGRAM

    Hi,
    copied from          http://www.sap-img.com/mm001.htm

Maybe you are looking for

  • Error while generating reports

    Hi, I have taken Customer Fname,Customer ID and salary (as a measure) to generate a report in compound layout.I am encountering the following error: Error Codes: OPR4ONWY:U9IM8TAC:OI2DL65P State: HY000. Code: 10058. [NQODBC] [SQL_STATE: HY000] [nQSEr

  • �� I have a java applet program (yanhua.java) need help!!!

    �� I have a java applet program (yanhua.java) that use mouse click a area show a fireworks, the applet program that a java fan mail me. Now i find some bug in the program, can you help me? thank in advance! The backdrop of the question: The yanhua.ja

  • ABAP  QUERY :transport number generation

    Friends, Please help me to generate the Transport request for ABAP query. I have modified an existing custom ABAP QUERY. I have followed the following process, but unable to get the transport number. Goto SQ02. Select the proper query area. Press the

  • File open issue, after file deleted. fopen status is failing in VC++

    /* fopen example */ #include <stdio.h> int _tmain(int argc, _TCHAR* argv[])   FILE * pFile;   for(int i=0; i < 1000000; i++)             bool ret = remove("C:\\abc.txt");             pFile = fopen ("C:\\abc.txt","w");             if (pFile!=NULL)    

  • As of today, I cant read my yahoo mail w/firefox 18.

    I have Windows XP SP-3 installed with Firefox-18. As of today, firefox will not open my yahoo email files. IE and Chrome work just fine opening my yahoo emails. When I click on an unread yahoo email, nothing happens. it just stalls. Sincerely, Steve