Special gl process

hi,
i read that there are 3 types of special gl processes : free offsetting postings, automatic offsetting posting and noted item.
1) only free offsetting posting will impact FS?
2) automatic offset will have notes or only appendix in FS. can consider impact FS?
3) automatic offset posting also called statistical posting as always posted to the same offset. is this configured? if yes, what tcode?
4) automatic offset or statistical posting only apply on guarantee?
5) how is the double entry like for point 4. can have example?
6) can have example on free offset posting?
7) what transaction will be for free offset posting.
8) all special gl account are alternative recon account in gl, correct?
9) for point 7, when dr debtor account, alternative recon account also get debited. correct? the entry side just like normal recon acc for normal subledger account recon account. correct?
thanks

> hi,
> i read that there are 3 types of special gl processes
> : free offsetting postings, automatic offsetting
> posting and noted item.
> 1) only free offsetting posting will impact FS?
> 2) automatic offset will have notes or only appendix
> in FS. can consider impact FS?
> 3) automatic offset posting also called statistical
> posting as always posted to the same offset. is this
> configured? if yes, what tcode?
> 4) automatic offset or statistical posting only apply
> on guarantee?<b> YEs</b>
> 5) how is the double entry like for point 4. can have
> example?
<b>Customer a/c Dr
Alter recon a/c Dr
Guarantee received Cr</b>>
6) can have example on free offset posting?
> 7) what transaction will be for free offset posting.- <b>Bill of exchange and Downpayment</b> 8) all special gl account are alternative recon
> account in gl, correct? <b>Yes</b>> 9) for point 7, when dr debtor account, alternative
> recon account also get debited. correct? the entry
> side just like normal recon acc for normal subledger
> account recon account. correct?
> thanks
Points  8 &9 - Yes All special GL will flow through alternate recon account. Every reocn account which will have an impact on special GL will be mapped to a Alternate recon account.
These alternate recon account will also get dr/ cr on the same side of the customer/ vendor account.

Similar Messages

  • ICR - Tables Special Ledger Process 002

    Hi,
    I'm implemented ICR Process 002. Somebody  knows What are the fields that should have tables total and actual line items of the Special Ledger Sender?
    Can you help me?
    Thank you.
    Best regards
    Giampaolo

    Hello Giamapaolo,
    If you already have ledger I2 for FBICRC002T and you do not need to run FBICS2 to run some kind of BADI implementation you do not need to create any additional ledgers for FBICRC002T.
    Best regards,
    Ralph

  • Payroll Run processing error out with PTO element

    I have created new payroll and trying to process first payroll of employee but when we are processing with PTO element it is getting error out below error.
    UDF Error in formula PTO_NONEXEMPT_VACATION_ORACLE_PAYROLL at line 45: Value exceeded allowable range (line 133 of XXRAC_PTO_HD_ANNIVERSARY_BALANCE)
    Thank You
    Nitin Maheshwari

    Benjamin,
                   there are several ways to reprocess the structure of a SSAS 2005 object.
                   In my example I use an SSIS 2005 processing task in an ETL package, but the simplest way is:
                   Log on to the database using SQL Server Management Studio 2005; Open the cubes tree under your database, and right-click one of the cubes; Choose "Process" from the context menu and then another window will open. This window should show your cube name and then some options; Under "Process Options", change the default option (I think it's "Process Full") to "Process Structure". Click "OK" and the structure of your cube should be reprocessed, correcting the error.
                   Some observations: You might have to do this first for all the dimensions, because the cubes depend on them, and you also might have to do it one object at a time through this method. Through an SSIS 2005 package, you are able to do this in batch using a special SSAS processing task.
                   Let me know if you solved your problem.
    Bruno

  • Special procurement in SRM

    Hi All
    Can the special procurement processes like Sub contracting, Consignment, third party PO and STO be handled in SRM ? if so , can anybody pls tell me how to go about it?
    Thanks
    Rashmi

    Hi Rashmi
    SRM version 4.0 does not support  following process
    1 Sub contracting
    2 Consignment
    3 Third party Out and Out
    However I have heard that from Version 6.0 they are planning to have some  features.
    Regards,
    Nimish Sheth
    Pls reward points for helpful answers.

  • For invoice transactions ( Business process ) Automatic A/c determination

    Hi,
    Its  a data transfer project ,
    using movement type of the material doc's debit/credit indicator i am able to map the corresponding value in Accounting value for  its total reciepts & issues for a particular material.
    but if it is the case of say invoicing docs say Incoming Invoice
    Price Change ,Debit / Credit Material, revaluation how do i map the value's
    thnks

    Hi,
    this is data transfer from sap 3.0 to BW .
    MB5B report in R/3 , functionality should be available in BW after data transfer.
    for this for this report u can write a little logic in BW say like cumulating reciepts or issues.
    As of now for a particular material, plant & date i had taken material doc
    for this corresponding Acc docs using AWKEY in BKPF . for a materials movement type & debit/credit indicator corresponding values are
    taken, i had taken care to exclude the special procure process.
    now i want in a case a price diff doc or for credit memo ( Invoice process doc's) how do u find the corresponding values.
    thnks

  • Subcontracting Process

    Hi
    If any one can explain in detail about scenario material vendor posting directly to subcontracting vendor
    It 's very urgent
    Thanks & Regards,
    Sadhish

    Hi Sadhish,
    Sub Contracting Cycle
    (1) You have a material that can be procured externally, and you have maintained BOM with components. Any waste generated and received during subcontracting process can be maintained as component with negative quantity.
    (2) You create a subcontracting PO (PO with Item Category L). You can also maintain Purchase Info Record for Subcontract category for material and subcontractor.
    (3) You make a transfer posting to issue components for SC PO. Material is sent to subcontractor. As material remains under your ownership, system does not make any value entry. But quantity is shown as "Material Provided to Vendor"
    (4) You receive finished material against SC-PO. You also specify components consumed in manufacturing of finished goods. Additionally, if you have negative components in BOM, now you'll also receive subcontracting by-products. There are three events, so three accounting entries are generated:
    DR FG Stock/ SC By-Product Stock
    CR Change in Stock (FG/ SC By-Product )
    (for finished goods received)
    DR Subcontracting Charges
    CR GR/IR Clg
    (for moneys payable to Subcontractor)
    DR Consumption (Components)
    CR Change in Stock (FG/ SC By-Product )
    (material provided to Vendor is now charged to expense)
    (5) You do the IV for SC Invoice, and the process is complete.
    Process of Subcontract in MM
    Sub-contract business process:
    You want to buy material from the supplier (processed material/ assembled item) , but for some reason (quality of certain item / price ) you will give some component to vendor .
    Vendor shall process the item / use the item provided & supply the final item.
    SAP process:
    1.Create the finished goods material code.
    2.Maintain the BOM for the material.
    3.Create PO with item category as "L" .
    4.Issue material to vendor with movement type 541
    5.Receive the material against the PO with movement type 101.
    6.MIRO to account for vendor's invoice for the service charge& material used by him.
    Can anybody tell me how a process has to be given to subcontracting?
    Suppose, I have 3 operations 1)weaving 2)dyeing 3)cutting & packing
    if no 2 process (i.e Dyeing) has to be given to subcontracting, what process should i follow ?
    The following process to be followed for subcontracting.
    1. Item code(material master) to be created at the stage of before dyeing.
    2. Item code(material master) to be created after Dyeing as subcontracted item.(F30)
    3. Bill of material to becreated for the material(2) calling for material(1)
    4. Inforecord and source list to be created for material(2) with the corresponding vendor
    5. PO to be released for material (2)
    6.Along with PO the material(1) to be issued to vendor
    7.On receipt of material when GR is made the stock with vendor will get updated.
    How to Create a Subcontract Order?
    To create a subcontract order, proceed as follows:
    Enter the material you want to order and the item category for subcontracting (L) in the order item.
    Press ENTER to display the screen for component processing.
    Enter the components that the vendor requires to manufacture the product.
    Please note:
    – You do not need to enter the date required for the components. This date is proposed by the system when you press ENTER.
    It is calculated as follows:
    Delivery date of the item - Planned delivery time
    – If you do not want the quantity of the components to be changed if the order quantity of the end product is altered, set the indicator Fixed quantity (column F).
    – You can determine whether the components are available on the date required by selecting Edit -> Availability check.
    If you entered a bill of material as the material in the subcontract order, the components are created automatically.
    If you want to determine the components in the bill of material at a later date (for example, if the bill of material is subsequently changed), choose Item -> Component -> New BOM explosion. The existing components are deleted and redetermined in the bill of material.
    Save the purchase order.
    When you print the purchase order, the components are printed per order item
    Subcontracting - Key Points
    Special Procurement Process.
    Item category: L
    Order type: NB
    In info record vendor should be maintained as subcontractor.
    Vendor (Subcontractor) receives the components used to manufacture a finished product directly from your company or through third party.
    Your company should place a purchase order for the finished product. In this manually you can enter the required individual components or it can be determined via the explosion of BOM (if exists).
    Stock check at vendor level: ME2O
    Company stock check: MMBE
    GR for individual components through movement type: 501 or 561 (if with out PO or without reference).
    GI to subcontracting vendor: through movement type 541.
    GR from sub contracting vendor: through movement type: 101
    Movement type 543 is displayed to cancel the material cost account.
    If the subcontracting order has to be generated through materials planning,the special procurement key has to be set in MRP 2 screen.
    - To create the Subcon Info Record : Tcode ME11 - Info Category - Click Subcontracting
    - To create Material BOM : Tcode CS01
    - With the Info and Material Setup, you can then create the Purchase Order in Tcode ME21N
    Hope it wud have answered ur question
    Reward if useful
    Aasif

  • Standard purchase organization in subcontracting process?

    Gurus,
    It's not mandatory to enter standard purchase organization during subcontracting process..It's manadtory during consignment and pipeline process.
    then, why standard purchase organization involves during special procurement process?
    Subcontaracting also a special procurement process..
    pls share ur ideas..

    Hi
    Standard purchasing organisation will be read by the program for Stock transfer, consignment & Pipeline as per the standard SAP.
    Thanks/karthik

  • Why I don't see all docs in document flow of i/c process?

    Hi Experts,
    we are using the following special SD process for i/c billing and final customer sales:
    Contract --> SO (OR) which triggers PR --> PO (converted by PR) --> OD (NL ref. PO) --> IV(ref. OD) and for the final customer, initial SO (OR) --> OD (LF ref. SO) --> F2 (Ref. OD).
    The problem is that I don't have the full document flow for this process despite the fact that all documents are linked together.
    More precise, any document linked to PO (OD (NL), GR/GR, IV) is not displayed in SO doc flow, only the PO without details. So, my flow is Contract, SO (OR), PO, OD( LF), F2.
    Why this happened? Is there a way to have in one picture all documents related to this process?
    Thanks for your assistance
    Sakis

    In your sales order (with complete sales process), try Status Overview.
    To check that, Sales Order - Document Flow( Press F5 from keyboard ) - Status Overview (click on button).
    Expand all the nodes, you should be able to see all the docs with stages of sales process.
    Regards
    JP

  • Query about third party sale process

    Hi,
    SD experts,would u please tell me the acctual spro configuration of "third party sale process".

    Hi Anirban,
    First, there is a note 550388 which is the FAQ note for customizing of third-party process.
    Actually the main configuration is just the item category and schedule line category.
    You could refer to TAS and TAB in standard system to create third party order and individual purchase order.
    You could also refer to the online documentation at
    http://help.sap.com/saphelp_47x200/helpdata/en/70/a7853478616434e10000009b38f83b/frameset.htm
    Sales->Special Business Process in Sales->Third Party Process
    Best regards,
    Smile

  • Batch processing time lapse photos

    I have a series of several hundred photos taken one a day.  There is some day-to-day variation in the camera position which causes distracting jitter when run through a simple time lapse engine.  There are a couple salient landmarks in each photo which could be used to auto-rotate, and (possibly auto-scale)  the images if the software could be directed to recognize and align these simple features.
    Thanks

    There are few forums dedicated specifically to time-lapse. Try to search for timescapes.com, but it might have changed names.
    Many of those artists and technicians use conventional After Effects filters or purchase special batch processing scripts for Photoshop. The scripts or filters level out those slight mechanical variations in f-stop on every frame and can help smooth out color tone issues. The output is usually converted to tiff or jpg for ease of animation and renumbered for ease of importing the sequences . Then they'll run AE's stabilizer. 
    Those forums also included lots of tutorials or advice on how to tweak your gear to shoot better source images that require less post production processing.
    Good luck, hope you find something useful out there.

  • Difference between Computation and Process

    Any Computation can also be implemented as a Process. Their "firing points" are also the same.
    So, why do Computations exist at all?
    Thanks

    Vikas - I don't know but computations always fire before processes at any given firing point allowing processes to reference session state that may have been set by a computation at the same or earlier firing point. It's true though that a process can set session state as well, so a computation is just a special-purpose process with declarative attributes that allow for application or page items to be named as the object of the computation. But then a validation is merely a special-purpose process that does what it does. And a branch is a special-purpose process that does a URL redirect or something similar, and before there were report regions there were just processes...
    Scott

  • Please help me with selecting the right institute for me

    HI All,
    Please help me which institute I should select for my SAP SD training?
    ONE INSTITUTE COVERING THE FOLLOWING TOPICS:
    Sales overview
    Enterprise structure related to SD
    Master data, like Customer master data, material master data, condition master data and Output master data.
    Partner determination
    Sales document types
    Item categories
    Schedule line categories
    Pricing: Condition table, access sequence, Condition type, pricing procedure
    Stock Posting
    Free goods
    Bills of Material
    Material determination
    Material Listing and Exclusion
    Incompletion logs
    Revenue account determination
    Credit management
    Outline agreements like quantity contract, value contract and scheduling agreements
    Shipping process like Shipping point determination, Route determination, Shipping conditions picking ,PGI
    Delivery types
    Delivery item categories
    Invoice process
    Billing types
    Special sales processes like cash sales, rush orders ,consignment process and Third party process
    Return sales process
    Credit memo process
    Debit memo process
    Availability check
    Rebate processing
    Intercompany sales
    Output determination
    Copy control
    Integration with MM,FI
    Technical topics like ABAP tables, user exits and IDOC’s
    Real time scenario’s
                   OR
    OTHER INSTITUTE COVERING THE FOLLOWING TOPICS:
    1. Introduction to Supply chain management
    2. Introduction to SAP ERP package
    3. Introduction to ASAP implementation methodology
    4. Lecture Demo on Basic navigation skills in SAP R/3
    5. SAP landscape. Tips and tricks
    6. Introduction to Enterprise structure in SD
    7. Overview of Material master records
    8. Demo on ROH, HAL and FERT creation
    9. Hands on exercise on creation of material mastesr records in SAP
    10. Introduction to SD master data (Business partners, conditions and outputs)
    11. Introduction to order processing and Demo
    12. Hands on exercises on sales order processing
    13. Introduction to delivery process, picking and post goods issue process
    14. Introduction to stock transport orders and inter-company stock transport Orders
    15. Exercises on delivery with respect to sales orders
    16. Introduction to billing process (Customer billing, Inter-company, Proforma, Credit memo and Debit memo)
    17. Introduction pricing procedure, condition records, condition tables and access sequence.
    18. Configuration on SD sales order types, delivery and billing
    19. Warehouse management overview
    20. Introduction to SAP WM configuration
    21. Demo by instructor on configuration
    22. Develop configuration scripts
    23. Introduction to develop BPP
    24. Hands on exercises to students
    25. Introduction to WM master data
    26. Introduction to transaction data in WM
    27. Hands on exercises on creation of master data elements in WM
    28. Hands on exercises to students on WM transaction data
    29. Introduction to CTS process (SE10, SCC1)
    30. Demo on WM business scenarios and integration points
    31. Introduction to develop integration test scenarios. Develop test scripts
    32. Introduction to OSS notes and SAP Help
    33. Introduction to EAI tools, FID, RF Gun, MDE, SAP console and hand held devices
    34. Introduction to SAP bold on tools (SRM, CRM, BW, SEM, GTS, CIC, FSCM, DP, SNP, PP/DS, GATP, CIF and Plug in)
    35. Introduction to quick reference guides, cheat sheet, FAQ, work instructions, job aides, transaction aides, work instructions and change management
    36.Interface between SD & FI
    37.C forms, H forms
    38.Excise Related Invoices
    39.CIN configuration (taxes)
    40. Debugging with help of ABAP Tool
    41.Excise Returns Process with pricing details
    42.Order, Delivery, Billing, exicise, Output types configuration

    You should talk to various institute.

  • Help required on ALV REPORT

    Hi,
    Please help with a solution:
    my requirement is to add the following to an existing program.
    i need to add 3 fields from a new table(a table which is not used in the program).
    the fields are :
    Vendor Part No. : Field ZWTYVND-Z_WTY_MAT_VPN
    Mail To Vendor No.:  Field ZWTYVND-Z_WTY_LIFNR_MAIL
    Mail To Vendor Name:  Field ZWTYVND-WTY_NAME1
    here is the program code:
    REPORT  zwtyrep008
            LINE-SIZE 500
            MESSAGE-ID zpp02.
    *& Report  ZWTYREP008                                                  *
    *$*$----------------------------------------------------------------$*$*
    *$*$---T A B L E S--------------------------------------------------$*$*
    *$*$----------------------------------------------------------------$*$*
    TABLES: wty_pnwtyh_dia,    "
            wty_pnwtyv_dia,
            mara,
            usr21,
            pnwtyv,
            adrp,
            s084.
    *$*$----------------------------------------------------------------$*$*
    *$*$ CONSTANTS
    *$*$----------------------------------------------------------------$*$*
    CONSTANTS: true(1)                                VALUE 'X',
               false(1)                               VALUE ' '.
    CONSTANTS: c_year_low(4)                          VALUE '1960',
               c_year_high(4)                         VALUE '9999',
               c_zero        LIKE wty_pvwty_dia-valiv VALUE '0.00',
               c_claim_to_process TYPE i              VALUE 3000.
    CONSTANTS: c_save(1)               VALUE 'U'.
    *$*$----------------------------------------------------------------$*$*
    *$*$ TYPES
    *$*$----------------------------------------------------------------$*$*
    TYPE-POOLS: slis, pwty.
    TYPES: BEGIN OF lt_period,
                   year(4),
                   poper(2),
                   start     TYPE d,
                   end       TYPE d,
          END   OF lt_period.
    TYPES: BEGIN OF tp_charac_value,
                 atwrt LIKE cawn-atwrt,
           END   OF tp_charac_value.
    TYPES: BEGIN OF tp_submit_records,
                 header_guid   LIKE wty_pnwtyv_dia-header_guid,
                 versn         LIKE wty_pnwtyv_dia-versn,
                 prev_version  LIKE wty_pnwtyv_dia-prev_version,
                 kateg         LIKE wty_pnwtyv_dia-kateg,
                 aktiv         LIKE wty_pnwtyv_dia-aktiv,
                 pnguid        LIKE wty_pnwtyv_dia-pnguid,
                 knumv         LIKE wty_pnwtyv_dia-knumv,
           END   OF tp_submit_records.
    TYPES: BEGIN OF tp_cond_table,
                 kschl  LIKE konv-kschl,
                 zaehk  LIKE konv-zaehk,
                 kinak  LIKE konv-kinak,
                 kbetr  LIKE konv-kbetr,
           END   OF tp_cond_table.
    *$*$----------------------------------------------------------------$*$*
    *$*$---I N T E R N A L   T A B L E S--------------------------------$*$*
    *$*$----------------------------------------------------------------$*$*
    * Report table to display with ALV
    DATA: t_detail_info TYPE STANDARD TABLE OF zwty_claim_avg_rep_det
                        WITH HEADER LINE
                        INITIAL SIZE 0.
    FIELD-SYMBOLS:<fs_detail_info> LIKE LINE OF t_detail_info.
    DATA: t_summary_alv TYPE STANDARD TABLE OF zwty_claim_avg_rep_sum
                        WITH HEADER LINE
                        INITIAL SIZE 0.
    FIELD-SYMBOLS:<fs_summary_alv>  LIKE LINE OF t_summary_alv.
    DATA: t_detail_alv  TYPE STANDARD TABLE OF zwty_claim_avg_rep_det
                        WITH HEADER LINE
                        INITIAL SIZE 0.
    FIELD-SYMBOLS:<fs_detail_alv> LIKE LINE OF t_detail_alv.
    DATA: it_submit_records TYPE HASHED TABLE OF tp_submit_records
                           WITH UNIQUE KEY header_guid versn
                           WITH HEADER LINE
                           INITIAL SIZE 0.
    FIELD-SYMBOLS: <fs_submit_rec_vs2> TYPE tp_submit_records.
    DATA: it_period TYPE HASHED TABLE OF lt_period
                    WITH UNIQUE KEY year poper
                    WITH HEADER LINE
                    INITIAL SIZE 0.
    FIELD-SYMBOLS: <fs_it_period>      LIKE LINE OF it_period.
    DATA: it_pvwty_dia_all  TYPE wty_pvwty_dia_tab.
    FIELD-SYMBOLS: <fs_pvwty_dia_es3> LIKE LINE OF it_pvwty_dia_all.
    DATA: it_cond_table TYPE STANDARD TABLE OF tp_cond_table
                        WITH HEADER LINE
                        INITIAL SIZE 0.
    FIELD-SYMBOLS: <fs_cond_table> TYPE tp_cond_table.
    *$*$----------------------------------------------------------------$*$*
    *$*$---G L O B A L  D A T A  ---------------------------------------$*$*
    *$*$----------------------------------------------------------------$*$*
    DATA: gt_fieldcat_sum   TYPE slis_t_fieldcat_alv,
          gt_fieldcat_det  TYPE slis_t_fieldcat_alv,
          gtw_fieldcat     LIKE LINE OF gt_fieldcat_sum,
          gt_top_of_page   TYPE slis_t_listheader,
          gtw_top_of_page  LIKE LINE OF gt_top_of_page,
          gt_end_of_page   TYPE slis_t_listheader,
          gtw_end_of_page  LIKE LINE OF gt_end_of_page,
          gs_layout        TYPE slis_layout_alv,
          gt_excluding     TYPE slis_t_extab,
          gtw_excluding    LIKE LINE OF gt_excluding,
          gs_variant1       TYPE disvariant,
          gs_variant2       TYPE disvariant,
          eventcat         TYPE slis_t_event,         "EVENEMENT
          eventcat_ln      LIKE LINE OF eventcat,     "LIGNE D'EVENEMENT
          gt_sort          TYPE slis_t_sortinfo_alv,
          gtw_sort         LIKE LINE OF gt_sort.
    DATA: wa_lis_progname  LIKE sy-cprog,
          wa_low_date      TYPE d,
          wa_high_date     TYPE d,
          wa_index_mat     TYPE i,
          wa_index_link    TYPE i,
          wa_level_alv     TYPE i.
    DATA: g_callback_pgm(40)          TYPE c,
          g_callback_user_command(30) TYPE c.
    DATA: my_print TYPE  slis_print_alv.
    FIELD-SYMBOLS: <fs_pvwty_dia> TYPE wty_pvwty_dia.
    * SELECTION SCREEN                                          *
    SELECTION-SCREEN SKIP 1.
    SELECTION-SCREEN BEGIN OF BLOCK post WITH FRAME TITLE text-001.
    SELECT-OPTIONS: s_cpudt FOR s084-spmon NO-EXTENSION,
                    s_postdt FOR  wty_pnwtyv_dia-fkdat NO-EXTENSION.
    SELECTION-SCREEN END   OF BLOCK post.
    SELECTION-SCREEN BEGIN OF BLOCK b1 WITH FRAME TITLE text-002.
    SELECT-OPTIONS: s_vend  FOR pnwtyv-v_parnr NO INTERVALS.
    SELECT-OPTIONS: s_clgrp FOR wty_pnwtyh_dia-clmgrp.
    SELECTION-SCREEN SKIP 1.
    SELECT-OPTIONS: s_model  FOR  wty_pnwtyh_dia-z_wty_model.
    SELECT-OPTIONS: s_matnr  FOR  mara-matnr.
    SELECTION-SCREEN END   OF BLOCK b1.
    SELECTION-SCREEN BEGIN OF BLOCK lay WITH FRAME TITLE text-004.
    PARAMETERS: varn1  TYPE slis_vari MEMORY ID fit_alv_gl,  "Dis. variant
                varn2  TYPE slis_vari.
    SELECTION-SCREEN END   OF BLOCK lay.
    *$*$----------------------------------------------------------------$*$*
    *$*$---A T  S E L E C T I O N - S C R E E N-------------------------$*$*
    *$*$----------------------------------------------------------------$*$*
    AT SELECTION-SCREEN ON VALUE-REQUEST FOR varn1.
      PERFORM alv_variant_f4 USING '0001' CHANGING varn1.
    AT SELECTION-SCREEN ON VALUE-REQUEST FOR varn2.
      PERFORM alv_variant_f4 USING '0002' CHANGING varn2.
    AT SELECTION-SCREEN ON BLOCK post.  "Validate posting parameters
      PERFORM validate_posting_parameter.
    AT SELECTION-SCREEN ON s_model.     "Validate model
      PERFORM validate_model.
    AT SELECTION-SCREEN ON s_vend.      "Validate vendor
      PERFORM validate_vendor.
    AT SELECTION-SCREEN ON s_matnr.      "Validate material
      PERFORM validate_material.
    AT SELECTION-SCREEN ON s_clgrp.     "Validate claim group
      PERFORM validate_claim_group.
    AT SELECTION-SCREEN OUTPUT.
    * Initialization.
    INITIALIZATION.
    * Initialize default display variant for ALV report
      CLEAR gs_variant1.
      MOVE sy-repid TO: gs_variant1-report,
                        gs_variant2-report.
      gs_variant1-handle = '0001'.
      gs_variant2-handle = '0002'.
      wa_lis_progname   = sy-repid.
      PERFORM set_default_variant CHANGING gs_variant1
                                           varn1.
      PERFORM set_default_variant CHANGING gs_variant2
                                           varn2.
      PERFORM get_fin_period USING c_year_low c_year_high.
      PERFORM set_period_to_analyse.
    *$*$----------------------------------------------------------------$*$*
    *$*$---S T A R T - O F - S E L E C T I O N--------------------------$*$*
    *$*$----------------------------------------------------------------$*$*
    START-OF-SELECTION.
      PERFORM select_claim_to_process.
    *$*$----------------------------------------------------------------$*$*
    *$*$---E N D - O F - S E L E C T I O N------------------------------$*$*
    *$*$----------------------------------------------------------------$*$*
    END-OF-SELECTION.
      CALL FUNCTION 'SAPGUI_PROGRESS_INDICATOR'
       EXPORTING
    *        PERCENTAGE       = 0
         text             =  text-m02.
      IF sy-batch = 'X'.
        PERFORM set_print_alv_grid.
      ENDIF.
      PERFORM show_alv_grid.
    *&      Form  PRINT_DETAIL_ALV
    FORM show_alv_grid.
    * Prepare ALV_GRID before display
    * ===============================
      PERFORM init_field.
      PERFORM init_layout.
      PERFORM init_fieldcat.
      PERFORM init_excluding.
      PERFORM init_event.
    *  SORT report_data BY bukrs werks.
      PERFORM call_alv_list_display_level_1.
    ENDFORM.                    " PRINT_DETAIL
    *&      Form  VARIANT_F4   copied from RPCWCCK3
    *       Display a list of all available display variants for the ALV.
    *      <--P_varn1  Return the selected variant and return
    FORM variant_f4 CHANGING p_varn1 TYPE disvariant-variant.
      DATA: l_variant LIKE disvariant.
    * Get the list of available variants for the report
      l_variant-report = sy-repid.
      CALL FUNCTION 'REUSE_ALV_VARIANT_F4'
        EXPORTING
          is_variant = l_variant
          i_save     = 'A'
        IMPORTING
          es_variant = l_variant.
      p_varn1 = l_variant-variant.
    ENDFORM.                               " VARIANT_F4
    *&      Form  INIT_FIELD
    FORM init_field.
      MOVE sy-repid          TO g_callback_pgm.
      MOVE 'MY_USER_COMMAND' TO g_callback_user_command.
    ENDFORM.                    " INIT_FIELD
    *&      Form  INIT_LAYOUT
    FORM init_layout.
      gs_layout-window_titlebar   = sy-title.
      gs_layout-colwidth_optimize = 'X'.
      gs_layout-expand_all        = 'X'.
      gs_layout-no_subtotals      = ''.
      gs_layout-key_hotspot       = 'X'.         " Afficher Hotspot
      gs_layout-zebra             = 'X'.
      gs_layout-group_change_edit = 'X'.
      gs_layout-f2code            = 'DISPLAY'.
    * gs_layout-max_linesize      = 400.
    * gs_layout-totals_only       = 'X'.
    ENDFORM.                    " INIT_LAYOUT
    *&      Form  INIT_FIELDCAT
    FORM init_fieldcat.
      DATA: lt_fieldcatalog    TYPE lvc_t_fcat,
            ltw_fieldcatalog   TYPE lvc_s_fcat.
      REFRESH: lt_fieldcatalog,
               gt_fieldcat_sum,
               gt_fieldcat_det.
      CLEAR   gtw_sort.
      REFRESH gt_sort.
    * ==============================================
    * Set the label column for summary report leve 1
    * ==============================================
      CALL FUNCTION 'LVC_FIELDCATALOG_MERGE'
        EXPORTING
          i_structure_name       = 'ZWTY_CLAIM_AVG_REP_SUM'
          i_client_never_display = 'X'
        CHANGING
          ct_fieldcat            = lt_fieldcatalog.
    *                             FIELD     pos sub  up  down Group
      PERFORM create_sort USING: 'V_PARNR'   1  'X'  'X'  ' '   'X',
                                 'NAME'      2  'X'  'X'  ' '   'X',
                                 'MAKTX'     3  'X'  'X'  ' '   'X',
                                 'MATNR'     4  'X'  'X'  ' '   'X'.
      LOOP AT lt_fieldcatalog INTO ltw_fieldcatalog.
        CLEAR: gtw_fieldcat.
        MOVE-CORRESPONDING ltw_fieldcatalog TO gtw_fieldcat.
        PERFORM set_alv_field_desc USING  ltw_fieldcatalog '1'.
        APPEND gtw_fieldcat TO gt_fieldcat_sum.
      ENDLOOP.
      PERFORM set_hot_spot TABLES gt_fieldcat_sum USING 'CLAIM_NB'.
    * =========================================
    * Field Catalog for Detail report (level 2)
    * =========================================
      REFRESH: lt_fieldcatalog.
      CALL FUNCTION 'LVC_FIELDCATALOG_MERGE'
        EXPORTING
          i_structure_name       = 'ZWTY_CLAIM_AVG_REP_DET'
          i_client_never_display = 'X'
        CHANGING
          ct_fieldcat            = lt_fieldcatalog.
      LOOP AT lt_fieldcatalog INTO ltw_fieldcatalog.
        CLEAR: gtw_fieldcat.
        MOVE-CORRESPONDING ltw_fieldcatalog TO gtw_fieldcat.
        PERFORM set_alv_field_desc USING  ltw_fieldcatalog '2'.
        APPEND gtw_fieldcat TO gt_fieldcat_det.
      ENDLOOP.
      PERFORM set_hot_spot TABLES gt_fieldcat_det USING 'CLMNO'.
    ENDFORM.                    " INIT_FIELDCAT
    *&      Form  INIT_SORT
    FORM create_sort USING  p_fieldname p_spos
                            p_subtot            TYPE char1
                            p_up                TYPE char1
                            p_down              TYPE char1
                            p_group             TYPE char1.
      CLEAR: gtw_sort.
      gtw_sort-fieldname = p_fieldname.
      gtw_sort-spos      = p_spos.
      gtw_sort-subtot    = p_subtot.
      gtw_sort-up        = p_up.
      gtw_sort-down      = p_down.
      gtw_sort-group     = p_group.
      APPEND gtw_sort TO gt_sort.
    ENDFORM.                    "create_sort
    *&      Form  INIT_EXCLUDING
    *       Exclude des option de l'application tool bar
    FORM init_excluding.
      CLEAR   gtw_excluding.
      REFRESH gt_excluding.
      gtw_excluding-fcode   = '&ABC'.
      APPEND gtw_excluding TO gt_excluding.
    ENDFORM.                    " INIT_EXCLUDING
    *&      Form  call_alv_list_display_level_1
    FORM call_alv_list_display_level_1.
    * DATA: l_i_save  VALUE 'U'.   "User-specific variants only
      DATA: l_i_save  VALUE 'A'.   "Any type of variants
      gs_variant1-report  = sy-repid.
      gs_variant1-variant = varn1.
      gs_layout-colwidth_optimize = true.
      wa_level_alv = 1.
      CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
        EXPORTING
          i_callback_program      = g_callback_pgm
          i_callback_user_command = g_callback_user_command
          is_layout               = gs_layout
          it_fieldcat             = gt_fieldcat_sum
          it_excluding            = gt_excluding
          it_sort                 = gt_sort
          i_save                  = l_i_save
          is_variant              = gs_variant1
          it_events               = eventcat
          is_print                = my_print
        TABLES
          t_outtab                = t_summary_alv
        EXCEPTIONS
          program_error           = 1
          OTHERS                  = 2.
    ENDFORM.                    " call_alv_list_display_level_1
    *&      Form  INIT_EVENT
    *       Determine quelle routine a executer selon l'event
    FORM init_event.
      eventcat_ln-name = 'TOP_OF_PAGE'.
      eventcat_ln-form = 'ALV_PAGE_HEADER'.
      APPEND eventcat_ln TO eventcat.
      eventcat_ln-name = 'END_OF_PAGE'.
      eventcat_ln-form = 'FOOTER_PAGE'.
      APPEND eventcat_ln TO eventcat.
    ENDFORM.                    " INIT_EVENT
    *&      Form  ALV_PAGE_HEADER
    FORM alv_page_header.
      DATA: l_date_time(22),
            l_char7(7),
            l_char10(10).
      DATA: p_date(10) TYPE c.
      DATA: p_time(8)  TYPE c.
      DATA: p_name(80) TYPE c.
    * Format current date and time
      WRITE sy-datum TO p_date USING EDIT MASK '____/__/__'.
      WRITE sy-uzeit TO p_time USING EDIT MASK '__:__:__'.
      CONCATENATE p_date '-' p_time
                  INTO l_date_time SEPARATED BY space.
    * Set the user name
      SELECT SINGLE
             persnumber addrnumber INTO (usr21-persnumber, usr21-addrnumber)
                 FROM  usr21
                 WHERE bname = sy-uname.
      SELECT SINGLE name_first name_last
             INTO   (adrp-name_first, adrp-name_last )
             FROM   adrp
             WHERE  persnumber = usr21-persnumber.
      CONCATENATE adrp-name_first adrp-name_last INTO p_name
      SEPARATED BY space.
      REFRESH gt_top_of_page.
      CLEAR   gtw_top_of_page.
    * Program title ------------------------------------------------
      CLEAR gtw_top_of_page.
      gtw_top_of_page-typ  = 'H'.
      gtw_top_of_page-info = sy-title.
      APPEND gtw_top_of_page TO gt_top_of_page.
      CLEAR gtw_top_of_page.
      gtw_top_of_page-typ     = 'S'.
      gtw_top_of_page-key  = 'Parameters :'.
    * Period / Posting Date -----------------------------------------
      IF s_cpudt[] IS INITIAL.
        WRITE s_postdt-low TO l_char10.
        CONCATENATE gtw_top_of_page-info
                    text-104
                    l_char10
               INTO gtw_top_of_page-info SEPARATED BY space.
        IF NOT s_postdt-high IS INITIAL.
          WRITE s_postdt-high TO l_char10.
          CONCATENATE gtw_top_of_page-info
                      text-105
                      l_char10
                      INTO gtw_top_of_page-info SEPARATED BY space.
        ENDIF.
        APPEND gtw_top_of_page TO gt_top_of_page.
      ELSE.
        CONCATENATE s_cpudt-low(4) '/' s_cpudt-low+4(2)
                    INTO l_char7 .
        CONCATENATE gtw_top_of_page-info
                    text-103
                    l_char7
                    INTO gtw_top_of_page-info SEPARATED BY space.
        IF s_cpudt-high NE space.
          CONCATENATE s_cpudt-high(4) '/' s_cpudt-high+4(2)
                      INTO l_char7 .
          CONCATENATE gtw_top_of_page-info
                      text-105
                      l_char7
                      INTO gtw_top_of_page-info SEPARATED BY space.
        ENDIF.
        APPEND gtw_top_of_page TO gt_top_of_page.
      ENDIF.
    * Display wich level we display -----------------------------
    *  IF wa_level_alv > 1.
    *    CLEAR gtw_top_of_page.
    *    IF wa_level_alv = 2.
    *      gtw_top_of_page-info = t_summary_alv-v_parnr.
    *      SHIFT gtw_top_of_page-info LEFT DELETING LEADING '0'.
    *    ENDIF.
    *    gtw_top_of_page-typ     = 'S'.
    *    gtw_top_of_page-key  = 'Partner:'.
    *    APPEND gtw_top_of_page TO gt_top_of_page.
    *  ENDIF.
    * Executed by -----------------------------------------------
      CLEAR gtw_top_of_page.
      gtw_top_of_page-typ     = 'S'.
      gtw_top_of_page-key  = 'Report executed by :'.
      gtw_top_of_page-info =  p_name.
    * * Date & time of execution --------------------------------
      APPEND gtw_top_of_page TO gt_top_of_page.
      gtw_top_of_page-key  = 'DATE :'.
      gtw_top_of_page-info = l_date_time.
      APPEND gtw_top_of_page TO gt_top_of_page.
    * Name of the report ----------------------------------------
      CLEAR gtw_top_of_page.
      gtw_top_of_page-typ  = 'A'.
    * LS_LINE-KEY:  not used for this type
      gtw_top_of_page-info = sy-repid.
      APPEND gtw_top_of_page TO gt_top_of_page.
      CALL FUNCTION 'REUSE_ALV_COMMENTARY_WRITE'
        EXPORTING
          it_list_commentary = gt_top_of_page.
    *  IF sy-batch = 'X' AND sy-linsz > 255 AND l_ctr_newpage = 0.
    *    NEW-PAGE PRINT ON LINE-SIZE 255.   "Pour wrapper !!!!!!
    *  ENDIF.
    ENDFORM.                    "ALV_PAGE_HEADER
    *&      Form  footer_page
    FORM footer_page.
      DATA: l_footer(300),
            l_page_no(5).
      l_page_no   = sy-pagno.
      CONCATENATE 'Page' l_page_no INTO l_footer SEPARATED BY space.
      SKIP 2.
      WRITE:/001 l_footer(sy-linsz) CENTERED.
    ENDFORM.                    "footer_page
    *&      Form  MY_USER_COMMAND
    *       text
    *      -->P_SY_UCOMM  text
    *      -->P_GS_SELFIELD  text
    FORM my_user_command USING    p_sy_ucomm
                                  p_gs_selfield TYPE slis_selfield.
      DATA: l_claim_no         LIKE mcshier-hiername,
            lv_tcode_last(15).
    * ======================================================
    * Call TX WTY to display the claim. Only possible at the
    * detail report(level 3)
    * ======================================================
      CASE p_gs_selfield-fieldname.
        WHEN 'CLMNO'.
          READ TABLE t_detail_alv INDEX p_gs_selfield-tabindex.
          SHIFT t_detail_alv-clmno LEFT DELETING LEADING '0'.
          l_claim_no = t_detail_alv-clmno.
          CONCATENATE sy-tcode syst-modno
                      INTO lv_tcode_last.
          EXPORT wty_tcode_last_memoid FROM lv_tcode_last TO MEMORY
                                       ID    'WTY_TCODE_LAST_MEMOID'.
          SET PARAMETER ID 'CLMNO' FIELD l_claim_no.
          CALL TRANSACTION 'WTY' AND SKIP FIRST SCREEN.
        WHEN 'CLAIM_NB'.
    *     =====================================
    *     Display the next level of information
    *     =====================================
          CASE  wa_level_alv.
            WHEN 1.
              REFRESH: t_detail_alv.
              wa_level_alv = 2.
              READ TABLE t_summary_alv INDEX p_gs_selfield-tabindex.
              LOOP AT t_detail_info
                      ASSIGNING <fs_detail_info>
                      WHERE v_parnr    EQ t_summary_alv-v_parnr
                        AND crncy      EQ t_summary_alv-crncy
                        AND item_type  EQ t_summary_alv-item_type
                        AND ov_meinh   EQ t_summary_alv-ov_meinh
                        AND iv_meinh   EQ t_summary_alv-iv_meinh
                        AND matnr      EQ t_summary_alv-matnr.
                MOVE-CORRESPONDING <fs_detail_info> TO t_detail_alv.
                APPEND t_detail_alv.
              ENDLOOP.
              CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
                EXPORTING
                  i_callback_program      = g_callback_pgm
                  i_callback_user_command = g_callback_user_command
                  is_layout               = gs_layout
                  it_fieldcat             = gt_fieldcat_det
                  it_excluding            = gt_excluding
    *              it_sort                 = gt_sort
                  i_save                  = c_save
                  is_variant              = gs_variant2
                  it_events               = eventcat
                  is_print                = my_print
                TABLES
                  t_outtab                = t_detail_alv
                EXCEPTIONS
                  program_error           = 1
                  OTHERS                  = 2.
              wa_level_alv = 1.
          ENDCASE.
      ENDCASE.
    ENDFORM.                    " MY_USER_COMMAND
    *       FORM PRINT_ALV_GRID                                           *
    *       Print the report not on screen for special batch processing.  *
    *  -->  IT         Table to print  -   Z_HRF_BEN_CONF_FLEX
    FORM set_print_alv_grid.
      my_print-print              = 'X'.  "Force printing
      my_print-no_print_selinfos  = 'X'.
      my_print-no_print_listinfos = 'X'.
      my_print-no_new_page        = ''.   "Separate spool files
      my_print-prnt_title         = 'X'.
      my_print-prnt_info          = 'X'.
      my_print-reserve_lines      = 3.
    ENDFORM.                    "set_print_alv_grid
    *&      Form  ALV_VARIANT_F4
    FORM alv_variant_f4 USING    p_handle
                        CHANGING p_vari.
      DATA: rs_variant LIKE disvariant.
      DATA: nof4 TYPE c.
      CLEAR nof4.
      LOOP AT SCREEN.
        IF screen-name = p_vari.
          IF screen-input = 0.
            nof4 = 'X'.
          ENDIF.
        ENDIF.
      ENDLOOP.
      rs_variant-report   = sy-repid.
      rs_variant-username = sy-uname.
      rs_variant-handle   = p_handle.
      CALL FUNCTION 'REUSE_ALV_VARIANT_F4'
        EXPORTING
          is_variant = rs_variant
          i_save     = 'A'
        IMPORTING
          es_variant = rs_variant
        EXCEPTIONS
          OTHERS     = 1.
      IF sy-subrc = 0 AND nof4 EQ space.
        p_vari = rs_variant-variant.
      ENDIF.
    ENDFORM.                               " ALV_VARIANT_F4
    *&      Form  validate_model
    *       text
    *  -->  p1        text
    *  <--  p2        text
    FORM validate_model .
      DATA: l_matnr LIKE mara-matnr.
      SELECT SINGLE matnr
             INTO  l_matnr
             FROM  mara
             WHERE matnr IN s_model
               AND mtart EQ 'ZKMA'.
      IF sy-subrc NE 0.
        MESSAGE e000 WITH text-e07.
      ENDIF.
    ENDFORM.                    " validate_model
    *&      Form  select_claim_to_process
    *       text
    *  -->  p1        text
    *  <--  p2        text
    FORM select_claim_to_process .
      DATA: lt_pnwtyh_dia     TYPE wty_pnwtyh_dia_tab,
            lt_pnwtyv_dia     TYPE wty_pnwtyv_dia_tab,
            lt_pvwty_dia      TYPE wty_pvwty_dia_tab,
            lt_pnwtyh_dia_tmp TYPE wty_pnwtyh_dia_tab,
            lt_pnwtyv_dia_tmp TYPE wty_pnwtyv_dia_tab,
            lt_pvwty_dia_tmp  TYPE wty_pvwty_dia_tab,
            lt_pvwty_dia_mat  TYPE wty_pvwty_dia_tab,
            lt_sel_fkdat      TYPE pwty_sel_fkdat_pt,
            lt_sel_v_parnr    TYPE pwty_sel_v_parnr_pt,
            lt_sel_clmty      TYPE pwty_sel_clmty_pt,
            lt_sel_clmgrp     TYPE pwty_sel_clmgrp_pt.
      DATA: lst_sel_fkdat LIKE LINE OF lt_sel_fkdat,
            lst_sel_clmty LIKE LINE OF lt_sel_clmty.
      DATA: BEGIN OF lt_clmno OCCURS 0,
                  clmno   LIKE pnwtyh-clmno,
            END   OF lt_clmno,
            lt_clmno_tmp   LIKE lt_clmno OCCURS 0,
            lt_claim    TYPE pwty_sel_clmno_pt,
            wa_clmno    LIKE LINE OF lt_claim.
      DATA: l_nb_claim         TYPE i.
      RANGES: lr_model FOR wty_pnwtyh_dia-z_wty_model.
      FIELD-SYMBOLS: <lfs_pnwtyh_dia>    LIKE LINE OF lt_pnwtyh_dia,
                     <lfs_pnwtyv_dia>    LIKE LINE OF lt_pnwtyv_dia,
                     <lfs_pvwty_dia_es2> LIKE LINE OF lt_pvwty_dia,
                     <lfs_pvwty_dia_mat> LIKE LINE OF lt_pvwty_dia_mat.
      REFRESH: lt_pnwtyh_dia, lt_pnwtyv_dia,lt_pvwty_dia, lt_sel_clmty,
               lr_model, t_detail_info, t_summary_alv, lt_pvwty_dia_mat.
      CALL FUNCTION 'SAPGUI_PROGRESS_INDICATOR'
       EXPORTING
    *    PERCENTAGE       = 0
         text             =  text-m01. "Extracting claim
    * ========================
    * Get the Claim to process
    * ========================
    *  SELECT clmno
    *         INTO  TABLE lt_clmno
    *         FROM  pnwtyh
    *         WHERE z_wty_convflg  EQ space
    *           AND z_wty_error    EQ space
    *  wa_clmno-sign   = 'I'.
    *  wa_clmno-option = 'EQ'.
    *  LOOP AT lt_clmno.
    *    wa_clmno-low     = lt_clmno-clmno.
    *    APPEND wa_clmno  TO lt_claim.
    *  ENDLOOP.
      lst_sel_fkdat-sign   = 'I'.
      lst_sel_fkdat-option = 'BT'.
      lst_sel_fkdat-low    = wa_low_date.
      lst_sel_fkdat-high   = wa_high_date.
      APPEND lst_sel_fkdat TO lt_sel_fkdat.
      lst_sel_clmty-sign   = 'E'.
      lst_sel_clmty-option = 'EQ'.
      lst_sel_clmty-low    = 'ZSBC'.
      APPEND lst_sel_clmty TO lt_sel_clmty.
      lt_sel_v_parnr[] = s_vend[].
      lt_sel_clmgrp[]  = s_clgrp[].
      CALL FUNCTION 'PVSDBWTY_CLAIM_SELECT'
        EXPORTING
          it_sel_fkdat     = lt_sel_fkdat
          it_sel_clmgrp    = lt_sel_clmgrp
          it_sel_v_parnr   = lt_sel_v_parnr
          it_sel_clmty     = lt_sel_clmty
    *      it_sel_clmno     = lt_claim
        IMPORTING
          et_pnwtyh_dia    = lt_pnwtyh_dia
          et_pnwtyv_dia    = lt_pnwtyv_dia
          et_pvwty_dia     = lt_pvwty_dia
        EXCEPTIONS
          no_entry_found   = 1
          authority_failed = 2
          OTHERS           = 3.
      IF sy-subrc = 3 .
        MESSAGE e309(wty) .
      ENDIF .
      CALL FUNCTION 'SAPGUI_PROGRESS_INDICATOR'
       EXPORTING
    *    PERCENTAGE       = 0
         text             =  text-m03. "Extracting claim
      LOOP AT lt_pvwty_dia
           ASSIGNING <fs_pvwty_dia>
           WHERE poskt_cust = 'MAT'.
        INSERT <fs_pvwty_dia> INTO TABLE lt_pvwty_dia_mat.
      ENDLOOP.
      it_pvwty_dia_all[] = lt_pvwty_dia[].
      SORT lt_pnwtyh_dia     BY pnguid.
      SORT lt_pvwty_dia      BY version_guid z_wty_posnr_hier.
      SORT lt_pvwty_dia_mat  BY version_guid.
      SORT it_pvwty_dia_all  BY version_guid posnr.
    * Keep Version record OC or IV in a separate table for later use
      LOOP AT lt_pnwtyv_dia
              ASSIGNING <lfs_pnwtyv_dia>.
        it_submit_records-header_guid  = <lfs_pnwtyv_dia>-header_guid.
        it_submit_records-versn        = <lfs_pnwtyv_dia>-versn.
        it_submit_records-prev_version = <lfs_pnwtyv_dia>-prev_version.
        it_submit_records-kateg        = <lfs_pnwtyv_dia>-kateg.
        it_submit_records-aktiv        = <lfs_pnwtyv_dia>-aktiv.
        it_submit_records-knumv        = <lfs_pnwtyv_dia>-knumv.
        it_submit_records-pnguid       = <lfs_pnwtyv_dia>-pnguid.
        INSERT TABLE it_submit_records.
      ENDLOOP.
    * =============
    * Process Claim
    * =============
      LOOP AT lt_pnwtyv_dia
              ASSIGNING <lfs_pnwtyv_dia>
              WHERE aktiv        EQ true   "Active version only
                AND kateg        EQ 'IV'   "Category
                AND fi_doc_exist EQ 'X'.
        CLEAR: t_detail_info, t_summary_alv.
    *   Read Header detail
        READ TABLE lt_pnwtyh_dia
             WITH KEY pnguid = <lfs_pnwtyv_dia>-header_guid
             ASSIGNING <lfs_pnwtyh_dia>
             BINARY SEARCH.
    *   Claim must be without error -----------------------------
        IF sy-subrc                      NE 0      OR
           <lfs_pnwtyh_dia>-z_wty_error   = true   OR
           <lfs_pnwtyh_dia>-z_wty_convflg = true.
          CONTINUE. "Rejected this Claim
        ENDIF.
    *   Check Model
        IF <lfs_pnwtyh_dia>-z_wty_model IN s_model.
        ELSE.
          CONTINUE. "Rejected this Claim
        ENDIF.
    *   Read first "MAT" Item information ------------------
        READ TABLE lt_pvwty_dia_mat
             WITH KEY version_guid = <lfs_pnwtyv_dia>-pnguid
             ASSIGNING <lfs_pvwty_dia_mat>
             BINARY SEARCH.
        wa_index_mat = sy-tabix.
        IF sy-subrc NE 0.
          CONTINUE. "Rejected this Claim
        ENDIF.
    *   ====================================================
    *   Process all item "MAT" linked to the current version
    *   ====================================================
        WHILE sy-subrc                     = 0
              AND
              <lfs_pvwty_dia_mat>-version_guid = <lfs_pnwtyv_dia>-pnguid.
          IF <lfs_pvwty_dia_mat>-matnr IN s_matnr.
    *       ======================================
    *       Process Items linked to the "MAT" Item
    *       ======================================
            READ TABLE lt_pvwty_dia
                 WITH KEY version_guid     = <lfs_pnwtyv_dia>-pnguid
                          z_wty_posnr_hier = <lfs_pvwty_dia_mat>-posnr
                 ASSIGNING <lfs_pvwty_dia_es2>
                 BINARY SEARCH.
            wa_index_link = sy-tabix.
            DO. "Execute only ONCE (to process all items linked to the)
              "MAT Item
              IF sy-subrc NE 0.
                EXIT.  "Exit the DO loop
              ENDIF.
              WHILE sy-subrc                     = 0
                    AND
                   <lfs_pvwty_dia_es2>-version_guid =
                           <lfs_pnwtyv_dia>-pnguid
                    AND
                   <lfs_pvwty_dia_es2>-z_wty_posnr_hier =
                           <lfs_pvwty_dia_mat>-posnr.
                IF <lfs_pvwty_dia_es2>-valiv EQ c_zero.
                ELSE.
    *             Initialize the detail information to display ---------
                  CLEAR: t_detail_info.
                  t_detail_info-v_parnr    = <lfs_pnwtyv_dia>-v_parnr.
                  t_detail_info-matnr      = <lfs_pvwty_dia_mat>-matnr.
                  t_detail_info-item_type  = <lfs_pvwty_dia_es2>-poskt_cust.
                  t_detail_info-iv_versn   = <lfs_pnwtyv_dia>-versn.
                  t_detail_info-clmno      = <lfs_pnwtyh_dia>-clmno.
                  t_detail_info-crncy      = <lfs_pnwtyv_dia>-v_crncy.
                  t_detail_info-iv_meinh   = <lfs_pvwty_dia_es2>-meinh.
                  t_detail_info-z_wty_model = <lfs_pnwtyh_dia>-z_wty_model.
                  ADD  <lfs_pvwty_dia_es2>-quant TO
                                                 t_detail_info-iv_appr_qty.
                  SELECT SINGLE kbetr
                         INTO   t_detail_info-iv_appr_rate
                         FROM   konv
                         WHERE  knumv  = <lfs_pnwtyv_dia>-knumv
                           AND  kposn  = <lfs_pvwty_dia_es2>-posnr
                           AND  kschl  = 'ZVAP'
                           AND  kinak  = space.
    *              t_detail_info-flat_indic   = <lfs_pnwtyh_dia>-z_wty_model
    *             t_detail_info-pric_indic   = <lfs_pnwtyh_dia>-z_wty_serno
                  PERFORM get_the_submit_record
                          USING <lfs_pnwtyv_dia>-header_guid
                                <lfs_pnwtyv_dia>-prev_version
                                <lfs_pnwtyh_dia>-clmno
                                <lfs_pvwty_dia_es2>-posnr.
                ENDIF.
    *           =====================
    *           Read next Linked item
    *           =====================
                PERFORM read_next_item  TABLES   lt_pvwty_dia
                                        CHANGING wa_index_link.
                IF sy-subrc = 0.
                  ASSIGN <fs_pvwty_dia> TO <lfs_pvwty_dia_es2>.
                ENDIF.
              ENDWHILE.
              EXIT.  "Exit the DO loop
            ENDDO.
          ENDIF.
    *     ====================
    *     Read next "MAT" item
    *     ====================
          PERFORM read_next_item  TABLES   lt_pvwty_dia_mat
                                  CHANGING wa_index_mat.
          IF sy-subrc = 0.
            ASSIGN <fs_pvwty_dia> TO <lfs_pvwty_dia_mat>.
          ENDIF.
        ENDWHILE.
      ENDLOOP.
    * ========================
    * Get the description text
    * ========================
      LOOP AT t_detail_info
           ASSIGNING <fs_detail_info>.
    *   Get the model text -------------------------------------
        SELECT SINGLE mfrpn
               INTO   <fs_detail_info>-z_wty_model
               FROM   mara
               WHERE  matnr = <fs_detail_info>-z_wty_model.
    *   Set Node name to regroup later by group -----------------
        SELECT SINGLE name1
               INTO   <fs_detail_info>-name
               FROM   lfa1
               WHERE  lifnr = <fs_detail_info>-v_parnr.
    *   Set Node name to regroup later by group -----------------
        SELECT SINGLE maktx
               INTO   <fs_detail_info>-maktx
               FROM   makt
               WHERE  matnr = <fs_detail_info>-matnr
                 AND  spras = sy-langu.
        MOVE-CORRESPONDING <fs_detail_info> TO t_summary_alv.
        t_summary_alv-claim_nb = 1.
        COLLECT t_summary_alv.
      ENDLOOP.
    * ===========================================
    * Calculate the average of the summary report
    * ===========================================
      LOOP AT t_summary_alv
           ASSIGNING <fs_summary_alv>.
        DIVIDE <fs_summary_alv>-ov_prop_qty   BY <fs_summary_alv>-claim_nb.
        DIVIDE <fs_summary_alv>-ov_prop_rate  BY <fs_summary_alv>-claim_nb.
        DIVIDE <fs_summary_alv>-ov_submit_qty  BY <fs_summary_alv>-claim_nb.
        DIVIDE <fs_summary_alv>-ov_submit_rate BY <fs_summary_alv>-claim_nb.
        DIVIDE <fs_summary_alv>-iv_appr_qty    BY <fs_summary_alv>-claim_nb.
        DIVIDE <fs_summary_alv>-iv_appr_rate   BY <fs_summary_alv>-claim_nb.
      ENDLOOP.
      DELETE t_summary_alv WHERE v_parnr NOT IN s_vend.
    ENDFORM.                    " select_claim_to_process
    *&      Form  SET_HOT_SPOT
    *       text
    *      -->P_0287   text
    FORM set_hot_spot  TABLES   p_fieldcat     TYPE slis_t_fieldcat_alv
                       USING    value(p_field).
      FIELD-SYMBOLS: <lfs_field_cat> LIKE LINE OF gt_fieldcat_sum.
      READ TABLE p_fieldcat WITH KEY fieldname  = p_field
           ASSIGNING <lfs_field_cat>.
      IF sy-subrc = 0.
        <lfs_field_cat>-hotspot = 'X'.
        <lfs_field_cat>-key     = 'X'.
      ENDIF.
    ENDFORM.                    " SET_HOT_SPOT
    *&      Form  set_screen_text
    *       text
    *      -->P_0997   text
    FORM set_screen_text  USING    p_label
                                   p_text.
      MOVE p_label TO :gtw_fieldcat-seltext_l,
                       gtw_fieldcat-seltext_m,
                       gtw_fieldcat-seltext_s,
                       gtw_fieldcat-reptext_ddic.
      IF p_text NE space.
        gtw_fieldcat-ddictxt = p_text.
      ENDIF.
    ENDFORM.                    " set_screen_text
    *&      Form  set_default_variant
    *       text
    *      -->P_0822   text
    *      <--P_GS_VARIANT1  text
    FORM set_default_variant  CHANGING p_variant     TYPE disvariant
                                       p_disvar      TYPE slis_vari.
    * Get default variant
      CALL FUNCTION 'REUSE_ALV_VARIANT_DEFAULT_GET'
        EXPORTING
          i_save     = c_save
        CHANGING
          cs_variant = p_variant
        EXCEPTIONS
          not_found  = 2.
      IF sy-subrc = 0.
        p_disvar =  p_variant-variant.
      ENDIF.
    ENDFORM.                    " set_default_variant
    *&      Form  validate_vendor
    *       text
    *  -->  p1        text
    *  <--  p2        text
    FORM validate_vendor.
      DATA: l_lifnr LIKE lfa1-lifnr.
      IF s_vend[] IS INITIAL.
      ELSE.
        SELECT SINGLE lifnr
               INTO   l_lifnr
               FROM   lfa1
               WHERE  lifnr IN s_vend.
        IF sy-subrc NE 0.
          MESSAGE e000 WITH text-e01.
        ENDIF.
      ENDIF.
    ENDFORM.                    " validate_vendor
    *&      Form  inform_claim_error
    *       text
    *  -->  p1        text
    *  <--  p2        text
    FORM inform_claim_error USING value(p_claim_no)
                                  value(p_version).
      DATA: l_text1(50),
            l_text2(50).
      CONCATENATE text-301
                  p_claim_no
                  INTO l_text1 SEPARATED BY space.
      CONCATENATE text-302
                  p_version
                  text-303
                  INTO l_text2 SEPARATED BY space.
      CALL FUNCTION 'POPUP_TO_INFORM'
        EXPORTING
          titel = text-200
          txt1  = l_text1
          txt2  = l_text2
          txt3  = ' '
          txt4  = text-304.
    ENDFORM.                    " inform_claim_error
    *&      Form  validate_posting_parameter
    *       text
    *  -->  p1        text
    *  <--  p2        text
    FORM validate_posting_parameter .
      DATA: l_low_date  TYPE d,
            l_high_date TYPE d.
      CLEAR: wa_low_date, wa_high_date.
    * Posting parameters must be entered
      IF s_cpudt[] IS INITIAL AND s_postdt[] IS INITIAL.
        MESSAGE e000 WITH text-e04.
      ENDIF.
    * Posting paramters can't be intered at the same time
      IF s_cpudt[] IS INITIAL OR s_postdt[] IS INITIAL.
      ELSE.
        MESSAGE e000 WITH text-e03.
      ENDIF.
    * Validate posting period ---------------------------------------------
      IF s_postdt[] IS INITIAL.
        READ TABLE s_cpudt INDEX 1.
        IF s_cpudt-low IS INITIAL.
          MESSAGE e000 WITH text-e03.
        ENDIF.
        PERFORM validate_period USING    s_cpudt-low
                                CHANGING l_low_date
                                         l_high_date.
        wa_low_date  = l_low_date.
        wa_high_date = l_high_date.
        IF s_cpudt-high IS INITIAL.
        ELSE.
          PERFORM validate_period USING    s_cpudt-high
                                  CHANGING l_low_date
                                           l_high_date.
          IF s_cpudt-high LT s_cpudt-low.
            MESSAGE ID 'DB' TYPE 'E' NUMBER '650' .
          ENDIF.
          wa_high_date = l_high_date.
        ENDIF.
      ELSE.
    *   Validate posting date --------------------------------------------
        READ TABLE s_postdt INDEX 1.
        wa_low_date  = s_postdt-low.
        IF s_postdt-high IS INITIAL.
          wa_high_date = wa_low_date.
        ELSE.
          wa_high_date = s_postdt-high.
        ENDIF.
      ENDIF.
    ENDFORM.                    " validate_posting_parameter
    *&      Form  get_fin_period
    *       Get the financial period from 1960 to 9999
    *  -->  p1        text
    *  <--  p2        text
    FORM get_fin_period USING value(p_year_low)
                              value(p_year_high).
      DATA : BEGIN OF fp_table OCCURS 0,
                   periv LIKE t009b-periv, "FINANCIAL YEAR VARIANT
                   bdatj LIKE t009b-bdatj, "CALENDAR YEAR
                   bumon LIKE t009b-bumon, "MONTH
                   butag LIKE t009b-butag, "DAY OF MONTH
                   poper LIKE t009b-poper, "COST PERIOD
                   reljr LIKE t009b-reljr, "YEAR SHIFT
             END OF fp_table.
      DATA: l_fin_bdatj       LIKE t009b-bdatj,
            l_period_start    TYPE d,
            l_period_end      TYPE d,
            l_prev_period_end TYPE d,
            l_prev_fin_bdatj  LIKE t009b-bdatj,
            l_prev_poper      LIKE t009b-poper,
            l_count           TYPE n.
    * Get the Fiscal year variant periods
      SELECT periv bdatj bumon butag poper reljr
             INTO  TABLE fp_table
             FROM  t009b
             WHERE periv = 'ZB'.
      LOOP AT fp_table.
        IF l_prev_period_end NE '00000000'.
          l_period_start = l_prev_period_end + 1.
        ENDIF.
        CONCATENATE fp_table-bdatj fp_table-bumon fp_table-butag
                    INTO l_period_end.
        l_prev_period_end = l_period_end.
        l_fin_bdatj       = fp_table-bdatj + fp_table-reljr.
        IF c_year_low NE ''      AND l_fin_bdatj LT p_year_low.
          CONTINUE.
        ELSEIF p_year_high NE '' AND l_fin_bdatj GT p_year_high.
          CONTINUE.
        ELSEIF p_year_low NE '' AND p_year_high EQ '' AND
               l_fin_bdatj  GT c_year_low.
          CONTINUE.
        ENDIF.
        IF l_prev_fin_bdatj EQ l_fin_bdatj         AND
           l_prev_poper     EQ fp_table-poper.
          it_period-end    = l_period_end.
          MODIFY it_period TRANSPORTING  end
                 WHERE year  = it_period-year
                   AND poper = it_period-poper.
        ELSE.
          it_period-year   = l_fin_bdatj.
          it_period-poper  = fp_table-poper+1.
          it_period-start  = l_period_start.
          it_period-end    = l_period_end.
          INSERT TABLE it_period.
        ENDIF.
        l_prev_fin_bdatj = l_fin_bdatj.
        l_prev_poper     = fp_table-poper.
        IF l_count EQ 0.
          l_count = l_count + 1.
        ENDIF.
      ENDLOOP.
    ENDFORM.                    " get_fin_period
    *&      Form  set_period_to_analyse
    *       Find the fiscal period for a specific date
    *  -->  p1        text
    *  <--  p2        text
    FORM set_period_to_analyse.
      LOOP AT it_period
           ASSIGNING <fs_it_period>
           WHERE start LE sy-datum
             AND end   GE sy-datum.
        CONCATENATE <fs_it_period>-year
                    <fs_it_period>-poper
                    INTO s_cpudt-low.
        s_cpudt-sign   = 'I'.
        s_cpudt-option = 'EQ'.
        APPEND s_cpudt.
        EXIT.
      ENDLOOP.
    ENDFORM.                    " set_period_to_analyse
    *&      Form  validate_material
    *       text
    *  -->  p1        text
    *  <--  p2        text
    FORM validate_material .
      DATA: l_matnr LIKE mara-matnr.
      IF s_matnr[] IS INITIAL.
      ELSE.
        SELECT SINGLE matnr
               INTO   l_matnr
               FROM   mara
               WHERE  matnr IN s_matnr.
        IF sy-subrc NE 0.
          MESSAGE e000 WITH text-e02.
        ENDIF.
      ENDIF.
    ENDFORM.                    " validate_material
    *&      Form  validate_claim_group
    *       text
    *  -->  p1        text
    *  <--  p2        text
    FORM validate_claim_group .
      DATA: l_clmgrp LIKE cwty006-clmgrp.
      IF s_clgrp[] IS INITIAL.
      ELSE.
        SELECT SINGLE clmgrp
               INTO   l_clmgrp
               FROM   cwty006
               WHERE  clmgrp IN s_clgrp.
        IF sy-subrc NE 0.
          MESSAGE e000 WITH text-e06.
        ENDIF.
      ENDIF.
    ENDFORM.                    " validate_claim_group
    *&      Form  set_alv_field_desc
    *       text
    *      -->P_LTW_FIELDCATALOG  text
    *      <--P_GTW_FIELDCAT  text
    FORM set_alv_field_desc USING value(p_fieldcat) TYPE lvc_s_fcat
                                  value(p_level).
      gtw_fieldcat-seltext_l    = p_fieldcat-scrtext_l.
      gtw_fieldcat-seltext_m    = p_fieldcat-scrtext_m.
      gtw_fieldcat-seltext_s    = p_fieldcat-scrtext_s.
      gtw_fieldcat-reptext_ddic = p_fieldcat-reptext.
      CASE p_fieldcat-fieldname.
        WHEN 'NAME'.
          PERFORM set_screen_text USING 'Vendor Name'           'L'.
        WHEN 'MAKTX'.
          PERFORM set_screen_text USING 'Material Description'  'L'.
        WHEN 'CLAIM_NB'.
          PERFORM set_screen_text USING '#Claims'               'L'.
        WHEN 'IV_MEINH'.
          PERFORM set_screen_text USING 'IV UoM'                'L'.
        WHEN 'OV_MEINH'.
          PERFORM set_screen_text USING 'OV UoM'                'L'.
        WHEN 'FLAT_INDIC'.
          PERFORM set_screen_text USING 'Flat Rate Ind.'        'L'.
        WHEN 'PRIC_INDIC'.
          PERFORM set_screen_text USING 'Price Ind.'            'L'.
        WHEN 'OV_PROP_QTY'.
          IF p_level = 1. "Summary report
    *BEGIN OF TR#D03K935718
    *        PERFORM set_screen_text USING 'OV avg. Prop. Qty'    'L'.
             PERFORM set_screen_text USING 'Avg Prop Qty Sub'    'L'.  "RFC2917
    *END OF TR#D03K935718
          ELSE.
            PERFORM set_screen_text USING 'OV Prop. Qty'         'L'.
          ENDIF.
        WHEN 'OV_PROP_RATE'.
          IF p_level = 1. "Summary report
    *BEGIN OF TR#D03K935718
    *        PERFORM set_screen_text USING 'OV avg. Prop. Rate $'  'L'.
             PERFORM set_screen_text USING 'Avg Prop Rate Sub'  'L'.    "RFC2917
    *END OF TR#D03K935718
          ELSE.
            PERFORM set_screen_text USING 'OV Prop. Rate $'       'L'.
          ENDIF.
        WHEN 'OV_SUBMIT_QTY'.
          IF p_level = 1. "Summary report
    *BEGIN OF TR#D03K935718
    *        PERFORM set_screen_text USING 'OV avg. Submit Qty'    'L'.
             PERFORM set_screen_text USING 'Avg Qty Sub'    'L'.          "RFC2917
    *END OF TR#D03K935718
          ELSE.
            PERFORM set_screen_text USING 'OV Submit Qty'         'L'.
          ENDIF.
        WHEN 'OV_SUBMIT_RATE'.
          IF p_level = 1. "Summary report
    *BEGIN OF TR#D03K935718
    *        PERFORM set_screen_text USING 'OV avg. Submit Rate $' 'L'.
            PERFORM set_screen_text USING 'Avg Rate Sub' 'L'.        "RFC2917
    *END OF TR#D03K935718
          ELSE.
            PERFORM set_screen_text USING 'OV Submit Rate $'      'L'.
          ENDIF.
        WHEN 'IV_APPR_QTY'.
          IF p_level = 1. "Summary report
    *BEGIN OF TR#D03K935718
    *        PERFORM set_screen_text USING 'IV Avg. Appr. Qty'     'L'.
            PERFORM set_screen_text USING 'Avg Qty Pd'     'L'.     "RFC2917
    *END OF TR#D03K935718
          ELSE.
            PERFORM set_screen_text USING 'IV Appr. Qty'          'L'.
          ENDIF.
        WHEN 'IV_APPR_RATE'.
          IF p_level = 1. "Summary report
    *BEGIN OF TR#D03K935718
    *        PERFORM set_screen_text USING 'IV Avg. Appr. Rate $'  'L'.
            PERFORM set_screen_text USING 'Avg Rate Pd'  'L'.   "RFC2917
    *END OF TR#D03K935718
          ELSE.
            PERFORM set_screen_text USING 'IV Appr. Rate $'       'L'.
          ENDIF.
        WHEN 'OV_VERSN'.
          PERFORM set_screen_text USING 'OV Versn.'               'L'.
        WHEN 'IV_VERSN'.
          PERFORM set_screen_text USING 'IV Versn.'               'L'.
        WHEN OTHERS.
          gtw_fieldcat-ddictxt      = p_fieldcat-selddictxt.
      ENDCASE.
    *   Initialisation des Labels des entetes de colonne -------------------
      gtw_fieldcat-no_out       = p_fieldcat-no_out.
      gtw_fieldcat-emphasize    = p_fieldcat-emphasize.
      gtw_fieldcat-fix_column   = p_fieldcat-fix_column.
      gtw_fieldcat-icon         = p_fieldcat-icon.
      gtw_fieldcat-no_zero      = 'X'.
      gtw_fieldcat-do_sum       = p_fieldcat-do_sum.
    ENDFORM.                    " set_alv_field_desc
    *&      Form  validate_period
    *       text
    *      -->P_S_CPUDT_LOW  text
    FORM validate_period  USING value(p_period)
                          CHANGING p_low_date    TYPE d
                                   p_high_date   TYPE d.
      DATA: l_year(4),
            l_poper(2).
      l_year  = p_period(4).
      l_poper = p_period+4(2).
      READ TABLE it_period WITH KEY year  = l_year
                                    poper = l_poper
                 ASSIGNING <fs_it_period>.
      IF sy-subrc NE 0.
        MESSAGE e000 WITH text-e04.
      ENDIF.
      p_low_date  = <fs_it_period>-start.
      p_high_date = <fs_it_period>-end.
    ENDFORM.                    " validate_period
    *&      Form  read_next_item
    *       text
    *  -->  p1        text
    *  <--  p2        text
    FORM read_next_item  TABLES pt_pvwty_dia     STRUCTURE wty_pvwty_dia
                         CHANGING p_index TYPE i.
      p_index = p_index + 1.
    *     Read next Item information ------------------------------
      READ TABLE pt_pvwty_dia INDEX p_index
           ASSIGNING <fs_pvwty_dia>.
    ENDFORM.                    " read_next_item
    *&      Form  get_the_submit_record
    *       text
    *      -->P_<LFS_PNWTYV_DIA>_HEADER_GUID  text
    *      -->P_<LFS_PNWTYV_DIA>_PREV_VERSION  text
    FORM get_the_submit_record  USING    p_header_guid
                                         p_prev_version
                                         p_claim_no
                                         p_posnr.
      DATA: l_nb_while       TYPE i,
            l_zaehk          LIKE konv-zaehk,
            l_submit_found(1).
    * ... USD1092841 - Add Start
      FIELD-SYMBOLS: <fs_submit_rec_vs3> TYPE tp_submit_records.
    * ... USD1092841 - Add End
      CLEAR: l_submit_found, l_nb_while.
      READ TABLE it_submit_records
           WITH KEY header_guid  = p_header_guid
                    versn        = p_prev_version
           ASSIGNING <fs_submit_rec_vs2>.
      WHILE sy-subrc = 0 .
        ADD 1 TO l_nb_while.
    *   if more than 30 loop(endless loop), it means som

    Hi Siddarth
    As per query, if you want to display sums automatically when you report is displayed for the first time, you'll have to modify your field catalog a bit.
    To acheive this, you need to identify the field for which the totals are calculated ex- for every new material num, or for every new documnet number etc.
    once you have this info, you identify the field that has to be totaled.
    then while building your fieldcatalog, set this parameter :
    l_wa_fieldcat-do_sum     =  'X' for the field that has to be totaled.
    and when you build a sort table then set this parameter:
    l_t_sort           TYPE slis_t_sortinfo_alv.
    l_s_sort-subtot    = 'X'. for the field for which totals are calculated.
    Hope this helps.
    Cheers
    Ravish
    Reward if helpful

  • Invoice before the delivery

    Hello everybody!
    I need the helping to resolve a problem for our implementing OM and AR for a Viet Nam customer.
    The company have a special business process is: Customers ordering a product, a Sale Order was created, Booked and waiting for pick release. But sometimes ,the customer want receive the invoices before the delivery. So that, we try make a Manual Invoice and reference the Invoice to that Sale Order for tracking progress shipping later. Because the invoice was Manual then may be variance between the invoice and total shipped goods.
    I'm wonder people have ever seen that problem yet? Please tell me the best solution for this case. And what's the name of that problem Oracle called?
    Thanks alot!

    Hello,
    You can create "proforma" invoice from sales order. This is easy way.
    From http://en.wikipedia.org/wiki/Pro_forma
    "In trade transactions, a pro forma invoice is a document that states a commitment from the seller to sell goods to the buyer at specified prices and terms. It is used to declare the value of the trade. It is not a true invoice, because it is not used to record accounts receivable for the seller and accounts payable for the buyer. Simply, a 'Proforma Invoice' is Confirmed Purchase Order where buyer and Supplier agrees on the Product Detail and its cost (usually-Supplier currency) to be shipped to buyer. Sales quotes are prepared in the form of a pro forma invoice which is different from a commercial invoice. It is used to create a sale and is sent in advance of the commercial invoice. The content of a pro forma invoice is almost identical to a commercial invoice and is usually considered a binding agreement although the price might change in advance of the final sale."
    Regards,
    Luko

  • Function module with UPDATE TASK

    All,
    Have a look at the below code. While debugging the control is not going inside the function module called using <b>call function ...... in update task</b> statement.
    I believe the function module is not executed immediately, but is scheduled for execution in a special work process (update work process). For this purpose, the name of the function module including the passed actual parameters is stored as a log record in the database table VBLOG. If the statement is executed during the update task, the addition IN UPDATE TASK is ignored.
    The actual execution is triggered by the statement COMMIT WORK which is not happening in this case. The formal parameters of the function module receive the values of the actual parameters from table VBLOG. How can I read the entries in VBLOG? Why the function module is not executed? Please suggest.
    PERFORM bte_publish ON COMMIT LEVEL 9.
    * syncron update
        COMMIT WORK AND WAIT.
    *       Publish business transaction events. The function module have
    *       to call as last update module!
    FORM bte_publish.
      IF NOT gvt_nodes IS INITIAL.
        CALL FUNCTION 'CUSTOMER_HIERARCHY_THROW_BTE' IN UPDATE TASK
             EXPORTING
                  ffi_valid_on    = knvh-datab
                  fti_event_list  = gvt_nodes
                  fti_event_listx = gvt_nodesx.
      ENDIF.
    ENDFORM.                               " BTE_PUBLISH
    Thanks,

    Right Naren. But I need to check inside the update function module, whether it is calling the BTE function module I had configured and the code which I had put in it. Any ideas?
    The COMMIT WORK is returning 4 and hence I believe it is not popping up another debuggin session in which the update FM runs.
    Thanks,
    Message was edited by: Somen

Maybe you are looking for