Getting wrong subtotals in the Report

Hi,
I have generated a report. But in that report i am getting wrong subtotals for some of the rows.
Please tell me what can be the reason and the corrective action for this.
Thanks and Regards,
Vikrant

Is that the Key fig are not properly adding up??? Then go the properties and set Calculate result as Summation
If this is not your problem then could you please show with an example how ur report looks like and what is the error that u are getting????

Similar Messages

  • Getting error while exporting the report

    Hi,
    I am facing error while exporting the report. Getting below error.
    "No data can be exported because there are no rows.Operation failed."
    how come this error is coming even though my report contains data.
    please do the needful.
    i am using the version discoverer 10g.
    Thanks,
    RC.

    I am having the same problem. I found this article in which the user was exporting 100,000 plus records and had the same issue exporting (Discoverer workbook exported to excel error - No dta can be exported and they were able to fix it by adjusting two memory settings in their pref.txt file. However, in my report there are only 1,100 records with eleven columns being returned. I export much larger reports on a daily basis.
    Originally, the report was returning records and when I would go to retrieve all records it would tell me that all the rows could not be returned and the data may be incomplete. After scrubbing my SQL I no longer get that message, but the report still will not export and I get the same error as you.
    I have not tried the pref.txt settings fix but may try it today to see if that is a workaround. I will then have to evaluate whether it is a good fix or just a band-aid.

  • Getting warning while running the report

    hi all am getting warning while running the report .
    the log file is given below
    +---------------------------------------------------------------------------+
    Process Manufacturing Inventory: Version : 11.5.0
    Copyright (c) 1979, 1999, Oracle Corporation. All rights reserved.
    XXVIS_OPM_STOCK_STATEMENT module: Visaka RG1 Register
    +---------------------------------------------------------------------------+
    Current system time is 11-OCT-2011 20:42:05
    +---------------------------------------------------------------------------+
    **Starts**11-OCT-2011 20:42:05
    **Ends**11-OCT-2011 20:43:25
    +---------------------------------------------------------------------------+
    Start of log messages from FND_FILE
    +---------------------------------------------------------------------------+
    +---------------------------------------------------------------------------+
    End of log messages from FND_FILE
    +---------------------------------------------------------------------------+
    +---------------------------------------------------------------------------+
    Executing request completion options...
    +------------- 1) PUBLISH -------------+
    Unable to find an Output Post Processor service to post-process request 15845789.
    Check that the Output Post Processor service is running.
    +--------------------------------------+
    +------------- 2) PRINT   -------------+
    Not printing the output of this request because post-processing failed.
    +--------------------------------------+
    Finished executing request completion options.
    +---------------------------------------------------------------------------+
    Concurrent request completed
    Current system time is 11-OCT-2011 20:43:25
    +---------------------------------------------------------------------------+what is mean by output post processor?
    why am getting this problem?
    Please help me to fix this problem .
    Thanks for all in advance

    Hi;
    Unable to find an Output Post Processor service to post-process request 15845789.
    Check that the Output Post Processor service is running.Check OPP Cm are up and run. Please also check logs for can see why you are getting this message
    Regard
    Helios

  • Getting warninig while running the report

    hi all am getting warning while running the report .
    am getting following errors in log file .
    log file is given below
    please help me
    +---------------------------------------------------------------------------+
    Process Manufacturing Inventory: Version : 11.5.0
    Copyright (c) 1979, 1999, Oracle Corporation. All rights reserved.
    XXVIS_OPM_STOCK_STATEMENT module: Visaka RG1 Register
    +---------------------------------------------------------------------------+
    Current system time is 11-OCT-2011 20:35:56
    +---------------------------------------------------------------------------+
    **Starts**11-OCT-2011 20:35:57
    **Ends**11-OCT-2011 20:37:26
    +---------------------------------------------------------------------------+
    Start of log messages from FND_FILE
    +---------------------------------------------------------------------------+
    +---------------------------------------------------------------------------+
    End of log messages from FND_FILE
    +---------------------------------------------------------------------------+
    +---------------------------------------------------------------------------+
    Executing request completion options...
    +------------- 1) PUBLISH -------------+
    Unable to find an Output Post Processor service to post-process request 15845786.
    Check that the Output Post Processor service is running.
    +--------------------------------------+
    +------------- 2) PRINT   -------------+
    Not printing the output of this request because post-processing failed.
    +--------------------------------------+
    Finished executing request completion options.
    +---------------------------------------------------------------------------+
    Concurrent request completed
    Current system time is 11-OCT-2011 20:37:26
    +---------------------------------------------------------------------------+
    [\code]
    thanks for all in advance.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           

    Ask this in the Oracle eBusiness Suite forum. This doesn't look like a Reports problem.

  • Problem in Getting Count answer for the report in OBIEE 11g..

    Hi friends,
    I created a report in OBIEE 11g, but i'm not getting the correct answer as i expected...I'm getting answer in presentation services but the answer is wrong..
    I'll explain to you with an example report: Suppose in the report "NATIONALITY COUNT IN DEPARTMENT WISE" manner
    i dragged the Nationality column from per_all_people_f which is dim table and i dragged the column that i applied aggregation rule "count" for the column "nation count" from per_all_assignments_f which is fact table......If i viewed answers means i'm getting correct answer
    (i.e.) nation count per Nationality..........
    NATIONALITY<---------------------->NATION COUNT
    AUSTRALIA 40
    INDIA 20
    AFRICA 10
    USA 5
    The above is the answer I'm getting with out including the department column from hr_all_organization_units...........
    But since according to the report i need count in department wise manner, so for that along with nationality and nation count column i dragged department column from hr_all_organization_units which is dim table and also i hide that column as i dont want to view the department column in answers..........
    If i clicked answers, means then I'm not getting the nation count for the nationality......... I'm getting the answer 0 for each and every nationality, if i included the hided department column
    NATIONALITY<----------------->NATION COUNT
    AFRICA 0
    AUSTRALIA 0
    INDIA 0
    USA 0
    I'm getting answers like the above if i include the department dimension column which is in hided manner.........................
    What is wrong with it........Whether i made any logical mistake for the report.....If so guide me friends..........
    Cheers,
    Harry...........

    Hi,
    you said about writing query in DB.......whether U meant of trying checking the query in toad..or something else..........
    Since im giving only one join from dim to fact in the physical diagram........
    But more than one join exist between those dim and fact, but im giving only one join mainly the primary key column of the dimension table to the fact table....Whether i need to give all the joins that exist(even if it has 2 or 3 joins between those fact and dim) tables....
    If i give count distinct means it is giving count for every nation as 1....like i mentioned below
    NATIONALITY<----------------------------------------------------->NATION COUNT
    INDIA---------------------------------------------------------------------1
    AUS------------------------------------------------------------------------1
    CAN------------------------------------------------------------------------1
    Since you said to check about depts of the particular column....i couldn't able to understand about "depts" that you meant????
    Whether i made any logical mistake...........
    thanks,
    Harry...
    Edited by: HariPrasad on Oct 10, 2010 9:55 PM

  • Getting error while executing the report in WEB

    Hello Experts,
    I have did validation in my report on selection screen, if that validation is successful then only we can see the report output
    otherwise it's give the error message.
    Validations are working query designer and RSRT but when I run the report in WEB then even if the validation is successful then also I am getting the error message and not able to see the report output.
    I have written the code in user exit for validation.
    Can any one tell me why it is so?
    what needs to do?
    Thanks
    Chetan

    Hi.
    Could you plz explain your validation logic and wich way it done ?
    Could you plz provide error message ?
    Regards.

  • User getting error while opening the report

    Admin can run the report, but users cannot.
    This is XI3.1 Cluster version on Linux. User's cannot run the webi document, getting the error below
    An error occured when trying to set preferences. Please contact your Business Objects administrator. (Error: INF)
    Also when the users try to set the preferences they get this error
    An error has occurred: Sorry, you do not have the right to 'Edit objects' (ID: 6) for 'linwe' (ID: 18496663). Please contact your administrator if you require this right.
    It looks like it might be issue with the rights, but can't figure out where.
    These users are in the developer access level where they have almost all the rights.
    Please help

    inorder for the users to change their preferences, following right must be enabled
    Access Levels --> select the ACL and go to included rights
    Application --> Infoview -->Change user's preferences
    Can you check whether it is enabled or not?

  • Getting IllegalThreadStateException, while exporting the report to PDF

    Hi Friends,
    I am using JRC to create report in PDF format.
    But intermitently I get java.lang.IllegalThreadStateException while trying to export ReportClientDocument into PDF format using the PrintOutPutContrller.
    The I am using for this is
    ExportOptions exportoptions = new ExportOptions();
    PDFExportFormatOptions pdfOptions = new PDFExportFormatOptions();
    exportoptions.setExportFormatType(ReportExportFormat.PDF);
    exportoptions.setFormatOptions(pdfOptions);
    reportInputStream = reportClientDocument.getPrintOutputController().export(exportoptions);
    The exception I get is:
    com.crystaldecisions.sdk.occa.report.lib.ReportSDKException: java.lang.IllegalThreadStateException---- Error code:-2147467259 Error code name:failed
    at com.crystaldecisions.sdk.occa.report.application.PrintOutputController.if(Unknown Source)
    at com.crystaldecisions.sdk.occa.report.application.PrintOutputController.export(Unknown Source)
    at com.crystaldecisions.sdk.occa.report.application.PrintOutputController.export(Unknown Source)
    at com.solidcore.as.report.ReportJob.createPDFReport(ReportJob.java:114)
    at com.solidcore.as.report.ReportJob.execute(ReportJob.java:66)
    at org.quartz.core.JobRunShell.run(JobRunShell.java:202)
    at org.quartz.simpl.SimpleThreadPool$WorkerThread.run(SimpleThreadPool.java:525)
    I am using JRC that comes with CR4E 2.0. The Report is designed using Crystal Report 2008.
    Please help me in solving the issue.
    Thank you,
    Deepak

    Hi Ted,
    Thank you for the answers.
    In our applications the Report will be generated in two ways.
    1. A user clicks on a link on web, and the report is generated in PDF format and sent via http.
                At present we are creating a new
                ReportClientDocument for every request and using ExportControl.processHttpRequest() API
                the report in PDF format is sent user through response.
    2. Quartz schuduler trigger a job, whose work is to generate Report in PDF format into a file, and the
              generated pdf file is sent to users via mail.
              Here I user ReportCLientDocument.export() API to get the InputStream and use the input stream
              to create PDF file.
    It is possible that a user is requesting a report on Web Page and the same report is being generated by Scheduler at the same time. But in each case a separate ReportClientDocument is being used.Since Report containse a huge data, and it takes time to generate PDF file so, it is possible that a given RPT file is opened by two spearate ReportClientDocuemnt (one via web user and other via Scheduler) at the same time.
    The have got rid of my earlier exceptions by sycncronizing the ReportClientDocuent.export() API.
    But now am getting following exception intermittently.
    2009-05-01 16:47:45.859 GMT+05:30 [ERROR] [ReportJob.java:137] [AnalyticsScheduler_Worker-10(34)] - [] Could not generate the Report.
    java.lang.NullPointerException
         at com.crystaldecisions.sdk.occa.report.application.ds.a(Unknown Source)
         at com.crystaldecisions.sdk.occa.report.application.ReportSource.a(Unknown Source)
         at com.crystaldecisions.sdk.occa.report.application.ReportSource.a(Unknown Source)
         at com.crystaldecisions.sdk.occa.report.application.PrintOutputController.if(Unknown Source)
         at com.crystaldecisions.sdk.occa.report.application.PrintOutputController.export(Unknown Source)
         at com.crystaldecisions.sdk.occa.report.application.PrintOutputController.export(Unknown Source)
         at com.solidcore.as.report.ReportJob.createPDFReport(ReportJob.java:123)
         at com.solidcore.as.report.ReportJob.execute(ReportJob.java:75)
         at org.quartz.core.JobRunShell.run(JobRunShell.java:202)
         at org.quartz.simpl.SimpleThreadPool$WorkerThread.run(SimpleThreadPool.java:525)
    2009-05-01 16:47:45.859 GMT+05:30 [ERROR] [JobRunShell.java:211] [AnalyticsScheduler_Worker-10] - Job reportJobGroup.reportJob threw an unhandled Exception:
    java.lang.NullPointerException
         at com.crystaldecisions.sdk.occa.report.application.ReportClientDocument.if(Unknown Source)
         at com.crystaldecisions.sdk.occa.report.application.ReportClientDocument.case(Unknown Source)
         at com.crystaldecisions.sdk.occa.report.application.ClientDocument.close(Unknown Source)
         at com.crystaldecisions.sdk.occa.report.application.ReportClientDocument.close(Unknown Source)
         at com.solidcore.as.report.ReportJob.createPDFReport(ReportJob.java:155)
         at com.solidcore.as.report.ReportJob.execute(ReportJob.java:75)
         at org.quartz.core.JobRunShell.run(JobRunShell.java:202)
         at org.quartz.simpl.SimpleThreadPool$WorkerThread.run(SimpleThreadPool.java:525)
    Edited by: Deepak Mishra on May 4, 2009 5:47 PM

  • "Edit Report" option getting disabled on saving the report in BPC 10.0

    I have created input schedules using "Edit Report" functionality in BPC 10.0 NW, added a few buttons and corresponding VB code and tested the input schedule by sending data and running data manager package. Everything is working fine. After that I saved the input schedule and closed the Excel. On reopening the excel Add-in and the input schdule, the "Edit report" option becomes disabled and refresh and other functionalities available for the report get disabled. I have faced this issue a couple of times. Has anybody else faced this issue? Can someone let me know the resolution to this problem?

    Hi Shruti,
    This is probably happening because the report/input schedules is not getting connected. Please check the connections once.
    Also if you had named the report in "Edit Report" earlier, say for example "Sales Report", once the report is open you should be able to see this name on the EPM context pane, right side under Current Report: Connected to "Your Model" and below that in the drop down the default selection should be "Sales Report". This means that the report is connected and the Edit Report option is active.
    Hope this helps.
    Regards,
    Bhairavi

  • Getting variation while running the report S_ALR_87012386

    Hi,
    We made a posting in AP  based in USD  (value xxx  USD;   Local Amount :  361,65 u20AC )
    Due to the nature of the TAX Transaction, it was applied the Vat Code  XX  (to aplly / deduct VAT  at 23%  - Services from Other Markets). The posting is OK;  according to the rules:
    However while executing the report :S_ALR_87012386(Advance return for tax on sales/purchases Portugal) there is abnormal situation that shows wrong VAT base amounts and 23% tax also not calculating the Base amounts.
    I have posted the same document with local currency but there is no problem with Local currency because document and Tax amount calculated correctly in both transaction and report.
    Doc with local currency:  CR    31 vendor                10000
                                              DR   40 GL account                  10000
                                              CR   50 23% tax ammount  2300
                                              DR   40 23%tax amount             2300
    Above line items are showing correctly in report also same as it is.
    Below line items are correct but in report it is showing wrongly.
    Doc with F currency:      CR    31 vendor                     $520        Local: 350.52
                                              DR   40 GL account                 $ 520   Local: 350.52
                                              CR   50 23% tax ammount  $82.62      Local:  82.62
                                              DR   40 23%tax amount           $ 80.62   Local:80.62   
    Local Base amount     showing as 269.90 & 431.14 respectively and it is not calculating the 23% tax like above line items.                             
    It seems that only occured with Foreign Currency.
    Pleas let me know if you need further inputs or anything...
    Please help me out in this...
    KMR

    Ask this in the Oracle eBusiness Suite forum. This doesn't look like a Reports problem.

  • How to get keydate properties in the report.

    Dear Experts,
    One of my query have a Keydate Properties which promote users when refreshing data.
    And then in the report, when I try to use function UserResponse("dp.kd.value") to get the value of this date, the result is a nubmer such as "124908480000"  but what I input is "2009-08-01".
    So how can I get  the result the same as what I input(2009-08-01) ?
    Thank you,
    Andy

    What is the format of your formula and what is in the back end.
    Are you using Date object?
    Use formula in this format...
    (UserResponse("Enter Date" );2);""));"MM/dd/yyyy")
    Regards,
    Bashir Awan

  • Get a list of the report seen by teh users

    Hi expert,
    I need to know what report has been seen the users, and what report has been changed.
    I'd like to know  about any transaction that can help me get this information.
    Can you help me please?
    Thanks.

    Hi,
    Pls Check the table RSDDSTAT .
    You can only get this information if the query/ workbook is enabled for statistics logging in transaction RSDDSTAT.
    If it is enabled you can goto table RSDDSTAT ( BW 3.5) or RSDDSTAT_OLAP( BI 7.0 ) to see the users who executed the query . These tables store all the information per query session and you will find more than one rows per session but you can find the information you want i.e. users executing a particular query / workbook.
    Also Tcode: SU01 will give you all the user lists in the server.
    Regards
    CSM Reddy

  • Display wrong map in the report

    Dear all:
                      I designed one report and use DE to be the value of 0region's value. But after I executed the report, I saw the map of US!!!!!!!!!!!!  Could you please tell why? How to do with it? Where can I get the solution. It is very urgent, please help me!
                      Thanks a lot!

    I use BI 7  Bex  query designer to design the query to be the data provider.
    the query rows is 0region,the value of the region belongs to DE country, the columns is other field.
    I use BEx Web Application Designer to designe report. I add the map to the template, set the data provider, execute the report, then, the map displayed is US country map.
    Another thing, if I change the row to be the 0country, I can show the correct map!

  • How do I get a list of the reports that a user has access to?

    <p>I need to be able to determine which reports a specified user has access to.  This is for an application where users will be able to search and view reports that have been archived through a separate process.  </p><p>I&#39;ve searched through the developer library, but I can&#39;t find this specific information.  Can I use the ObjectPrinicpals class to get this info?</p><p>Thanks!</p><p>-Dell<br /></p>

    Hi Robert!
    Yes, the presentation went well. It was a lot of fun to do and I had a great time at the conference.
    Your suggestion works great if I'm walking down through the reports looking to see who has access to them.Â
    However, I need to do this starting from the User object. When I use the ObjectPrincipals of the User, I get a list of the users who have the rights to modify the user. I did a lot of work on this last week and it boils down to I'm going to have to actually log in as the user (I can use trusted authentication to do this without having the user's password) and then run a query to select all of the reports in the system - this should give me just the reports that the user has access to. Not the most efficient way to get the data from my perspective, but it should work.
    This would be a great feature to have added to future versions of the SDK. I need it for a couple of purposes:
    1. To gather information to set up the security in my archive viewer application.
    2. For auditing purposes - we currently have only Professional licenses so I don't have access to the internal auditing functionality. Plus, I'm not sure that that includes the kind of info I'm looking for so I'm building an app that extracts information to XML which is then used by a couple of reports so that I can provide the audit info as needed.
    -Dell
    Â - A computer only does what you told it to, not what you thought you told it to!</p>

  • Can any one help me to get Material no in the report

    Hi Gurus
    Can anyone help me to alter and get material number and description from VBAP , This is basically document price change report for users.
    The code is below
    report ZCHGDOC_BY_SALES no standard page heading
                              line-size 132.
    type-pools:
      slis.                     " ALV types
    Tables
    tables:
      cdhdr,                    " Change documents: Header
      cdpos,                    " Change documents: Items
      vbak,                     " Sales order: Header
      mara,                     " Material No
      user_addr,                 " User Address
      vbap.                     " Contract order: Items
    Types
    types:
      begin of ty_cdhdr,
        objectclas like cdhdr-objectclas,     " Object class
        objectid   like cdhdr-objectid,       " Object value
        changenr   like cdhdr-changenr,       " Document change number
        username   like cdhdr-username,       " Changed by
        udate      like cdhdr-udate,          " Changed on
        utime      like cdhdr-utime,          " Changed at
        tcode      like cdhdr-tcode,          " Transaction code
      end of ty_cdhdr,
      ty_it_cdhdr type ty_cdhdr occurs 0,
      begin of ty_cdpos,
        objectclas like cdpos-objectclas,     " Object class
        objectid   like cdpos-objectid,       " Object value
        changenr   like cdpos-changenr,       " Document change number
        tabname    like cdpos-tabname,        " Table name
        tabkey     like cdpos-tabkey,         " Table key
        fname      like cdpos-fname,          " Field name
        chngind    like cdpos-chngind,        " Change indicator
        value_new  like cdpos-value_new,      " New value of field
        value_old  like cdpos-value_old,      " Old value of field
      end of ty_cdpos,
      ty_it_cdpos type ty_cdpos occurs 0,
      begin of ty_dd03l,
        tabname   like dd03l-tabname,
        fieldname like dd03l-fieldname,
        as4local  like dd03l-as4local,
        as4vers   like dd03l-as4vers,
        rollname  like dd03l-rollname,
      end of ty_dd03l,
      ty_it_dd03l type ty_dd03l occurs 0,
      begin of ty_dd04t,
        rollname   like dd04t-rollname,
        ddlanguage like dd04t-ddlanguage,
        as4local   like dd04t-as4local,
        as4vers    like dd04t-as4vers,
        scrtext_l  like dd04t-scrtext_l,
      end of ty_dd04t,
      ty_it_dd04t type ty_dd04t occurs 0,
      begin of ty_kna1,
        kunnr like kna1-kunnr,                 " Customer number
        name1 like kna1-name1,                 " Customer name
      end of ty_kna1,
      ty_it_kna1 type ty_kna1 occurs 0,
       begin of ty_user_addr,
        bname    like user_addr-bname,              " user no
        name_textc like user_addr-name_textc ,      " Username
      end of ty_user_addr,
      ty_it_user_addr type ty_user_addr occurs 0,
      begin of ty_vbap,
        matnr     like vbap-matnr,             " Material No
        arktx     like vbap-arktx,             " Production Description
      end of ty_vbap,
      ty_it_vbap type ty_vbap occurs 0,
      ty_text(500) type c,
      ty_lines type tline,
      ty_it_lines type ty_lines occurs 0,
      begin of ty_merged,
        vbeln     like vbak-vbeln,            " Sales order number
        erdat     like vbak-erdat,            " Created on
        auart     like vbak-auart,            " Order type
        faksk     like vbak-faksk,            " Billing block in SD document
        netwr     like vbak-netwr,            " Net value
        waerk     like vbak-waerk,            " Currency
        vkorg     like vbak-vkorg,            " Sales organisation
        vtweg     like vbak-vtweg,            " Distribution channel
        vkbur     like vbak-vkbur,            " Sales office
        fkara     like vbak-fkara,            " Proposed billing type
        kunnr     like vbak-kunnr,            " Sold-to party
        bname     like vbak-bname ,           " User No
        xblnr     like vbak-xblnr,            " Reference
        fbuda     like vbkd-fbuda,            " Date services rendered
        username  like cdhdr-username,        " Changed by
        udate     like cdhdr-udate,           " Changed on
        utime     like cdhdr-utime,           " Changed at
        tcode     like cdhdr-tcode,           " Transaction code
        tabname   like cdpos-tabname,         " Table name
        tabkey    like cdpos-tabkey,          " Table key
        fname     like cdpos-fname,           " Field name
        chngind   like cdpos-chngind,         " Change indicator
        value_new like cdpos-value_new,       " New value of field
        value_old like cdpos-value_old,       " Old value of field
        scrtext_l like dd04t-scrtext_l,       " Description of field
        intnote   type ty_text,               " Internal note
        hdrnote   type ty_text,               " Header note
        name1     like adrc-name1,            " Sold-to party name
        matnr     like vbap-matnr,            " Material No
        arktx     like vbap-arktx,            " Product Description
      end of ty_merged,
      ty_it_merged type ty_merged occurs 0,
      begin of ty_vbak,
        vbeln    like vbak-vbeln,             " Sales order number
        erdat    like vbak-erdat,             " Created on
        auart    like vbak-auart,             " Order type
        faksk    like vbak-faksk,             " Billing block in SD document
        netwr    like vbak-netwr,             " Net value
        waerk    like vbak-waerk,             " Currency
        vkorg    like vbak-vkorg,             " Sales organisation
        vtweg    like vbak-vtweg,             " Distribution channel
        vkbur    like vbak-vkbur,             " Sales office
        fkara    like vbak-fkara,             " Proposed billing type
        kunnr    like vbak-kunnr,             " Sold-to party
        xblnr    like vbak-xblnr,             " Reference
        objectid like cdhdr-objectid,         " Change document object
      end of ty_vbak,
      ty_it_vbak type ty_vbak occurs 0,
      begin of ty_vbkd,
        vbeln like vbkd-vbeln,                " Sales order number
        posnr like vbkd-posnr,                " Sales order item
        fbuda like vbkd-fbuda,                " Date services rendered
      end of ty_vbkd,
      ty_it_vbkd type ty_vbkd occurs 0.
    Internal tables
    data:
      it_cdhdr    type ty_it_cdhdr,
      it_cdpos    type ty_it_cdpos,
      it_fieldcat type slis_t_fieldcat_alv,
      it_kna1     type ty_it_kna1,
      it_user_addr type ty_it_user_addr,
      it_merged   type ty_it_merged,
      it_vbak     type ty_it_vbak,
    Material No
      it_vbap     type ty_it_vbap,
      it_vbkd     type ty_it_vbkd.
    data:
      wa_vbak  type ty_vbak.
    data:
      st_tvariant  like disvariant,
      st_variant   like disvariant.
    constants:
      co_as4local_a           like dd03l-as4local     " Active version
                              value 'A',
      co_objectclas_verkbeleg like cdhdr-objectclas
                              value 'VERKBELEG',
      co_posnr_initial        like vbkd-posnr         " Initial item number
                              value is initial,
      co_posnr_initial_2        like vbap-posnr         " Initial item number
                              value is initial,
      co_save_u               type c                  " User display variant
                              value 'U',              " saving allowed.
      co_trvog_0              like vbak-trvog         " Sales order
                              value '0'.
    data:
      va_exit                 type c,                 " ALV display
      va_tabix                like sy-tabix.
    selection-screen: begin of block b1 with frame title text-001.
    select-options:
      s_vkorg  for vbak-vkorg OBLIGATORY,            " Sales organisation
      s_vkbur  for vbak-vkbur,            " Sales office
      s_vtweg  for vbak-vtweg,            " Distribution channel
      s_vbeln  for vbak-vbeln,            " Sales order number
      s_usrnme for cdhdr-username,        " Changed by
      s_udate  for cdhdr-udate.           " Changed on
    selection-screen: end of block b1,
                      begin of block b2 with frame title text-002.
    parameters:
      p_varint like disvariant-variant.   " Display variant.
    selection-screen: end of block b2.
    Initialization
    initialization.
    Load display variant.
      if not p_varint is initial.
        move st_variant to st_tvariant.
        move p_varint to st_tvariant-variant.
        call function 'REUSE_ALV_VARIANT_EXISTENCE'
             exporting
                  i_save     = co_save_u
             changing
                  cs_variant = st_tvariant.
        st_variant = st_tvariant.
      else.
        clear st_variant.
        st_variant-report = sy-repid.
      endif.
    at selection-screen on value-request for p_varint.
    Provide display variant list for this program.
      call function 'REUSE_ALV_VARIANT_F4'
           exporting
                is_variant = st_variant
                i_save     = co_save_u
           importing
                e_exit     = va_exit
                es_variant = st_tvariant
           exceptions
                not_found  = 2.
      if sy-subrc eq 2.
        message id sy-msgid type 'S'
                number sy-msgno
                with sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
      else.
        if va_exit eq space.
          st_variant = st_tvariant.
          p_varint = st_tvariant-variant.
        endif.
      endif.
    At selection screen
    at selection-screen.
    Load display variant.
      if not p_varint is initial.
        move st_variant to st_tvariant.
        move p_varint to st_tvariant-variant.
        call function 'REUSE_ALV_VARIANT_EXISTENCE'
             exporting
                  i_save     = co_save_u
             changing
                  cs_variant = st_tvariant.
        st_variant = st_tvariant.
      else.
        clear st_variant.
        st_variant-report = sy-repid.
      endif.
    Start of selection
    Extract order details from VBAK
      select vbeln erdat auart faksk netwr waerk vkorg vtweg vkbur fkara
             kunnr xblnr
             from  vbak
             into  table it_vbak
             where vkorg in s_vkorg
             and   vkbur in s_vkbur
             and   vbeln in s_vbeln.
      if sy-subrc ne 0.
      No data found for selection
        message s001(zgen).
        exit.
      endif.
      loop at it_vbak into wa_vbak.
        va_tabix = sy-tabix.
        wa_vbak-objectid = wa_vbak-vbeln.
        modify it_vbak from wa_vbak
                       index va_tabix
                       transporting objectid.
      endloop.
    if sy-subrc ne 0.
      No data found for selection
       message s001(zgen).
       exit.
    endif.
    loop at it_vbak into wa_vbak.
       va_tabix = sy-tabix.
       wa_vbak-objectid = wa_vbak-vbeln.
       modify it_vbak from wa_vbak
                      index va_tabix
                      transporting objectid.
    endloop.
    Extract  Change data
      select objectclas objectid changenr username udate utime tcode
             from  cdhdr
             into  table it_cdhdr
             for   all entries in it_vbak
             where objectclas eq co_objectclas_verkbeleg
             and   objectid   eq it_vbak-objectid
             and   username   in s_usrnme
             and   udate      in s_udate.
      if sy-subrc eq 0.
        select objectclas objectid changenr tabname tabkey fname chngind
               value_new value_old
               from  cdpos
               into  table it_cdpos
               for   all entries in it_cdhdr
               where fname NE 'CMPRE_FLT'
               and objectclas eq it_cdhdr-objectclas
               and   objectid   eq it_cdhdr-objectid
               and   changenr   eq it_cdhdr-changenr.
      endif.
    Extract customer details from KNA1
      select kunnr name1
             from  kna1
             into  table it_kna1
             for   all entries in it_vbak
             where kunnr eq it_vbak-kunnr.
    ---- Changes are made here -
       select matnr arktx
       from vbap
       into table it_vbap
       for all entries in it_vbak
       where
       vbeln eq it_vbak-vbeln.
    -----------------End of Change ----------------------*
    Extract Contract No from vbkd.
      select vbeln posnr fbuda
             from  vbkd
             into  table it_vbkd
             for   all entries in it_vbak
             where vbeln eq it_vbak-vbeln
             and   posnr eq co_posnr_initial.
      perform merge_data tables it_cdhdr
                                it_cdpos
                                it_kna1
                                it_user_addr
                                it_merged
                                it_vbak
                                it_vbap
                                it_vbkd.
      if it_merged[] is initial.
        message s001(zgen).
        exit.
      endif.
    Release memory no longer required.
      free: it_cdhdr,
            it_cdpos,
            it_kna1,
            it_user_addr,
            it_vbak,
            it_vbap,
            it_vbkd.
    Build field catalog for call to report function
      perform build_field_catalog tables it_fieldcat.
    Output report.
      perform output_report tables it_fieldcat
                                   it_merged.
    *&      Form  merge_data
          text
    form merge_data  tables   pa_it_cdhdr  type ty_it_cdhdr
                              pa_it_cdpos  type ty_it_cdpos
                              pa_it_kna1   type ty_it_kna1
                              pa_it_user_addr type ty_it_user_addr
                              pa_it_merged type ty_it_merged
                              pa_it_vbak   type ty_it_vbak
                              pa_it_vbap   type ty_it_vbap
                              pa_it_vbkd   type ty_it_vbkd.
    Local internal tables
    data:
      lit_dd03l type ty_it_dd03l,
      lit_dd04t type ty_it_dd04t.
    Local work areas
    data:
      lwa_cdhdr  type ty_cdhdr,
      lwa_cdpos  type ty_cdpos,
      lwa_dd03l  type ty_dd03l,
      lwa_dd04t  type ty_dd04t,
      lwa_kna1   type ty_kna1,
      lwa_user_addr type ty_user_addr,
      lwa_merged type ty_merged,
      lwa_vbak   type ty_vbak,
      lwa_vbap   type ty_vbap,
      lwa_vbkd   type ty_vbkd.
    Local variables
    data:
      lva_dd03l_tabix like sy-tabix,
      lva_dd04t_tabix like sy-tabix.
    Sort Data
      sort pa_it_cdhdr by objectid changenr.
      sort pa_it_cdpos by objectid changenr tabname tabkey fname.
      sort pa_it_kna1  by kunnr.
      sort pa_it_user_addr by bname.
      sort pa_it_vbak  by vbeln.
       sort pa_it_vbkd  by vbeln.
      loop at pa_it_vbak into lwa_vbak.
        clear lwa_merged.
      Assign sales order fields to reporting work area
        lwa_merged-vbeln = lwa_vbak-vbeln.
        lwa_merged-erdat = lwa_vbak-erdat.
        lwa_merged-auart = lwa_vbak-auart.
        lwa_merged-faksk = lwa_vbak-faksk.
        lwa_merged-netwr = lwa_vbak-netwr.
        lwa_merged-waerk = lwa_vbak-waerk.
        lwa_merged-vkorg = lwa_vbak-vkorg.
        lwa_merged-vtweg = lwa_vbak-vtweg.
        lwa_merged-vkbur = lwa_vbak-vkbur.
        lwa_merged-fkara = lwa_vbak-fkara.
        lwa_merged-kunnr = lwa_vbak-kunnr.
       lwa_merged-bname = 1wa_user_addr-bname.
        lwa_merged-xblnr = lwa_vbak-xblnr.
    Assgin Material to reporting work area
       lwa_merged-matnr  = lwa_vbap-vbeln.
      Get name of sold-to party from PA_IT_KNA1
        clear lwa_kna1.
        read table pa_it_kna1 into lwa_kna1
                              with key kunnr = lwa_vbak-kunnr
                              binary search.
        lwa_merged-name1 = lwa_kna1-name1.
      Get name of name from vbap
            clear lwa_vbap.
        read table pa_it_vbap into lwa_vbap
                              with key matnr = lwa_vbap-matnr
                              binary search.
        lwa_merged-arktx = lwa_vbap-arktx.
      Get name  from PA_it_user_addr
       clear lwa_user_addr.
       read table pa_it_user_addr into lwa_user_addr
                             with key  = lwa_user_addr-bname
                             binary search.
       lwa_merged-username = lwa_user_addr-name_textc.
      Get business data from PA_IT_VBKD.
        clear lwa_vbkd.
        read table pa_it_vbkd into lwa_vbkd
                              with key vbeln = lwa_vbak-vbeln
                              binary search.
        lwa_merged-fbuda = lwa_vbkd-fbuda.
      Get internal note text for sales order
        perform read_text using '0002'
                                '1'
                                lwa_merged-vbeln
                                'VBBK'
                                lwa_merged-intnote.
      Get header note 1 text for sales order
        perform read_text using 'Z002'
                                '1'
                                lwa_merged-vbeln
                                'VBBK'
                                lwa_merged-hdrnote.
      Determine if change documents exist for sales order.
        clear lwa_cdhdr.
        read table pa_it_cdhdr into lwa_cdhdr
                               with key objectid = lwa_vbak-objectid.
        if sy-subrc ne 0.
          continue.
        endif.
        loop at pa_it_cdhdr into lwa_cdhdr
                            from sy-tabix.
          lwa_merged-username = lwa_cdhdr-username.
          lwa_merged-udate    = lwa_cdhdr-udate.
          lwa_merged-utime    = lwa_cdhdr-utime.
          lwa_merged-tcode    = lwa_cdhdr-tcode.
          clear lwa_cdpos.
          read table pa_it_cdpos into lwa_cdpos
                                 with key objectid = lwa_cdhdr-objectid
                                          changenr = lwa_cdhdr-changenr
                                 binary search.
          loop at pa_it_cdpos into lwa_cdpos
                              from sy-tabix.
            lwa_merged-tabname   = lwa_cdpos-tabname.
            lwa_merged-tabkey    = lwa_cdpos-tabkey.
            lwa_merged-fname     = lwa_cdpos-fname.
            lwa_merged-chngind   = lwa_cdpos-chngind.
            lwa_merged-value_new = lwa_cdpos-value_new.
            lwa_merged-value_old = lwa_cdpos-value_old.
          Get description for field - determine date element
            clear lwa_dd03l.
            read table lit_dd03l into lwa_dd03l
                                 with key tabname   = lwa_cdpos-tabname
                                          fieldname = lwa_cdpos-fname
                                 binary search.
            lva_dd03l_tabix = sy-tabix.
            if sy-subrc ne 0.
              select single tabname fieldname as4local as4vers rollname
                     from   dd03l
                     into   lwa_dd03l
                     where  tabname   eq lwa_cdpos-tabname
                     and    fieldname eq lwa_cdpos-fname
                     and    as4local  eq co_as4local_a.
              if sy-subrc eq 0.
                insert lwa_dd03l into lit_dd03l
                                 index lva_dd03l_tabix.
              endif.
            endif.
          If data element was found, get description
            if not lwa_dd03l is initial.
              clear lwa_dd04t.
              read table lit_dd04t into lwa_dd04t
                                   with key rollname   = lwa_dd03l-rollname
                                            ddlanguage = sy-langu
                                   binary search.
              lva_dd04t_tabix = sy-tabix.
              if sy-subrc ne 0.
                select single rollname ddlanguage as4local as4vers scrtext_l
                       from  dd04t
                       into  lwa_dd04t
                       where rollname   eq lwa_dd03l-rollname
                       and   ddlanguage eq sy-langu.
                if sy-subrc eq 0.
                  insert lwa_dd04t into lit_dd04t
                                   index lva_dd04t_tabix.
                else.
                  lwa_dd04t-scrtext_l = 'Description for field not found'.
                endif.
              endif.
            endif.
            lwa_merged-scrtext_l = lwa_dd04t-scrtext_l.
            append lwa_merged to pa_it_merged.
            at end of changenr.
            Only process field changes for this change document.
              exit.
            endat.
          endloop.
          at end of objectid.
          Initialise work area so we know change document for order has
          been processed.
            clear lwa_merged.
          Only process change documents for this sales order.
            exit.
          endat.
        endloop.
      endloop.
    endform.                    " merge_data
    *&      Form  build_field_catalog
          text
    form build_field_catalog tables pa_it_fieldcat type slis_t_fieldcat_alv.
    data:
    Local variable
      lva_col_pos   type slis_fieldcat_alv-col_pos,
    Local structure
      st_fieldcat   type slis_fieldcat_alv.
      lva_col_pos = 0.
      clear st_fieldcat.
      add 1 to lva_col_pos.
      st_fieldcat-tabname       = 'PA_IT_MERGED'.
      st_fieldcat-fieldname     = 'VBELN'.
      st_fieldcat-ref_tabname   = 'VBAK'.
      st_fieldcat-ref_fieldname = 'VBELN'.
      st_fieldcat-row_pos       = '1'.
      st_fieldcat-col_pos       = lva_col_pos.
      append st_fieldcat to pa_it_fieldcat.
      clear st_fieldcat.
      add 1 to lva_col_pos.
      st_fieldcat-tabname       = 'PA_IT_MERGED'.
      st_fieldcat-fieldname     = 'VKBUR'.
      st_fieldcat-ref_tabname   = 'VBAK'.
      st_fieldcat-ref_fieldname = 'VKBUR'.
      st_fieldcat-row_pos       = '1'.
      st_fieldcat-outputlen = '6'.
      st_fieldcat-col_pos       = lva_col_pos.
      append st_fieldcat to pa_it_fieldcat.
    clear st_fieldcat.
      add 1 to lva_col_pos.
      st_fieldcat-tabname       = 'PA_IT_MERGED'.
      st_fieldcat-fieldname     = 'VKORG'.
      st_fieldcat-ref_tabname   = 'VBAK'.
      st_fieldcat-ref_fieldname = 'VKORG'.
      st_fieldcat-row_pos       = '1'.
      st_fieldcat-outputlen = '6'.
      st_fieldcat-col_pos       = lva_col_pos.
      append st_fieldcat to pa_it_fieldcat.
    clear st_fieldcat.
      add 1 to lva_col_pos.
      st_fieldcat-tabname       = 'PA_IT_MERGED'.
      st_fieldcat-fieldname     = 'KUNNR'.
      st_fieldcat-ref_tabname   = 'VBAK'.
      st_fieldcat-ref_fieldname = 'KUNNR'.
      st_fieldcat-row_pos       = '1'.
      st_fieldcat-col_pos       = lva_col_pos.
        st_fieldcat-outputlen = '6'.
      append st_fieldcat to pa_it_fieldcat.
    clear st_fieldcat.
      add 1 to lva_col_pos.
      st_fieldcat-tabname       = 'PA_IT_MERGED'.
      st_fieldcat-fieldname     = 'NAME1'.
      st_fieldcat-ref_tabname   = 'KNA1'.
      st_fieldcat-ref_fieldname = 'NAME1'.
      st_fieldcat-row_pos       = '1'.
        st_fieldcat-outputlen = '15'.
      st_fieldcat-col_pos       = lva_col_pos.
      append st_fieldcat to pa_it_fieldcat.
    clear st_fieldcat.
      add 1 to lva_col_pos.
      st_fieldcat-tabname       = 'PA_IT_MERGED'.
      st_fieldcat-fieldname     = 'MATNR'.
      st_fieldcat-ref_tabname   = 'VBAP'.
      st_fieldcat-ref_fieldname = 'MATNR'.
      st_fieldcat-row_pos       = '1'.
      st_fieldcat-col_pos       = lva_col_pos.
        st_fieldcat-outputlen = '6'.
      append st_fieldcat to pa_it_fieldcat.
    clear st_fieldcat.
      add 1 to lva_col_pos.
      st_fieldcat-tabname       = 'PA_IT_MERGED'.
      st_fieldcat-fieldname     = 'arktx'.
      st_fieldcat-ref_tabname   = 'VBAP'.
      st_fieldcat-ref_fieldname = 'arktx'.
      st_fieldcat-row_pos       = '1'.
      st_fieldcat-col_pos       = lva_col_pos.
        st_fieldcat-outputlen = '6'.
      append st_fieldcat to pa_it_fieldcat.
    clear st_fieldcat.
      add 1 to lva_col_pos.
      st_fieldcat-tabname       = 'PA_IT_MERGED'.
      st_fieldcat-fieldname     = 'SCRTEXT_L'.
      st_fieldcat-ref_tabname   = 'DD04T'.
      st_fieldcat-ref_fieldname = 'SCRTEXT_L'.
      st_fieldcat-row_pos       = '1'.
       st_fieldcat-outputlen = '20'.
      st_fieldcat-col_pos       = lva_col_pos.
      append st_fieldcat to pa_it_fieldcat.
      clear st_fieldcat.
      add 1 to lva_col_pos.
      st_fieldcat-tabname       = 'PA_IT_MERGED'.
      st_fieldcat-fieldname     = 'UDATE'.
      st_fieldcat-ref_tabname   = 'CDHDR'.
      st_fieldcat-ref_fieldname = 'UDATE'.
      st_fieldcat-row_pos       = '1'.
      st_fieldcat-outputlen = '10'.
      st_fieldcat-col_pos       = lva_col_pos.
      append st_fieldcat to pa_it_fieldcat.
      clear st_fieldcat.
      add 1 to lva_col_pos.
      st_fieldcat-tabname       = 'PA_IT_MERGED'.
      st_fieldcat-fieldname     = 'USERNAME'.
      st_fieldcat-ref_tabname   = 'CDHDR'.
      st_fieldcat-ref_fieldname = 'USERNAME'.
      st_fieldcat-row_pos       = '1'.
      st_fieldcat-outputlen = '6'.
      st_fieldcat-col_pos       = lva_col_pos.
      append st_fieldcat to pa_it_fieldcat.
    clear st_fieldcat.
    add 1 to lva_col_pos.
    st_fieldcat-tabname       = 'PA_IT_MERGED'.
    st_fieldcat-fieldname     = 'FNAME'.
    st_fieldcat-ref_tabname   = 'CDPOS'.
    st_fieldcat-ref_fieldname = 'FNAME'.
    st_fieldcat-row_pos       = '4'.
    st_fieldcat-outputlen = '8'.
    st_fieldcat-col_pos       = lva_col_pos.
    append st_fieldcat to pa_it_fieldcat.
      clear st_fieldcat.
      add 1 to lva_col_pos.
      st_fieldcat-tabname       = 'PA_IT_MERGED'.
      st_fieldcat-fieldname     = 'CHNGIND'.
      st_fieldcat-ref_tabname   = 'CDPOS'.
      st_fieldcat-ref_fieldname = 'CHNGIND'.
      st_fieldcat-row_pos       = '1'.
      st_fieldcat-outputlen = '8'.
      st_fieldcat-col_pos       = lva_col_pos.
      append st_fieldcat to pa_it_fieldcat.
      clear st_fieldcat.
      add 1 to lva_col_pos.
      st_fieldcat-tabname       = 'PA_IT_MERGED'.
      st_fieldcat-fieldname     = 'WAERK'.
      st_fieldcat-ref_tabname   = 'VBAK'.
      st_fieldcat-ref_fieldname = 'WAERK'.
      st_fieldcat-row_pos       = '1'.
      st_fieldcat-outputlen = '5'.
      st_fieldcat-col_pos       = lva_col_pos..
      append st_fieldcat to pa_it_fieldcat.
      clear st_fieldcat.
      add 1 to lva_col_pos.
      st_fieldcat-tabname       = 'PA_IT_MERGED'.
      st_fieldcat-fieldname     = 'VALUE_NEW'.
      st_fieldcat-ref_tabname   = 'CDPOS'.
      st_fieldcat-ref_fieldname = 'VALUE_NEW'.
      st_fieldcat-row_pos       = '1'.
      st_fieldcat-outputlen = '6'.
      st_fieldcat-col_pos       = lva_col_pos.
      append st_fieldcat to pa_it_fieldcat.
      clear st_fieldcat.
      add 1 to lva_col_pos.
      st_fieldcat-tabname       = 'PA_IT_MERGED'.
      st_fieldcat-fieldname     = 'VALUE_OLD'.
      st_fieldcat-ref_tabname   = 'CDPOS'.
      st_fieldcat-ref_fieldname = 'VALUE_OLD'.
      st_fieldcat-row_pos       = '1'.
      st_fieldcat-outputlen = '6'.
      st_fieldcat-col_pos       = lva_col_pos.
      append st_fieldcat to pa_it_fieldcat.
    endform.                    " build_field_catalog
    *&      Form  output_report
          text
    form output_report tables pa_it_fieldcat type slis_t_fieldcat_alv
                              pa_it_merged   type ty_it_merged.
    Local variables
    data:
      lva_formname type slis_formname,
      lva_repid    like sy-repid.
      lva_repid = sy-repid.
      lva_formname = 'ALV_USER_COMMAND'.
      call function 'REUSE_ALV_GRID_DISPLAY'
        exporting
          i_callback_program = lva_repid
          i_callback_user_command = lva_formname
          i_save             = 'A'
          is_variant         = st_variant
          it_fieldcat        = pa_it_fieldcat[]
        tables
          t_outtab           = pa_it_merged
        exceptions
          program_error      = 1
          others             = 2.
    endform.                    " output_report
    *&      Form  alv_user_command
          text
    form alv_user_command using pa_ucomm    like sy-ucomm
                                pa_selfield type slis_selfield.
    Local work areas
    data:
      lwa_merged type ty_merged.
      clear lwa_merged.
      read table it_merged into lwa_merged
                           index pa_selfield-tabindex.
      case pa_selfield-fieldname.
        when 'VBELN'.
        Contract Number
          set parameter id 'AUN' field lwa_merged-vbeln.
         call transaction 'VA03' and skip first screen.
    S_BCE_68001393
    when 'USERNAME'.
        Username
          set parameter id 'username' field lwa_merged-username.
          call transaction 'S_BCE_68001393' and skip first screen.
        when 'KUNNR'.
        Customer number
          set parameter id 'KUN' field lwa_merged-kunnr.
          set parameter id 'VKO' field space.
          set parameter id 'VTW' field space.
          set parameter id 'SPA' field space.
          call transaction 'XD03' and skip first screen.
      endcase.
    endform.                    " alv_user_command
    *&      Form  read_text
          text
    form read_text  using    pa_id
                             pa_inline_count
                             pa_name
                             pa_object
                             pa_text.
    Local internal tables
    data:
      lit_inlines type ty_it_lines,
      lit_lines   type ty_it_lines.
    Local work areas
    data:
      lwa_lines   type ty_lines.
    Local variables
    data:
      lva_tdname    like thead-tdname.
      refresh: lit_inlines,
               lit_lines.
      lva_tdname = pa_name.
      call function 'READ_TEXT_INLINE'
        exporting
          id                    = pa_id
          inline_count          = pa_inline_count
          language              = sy-langu
          name                  = lva_tdname
          object                = pa_object
        tables
          inlines               = lit_inlines
          lines                 = lit_lines
        exceptions
          id                    = 1
          language              = 2
          name                  = 3
          not_found             = 4
          object                = 5
          reference_check       = 6
          others                = 7.
      loop at lit_lines into lwa_lines.
        concatenate pa_text
                    lwa_lines-tdline
                    into pa_text separated by space.
      endloop.
    endform.                    " read_text ENDLOOP.

    Hi Eswar
    According to your instruction I did the modification to add the material no and description but I am unable to get atleast material no seeing below my coding please do some debugging and send to me
    report ZCHGDOC_BY_SALES no standard page heading
                              line-size 132.
    type-pools:
      slis.                     " ALV types
    Tables
    tables:
      cdhdr,                    " Change documents: Header
      cdpos,                    " Change documents: Items
      vbak,                     " Sales order: Header
      mara,                     " Material Number
      makt,                     " Material Description
      user_addr,                " User Address
      vbap.                     " Contract order: Items
    Types
    types:
      begin of ty_cdhdr,
        objectclas like cdhdr-objectclas,     " Object class
        objectid   like cdhdr-objectid,       " Object value
        changenr   like cdhdr-changenr,       " Document change number
        username   like cdhdr-username,       " Changed by
        udate      like cdhdr-udate,          " Changed on
        utime      like cdhdr-utime,          " Changed at
        tcode      like cdhdr-tcode,          " Transaction code
      end of ty_cdhdr,
      ty_it_cdhdr type ty_cdhdr occurs 0,
      begin of ty_cdpos,
        objectclas like cdpos-objectclas,     " Object class
        objectid   like cdpos-objectid,       " Object value
        changenr   like cdpos-changenr,       " Document change number
        tabname    like cdpos-tabname,        " Table name
        tabkey     like cdpos-tabkey,         " Table key
        fname      like cdpos-fname,          " Field name
        chngind    like cdpos-chngind,        " Change indicator
        value_new  like cdpos-value_new,      " New value of field
        value_old  like cdpos-value_old,      " Old value of field
      end of ty_cdpos,
      ty_it_cdpos type ty_cdpos occurs 0,
      begin of ty_dd03l,
        tabname   like dd03l-tabname,
        fieldname like dd03l-fieldname,
        as4local  like dd03l-as4local,
        as4vers   like dd03l-as4vers,
        rollname  like dd03l-rollname,
      end of ty_dd03l,
      ty_it_dd03l type ty_dd03l occurs 0,
      begin of ty_dd04t,
        rollname   like dd04t-rollname,
        ddlanguage like dd04t-ddlanguage,
        as4local   like dd04t-as4local,
        as4vers    like dd04t-as4vers,
        scrtext_l  like dd04t-scrtext_l,
      end of ty_dd04t,
      ty_it_dd04t type ty_dd04t occurs 0,
      begin of ty_kna1,
        kunnr like kna1-kunnr,                 " Customer number
        name1 like kna1-name1,                 " Customer name
      end of ty_kna1,
      ty_it_kna1 type ty_kna1 occurs 0,
       begin of ty_user_addr,
        bname    like user_addr-bname,              " user no
        name_textc like user_addr-name_textc ,      " Username
      end of ty_user_addr,
      ty_it_user_addr type ty_user_addr occurs 0,
      begin of ty_vbap,
        vbeln like vbap-vbeln,                  " Contract number
        posnr like vbap-posnr,                  " Contract item
        matnr like vbap-matnr,                  " Material
        abgru like vbap-abgru,                  " Reason for rejection
        werks like vbap-werks,                  " Plant
        arktx like vbap-arktx,                  " Product description
        maktx like makt-maktx,                  " Production Description
      end of ty_vbap,
      ty_it_vbap type ty_vbap occurs 0,
      begin of ty_mara,
        matnr like mara-matnr,                  " Material
        extwg like mara-extwg,                  " External material group
        mstav like mara-mstav,                  " Blocking reason
        mstdv like mara-mstdv,                  " Blocking reason valid from
      end of ty_mara,
      ty_it_mara type ty_mara occurs 0,
      begin of ty_marc,
        matnr like marc-matnr,                  " Material
        werks like marc-werks,                  " Plant
        mmsta like marc-mmsta,                  " Blocking reason
        mmstd like marc-mmstd,                  " Blocking reason valid from
      end of ty_marc,
      ty_it_marc type ty_marc occurs 0,
      ty_text(500) type c,
      ty_lines type tline,
      ty_it_lines type ty_lines occurs 0,
      begin of ty_merged,
        vbeln     like vbak-vbeln,            " Sales order number
        erdat     like vbak-erdat,            " Created on
        auart     like vbak-auart,            " Order type
        faksk     like vbak-faksk,            " Billing block in SD document
        netwr     like vbak-netwr,            " Net value
        waerk     like vbak-waerk,            " Currency
        vkorg     like vbak-vkorg,            " Sales organisation
        vtweg     like vbak-vtweg,            " Distribution channel
        vkbur     like vbak-vkbur,            " Sales office
        fkara     like vbak-fkara,            " Proposed billing type
        kunnr     like vbak-kunnr,            " Sold-to party
        bname     like vbak-bname ,           " User No
        xblnr     like vbak-xblnr,            " Reference
        fbuda     like vbkd-fbuda,            " Date services rendered
        username  like cdhdr-username,        " Changed by
        udate     like cdhdr-udate,           " Changed on
        utime     like cdhdr-utime,           " Changed at
        tcode     like cdhdr-tcode,           " Transaction code
        tabname   like cdpos-tabname,         " Table name
        tabkey    like cdpos-tabkey,          " Table key
        fname     like cdpos-fname,           " Field name
        chngind   like cdpos-chngind,         " Change indicator
        value_new like cdpos-value_new,       " New value of field
        value_old like cdpos-value_old,       " Old value of field
        scrtext_l like dd04t-scrtext_l,       " Description of field
        intnote   type ty_text,               " Internal note
        hdrnote   type ty_text,               " Header note
        name1     like adrc-name1,            " Sold-to party name
        matnr     like vbap-matnr,            " Material No
        arktx     like  vbap-arktx,
      end of ty_merged,
      ty_it_merged type ty_merged occurs 0,
      begin of ty_vbak,
        vbeln    like vbak-vbeln,             " Sales order number
        erdat    like vbak-erdat,             " Created on
        auart    like vbak-auart,             " Order type
        faksk    like vbak-faksk,             " Billing block in SD document
        netwr    like vbak-netwr,             " Net value
        waerk    like vbak-waerk,             " Currency
        vkorg    like vbak-vkorg,             " Sales organisation
        vtweg    like vbak-vtweg,             " Distribution channel
        vkbur    like vbak-vkbur,             " Sales office
        fkara    like vbak-fkara,             " Proposed billing type
        kunnr    like vbak-kunnr,             " Sold-to party
        xblnr    like vbak-xblnr,             " Reference
        objectid like cdhdr-objectid,         " Change document object
        matnr    like vbap-matnr,
      end of ty_vbak,
      ty_it_vbak type ty_vbak occurs 0,
      begin of ty_vbkd,
        vbeln like vbkd-vbeln,                " Sales order number
        posnr like vbkd-posnr,                " Sales order item
        fbuda like vbkd-fbuda,                " Date services rendered
      end of ty_vbkd,
      ty_it_vbkd type ty_vbkd occurs 0.
    Internal tables
    data:
      it_cdhdr    type ty_it_cdhdr,
      it_cdpos    type ty_it_cdpos,
      it_fieldcat type slis_t_fieldcat_alv,
      it_kna1     type ty_it_kna1,
      it_user_addr type ty_it_user_addr,
      it_merged   type ty_it_merged,
      it_vbak     type ty_it_vbak,
    Material No
      it_vbap     type ty_it_vbap,
      it_mara     type ty_it_mara,
      it_vbkd     type ty_it_vbkd.
    data:
      wa_vbak  type ty_vbak.
    data:
      st_tvariant  like disvariant,
      st_variant   like disvariant.
    constants:
      co_as4local_a           like dd03l-as4local     " Active version
                              value 'A',
      co_objectclas_verkbeleg like cdhdr-objectclas
                              value 'VERKBELEG',
      co_posnr_initial        like vbkd-posnr         " Initial item number
                              value is initial,
      co_posnr_initial_2        like vbap-posnr         " Initial item number
                              value is initial,
      co_save_u               type c                  " User display variant
                              value 'U',              " saving allowed.
      co_trvog_0              like vbak-trvog         " Sales order
                              value '0'.
    data:
      va_exit                 type c,                 " ALV display
      va_tabix                like sy-tabix.
    selection-screen: begin of block b1 with frame title text-001.
    select-options:
    " s_vkorg  for vbak-vkorg OBLIGATORY,           " Sales organisation
       s_vkorg  for vbak-vkorg ,           " Sales organisation
       s_vkbur  for vbak-vkbur,            " Sales office
       s_vtweg  for vbak-vtweg,            " Distribution channel
       s_vbeln  for vbak-vbeln,            " Sales order number
       s_kunnr  for vbak-kunnr,            " sold to party
       "s_matnr  for vbap-matnr,            " Material No
       s_usrnme for cdhdr-username,        " Changed by
       s_udate  for cdhdr-udate.           " Changed on
    selection-screen: end of block b1,
                      begin of block b2 with frame title text-002.
    parameters:
      p_varint like disvariant-variant.   " Display variant.
    selection-screen: end of block b2.
    Initialization
    initialization.
    Load display variant.
      if not p_varint is initial.
        move st_variant to st_tvariant.
        move p_varint to st_tvariant-variant.
        call function 'REUSE_ALV_VARIANT_EXISTENCE'
             exporting
                  i_save     = co_save_u
             changing
                  cs_variant = st_tvariant.
        st_variant = st_tvariant.
      else.
        clear st_variant.
        st_variant-report = sy-repid.
      endif.
    at selection-screen on value-request for p_varint.
    Provide display variant list for this program.
      call function 'REUSE_ALV_VARIANT_F4'
           exporting
                is_variant = st_variant
                i_save     = co_save_u
           importing
                e_exit     = va_exit
                es_variant = st_tvariant
           exceptions
                not_found  = 2.
      if sy-subrc eq 2.
        message id sy-msgid type 'S'
                number sy-msgno
                with sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
      else.
        if va_exit eq space.
          st_variant = st_tvariant.
          p_varint = st_tvariant-variant.
        endif.
      endif.
    At selection screen
    at selection-screen.
    Load display variant.
      if not p_varint is initial.
        move st_variant to st_tvariant.
        move p_varint to st_tvariant-variant.
        call function 'REUSE_ALV_VARIANT_EXISTENCE'
             exporting
                  i_save     = co_save_u
             changing
                  cs_variant = st_tvariant.
        st_variant = st_tvariant.
      else.
        clear st_variant.
        st_variant-report = sy-repid.
      endif.
    Start of selection
    Extract order details from VBAK
      select vbeln erdat auart faksk netwr waerk vkorg vtweg vkbur fkara
             kunnr xblnr
             from  vbak
             into  table it_vbak
             where vkorg in s_vkorg
             and   vkbur in s_vkbur
             and   kunnr in s_kunnr
             and   vbeln in s_vbeln.
      if sy-subrc ne 0.
      No data found for selection
        message s001(zgen).
        exit.
      endif.
      loop at it_vbak into wa_vbak.
        va_tabix = sy-tabix.
        wa_vbak-objectid = wa_vbak-vbeln.
        modify it_vbak from wa_vbak
                       index va_tabix
                       transporting objectid.
      endloop.
    Extract  Change data
      select objectclas objectid changenr username udate utime tcode
             from  cdhdr
             into  table it_cdhdr
             for   all entries in it_vbak
             where objectclas eq co_objectclas_verkbeleg
             and   objectid   eq it_vbak-objectid
             and   username   in s_usrnme
             and   udate      in s_udate.
      if sy-subrc eq 0.
        select objectclas objectid changenr tabname tabkey fname chngind
               value_new value_old
               from  cdpos
               into  table it_cdpos
               for   all entries in it_cdhdr
               where fname NE 'CMPRE_FLT'
               and objectclas eq it_cdhdr-objectclas
               and   objectid   eq it_cdhdr-objectid
               and   changenr   eq it_cdhdr-changenr.
      endif.
    Extract customer details from KNA1
      select kunnr name1
             from  kna1
             into  table it_kna1
             for   all entries in it_vbak
             where kunnr eq it_vbak-kunnr.
    ---- Changes are made here -
    Extract general material details from MARA
    select matnr
    from  vbap
            into  table it_vbap
            for   all entries in it_vbap
            where vbeln eq it_vbap-vbeln
            and  matnr eq it_vbap-matnr.
    select maktx from makt
            into  table it_vbap
            for   all entries in it_vbak
            where matnr eq it_vbap-matnr.
    select MAKTX from MAKT
    into table it_vbap  "<<<<<<if you have maktx in the structure
    for all entries in it_vbap
    where
    matnr eq it_vbap-matnr.
    select a~matnr  
    from vbap as a
        inner join makt as b
        on b~matnr = a~matnr
        into table it_vbap
        for all entries in it_vbak
        where
        a~vbeln eq it_vbak-vbeln.
        "and b~spras eq sy-langu.
       select a~matnr
       from vbap as a
       inner join makt as b
       on bmatnr = amatnr
       into table it_vbap
       for all entries in it_vbak
       where
       a~vbeln eq it_vbak-vbeln.
       "and b~spras eq sy-langu.
    Extract general material details from MARA
      select matnr extwg mstav mstdv
             from  mara
             into  table it_mara
             for   all entries in it_vbap
             where matnr eq it_vbap-matnr.
    -----------------End of Change ----------------------*
    Extract Contract No from vbkd.
      select vbeln posnr fbuda
             from  vbkd
             into  table it_vbkd
             for   all entries in it_vbak
             where vbeln eq it_vbak-vbeln
             and   posnr eq co_posnr_initial.
      perform merge_data tables it_cdhdr
                                it_cdpos
                                it_kna1
                                it_user_addr
                                it_merged
                                it_vbak
                                it_vbap
                                it_vbkd.
      if it_merged[] is initial.
        message s001(zgen).
        exit.
      endif.
    Release memory no longer required.
      free: it_cdhdr,
            it_cdpos,
            it_kna1,
            it_user_addr,
            it_vbak,
            it_vbap,
            it_vbkd.
    Build field catalog for call to report function
      perform build_field_catalog tables it_fieldcat.
    Output report.
      perform output_report tables it_fieldcat
                                   it_merged.
    *&      Form  merge_data
          text
    form merge_data  tables   pa_it_cdhdr  type ty_it_cdhdr
                              pa_it_cdpos  type ty_it_cdpos
                              pa_it_kna1   type ty_it_kna1
                              pa_it_user_addr type ty_it_user_addr
                              pa_it_merged type ty_it_merged
                              pa_it_vbak   type ty_it_vbak
                              pa_it_vbap   type ty_it_vbap
                              pa_it_vbkd   type ty_it_vbkd.
    Local internal tables
    data:
      lit_dd03l type ty_it_dd03l,
      lit_dd04t type ty_it_dd04t.
    Local work areas
    data:
      lwa_cdhdr  type ty_cdhdr,
      lwa_cdpos  type ty_cdpos,
      lwa_dd03l  type ty_dd03l,
      lwa_dd04t  type ty_dd04t,
      lwa_kna1   type ty_kna1,
      lwa_user_addr type ty_user_addr,
      lwa_merged type ty_merged,
      lwa_vbak   type ty_vbak,
      lwa_vbap   type ty_vbap,
      lwa_vbkd   type ty_vbkd.
    Local variables
    data:
      lva_dd03l_tabix like sy-tabix,
      lva_dd04t_tabix like sy-tabix.
    Sort Data
      sort pa_it_cdhdr by objectid changenr.
      sort pa_it_cdpos by objectid changenr tabname tabkey fname.
      sort pa_it_kna1  by kunnr.
      sort pa_it_vbap  by matnr.
      sort pa_it_user_addr by bname.
      sort pa_it_vbak  by vbeln.
       sort pa_it_vbkd  by vbeln.
    Change here 
    loop at pa_it_vbap into lwa_vbap.
       read table pa_it_vbak into lwa_vbak with key vbeln = lwa_vbap-vbeln.
       check sy-subrc eq 0.
       move-corresponding lwa_vbak to lwa_merged.  
    End of Changes here  
      endloop.    
      loop at pa_it_vbak into lwa_vbak.
        clear lwa_merged.
      Assign sales order fields to reporting work area
        lwa_merged-vbeln = lwa_vbak-vbeln.
        lwa_merged-erdat = lwa_vbak-erdat.
        lwa_merged-auart = lwa_vbak-auart.
        lwa_merged-faksk = lwa_vbak-faksk.
        lwa_merged-netwr = lwa_vbak-netwr.
        lwa_merged-waerk = lwa_vbak-waerk.
        lwa_merged-vkorg = lwa_vbak-vkorg.
        lwa_merged-vtweg = lwa_vbak-vtweg.
        lwa_merged-vkbur = lwa_vbak-vkbur.
        lwa_merged-fkara = lwa_vbak-fkara.
        lwa_merged-kunnr = lwa_vbak-kunnr.
       lwa_merged-vbeln = lwa_vbap-vbeln.
       lwa_merged-bname = 1wa_user_addr-bname.
        lwa_merged-xblnr = lwa_vbak-xblnr.
    Assgin Material to reporting work area
        lwa_merged-matnr  = lwa_vbap-matnr.
      Get name of sold-to party from PA_IT_KNA1
        clear lwa_kna1.
        read table pa_it_kna1 into lwa_kna1
                              with key kunnr = lwa_vbak-kunnr
                              binary search.
        lwa_merged-name1 = lwa_kna1-name1.
      Get name of name from vbap
        clear lwa_vbap.
        read table pa_it_vbap into lwa_vbap
                              with key vbeln = lwa_vbap-vbeln
                              binary search.
        lwa_merged-arktx = lwa_vbap-arktx.
      Get business data from PA_IT_VBKD.
        clear lwa_vbkd.
        read table pa_it_vbkd into lwa_vbkd
                              with key vbeln = lwa_vbak-vbeln
                              binary search.
        lwa_merged-fbuda = lwa_vbkd-fbuda.
      Get internal note text for sales order
        perform read_text using '0002'
                                '1'
                                lwa_merged-vbeln
                                'VBBK'
                                lwa_merged-intnote.
      Get header note 1 text for sales order
        perform read_text using 'Z002'
                                '1'
                                lwa_merged-vbeln
                                'VBBK'
                                lwa_merged-hdrnote.
      Determine if change documents exist for sales order.
        clear lwa_cdhdr.
        read table pa_it_cdhdr into lwa_cdhdr
                               with key objectid = lwa_vbak-objectid.
        if sy-subrc ne 0.
          continue.
        endif.
        loop at pa_it_cdhdr into lwa_cdhdr
                            from sy-tabix.
          lwa_merged-username = lwa_cdhdr-username.
          lwa_merged-udate    = lwa_cdhdr-udate.
          lwa_merged-utime    = lwa_cdhdr-utime.
          lwa_merged-tcode    = lwa_cdhdr-tcode.
          clear lwa_cdpos.
          read table pa_it_cdpos into lwa_cdpos
                                 with key objectid = lwa_cdhdr-objectid
                                          changenr = lwa_cdhdr-changenr
                                 binary search.
          loop at pa_it_cdpos into lwa_cdpos
                              from sy-tabix.
            lwa_merged-tabname   = lwa_cdpos-tabname.
            lwa_merged-tabkey    = lwa_cdpos-tabkey.
            lwa_merged-fname     = lwa_cdpos-fname.
            lwa_merged-chngind   = lwa_cdpos-chngind.
            lwa_merged-value_new = lwa_cdpos-value_new.
            lwa_merged-value_old = lwa_cdpos-value_old.
          Get description for field - determine date element
            clear lwa_dd03l.
            read table lit_dd03l into lwa_dd03l
                                 with key tabname   = lwa_cdpos-tabname
                                          fieldname = lwa_cdpos-fname
                                 binary search.
            lva_dd03l_tabix = sy-tabix.
            if sy-subrc ne 0.
              select single tabname fieldname as4local as4vers rollname
                     from   dd03l
                     into   lwa_dd03l
                     where  tabname   eq lwa_cdpos-tabname
                     and    fieldname eq lwa_cdpos-fname
                     and    as4local  eq co_as4local_a.
              if sy-subrc eq 0.
                insert lwa_dd03l into lit_dd03l
                                 index lva_dd03l_tabix.
              endif.
            endif.
          If data element was found, get description
            if not lwa_dd03l is initial.
              clear lwa_dd04t.
              read table lit_dd04t into lwa_dd04t
                                   with key rollname   = lwa_dd03l-rollname
                                            ddlanguage = sy-langu
                                   binary search.
              lva_dd04t_tabix = sy-tabix.
              if sy-subrc ne 0.
                select single rollname ddlanguage as4local as4vers scrtext_l
                       from  dd04t
                       into  lwa_dd04t
                       where rollname   eq lwa_dd03l-rollname
                       and   ddlanguage eq sy-langu.
                if sy-subrc eq 0.
                  insert lwa_dd04t into lit_dd04t
                                   index lva_dd04t_tabix.
                else.
                  lwa_dd04t-scrtext_l = 'Description for field not found'.
                endif.
              endif.
            endif.
            lwa_merged-scrtext_l = lwa_dd04t-scrtext_l.
            append lwa_merged to pa_it_merged.
            at end of changenr.
            Only process field changes for this change document.
              exit.
            endat.
          endloop.
          at end of objectid.
          Initialise work area so we know change document for order has
          been processed.
            clear lwa_merged.
          Only process change documents for this sales order.
            exit.
          endat.
        endloop.
      endloop.
    end of loop
    endform.                    " merge_data
    *&      Form  build_field_catalog
          text
    form build_field_catalog tables pa_it_fieldcat type slis_t_fieldcat_alv.
    data:
    Local variable
      lva_col_pos   type slis_fieldcat_alv-col_pos,
    Local structure
      st_fieldcat   type slis_fieldcat_alv.
      lva_col_pos = 0.
      clear st_fieldcat.
      add 1 to lva_col_pos.
      st_fieldcat-tabname       = 'PA_IT_MERGED'.
      st_fieldcat-fieldname     = 'VBELN'.
      st_fieldcat-ref_tabname   = 'VBAK'.
      st_fieldcat-ref_fieldname = 'VBELN'.
      st_fieldcat-row_pos       = '1'.
      st_fieldcat-col_pos       = lva_col_pos.
      append st_fieldcat to pa_it_fieldcat.
      clear st_fieldcat.
      add 1 to lva_col_pos.
      st_fieldcat-tabname       = 'PA_IT_MERGED'.
      st_fieldcat-fieldname     = 'VKBUR'.
      st_fieldcat-ref_tabname   = 'VBAK'.
      st_fieldcat-ref_fieldname = 'VKBUR'.
      st_fieldcat-row_pos       = '1'.
      st_fieldcat-outputlen = '6'.
      st_fieldcat-col_pos       = lva_col_pos.
      append st_fieldcat to pa_it_fieldcat.
    clear st_fieldcat.
      add 1 to lva_col_pos.
      st_fieldcat-tabname       = 'PA_IT_MERGED'.
      st_fieldcat-fieldname     = 'VKORG'.
      st_fieldcat-ref_tabname   = 'VBAK'.
      st_fieldcat-ref_fieldname = 'VKORG'.
      st_fieldcat-row_pos       = '1'.
      st_fieldcat-outputlen = '6'.
      st_fieldcat-col_pos       = lva_col_pos.
      append st_fieldcat to pa_it_fieldcat.
    clear st_fieldcat.
      add 1 to lva_col_pos.
      st_fieldcat-tabname       = 'PA_IT_MERGED'.
      st_fieldcat-fieldname     = 'KUNNR'.
      st_fieldcat-ref_tabname   = 'VBAK'.
      st_fieldcat-ref_fieldname = 'KUNNR'.
      st_fieldcat-row_pos       = '1'.
      st_fieldcat-col_pos       = lva_col_pos.
        st_fieldcat-outputlen = '6'.
      append st_fieldcat to pa_it_fieldcat.
    clear st_fieldcat.
      add 1 to lva_col_pos.
      st_fieldcat-tabname       = 'PA_IT_MERGED'.
      st_fieldcat-fieldname     = 'NAME1'.
      st_fieldcat-ref_tabname   = 'KNA1'.
      st_fieldcat-ref_fieldname = 'NAME1'.
      st_fieldcat-row_pos       = '1'.
        st_fieldcat-outputlen = '15'.
      st_fieldcat-col_pos       = lva_col_pos.
      append st_fieldcat to pa_it_fieldcat.
    clear st_fieldcat.
      add 1 to lva_col_pos.
      st_fieldcat-tabname       = 'PA_IT_MERGED'.
      st_fieldcat-fieldname     = 'MATNR'.
      st_fieldcat-ref_tabname   = 'VBAP'.
      st_fieldcat-ref_fieldname = 'MATNR'.
      st_fieldcat-row_pos       = '1'.
      st_fieldcat-col_pos       = lva_col_pos.
        st_fieldcat-outputlen = '6'.
      append st_fieldcat to pa_it_fieldcat.
    *clear st_fieldcat.
    add 1 to lva_col_pos.
    st_fieldcat-tabname       = 'PA_IT_MERGED'.
    st_fieldcat-fieldname     = 'MATNR'.
    st_fieldcat-ref_tabname   = 'MARA'.
    st_fieldcat-ref_fieldname = 'MATNR'.
    st_fieldcat-row_pos       = '1'.
    st_fieldcat-col_pos       = lva_col_pos.
       st_fieldcat-outputlen = '6'.
    append st_fieldcat to pa_it_fieldcat.
    clear st_fieldcat.
      add 1 to lva_col_pos.
      st_fieldcat-tabname       = 'PA_IT_MERGED'.
      st_fieldcat-fieldname     = 'SCRTEXT_L'.
      st_fieldcat-ref_tabname   = 'DD04T'.
      st_fieldcat-ref_fieldname = 'SCRTEXT_L'.
      st_fieldcat-row_pos       = '1'.
       st_fieldcat-outputlen = '20'.
      st_fieldcat-col_pos       = lva_col_pos.
      append st_fieldcat to pa_it_fieldcat.
      clear st_fieldcat.
      add 1 to lva_col_pos.
      st_fieldcat-tabname       = 'PA_IT_MERGED'.
      st_fieldcat-fieldname     = 'UDATE'.
      st_fieldcat-ref_tabname   = 'CDHDR'.
      st_fieldcat-ref_fieldname = 'UDATE'.
      st_fieldcat-row_pos       = '1'.
      st_fieldcat-outputlen = '10'.
      st_fieldcat-col_pos       = lva_col_pos.
      append st_fieldcat to pa_it_fieldcat.
      clear st_fieldcat.
      add 1 to lva_col_pos.
      st_fieldcat-tabname       = 'PA_IT_MERGED'.
      st_fieldcat-fieldname     = 'USERNAME'.
      st_fieldcat-ref_tabname   = 'CDHDR'.
      st_fieldcat-ref_fieldname = 'USERNAME'.
      st_fieldcat-row_pos       = '1'.
      st_fieldcat-outputlen = '6'.
      st_fieldcat-col_pos       = lva_col_pos.
      append st_fieldcat to pa_it_fieldcat.
    clear st_fieldcat.
    add 1 to lva_col_pos.
    st_fieldcat-tabname       = 'PA_IT_MERGED'.
    st_fieldcat-fieldname     = 'FNAME'.
    st_fieldcat-ref_tabname   = 'CDPOS'.
    st_fieldcat-ref_fieldname = 'FNAME'.
    st_fieldcat-row_pos       = '4'.
    st_fieldcat-outputlen = '8'.
    st_fieldcat-col_pos       = lva_col_pos.
    append st_fieldcat to pa_it_fieldcat.
      clear st_fieldcat.
      add 1 to lva_col_pos.
      st_fieldcat-tabname       = 'PA_IT_MERGED'.
      st_fieldcat-fieldname     = 'CHNGIND'.
      st_fieldcat-ref_tabname   = 'CDPOS'.
      st_fieldcat-ref_fieldname = 'CHNGIND'.
      st_fieldcat-row_pos       = '1'.
      st_fieldcat-outputlen = '8'.
      st_fieldcat-col_pos       = lva_col_pos.
      append st_fieldcat to pa_it_fieldcat.
      clear st_fieldcat.
      add 1 to lva_col_pos.
      st_fieldcat-tabname       = 'PA_IT_MERGED'.
      st_fieldcat-fieldname     = 'WAERK'.
      st_fieldcat-ref_tabname   = 'VBAK'.
      st_fieldcat-ref_fieldname = 'WAERK'.
      st_fieldcat-row_pos       = '1'.
      st_fieldcat-outputlen = '5'.
      st_fieldcat-col_pos       = lva_col_pos..
      append st_fieldcat to pa_it_fieldcat.
      clear st_fieldcat.
      add 1 to lva_col_pos.
      st_fieldcat-tabname       = 'PA_IT_MERGED'.
      st_fieldcat-fieldname     = 'VALUE_NEW'.
      st_fieldcat-ref_tabname   = 'CDPOS'.
      st_fieldcat-ref_fieldname = 'VALUE_NEW'.
      st_fieldcat-row_pos       = '1'.
      st_fieldcat-outputlen = '6'.
      st_fieldcat-col_pos       = lva_col_pos.
      append st_fieldcat to pa_it_fieldcat.
      clear st_fieldcat.
      add 1 to lva_col_pos.
      st_fieldcat-tabname       = 'PA_IT_MERGED'.
      st_fieldcat-fieldname     = 'VALUE_OLD'.
      st_fieldcat-ref_tabname   = 'CDPOS'.
      st_fieldcat-ref_fieldname = 'VALUE_OLD'.
      st_fieldcat-row_pos       = '1'.
      st_fieldcat-outputlen = '6'.
      st_fieldcat-col_pos       = lva_col_pos.
      append st_fieldcat to pa_it_fieldcat.
    endform.                    " build_field_catalog
    *&      Form  output_report
          text
    form output_report tables pa_it_fieldcat type slis_t_fieldcat_alv
                              pa_it_merged   type ty_it_merged.
    Local variables
    data:
      lva_formname type slis_formname,
      lva_repid    like sy-repid.
      lva_repid = sy-repid.
      lva_formname = 'ALV_USER_COMMAND'.
      call function 'REUSE_ALV_GRID_DISPLAY'
        exporting
          i_callback_program = lva_repid
          i_callback_user_command = lva_formname
          i_save             = 'A'
          is_variant         = st_variant
          it_fieldcat        = pa_it_fieldcat[]
        tables
          t_outtab           = pa_it_merged
        exceptions
          program_error      = 1
          others             = 2.
    endform.                    " output_report
    *&      Form  alv_user_command
          text
    form alv_user_command using pa_ucomm    like sy-ucomm
                                pa_selfield type slis_selfield.
    Local work areas
    data:
      lwa_merged type ty_merged.
      clear lwa_merged.
      read table it_merged into lwa_merged
                           index pa_selfield-tabindex.
      case pa_selfield-fieldname.
        when 'VBELN'.
        Contract Number
          set parameter id 'AUN' field lwa_merged-vbeln.
         call transaction 'VA03' and skip first screen.
    S_BCE_68001393
    when 'USERNAME'.
        Username
          set parameter id 'username' field lwa_merged-username.
          call transaction 'S_BCE_68001393' and skip first screen.
        when 'KUNNR'.
        Customer number
          set parameter id 'KUN' field lwa_merged-kunnr.
          set parameter id 'VKO' field space.
          set parameter id 'VTW' field space.
          set parameter id 'SPA' field space.
          call transaction 'XD03' and skip first screen.
      endcase.
    endform.                    " alv_user_command
    *&      Form  read_text
          text
    form read_text  using    pa_id
                             pa_inline_count
                             pa_name
                             pa_object
                             pa_text.
    Local internal tables
    data:
      lit_inlines type ty_it_lines,
      lit_lines   type ty_it_lines.
    Local work areas
    data:
      lwa_lines   type ty_lines.
    Local variables
    data:
      lva_tdname    like thead-tdname.
      refresh: lit_inlines,
               lit_lines.
      lva_tdname = pa_name.
      call function 'READ_TEXT_INLINE'
        exporting
          id                    = pa_id
          inline_count          = pa_inline_count
          language              = sy-langu
          name                  = lva_tdname
          object                = pa_object
        tables
          inlines               = lit_inlines
          lines                 = lit_lines
        exceptions
          id                    = 1
          language              = 2
          name                  = 3
          not_found             = 4
          object                = 5
          reference_check       = 6
          others                = 7.
      loop at lit_lines into lwa_lines.
        concatenate pa_text
                    lwa_lines-tdline
                    into pa_text separated by space.
      endloop.
    endform.                    " read_text ENDLOOP.

Maybe you are looking for

  • Exchange rate message in PO

    Dear experts, I receive a warning message "exchange rate deviates by 7%" when changing the exchange rate during PO creation. I would like to change it to an error message. In " IMG > MM > Purchasing > Environment data > Define attributes of system me

  • With multiple tabs open, crashing with no warning to close tabs and no crash report. Just bye-bye.

    I have the option to warn me before closing multiple tabs selected. I left my desk for an hour with multiple windows open. When I returned, all but 1 window disappeared. I was typing on Facebook with multiple tabs open and instantly all tabs and wind

  • Help for Help

    Hi I remember i have used a SAP Help wich shows a window when we can write a word and it shows the documentation help for that word. This is like help window showed when we press F1 in some code line in ABAP program for search help for some ABAP comm

  • IOS 5 update Contact issue

    After updating my iPhone 4 to iOS 5, I have alot more contacts than I did before. Where did these contacts come from. I currently have my iPhone connected to our works Microsoft Exchange server and when you look in outlook alot of the contacts are no

  • Is there anyway to reset your back up email?

    I have never run into the problem of needing to provide answers to three security questions. I don't remember my answers. I don't even know what email I used as the back up email. It's some gmail and the email I use is yahoo. It's really frustrating.