Reporting reqirement

Hi all,
can any one give me please the transaction code or path for the following report like:
Printing all Vouchers:
Sales Invoice,
Purchase order,
Bank Check Paymennnt. Debit Note,
Credit Note,Sales Order,
Bank payment and receipt,
cash paymennt and receipt,
petty cash book,
Journal .
TDS certificate,
E form.
this is my client requirement.i hope you help me in this case.
Thanku

hi
All reports are avilable in sap eassy access in INFORMATION SYSTEM.
Path; Financial  accounting-genaral ledger accounting-information system .it is for gl reports.
Vendors Reports
               Financial  accounting-account paybles-information system
Customers reports
               Financial  accounting-account recivables-information system.
ANd same thing ASSET ACCing also.................

Similar Messages

  • R/3 and BW

    Hi All,
    In a development project can R/3 and BW go live simulataneously. if yes why?
    if no Why?
    Help is appreciated with points
    Cheers
    Ravi kiran

    Hi,
    As per my experience,If I am asked to give suggestion,I would recommend to implement BIW only after Organization is comfortable in using SAP R/3. So you can get good requirements in number and in quality. And also Functional team of Client would be ina postition to give Idealistic (not a sort of R/3 reports) reqirements for BIw. And also they would be in apostion to say which type of data they want to consider exactly and also in which way for a specific report.
    So that Organization also can see the real advantage and ROI of BIW.
    With rgds,
    Anil Kumar Sharma .P

  • Want Standard Reports like my reqirement

    Hi,
    According to user requirement, we have to make some reports.
    1...Report of Material due to Which Inventory increased with the consumption trend of last three month
    2...Report of Purchase in Last 6 Month & 3 Month but not consumed till date
    3...List of Slow & Non Moving Material (more than 730 days)
    4...Report of Actual Price Trend of f BRASS, COPPER, SILVER ,STEEL of Last Six Month
    SAP have standard reports like this or not??
    Regards..

    About 3.
    MC50 (Dead stock) seems similar with your request.
    And i suggest you to issue the questions to MM functional part.
    Edited by: SAM XIAO on Nov 17, 2009 7:03 AM

  • Project Report in Report Painter

    Hi,
    Need your help for one of my issue.
    Current issue in the System / reqirment:
    There is a project report in report painter-GR55 which used to provide planed / actual cost and planed / actual quantity of the project. Whenever we are trying to run the report for several years and periods there is no cumulative data displaying. E.g. if we want to execute the report for the range of 001 period/2009 fiscal year to 004 period/2010 fiscal year, system is displaying data of 2009 and 2010 for the period of 01 to 04 only and there is missing data for period from 05 till 12 in 2009
    Root cause:
    There is no field in table-CCSS for the fiscal year/ period (FISCPER field name). As per the OSS note-157720 this is standard behavior of report painter. SAP suggested to build new report group based on OSS note-157720.
    Approach:
    An an alternative we used table-RWCOOM as there is field fiscal year/period (FISCPER). The new report group is working fine except planed cost of the project as the planed cost of the service orders are added up to project planed cost. We found there is missing field name-Object indicator which will restrict planed cost of the service order flow into project for which planed cost of the service orders are added up to project cost plan. This field-object indicator is available in table-CCSS.
    Looking for now to fix the issue:
    Option-1
    We are looking for any field similar to object indicator in table-RWCOOM which will restrict planed cost of service flow into Project
    Option-2
    Build new report based on OSS Note-157720.
    Please advise for this issue.
    Thank you in advance.
    Regards,
    Rakesh

    Hi Eli,
    Thanks a lot for your suggestion. A small query i got here while building the auxilarry coloumns-2 and 3.
    As per the Note (157720), in the auxilary coloumn-2 for the period we have to define period as 0 .....from period-1. Whereas my from period will be 1 and i can't provide from period-1 here
    In same way for Auxilarry coloumn-3 period details as per the Note will be To period +1 ...17 whereas my to period will be  12 so i may not enter the details.
    System will forbid if to period value is less than from period value.
    Could you guide me on this.
    Thank you for your cooperation.
    Regards,
    Rakesh

  • Report as per FBL1N - Vendor line Items

    Hi Experts,
    I have a requirement to generate a report as per FBL1N, the current process is as follows. User enters shipments in dynamic selection > document > Reference > right side Reference. '*' is kept before and after the shipments. Other selections are company code and All items radio button and Execute.
    My question is , What are the tables this looks at ? I am assuming BSIK, BSAK and BSEG. How to know which tables it looks at ? I think this may be functional question. If you have any questions please let me know.
    Thank you,
    Surya

    Hi All,
    Thanks a lot for your quick responses. By looking at your responses, here I am presenting the actual reqirement.
    Fianl aim of this report is to give the user to decide GR/IR clearing. User does as follows.
    1. Run MB5S, with the report she finds shipments associated with them by looking at GL line items.
    2. Then she runs The above steps to determine wether those shipments are paid or not.
    3. If they are paid then clear the corresponding entries. If not paid then sends message to Vendor to send Invoice.
    Right now I am doing as following:
    Selctions screen has company code, GL account, Posting date (selection range), PO number (selection option).
    I am querying BSIS for GR data with this data and document type WE. And query BSIS again for document type Z6(Haulier) and posting key 31 for Invoice data for all entries of GR data by matching XBLNR(shipment# in this case) and ZUONR(Assignment key a combinations of PO# and PO line item). GR data and IR data will be into two different tables.
    Now I am going to BSEG for all entries of GR data and IR data and get quantity and Vendor (LIFNR). Now starts the matching of GR with corresponding IR happnes on company code, XBLNR(Shipment#) and ZUONR. If a match is found then keep GR data and corresponding IR data in one line and append to final result set. If no match found then just append IR data to the final result set.
    Loop through the final result set to determine the status based on the following coditions.
    1 if gr qty = ir qty and gr amount = ir amount then F13 pending
    elseif gr qty > ir qty and gr amount > ir amount then GR surplus
    elseif gr qty < ir qty and gr amount < ir amount then IR surplus
    elseif gr qty = ir qty and gr amount <> ir amount then Qty correction
    elseif gr qty <> ir qty and gr amount = ir amount then Amount correction
    Now I have to take the shipments from the above list and go to FBL1N(I already described this). Once this list(FBL1N result) comes I have to prepare the final list for output based the shipmets found in this list by comparing the list came before FBL1N result.
    I am little concerned about the performance also, any tips for that also welcome.
    As mentioned by Pedro above, I want to know wether there are any FMs available or not at each step of this process. If you have any questions please let me know so that I can give more details. Your help is greatly appreciated.
    Thank you,
    Surya.

  • Report (OFFSETTING   A/C  in  GL  LINE ITEMS) urgent

    hi everbody,
    i have to develop a report with
    OFFSETTING A/C in GL LINE ITEMS.
    if anyone has has code regarding this report
    then plz share with me.
    my id is- [email protected]
    plz i am looking for it.hope that u all will help me and share with me the code regadring above report.
    i will surely give points for ur effort.
    thanks & Regards
    sanjeev

    hi deepak,
    check the code . i have problem that i am not getting
    offsetting item after clicking my 2nd radio button.
    by clicking on this i am getting datathat is aslo reqired but along with it i should get offsetting item details
    aslo but i am unable to get it.
    so plz provide for this any solution .
    REPORT zglaccline NO STANDARD PAGE HEADING                              
                       LINE-SIZE 300                                         
                       LINE-COUNT 65(3).                                                                               
    TABLES : bkpf, bseg.                                                                               
    DATA : BEGIN OF it_bkpf OCCURS 0,                                       
            bukrs LIKE bkpf-bukrs,                                           
            belnr LIKE bkpf-belnr,                                           
            gjahr LIKE bkpf-gjahr,                                           
            monat LIKE bkpf-monat,                                           
            budat LIKE bkpf-budat,                                           
            brnch LIKE bkpf-brnch,                                           
            xblnr LIKE bkpf-xblnr,                                           
            waers LIKE bkpf-waers,                                           
            END OF it_bkpf.                                                                               
    DATA : BEGIN OF it_bseg OCCURS 0,                                        
    gsber LIKE bseg-gsber,                                                   
    hkont LIKE bseg-hkont,                                                   
    kunnr LIKE bseg-kunnr,                                                   
    sgtxt LIKE bseg-sgtxt,                                                   
    bschl LIKE bseg-bschl,                                                   
    wrbtr LIKE bseg-wrbtr,                                                   
    dmbtr LIKE bseg-dmbtr,                                                   
    pswsl LIKE bseg-pswsl,                                                   
    kostl LIKE bseg-kostl,                                                   
    prctr LIKE bseg-prctr,                                                   
    aufnr LIKE bseg-aufnr,                                                   
    shkzg LIKE bseg-shkzg,                                                   
    augbl LIKE bseg-augbl,                                                   
    END OF it_bseg.                                                                               
    DATA : BEGIN OF it_res OCCURS 0,                                           
    bukrs LIKE bkpf-bukrs,                                                    
    gjahr LIKE bkpf-gjahr,                                                    
    monat LIKE bkpf-monat,                                                    
    belnr LIKE bkpf-belnr,                                                    
    budat LIKE bkpf-budat,                                                    
    brnch LIKE bkpf-brnch,                                                    
    gsber LIKE bseg-gsber,                                                    
    hkont LIKE bseg-hkont,                                                    
    kunnr LIKE bseg-kunnr,                                                    
    bschl LIKE bseg-bschl,                                                    
    prctr LIKE bseg-prctr,                                                    
    kostl LIKE bseg-kostl,                                                    
    aufnr LIKE bseg-aufnr,                                                    
    pswsl LIKE bseg-pswsl,                                                    
    wrbtr LIKE bseg-wrbtr,                                                                               
    waers LIKE bkpf-waers,                                                 
    dmbtr LIKE bseg-dmbtr,                                                 
    xblnr LIKE bkpf-xblnr,                                                 
    txt50 LIKE skat-txt50,                                                 
    sgtxt LIKE bseg-sgtxt,                                                 
    shkzg LIKE bseg-shkzg,                                                 
    END OF it_res.                                                                               
    DATA : BEGIN OF itab_head OCCURS 0,                                     
           name1(20) TYPE c,                                                
           END OF itab_head.                                                
    SELECTION-SCREEN BEGIN OF BLOCK b_2 WITH FRAME TITLE text-002.          
    PARAMETERS : p_sel1 RADIOBUTTON GROUP sel,                              
                 p_sel2 RADIOBUTTON GROUP sel,                              
                 p_sel3 RADIOBUTTON GROUP sel.                              
    SELECTION-SCREEN END OF BLOCK b_2.                                      
    SELECTION-SCREEN SKIP 1.                                                
    SELECTION-SCREEN BEGIN OF BLOCK b_1 WITH FRAME TITLE text-001.          
    PARAMETER p_bukrs LIKE bkpf-bukrs DEFAULT 'ML' OBLIGATORY.              
    SELECT-OPTIONS : s_belnr FOR bkpf-belnr.                                
    SELECT-OPTIONS : s_gjahr FOR bkpf-gjahr OBLIGATORY.                     
    SELECT-OPTIONS : s_monat FOR bkpf-monat.                                
    SELECT-OPTIONS : s_blart FOR bkpf-blart.                                
    SELECT-OPTIONS : s_budat FOR bkpf-budat.                                
    SELECT-OPTIONS : s_waers FOR bkpf-waers.                                
    SELECT-OPTIONS : s_hkont FOR bseg-hkont.                                
    SELECT-OPTIONS : s_bldat FOR bkpf-bldat.                                
    SELECTION-SCREEN END OF BLOCK b_1.                                                                               
    SELECT bukrs belnr gjahr monat budat brnch xblnr waers                  
       INTO CORRESPONDING FIELDS OF TABLE it_bkpf                           
       FROM bkpf                                                            
       WHERE bukrs = p_bukrs                                                
       AND belnr IN s_belnr                                                 
       AND gjahr IN s_gjahr                                                 
       AND monat IN s_monat                                                 
       AND blart IN s_blart                                                 
       AND budat IN s_budat                                                 
       AND bldat IN s_bldat                                                 
       AND waers IN s_waers.                                                                               
    IF NOT it_bkpf[] IS INITIAL.                                            
      LOOP AT it_bkpf.                                                      
    IF p_sel1 = 'X'.                                                        
        SELECT gsber hkont kunnr sgtxt bschl wrbtr pswsl kostl shkzg        
                            dmbtr prctr aufnr augdt augbl                               
           INTO CORRESPONDING FIELDS OF TABLE it_bseg                       
           FROM bseg                                                        
           WHERE bukrs = it_bkpf-bukrs                                      
           AND belnr   = it_bkpf-belnr                                      
           AND gjahr   = it_bkpf-gjahr                                      
           AND pswsl   = it_bkpf-waers                                      
           AND hkont  IN s_hkont.                                           
    ELSEIF p_sel2 = 'X'.                                                    
        SELECT gsber hkont kunnr sgtxt bschl wrbtr pswsl kostl shkzg        
                dmbtr prctr aufnr augdt augbl                               
           INTO CORRESPONDING FIELDS OF TABLE it_bseg                       
           FROM bseg                                                        
           WHERE bukrs = it_bkpf-bukrs                                      
           AND belnr   = it_bkpf-belnr                                      
           AND gjahr   = it_bkpf-gjahr                                      
           AND pswsl   = it_bkpf-waers.                                    
          AND koart <> 'S'.                                              
    ENDIF.                                                                 
        IF sy-subrc EQ 0.                                                  
          LOOP AT it_bseg.                                                 
            SELECT SINGLE txt50 INTO it_res-txt50                          
                 FROM skat                                                 
                 WHERE spras = 'EN'                                        
                 AND   ktopl = 'MCA'                                       
                 AND   saknr = it_bseg-hkont.                                                                               
    it_res-bukrs = it_bkpf-bukrs.                                  
            it_res-gjahr = it_bkpf-gjahr.                                  
            it_res-monat = it_bkpf-monat.                                  
            it_res-gsber = it_bseg-gsber.                                  
            it_res-belnr = it_bkpf-belnr.                                  
            it_res-budat = it_bkpf-budat.                                  
            it_res-brnch = it_bkpf-brnch.                                  
            it_res-kunnr = it_bseg-kunnr.                                  
            it_res-hkont = it_bseg-hkont.                                  
            it_res-sgtxt = it_bseg-sgtxt.                                  
            it_res-bschl = it_bseg-bschl.                                  
            it_res-wrbtr = it_bseg-wrbtr.                                  
            it_res-pswsl = it_bseg-pswsl.                                  
            it_res-waers = it_bkpf-waers.                                  
            it_res-dmbtr = it_bseg-dmbtr.                                  
            it_res-kostl = it_bseg-kostl.                                  
            it_res-prctr = it_bseg-prctr.                                  
            it_res-aufnr = it_bseg-aufnr.                                  
            it_res-shkzg = it_bseg-shkzg.                                  
           it_res-augbl = it_bseg-augbl.                                 
            it_res-xblnr = it_bkpf-xblnr.                                  
            APPEND it_res.                                                 
            CLEAR it_res.                                                  
          ENDLOOP.                                                         
          CLEAR it_bkpf.                                                   
        ENDIF.                                                             
      ENDLOOP.                                                             
    ENDIF.                                                                 
    LOOP AT it_res.                                                        
      IF it_res-shkzg EQ 'H'.                                              
        it_res-wrbtr = it_res-wrbtr * -1.                                  
        it_res-dmbtr = it_res-dmbtr * -1.                                  
      ENDIF.                                                               
      WRITE : /2(4) it_res-bukrs,                                          
               13(4) it_res-gjahr,                                         
               21(2) it_res-monat,                                         
               31(10) it_res-belnr,                                        
               44(10) it_res-budat,                                        
               55(4) it_res-brnch,                                         
               60(4) it_res-gsber,                                          
               70(10) it_res-hkont,                                         
               82(10) it_res-kunnr,                                         
               94(2) it_res-bschl,                                          
               104(10) it_res-prctr,                                              
              116(10)  it_res-kostl,                                        
              128(12)  it_res-aufnr,                                        
              142(5)  it_res-pswsl,                                         
              148(13)  it_res-wrbtr,                                        
              164(5)  it_res-waers,                                         
              170(13)  it_res-dmbtr,                                        
             187(16)   it_res-xblnr,                                        
              205(50)  it_res-sgtxt.                                        
      MODIFY it_res.                                                        
      CLEAR it_res.                                                         
    ENDLOOP.
    Message was edited by: sanjeev singh

  • Stock report for cross-company sales

    Dear all,
    We are using for our Saudi Arabia company the cross-company sales process with sourcing unit in another country.
    There is a Legal requirement in Saudi to provide a Stock report (with "stock in", "stock out" quantities and values).
    But with the cross-company sales process the stock movements are not visible in Saudi.
    Any advice ? Is there a report in SAP for this legal reqirement in Saudi Arabia ?
    Best regards

    Hi,
    Try to use t-code MB51, will give you a list with the relevant movement types!
    Good luck
    Tao

  • Custom Report for CO04n Mass Printing

    Hi,
    In CO04n for a given order number, production plant and order type when we click from main menu mass printing->execute. We get a list of outputs together for the order number.
    Object List.
    Job Ticket
    Pick List
    Goods Issue
    Goods receipt
    Confirmation slip.
    I want to create a custom report with order number as input and according to radio button selected the layout should be displayed. Is it possible.
    I know the driver program and form name. How can I develop this custom report.

    Hi ,
    You can develop Custome Report   , but for that 
    you will require  help from your Functional Team  , which will guide you thorug data selection  and processing
    i.e from which table data to be taken what to process .
      in that Report you can  display all details  which you reqired and also add one check box  in alv grid   in order to  select order no  .
      also take one button  on display Grid menu   using PF-status  .
      You have to  go through it step by step .
    Regards
    Deepak.

  • How to create spool in an online report

    Hi All,
    I have a requirement where the ALV report output has customers and details related to it.For example My report output has three customers(with a check box against it) and each customer has 5 line items.The user will select first and the last customer and press a push button provided.Once he clicks this push button, I should get the customers which are selected by the users and the line items related to this customers.I am able to capture all this.Now the real problem here is that I have to create a pdf document for each customer along with line items and send it as an email.In effect, in this scenario I have to create two pdf documents since the user has selected two customers on the output screen and send it to the email of that particular customer.Is there any FM available to create spool in the background for each of these customers(along with line items data) and make use of this spool number to generate a pdf document using CONVERT_ABAPSPOOLJOB_2_PDF.Once I get this I can send the email.
    Please help!
    Thanks in advance
    Sandeep

    The following steps shows how to download the output data in to PDF.
    1.Provide Spool Parameters using following function module 'GET_PRINT_PARAMETERS'.
    --This function module will provide the print parameters for creating the output in the spool; the required parameters are passed to the ‘OUT_PARAMETERS’ import parameter.
    2.Submit the report to generate the output in the spool.
    SUBMIT (sy-repid) TO SAP-SPOOL WITHOUT SPOOL DYNPRO
                         SPOOL PARAMETERS wa_mstr_print_parms
                         WITH SELECTION-TABLE  i_int_tab
                         AND RETURN.
    --Submit the report to generate the output in the spool as i_int_table is an internal table with structure RSPARAMS. As variant allows you to set the names and contents of the parameter and selection options dynamically at runtime, we need to use the function module RS_REFRESH_FROM_SELECTOPTIONS to read the contents of the parameters and selection options of the current program into an internal table i_int_table with the structure RSPARAMS and pass that internal table in above manner.
    3.To Find the spool number from the table TSP01
    Data: l_rq2name LIKE tsp01-rq2name.
    *Concatenate the report and User name as per the value available in the table   
    TSP01.
      CONCATENATE f_repid+0(9)
                  f_uname+0(3)
        INTO l_rq2name.
    *Fetch the most recent spool from the TSP01 table
      SELECT * FROM tsp01 WHERE  rq2name = l_rq2name
      ORDER BY rqcretime DESCENDING.
        l_rqident = tsp01-rqident.
        EXIT.
      ENDSELECT.
    4.Convert Spool to PDF using the FM : CONVERT_ABAPSPOOLJOB_2_PDF.
    5.Download to local file by using the FM : DOWNLOAD
    This function module returns an internal table data_tab contains the PDF formatted output.
    Using above points your can create the output in the PDF from there you can send the email.
    Hope your reqirement can met using the above five points.
    Reward points please
    Thanks,
    Ravi Kanth

  • How to display the data monthwise in the following report

    see the following report. i will give u the code
    if we go to fd10n then we see the monthwise debit,credit and the outstanding amount . i want to display the data monthwise in my report. means if i select the first month then it will dislpay only month of april debit, credit, and the outstanding amount.
    if anyone know the answer then please help me.
    Thanks.
    Dinesh
    *& Report  ZCUSTOMER_GROUP
    REPORT  ZCUSTOMER_GROUP NO STANDARD PAGE HEADING.
    TABLES: KNA1,KNVV,KNB1,T151T,T685T,KNVI,TSKDT,BSID,T001,KNC1,KNC3.
    TYPE-POOLS: SLIS.
    TYPES: BEGIN OF IT_FINAL,
                BZIRK LIKE KNVV-BZIRK,
                VKBUR LIKE KNVV-VKBUR,
                KDGRP LIKE KNVV-KDGRP,
                KUNNR LIKE KNVV-KUNNR,
                VKORG LIKE KNVV-VKORG,
                VTWEG LIKE KNVV-VTWEG,
                SPART LIKE KNVV-SPART,
                KTGRD LIKE KNVV-KTGRD,
                NAME1 LIKE KNA1-NAME1,
                ORT01 LIKE KNA1-ORT01,
                STCEG LIKE KNA1-STCEG,
                REGIO LIKE KNA1-REGIO,
                STRAS LIKE KNA1-STRAS,
                TELF1 LIKE KNA1-TELF1,
                WERKS LIKE KNA1-WERKS,
                SPRAS TYPE SPRAS,
                GFORM LIKE KNA1-GFORM,
                LAND1 LIKE KNA1-LAND1,
                ALTKN LIKE KNB1-ALTKN,
                AKONT LIKE KNB1-AKONT,
                VZSKZ TYPE KNB1-VZSKZ,
               VTEXT LIKE T685T-VTEXT,
                KTEXT LIKE T151T-KTEXT,
                TATYP TYPE KNVI-TATYP,
                TAXKD TYPE KNVI-TAXKD,
              taxkd type tskdt-taxkd,
              tatyp type tskdt-tatyp,
               VTEXT TYPE TSKDT-VTEXT,
               UMSKZ LIKE BSID-UMSKZ,
               DMBTR TYPE BSID-DMBTR,
              coll LIKE bsid-dmbtr,
              coll1 LIKE bsid-dmbtr,
              coll2 LIKE bsid-dmbtr,
              coll3 LIKE bsid-dmbtr,
              advance LIKE bsid-dmbtr,
              deposit LIKE bsid-dmbtr,
              amount type bsid-dmbtr,
              shkzg type bsid-shkzg,
              blart type bsid-blart,
               BUDAT TYPE BSID-BUDAT,
               BLDAT TYPE BSID-BLDAT,
              GJAHR LIKE BSID-GJAHR,
              outstand LIKE bsid-dmbtr,
              debit like bsid-dmbtr,
               UM01S LIKE KNC1-UM01S,
               UM02S LIKE KNC1-UM02S,
               UM03S LIKE KNC1-UM03S,
               UM04S LIKE KNC1-UM04S,
               UM05S LIKE KNC1-UM05S,
               UM06S LIKE KNC1-UM06S,
               UM07S LIKE KNC1-UM07S,
               UM08S LIKE KNC1-UM08S,
               UM09S LIKE KNC1-UM09S,
               UM10S LIKE KNC1-UM10S,
               UM11S LIKE KNC1-UM11S,
               UM12S LIKE KNC1-UM12S,
               UM13S LIKE KNC1-UM13S,
               UM14S LIKE KNC1-UM14S,
               UM15S LIKE KNC1-UM15S,
               UM16S LIKE KNC1-UM16S,
              DEBIT LIKE KNC1-UM01S,
               GJAHR LIKE KNC1-GJAHR,
                DEBIT TYPE STRING,
               UM01H LIKE KNC1-UM01H,
               UM02H LIKE KNC1-UM02H,
               UM03H LIKE KNC1-UM03H,
               UM04H LIKE KNC1-UM04H,
               UM05H LIKE KNC1-UM05H,
               UM06H LIKE KNC1-UM06H,
               UM07H LIKE KNC1-UM07H,
               UM08H LIKE KNC1-UM08H,
               UM09H LIKE KNC1-UM09H,
               UM10H LIKE KNC1-UM10H,
               UM11H LIKE KNC1-UM11H,
               UM12H LIKE KNC1-UM12H,
               UM13H LIKE KNC1-UM13H,
               UM14H LIKE KNC1-UM14H,
               UM15H LIKE KNC1-UM15H,
               UM16H LIKE KNC1-UM16H,
               CREDIT TYPE STRING,
               UMSAV LIKE KNC1-UMSAV,
             GJAHR LIKE KNC1-GJAHR,
               SHBKZ LIKE KNC3-SHBKZ,
               SALDV LIKE KNC3-SALDV,
               SOLLL LIKE KNC3-SOLLL,
               HABNL LIKE KNC3-HABNL,
               DOWN TYPE STRING,
               DEPOSIT TYPE STRING,
               COLL TYPE STRING,
       END OF IT_FINAL.
    TYPES : BEGIN OF IT_KNVV ,
                BZIRK LIKE KNVV-BZIRK,
                VKBUR LIKE KNVV-VKBUR,
                KDGRP LIKE KNVV-KDGRP,
                KUNNR LIKE KNVV-KUNNR,
                VKORG LIKE KNVV-VKORG,
                VTWEG LIKE KNVV-VTWEG,
                SPART LIKE KNVV-SPART,
                KTGRD LIKE KNVV-KTGRD,
    END OF IT_KNVV.
    TYPES: BEGIN OF IT_KNA1 ,
                NAME1 LIKE KNA1-NAME1,
                ORT01 LIKE KNA1-ORT01,
                STCEG LIKE KNA1-STCEG,
                REGIO LIKE KNA1-REGIO,
                STRAS LIKE KNA1-STRAS,
                TELF1 LIKE KNA1-TELF1,
                WERKS LIKE KNA1-WERKS,
                KUNNR LIKE KNA1-KUNNR,
                GFORM LIKE KNA1-GFORM,
                SPRAS TYPE SPRAS,
                LAND1 LIKE KNA1-LAND1,
    END OF IT_KNA1.
    TYPES: BEGIN OF IT_KNB1 ,
            ALTKN LIKE KNB1-ALTKN,
            AKONT LIKE KNB1-AKONT,
            VZSKZ TYPE KNB1-VZSKZ,
            KUNNR LIKE KNB1-KUNNR,
    END OF IT_KNB1.
    TYPES: BEGIN OF IT_T151T ,
           KTEXT LIKE T151T-KTEXT,
           KDGRP LIKE T151T-KDGRP,
           SPRAS TYPE SPRAS,
      END OF IT_T151T.
    DATA: BEGIN OF IT_T685T OCCURS 0,
          VTEXT LIKE T685T-VTEXT,
          spras type spras,
    END OF IT_T685T.
    TYPES: BEGIN OF IT_KNVI ,
          TAXKD TYPE KNVI-TAXKD,
          TATYP TYPE KNVI-TATYP,
          KUNNR TYPE KNVI-KUNNR,
    END OF IT_KNVI.
    TYPES: BEGIN OF IT_TSKDT ,
          TAXKD TYPE TSKDT-TAXKD,
         TATYP TYPE tskdt-TATYP,
          VTEXT TYPE TSKDT-TATYP,
          SPRAS TYPE SPRAS,
    END OF IT_TSKDT.
    TYPES: BEGIN OF IT_BSID ,
          UMSKZ TYPE BSID-UMSKZ,
          DMBTR TYPE BSID-DMBTR,
          COLL LIKE BSID-DMBTR,
          COLL1 LIKE BSID-DMBTR,
          COLL2 LIKE BSID-DMBTR,
          COLL3 LIKE BSID-DMBTR,
          ADVANCE LIKE BSID-DMBTR,
          DEPOSIT LIKE BSID-DMBTR,
           SHKZG TYPE BSID-SHKZG,
           KUNNR TYPE BSID-KUNNR,
           BUDAT TYPE BSID-BUDAT,
           BLART TYPE BSID-BLART,
           OUTSTAND LIKE BSID-DMBTR,
           GJAHR LIKE BSID-GJAHR,
       END OF IT_BSID.
    TYPES : BEGIN OF IT_KNC1,
               UM01S LIKE KNC1-UM01S,
               UM02S LIKE KNC1-UM02S,
               UM03S LIKE KNC1-UM03S,
               UM04S LIKE KNC1-UM04S,
               UM05S LIKE KNC1-UM05S,
               UM06S LIKE KNC1-UM06S,
               UM07S LIKE KNC1-UM07S,
               UM08S LIKE KNC1-UM08S,
               UM09S LIKE KNC1-UM09S,
               UM10S LIKE KNC1-UM10S,
               UM11S LIKE KNC1-UM11S,
               UM12S LIKE KNC1-UM12S,
               UM13S LIKE KNC1-UM13S,
               UM14S LIKE KNC1-UM14S,
               UM15S LIKE KNC1-UM15S,
               UM16S LIKE KNC1-UM16S,
              DEBIT LIKE KNC1-UM01S,
                DEBIT TYPE STRING,
               UM01H LIKE KNC1-UM01H,
               UM02H LIKE KNC1-UM02H,
               UM03H LIKE KNC1-UM03H,
               UM04H LIKE KNC1-UM04H,
               UM05H LIKE KNC1-UM05H,
               UM06H LIKE KNC1-UM06H,
               UM07H LIKE KNC1-UM07H,
               UM08H LIKE KNC1-UM08H,
               UM09H LIKE KNC1-UM09H,
               UM10H LIKE KNC1-UM10H,
               UM11H LIKE KNC1-UM11H,
               UM12H LIKE KNC1-UM12H,
               UM13H LIKE KNC1-UM13H,
               UM14H LIKE KNC1-UM14H,
               UM15H LIKE KNC1-UM15H,
               UM16H LIKE KNC1-UM16H,
               CREDIT TYPE STRING,
            UMSAV LIKE KNC1-UMSAV,
            KUNNR LIKE KNC1-KUNNR,
            GJAHR LIKE KNC1-GJAHR,
    END OF IT_KNC1.
    TYPES : BEGIN OF IT_KNC3,
            SHBKZ LIKE KNC3-SHBKZ,
            SALDV LIKE KNC3-SALDV,
            SOLLL LIKE KNC3-SOLLL,
            HABNL LIKE KNC3-HABNL,
            KUNNR LIKE KNC3-KUNNR,
            GJAHR LIKE KNC3-GJAHR,
            DOWN TYPE STRING,
            DEPOSIT TYPE STRING,
    END OF IT_KNC3.
    *INTERNAL TABLE DECLARATION
    DATA: I_FINAL TYPE STANDARD TABLE OF IT_FINAL,
          I_KNVV  TYPE STANDARD TABLE OF IT_KNVV,
          I_KNA1  TYPE STANDARD TABLE OF IT_KNA1,
          I_KNB1  TYPE STANDARD TABLE OF IT_KNB1,
          I_T151T  TYPE STANDARD TABLE OF IT_T151T,
          I_KNVI  TYPE STANDARD TABLE OF IT_KNVI,
          I_TSKDT  TYPE STANDARD TABLE OF IT_TSKDT,
          I_BSID  TYPE STANDARD TABLE OF IT_BSID,
          I_KNC1  TYPE STANDARD TABLE OF IT_KNC1,
          I_KNC3  TYPE STANDARD TABLE OF IT_KNC3.
    *DECLARATION FOR THE WORK AREA
    DATA: WA_FINAL TYPE IT_FINAL,
           WA_KNVV TYPE IT_KNVV,
           WA_KNA1 TYPE IT_KNA1,
           WA_KNB1 TYPE IT_KNB1,
           WA_T151T TYPE IT_T151T,
           WA_KNVI TYPE IT_KNVI,
           WA_TSKDT TYPE IT_TSKDT,
           WA_BSID TYPE IT_BSID,
           WA_KNC1 TYPE IT_KNC1,
           WA_KNC3 TYPE IT_KNC3.
    DECLARATION FOR THE FIELD CATALOG.
    DATA: FIELDCATALOG TYPE SLIS_T_FIELDCAT_ALV WITH HEADER LINE,
          WA_FIELDCATALOG TYPE SLIS_T_FIELDCAT_ALV WITH HEADER LINE,
          GD_LAYOUT TYPE SLIS_LAYOUT_ALV.
    DATA  GD_REPID LIKE SY-REPID.
    SELECTION-SCREEN BEGIN OF BLOCK B1 WITH FRAME TITLE TEXT-001.
    BREAK-POINT.
    SELECT-OPTIONS: CUST_GRP FOR KNVV-KDGRP.
    SELECT-OPTIONS: SALES_OF FOR KNVV-VKBUR.
    SELECT-OPTIONS: REGION FOR KNA1-REGIO.
    SELECT-OPTIONS: DATE FOR BSID-BLDAT.
    SELECT-OPTIONS: YEAR FOR KNC1-GJAHR.
    SELECT-OPTIONS: CUST_NO FOR KNVV-KUNNR.
    SELECTION-SCREEN :END OF BLOCK B1.
    * DECLARATION FOR THE SUBROUTIN FOR BASIC LIST.
    PERFORM data_retrival.
    PERFORM F_GET_I_KNVV_DATA.
    PERFORM F_GET_I_KNA1_DATA.
    PERFORM F_GET_I_KNB1_DATA.
    PERFORM F_GET_I_T151T_DATA.
    *PERFORM F_GET_IT_T685T_DATA.
    PERFORM F_GET_I_KNVI_DATA.
    PERFORM F_GET_I_TSKDT_DATA.
    PERFORM F_GET_I_BSID_DATA.
    PERFORM F_GET_I_KNC1_DATA.
    PERFORM F_GET_I_KNC3_DATA.
    PERFORM F_GET_I_FINAL_DATA.
      PERFORM DATA_BUILD.
      PERFORM DATA_CALL.
    FORM F_GET_I_KNVV_DATA.
    SELECT BZIRK KDGRP KTGRD KUNNR SPART VKBUR VKORG VTWEG
    FROM KNVV
    INTO CORRESPONDING FIELDS OF TABLE I_KNVV
    WHERE KDGRP IN CUST_GRP AND VKBUR IN SALES_OF AND KUNNR IN CUST_NO.
    ENDFORM.
    FORM F_GET_I_KNA1_DATA.
    SELECT KUNNR NAME1 ORT01 REGIO STCEG STRAS TELF1 WERKS  GFORM SPRAS LAND1
    FROM KNA1
    INTO CORRESPONDING FIELDS OF TABLE I_KNA1 FOR ALL ENTRIES IN I_KNVV
      WHERE KUNNR = I_KNVV-KUNNR AND  REGIO IN REGION AND LAND1 = 'IN' .
    ENDFORM.
    FORM F_GET_I_KNB1_DATA.
    SELECT ALTKN AKONT VZSKZ KUNNR
    FROM KNB1
    INTO CORRESPONDING FIELDS OF TABLE I_KNB1 FOR ALL ENTRIES IN I_KNVV
    WHERE KUNNR = I_KNVV-KUNNR.
      ENDFORM.
    FORM F_GET_I_T151T_DATA.
    SELECT KTEXT KDGRP SPRAS
    FROM T151T
    INTO CORRESPONDING FIELDS OF TABLE I_T151T FOR ALL ENTRIES IN I_KNVV
    WHERE KDGRP = I_KNVV-KDGRP AND SPRAS = 'E' .
    ENDFORM.
    *FORM F_GET_IT_T685T_DATA.
    *select vtext spras
    *from t685t
    *into CORRESPONDING FIELDS OF TABLE it_t685t for all entries in it_kna1
    where spras = it_kna1-spras and spras = 'E'.
    *endform.
    FORM F_GET_I_KNVI_DATA.
    SELECT TAXKD TATYP KUNNR
    FROM KNVI
    INTO CORRESPONDING FIELDS OF TABLE I_KNVI FOR ALL ENTRIES IN I_KNVV
    WHERE KUNNR = I_KNVV-KUNNR
    AND TAXKD = '8' OR TAXKD = '3' OR TAXKD = '0'
    AND TATYP = 'Z1AU' OR TATYP = 'ZCST'.
    *and ( taxkd = '8' or taxkd = '0' or taxkd = '3')
    and ( tatyp = 'Z1AU' OR TATYP = 'ZCST' ).
    ENDFORM.
    FORM F_GET_I_TSKDT_DATA.
    SELECT VTEXT TAXKD SPRAS FROM
    TSKDT
    INTO CORRESPONDING FIELDS OF TABLE I_TSKDT FOR ALL ENTRIES IN I_KNVI
    WHERE TAXKD = I_KNVI-TAXKD AND SPRAS = 'E'.
    ENDFORM.
    FORM F_GET_I_BSID_DATA.
    *DATA: DMBTR TYPE BSID-DMBTR,
         OUTSTAND LIKE BSID-DMBTR.
    SELECT UMSKZ DMBTR SHKZG KUNNR BLART GJAHR BUDAT BLDAT
    FROM BSID
    INTO CORRESPONDING FIELDS OF TABLE I_BSID
    FOR ALL ENTRIES IN I_KNVV
    WHERE KUNNR = I_KNVV-KUNNR AND BLDAT IN DATE.
    *AND  ( BLART = 'HR' OR BLART = 'DZ' OR BLART = 'P1'  )
    *and umskz = 'A' or umskz = 'L' OR UMSKZ = ''
    *AND SHKZG = 'S' OR SHKZG = 'H'.
    ENDFORM.
    FORM F_GET_I_KNC1_DATA.
    SELECT UM01S UM02S UM03S UM04S UM05S UM06S UM07S UM08S UM09S UM10S UM11S UM12S UM13S UM14S UM15S UM16S
           UM01H UM02H UM03H UM04H UM05H UM06H UM07H UM08H UM09H UM10H UM11H UM12H UM13H UM14H UM15H UM16H
           UMSAV KUNNR GJAHR
    FROM KNC1
    INTO CORRESPONDING FIELDS OF TABLE I_KNC1
    FOR ALL ENTRIES IN I_KNVV
    WHERE KUNNR = I_KNVV-KUNNR AND GJAHR IN YEAR .
    ENDFORM.
    FORM F_GET_I_KNC3_DATA.
    SELECT KUNNR GJAHR SHBKZ SALDV SOLLL HABNL
    FROM KNC3
    INTO CORRESPONDING FIELDS OF TABLE I_KNC3
    FOR ALL ENTRIES IN I_KNVV
    WHERE KUNNR = I_KNVV-KUNNR
    AND SHBKZ = 'A' OR SHBKZ = 'L'.
    ENDFORM.
    FORM F_GET_I_FINAL_DATA.
    *BREAK-POINT.
    LOOP AT I_KNVV INTO WA_KNVV.
    CLEAR WA_FINAL.
    WA_FINAL-BZIRK = WA_KNVV-BZIRK.
    WA_FINAL-VKBUR = WA_KNVV-VKBUR.
    WA_FINAL-KDGRP = WA_KNVV-KDGRP.
    WA_FINAL-KUNNR = WA_KNVV-KUNNR.
    WA_FINAL-VKORG = WA_KNVV-VKORG.
    WA_FINAL-VTWEG = WA_KNVV-VTWEG.
    WA_FINAL-SPART = WA_KNVV-SPART.
    WA_FINAL-KTGRD = WA_KNVV-KTGRD.
    READ TABLE I_KNA1 INTO WA_KNA1 WITH KEY KUNNR = WA_KNVV-KUNNR.
    WA_FINAL-NAME1 = WA_KNA1-NAME1.
    WA_FINAL-ORT01 = WA_KNA1-ORT01.
    WA_FINAL-STCEG = WA_KNA1-STCEG.
    WA_FINAL-REGIO = WA_KNA1-REGIO.
    WA_FINAL-STRAS = WA_KNA1-STRAS.
    WA_FINAL-TELF1 = WA_KNA1-TELF1.
    WA_FINAL-WERKS = WA_KNA1-WERKS.
    WA_FINAL-GFORM = WA_KNA1-GFORM.
    WA_FINAL-LAND1 = WA_KNA1-LAND1.
    IF SY-SUBRC = 0.
    ENDIF.
    READ TABLE I_KNB1 INTO WA_KNB1 WITH KEY KUNNR = WA_KNVV-KUNNR.
    IF SY-SUBRC = 0.
    WA_FINAL-ALTKN = WA_KNB1-ALTKN.
    WA_FINAL-AKONT = WA_KNB1-AKONT.
    WA_FINAL-VZSKZ = WA_KNB1-VZSKZ.
    ENDIF.
    READ TABLE I_T151T INTO WA_T151T WITH KEY KDGRP = WA_KNVV-KDGRP .
    IF SY-SUBRC = 0.
    WA_FINAL-KTEXT = WA_T151T-KTEXT.
    ENDIF.
    READ TABLE I_KNVI INTO WA_KNVI  WITH KEY KUNNR = WA_KNVV-KUNNR.
    IF SY-SUBRC = 0.
    WA_FINAL-TAXKD = WA_KNVI-TAXKD.
    WA_FINAL-TATYP = WA_KNVI-TATYP.
    ENDIF.
    READ TABLE I_TSKDT INTO WA_TSKDT WITH KEY TAXKD = WA_KNVI-TAXKD
    WA_FINAL-VTEXT = WA_TSKDT-VTEXT.
    *UP TO THIS POINT REPORT IS OK
    *read table I_bsid INTO WA_BSID with key kunnr = WA_kna1-kunnr
                               UMSKZ = 'A' .
    *if sy-subrc = 0.
    *WA_final-DOWN = WA_bsid-dmbtr * -1.
    **modify i_final.
    **clear it_bsid.
    *endif.
    *read table i_bsid INTO WA_BSID with key kunnr = WA_kna1-kunnr
                               UMSKZ = 'L'  .
    *if sy-subrc = 0.
    *WA_final-deposit = WA_bsid-dmbtr * -1.
    *endif.
    *read table i_bsid INTO WA_BSID with key kunnr = WA_kna1-kunnr
                               blart = 'DZ' .
    **IF BLART = 'HR' OR BLART = 'DZ' OR BLART = 'P1'.
    *if sy-subrc = 0.
    *WA_final-coll1 = WA_bsid-dmbtr * -1.
    *ENDIF.
    *read table i_bsid INTO WA_BSID with key kunnr = WA_kna1-kunnr
                               blart = 'HR' .
    **IF BLART = 'HR' OR BLART = 'DZ' OR BLART = 'P1'.
    *if sy-subrc = 0.
    *WA_final-coll2 = WA_bsid-dmbtr * -1.
    *ENDIF.
    *read table i_bsid INTO WA_BSID with key kunnr = WA_kna1-kunnr
                               blart = 'P1' .
    **IF BLART = 'HR' OR BLART = 'DZ' OR BLART = 'P1'.
    *if sy-subrc = 0.
    *WA_final-coll3 = WA_bsid-dmbtr * -1.
    *ENDIF.
    *read table i_bsid INTO WA_BSID with key kunnr = WA_kna1-kunnr.
    **IF BLART = 'HR' OR BLART = 'DZ' OR BLART = 'P1'.
    *if sy-subrc = 0.
    *WA_final-coll = ( WA_final-coll1 + WA_final-coll2 + WA_final-coll3 ) - ( wa_final-deposit ) * -1.
    *ENDIF.
    *read table i_bsid INTO WA_BSID with key kunnr = WA_kna1-kunnr
                               UMSKZ = 'L'  .
    *if sy-subrc = 0.
    *WA_final-deposit = WA_bsid-dmbtr * -1.
    *endif.
    READ TABLE I_KNC1 INTO WA_KNC1 WITH KEY KUNNR = WA_KNVV-KUNNR
    IF SY-SUBRC = 0.
    WA_FINAL-UM01S = WA_KNC1-UM01S.
    ENDIF.
    READ TABLE I_KNC1 INTO WA_KNC1 WITH KEY KUNNR = WA_KNVV-KUNNR
    IF SY-SUBRC = 0.
    WA_FINAL-UM02S = WA_KNC1-UM02S.
    ENDIF.
    READ TABLE I_KNC1 INTO WA_KNC1 WITH KEY KUNNR = WA_KNVV-KUNNR
    IF SY-SUBRC = 0.
    WA_FINAL-UM03S = WA_KNC1-UM03S.
    ENDIF.
    READ TABLE I_KNC1 INTO WA_KNC1 WITH KEY KUNNR = WA_KNVV-KUNNR
    IF SY-SUBRC = 0.
    WA_FINAL-UM04S = WA_KNC1-UM04S.
    ENDIF.
    READ TABLE I_KNC1 INTO WA_KNC1 WITH KEY KUNNR = WA_KNVV-KUNNR
    IF SY-SUBRC = 0.
    WA_FINAL-UM05S = WA_KNC1-UM05S.
    ENDIF.
    READ TABLE I_KNC1 INTO WA_KNC1 WITH KEY KUNNR = WA_KNVV-KUNNR
    IF SY-SUBRC = 0.
    WA_FINAL-UM06S = WA_KNC1-UM06S.
    ENDIF.
    READ TABLE I_KNC1 INTO WA_KNC1 WITH KEY KUNNR = WA_KNVV-KUNNR
    IF SY-SUBRC = 0.
    WA_FINAL-UM07S = WA_KNC1-UM07S.
    ENDIF.
    READ TABLE I_KNC1 INTO WA_KNC1 WITH KEY KUNNR = WA_KNVV-KUNNR
    IF SY-SUBRC = 0.
    WA_FINAL-UM08S = WA_KNC1-UM08S.
    ENDIF.
    READ TABLE I_KNC1 INTO WA_KNC1 WITH KEY KUNNR = WA_KNVV-KUNNR
    IF SY-SUBRC = 0.
    WA_FINAL-UM09S = WA_KNC1-UM09S.
    ENDIF.
    READ TABLE I_KNC1 INTO WA_KNC1 WITH KEY KUNNR = WA_KNVV-KUNNR
    IF SY-SUBRC = 0.
    WA_FINAL-UM10S = WA_KNC1-UM10S.
    ENDIF.
    READ TABLE I_KNC1 INTO WA_KNC1 WITH KEY KUNNR = WA_KNVV-KUNNR
    IF SY-SUBRC = 0.
    WA_FINAL-UM11S = WA_KNC1-UM11S.
    ENDIF.
    READ TABLE I_KNC1 INTO WA_KNC1 WITH KEY KUNNR = WA_KNVV-KUNNR
    IF SY-SUBRC = 0.
    WA_FINAL-UM12S = WA_KNC1-UM12S.
    ENDIF.
    READ TABLE I_KNC1 INTO WA_KNC1 WITH KEY KUNNR = WA_KNVV-KUNNR
    IF SY-SUBRC = 0.
    WA_FINAL-UM13S = WA_KNC1-UM13S.
    ENDIF.
    READ TABLE I_KNC1 INTO WA_KNC1 WITH KEY KUNNR = WA_KNVV-KUNNR
    IF SY-SUBRC = 0.
    WA_FINAL-UM14S = WA_KNC1-UM14S.
    ENDIF.
    READ TABLE I_KNC1 INTO WA_KNC1 WITH KEY KUNNR = WA_KNVV-KUNNR
    IF SY-SUBRC = 0.
    WA_FINAL-UM15S = WA_KNC1-UM15S.
    ENDIF.
    READ TABLE I_KNC1 INTO WA_KNC1 WITH KEY KUNNR = WA_KNVV-KUNNR
    IF SY-SUBRC = 0.
    WA_FINAL-UM16S = WA_KNC1-UM16S.
    ENDIF.
    READ TABLE I_KNC1 INTO WA_KNC1 WITH KEY KUNNR = WA_KNVV-KUNNR  .
    IF SY-SUBRC = 0.
    WA_FINAL-DEBIT = WA_KNC1-UM01S + WA_KNC1-UM02S + WA_KNC1-UM03S + WA_KNC1-UM04S + WA_KNC1-UM05S + WA_KNC1-UM06S + WA_KNC1-UM07S +
                     WA_KNC1-UM08S + WA_KNC1-UM09S + WA_KNC1-UM10S + WA_KNC1-UM11S + WA_KNC1-UM12S + WA_KNC1-UM13S + WA_KNC1-UM14S +
                     WA_KNC1-UM15S + WA_KNC1-UM16S .
    ENDIF.
    READ TABLE I_KNC1 INTO WA_KNC1 WITH KEY KUNNR = WA_KNVV-KUNNR.
    IF SY-SUBRC = 0.
    WA_FINAL-UM01H = WA_KNC1-UM01H.
    ENDIF.
    READ TABLE I_KNC1 INTO WA_KNC1 WITH KEY KUNNR = WA_KNVV-KUNNR
    IF SY-SUBRC = 0.
    WA_FINAL-UM02H = WA_KNC1-UM02H.
    ENDIF.
    READ TABLE I_KNC1 INTO WA_KNC1 WITH KEY KUNNR = WA_KNVV-KUNNR
    IF SY-SUBRC = 0.
    WA_FINAL-UM03H = WA_KNC1-UM03H.
    ENDIF.
    READ TABLE I_KNC1 INTO WA_KNC1 WITH KEY KUNNR = WA_KNVV-KUNNR
    IF SY-SUBRC = 0.
    WA_FINAL-UM04H = WA_KNC1-UM04H.
    ENDIF.
    READ TABLE I_KNC1 INTO WA_KNC1 WITH KEY KUNNR = WA_KNVV-KUNNR
    IF SY-SUBRC = 0.
    WA_FINAL-UM05H = WA_KNC1-UM05H.
    ENDIF.
    READ TABLE I_KNC1 INTO WA_KNC1 WITH KEY KUNNR = WA_KNVV-KUNNR
    IF SY-SUBRC = 0.
    WA_FINAL-UM06H = WA_KNC1-UM06H.
    ENDIF.
    READ TABLE I_KNC1 INTO WA_KNC1 WITH KEY KUNNR = WA_KNVV-KUNNR
    IF SY-SUBRC = 0.
    WA_FINAL-UM07H = WA_KNC1-UM07H.
    ENDIF.
    READ TABLE I_KNC1 INTO WA_KNC1 WITH KEY KUNNR = WA_KNVV-KUNNR
    IF SY-SUBRC = 0.
    WA_FINAL-UM08H = WA_KNC1-UM08H.
    ENDIF.
    READ TABLE I_KNC1 INTO WA_KNC1 WITH KEY KUNNR = WA_KNVV-KUNNR
    IF SY-SUBRC = 0.
    WA_FINAL-UM09H = WA_KNC1-UM09H.
    ENDIF.
    READ TABLE I_KNC1 INTO WA_KNC1 WITH KEY KUNNR = WA_KNVV-KUNNR
    IF SY-SUBRC = 0.
    WA_FINAL-UM10H = WA_KNC1-UM10H.
    ENDIF.
    READ TABLE I_KNC1 INTO WA_KNC1 WITH KEY KUNNR = WA_KNVV-KUNNR
    IF SY-SUBRC = 0.
    WA_FINAL-UM11H = WA_KNC1-UM11H.
    ENDIF.
    READ TABLE I_KNC1 INTO WA_KNC1 WITH KEY KUNNR = WA_KNVV-KUNNR
    IF SY-SUBRC = 0.
    WA_FINAL-UM12H = WA_KNC1-UM12H.
    ENDIF.
    READ TABLE I_KNC1 INTO WA_KNC1 WITH KEY KUNNR = WA_KNVV-KUNNR
    IF SY-SUBRC = 0.
    WA_FINAL-UM13H = WA_KNC1-UM13H.
    ENDIF.
    READ TABLE I_KNC1 INTO WA_KNC1 WITH KEY KUNNR = WA_KNVV-KUNNR
    IF SY-SUBRC = 0.
    WA_FINAL-UM14H = WA_KNC1-UM14H.
    ENDIF.
    READ TABLE I_KNC1 INTO WA_KNC1 WITH KEY KUNNR = WA_KNVV-KUNNR
    IF SY-SUBRC = 0.
    WA_FINAL-UM15H = WA_KNC1-UM15H.
    ENDIF.
    READ TABLE I_KNC1 INTO WA_KNC1 WITH KEY KUNNR = WA_KNVV-KUNNR
    IF SY-SUBRC = 0.
    WA_FINAL-UM16H = WA_KNC1-UM16H.
    ENDIF.
    READ TABLE I_KNC1 INTO WA_KNC1 WITH KEY KUNNR = WA_KNVV-KUNNR
    IF SY-SUBRC = 0.
    WA_FINAL-CREDIT = WA_KNC1-UM01H + WA_KNC1-UM02H + WA_KNC1-UM03H + WA_KNC1-UM04H + WA_KNC1-UM05H + WA_KNC1-UM06H + WA_KNC1-UM07H +
                     WA_KNC1-UM08H + WA_KNC1-UM09H + WA_KNC1-UM10H + WA_KNC1-UM11H + WA_KNC1-UM12H + WA_KNC1-UM13H + WA_KNC1-UM14H +
                     WA_KNC1-UM15H + WA_KNC1-UM16H .
    ENDIF.
    READ TABLE I_KNC3 INTO WA_KNC3 WITH KEY KUNNR = WA_KNVV-KUNNR GJAHR = WA_KNC1-GJAHR
                                                SHBKZ  = 'A' .
    IF SY-SUBRC = 0.
    WA_FINAL-SALDV = WA_KNC3-SALDV  .
    ENDIF.
    READ TABLE I_KNC3 INTO WA_KNC3 WITH KEY KUNNR = WA_KNVV-KUNNR GJAHR = WA_KNC1-GJAHR
                                                 SHBKZ = 'A' .
    IF SY-SUBRC = 0.
    WA_FINAL-SOLLL = WA_KNC3-SOLLL  .
    ENDIF.
    READ TABLE I_KNC3 INTO WA_KNC3 WITH KEY KUNNR = WA_KNVV-KUNNR GJAHR = WA_KNC1-GJAHR
                                                 SHBKZ = 'A' .
    IF SY-SUBRC = 0.
    WA_FINAL-HABNL = WA_KNC3-HABNL  .
    ENDIF.
    READ TABLE I_KNC3 INTO WA_KNC3 WITH KEY KUNNR = WA_KNVV-KUNNR GJAHR = WA_KNC1-GJAHR
                                        SHBKZ = 'A'  .
    IF SY-SUBRC = 0.
    WA_FINAL-DOWN =   WA_KNC3-SALDV + WA_KNC3-SOLLL + WA_KNC3-HABNL  * -1.
    ENDIF.
    READ TABLE I_KNC3 INTO WA_KNC3 WITH KEY KUNNR = WA_KNVV-KUNNR GJAHR = WA_KNC1-GJAHR
                                SHBKZ = 'L' .
    IF SY-SUBRC = 0.
    WA_FINAL-SALDV = WA_KNC3-SALDV  .
    ENDIF.
    READ TABLE I_KNC3 INTO WA_KNC3 WITH KEY KUNNR = WA_KNVV-KUNNR GJAHR = WA_KNC1-GJAHR
                                SHBKZ = 'L' .
    IF SY-SUBRC = 0.
    WA_FINAL-SOLLL = WA_KNC3-SOLLL  .
    ENDIF.
    READ TABLE I_KNC3 INTO WA_KNC3 WITH KEY KUNNR = WA_KNVV-KUNNR GJAHR = WA_KNC1-GJAHR
                                SHBKZ = 'L' .
    IF SY-SUBRC = 0.
    WA_FINAL-HABNL = WA_KNC3-HABNL  .
    ENDIF.
    READ TABLE I_KNC3 INTO WA_KNC3 WITH KEY KUNNR = WA_KNVV-KUNNR GJAHR = WA_KNC1-GJAHR
                                SHBKZ = 'L'  .
    IF SY-SUBRC = 0.
    WA_FINAL-DEPOSIT =  WA_KNC3-SALDV + WA_KNC3-SOLLL + WA_KNC3-HABNL * -1.
    ENDIF.
    READ TABLE I_KNC3 INTO WA_KNC3 WITH KEY KUNNR = WA_KNVV-KUNNR GJAHR = WA_KNC1-GJAHR.
    IF SY-SUBRC = 0.
    WA_FINAL-COLL =  WA_FINAL-DOWN - WA_FINAL-DEPOSIT.
    ENDIF.
    APPEND WA_FINAL TO I_FINAL.
    ENDLOOP.
    ENDFORM.
    FORM DATA_BUILD.
      CLEAR WA_FIELDCATALOG.
      WA_FIELDCATALOG-FIELDNAME = 'NAME1'.
      WA_FIELDCATALOG-SELTEXT_M = 'NAME'.
    fieldcatalog-col_pos = 1.
      WA_FIELDCATALOG-OUTPUTLEN = 15 .
    fieldcatalog-emphasize = 'X'. " COLOR OF THIS COLUMN.
      APPEND WA_FIELDCATALOG TO FIELDCATALOG.
    CLEAR WA_FIELDCATALOG.
      WA_FIELDCATALOG-FIELDNAME = 'ORT01'.
      WA_FIELDCATALOG-SELTEXT_M = 'CITY'.
    fieldcatalog-col_pos = 2.
      WA_FIELDCATALOG-OUTPUTLEN = 15 .
    fieldcatalog-emphasize = 'X'. " COLOR OF THIS COLUMN.
      APPEND WA_FIELDCATALOG TO FIELDCATALOG.
    CLEAR WA_FIELDCATALOG.
    WA_FIELDCATALOG-FIELDNAME = 'STCEG'.
      WA_FIELDCATALOG-SELTEXT_M = 'VAT. REG. NO.'.
    fieldcatalog-col_pos = 3.
      WA_FIELDCATALOG-OUTPUTLEN = 15 .
    fieldcatalog-emphasize = 'X'. " COLOR OF THIS COLUMN.
      APPEND WA_FIELDCATALOG TO FIELDCATALOG.
    CLEAR WA_FIELDCATALOG.
    WA_FIELDCATALOG-FIELDNAME = 'REGIO'.
      WA_FIELDCATALOG-SELTEXT_M = 'REGION'.
    fieldcatalog-col_pos = 4.
      WA_FIELDCATALOG-OUTPUTLEN = 15 .
    fieldcatalog-emphasize = 'X'. " COLOR OF THIS COLUMN.
      APPEND WA_FIELDCATALOG TO FIELDCATALOG.
    CLEAR WA_FIELDCATALOG.
    WA_FIELDCATALOG-FIELDNAME = 'STRAS'.
      WA_FIELDCATALOG-SELTEXT_M = 'STREET'.
    fieldcatalog-col_pos = 5.
      WA_FIELDCATALOG-OUTPUTLEN = 15 .
    fieldcatalog-emphasize = 'X'. " COLOR OF THIS COLUMN.
      APPEND WA_FIELDCATALOG TO FIELDCATALOG.
    CLEAR WA_FIELDCATALOG.
    WA_FIELDCATALOG-FIELDNAME = 'TELF1'.
      WA_FIELDCATALOG-SELTEXT_M = 'TELEPHONE'.
    fieldcatalog-col_pos = 6.
      WA_FIELDCATALOG-OUTPUTLEN = 15 .
    fieldcatalog-emphasize = 'X'. " COLOR OF THIS COLUMN.
      APPEND WA_FIELDCATALOG TO FIELDCATALOG.
    CLEAR WA_FIELDCATALOG.
    WA_FIELDCATALOG-FIELDNAME = 'WERKS'.
      WA_FIELDCATALOG-SELTEXT_M = 'PLANT'.
    fieldcatalog-col_pos = 7.
      WA_FIELDCATALOG-OUTPUTLEN = 15 .
    fieldcatalog-emphasize = 'X'. " COLOR OF THIS COLUMN.
      APPEND WA_FIELDCATALOG TO FIELDCATALOG.
    CLEAR WA_FIELDCATALOG.
    WA_FIELDCATALOG-FIELDNAME = 'BZIRK'.
      WA_FIELDCATALOG-SELTEXT_M = 'SALES DISTRICT'.
    fieldcatalog-col_pos = 8.
      WA_FIELDCATALOG-OUTPUTLEN = 15 .
    fieldcatalog-emphasize = 'X'. " COLOR OF THIS COLUMN.
      APPEND WA_FIELDCATALOG TO FIELDCATALOG.
    CLEAR WA_FIELDCATALOG.
    WA_FIELDCATALOG-FIELDNAME = 'VKBUR'.
      WA_FIELDCATALOG-SELTEXT_M = 'SALES OFFICE'.

    hi dinesh......
    please use  'INTO TABLE' instead of  ' INTO CORRESPONDING FIELDS OF TABLE '.  and use ' FOR ALL ENTRIES '............based on relavence ....coz when I set break point  over the select queries it took me long time to execute .......
    becoz u didnt used the for all entries  in select query ............ u r read statement
    READ TABLE I_KNA1 INTO WA_KNA1 WITH KEY KUNNR = WA_KNVV-KUNNR.  ..... 
    it is reading wrong kunnr value .............even it took long time to execute ......
    use sort where ever required...
    use for all entries .......and check weather the table initial or not......
    use sy-subrc check where ever reqired ..............

  • Create alv report

    hi friends,
    i have urgent reqirement pls help on this topic
    ·     Created an ALV report that displays Purchase document details in hierarchical manner using predefined function modules.
    thanks
    ravi

    Hi Ravi,
    Check this example.
    *& Report  ZDEMO_ALVTREE                                               *
    *& Example of a simple ALV Grid Report                                 *
    *& The basic requirement for this demo is to display a number of       *
    *& fields from the EKPO and EKKO table in a tree structure.            *
                             Amendment History                           *
    REPORT  zdemo_alvgrid                 .
    *Data Declaration
    TABLES:     ekko.
    TYPE-POOLS: slis.                                 "ALV Declarations
    TYPES: BEGIN OF t_ekko,
      ebeln TYPE ekpo-ebeln,
      ebelp TYPE ekpo-ebelp,
      statu TYPE ekpo-statu,
      aedat TYPE ekpo-aedat,
      matnr TYPE ekpo-matnr,
      menge TYPE ekpo-menge,
      meins TYPE ekpo-meins,
      netpr TYPE ekpo-netpr,
      peinh TYPE ekpo-peinh,
    END OF t_ekko.
    DATA: it_ekko     TYPE STANDARD TABLE OF t_ekko INITIAL SIZE 0,
          it_ekpo     TYPE STANDARD TABLE OF t_ekko INITIAL SIZE 0,
          it_emptytab TYPE STANDARD TABLE OF t_ekko INITIAL SIZE 0,
          wa_ekko     TYPE t_ekko,
          wa_ekpo     TYPE t_ekko.
    DATA: ok_code like sy-ucomm,           "OK-Code
          save_ok like sy-ucomm.
    *ALV data declarations
    DATA: fieldcatalog  TYPE lvc_t_fcat WITH HEADER LINE.
    DATA: gd_fieldcat   TYPE lvc_t_fcat,
          gd_tab_group  TYPE slis_t_sp_group_alv,
          gd_layout     TYPE slis_layout_alv.
    *ALVtree data declarations
    CLASS cl_gui_column_tree DEFINITION LOAD.
    CLASS cl_gui_cfw DEFINITION LOAD.
    DATA: gd_tree             TYPE REF TO cl_gui_alv_tree,
          gd_hierarchy_header TYPE treev_hhdr,
          gd_report_title     TYPE slis_t_listheader,
          gd_logo             TYPE sdydo_value,
          gd_variant          TYPE disvariant.
    *Create container for alv-tree
    DATA: l_tree_container_name(30) TYPE c,
          l_custom_container        TYPE REF TO cl_gui_custom_container.
    *Includes
    *INCLUDE ZDEMO_ALVTREEO01. "Screen PBO Modules
    *INCLUDE ZDEMO_ALVTREEI01. "Screen PAI Modules
    *INCLUDE ZDEMO_ALVTREEF01. "ABAP Subroutines(FORMS)
    *Start-of-selection.
    START-OF-SELECTION.
    ALVtree setup data
        PERFORM data_retrieval.
        PERFORM build_fieldcatalog.
        PERFORM build_layout.
        PERFORM build_hierarchy_header CHANGING gd_hierarchy_header.
        PERFORM build_report_title USING gd_report_title gd_logo.
        PERFORM build_variant.
    Display ALVtree report
      call screen 100.
    *&      Form  DATA_RETRIEVAL
          Retrieve data into Internal tables
    FORM data_retrieval.
      SELECT ebeln
       UP TO 10 ROWS
        FROM ekko
        INTO corresponding fields of TABLE it_ekko.
      loop at it_ekko into wa_ekko.
        SELECT ebeln ebelp statu aedat matnr menge meins netpr peinh
          FROM ekpo
          appending TABLE it_ekpo
         where ebeln eq wa_ekko-ebeln.
      endloop.
    ENDFORM.                    " DATA_RETRIEVAL
    *&      Form  BUILD_FIELDCATALOG
          Build Fieldcatalog for ALV Report
    FORM build_fieldcatalog.
    Please not there are a number of differences between the structure of
    ALVtree fieldcatalogs and ALVgrid fieldcatalogs.
    For example the field seltext_m is replace by scrtext_m in ALVtree.
      fieldcatalog-fieldname   = 'EBELN'.           "Field name in itab
      fieldcatalog-scrtext_m   = 'Purchase Order'.  "Column text
      fieldcatalog-col_pos     = 0.                 "Column position
      fieldcatalog-outputlen   = 15.                "Column width
      fieldcatalog-emphasize   = 'X'.               "Emphasize  (X or SPACE)
      fieldcatalog-key         = 'X'.               "Key Field? (X or SPACE)
    fieldcatalog-do_sum      = 'X'.              "Sum Column?
    fieldcatalog-no_zero     = 'X'.              "Don't display if zero
      APPEND fieldcatalog TO gd_fieldcat.
      CLEAR  fieldcatalog.
      fieldcatalog-fieldname   = 'EBELP'.
      fieldcatalog-scrtext_m   = 'PO Iten'.
      fieldcatalog-outputlen   = 15.
      fieldcatalog-col_pos     = 1.
      APPEND fieldcatalog TO gd_fieldcat..
      CLEAR  fieldcatalog.
      fieldcatalog-fieldname   = 'STATU'.
      fieldcatalog-scrtext_m   = 'Status'.
      fieldcatalog-outputlen   = 15.
      fieldcatalog-col_pos     = 2.
      APPEND fieldcatalog TO gd_fieldcat..
      CLEAR  fieldcatalog.
      fieldcatalog-fieldname   = 'AEDAT'.
      fieldcatalog-scrtext_m   = 'Item change date'.
      fieldcatalog-outputlen   = 15.
      fieldcatalog-col_pos     = 3.
      APPEND fieldcatalog TO gd_fieldcat..
      CLEAR  fieldcatalog.
      fieldcatalog-fieldname   = 'MATNR'.
      fieldcatalog-scrtext_m   = 'Material Number'.
      fieldcatalog-outputlen   = 15.
      fieldcatalog-col_pos     = 4.
      APPEND fieldcatalog TO gd_fieldcat..
      CLEAR  fieldcatalog.
      fieldcatalog-fieldname   = 'MENGE'.
      fieldcatalog-scrtext_m   = 'PO quantity'.
      fieldcatalog-outputlen   = 15.
      fieldcatalog-col_pos     = 5.
      APPEND fieldcatalog TO gd_fieldcat..
      CLEAR  fieldcatalog.
      fieldcatalog-fieldname   = 'MEINS'.
      fieldcatalog-scrtext_m   = 'Order Unit'.
      fieldcatalog-outputlen   = 15.
      fieldcatalog-col_pos     = 6.
      APPEND fieldcatalog TO gd_fieldcat..
      CLEAR  fieldcatalog.
      fieldcatalog-fieldname   = 'NETPR'.
      fieldcatalog-scrtext_m   = 'Net Price'.
      fieldcatalog-outputlen   = 15.
      fieldcatalog-col_pos     = 7.
      fieldcatalog-datatype     = 'CURR'.
      APPEND fieldcatalog TO gd_fieldcat..
      CLEAR  fieldcatalog.
      fieldcatalog-fieldname   = 'PEINH'.
      fieldcatalog-scrtext_m   = 'Price Unit'.
      fieldcatalog-outputlen   = 15.
      fieldcatalog-col_pos     = 8.
      APPEND fieldcatalog TO gd_fieldcat..
      CLEAR  fieldcatalog.
    ENDFORM.                    " BUILD_FIELDCATALOG
    *&      Form  BUILD_LAYOUT
          Build layout for ALV grid report
    FORM build_layout.
      gd_layout-no_input          = 'X'.
      gd_layout-colwidth_optimize = 'X'.
      gd_layout-totals_text       = 'Totals'(201).
    gd_layout-totals_only        = 'X'.
    gd_layout-f2code            = 'DISP'.  "Sets fcode for when double
                                            "click(press f2)
    gd_layout-zebra             = 'X'.
    gd_layout-group_change_edit = 'X'.
    gd_layout-header_text       = 'helllllo'.
    ENDFORM.                    " BUILD_LAYOUT
    *&      Form  build_hierarchy_header
          build hierarchy-header-information
         -->P_L_HIERARCHY_HEADER  structure for hierarchy-header
    FORM build_hierarchy_header CHANGING
                                   p_hierarchy_header TYPE treev_hhdr.
      p_hierarchy_header-heading = 'Hierarchy Header'(013).
      p_hierarchy_header-tooltip = 'This is the Hierarchy Header !'(014).
      p_hierarchy_header-width = 30.
      p_hierarchy_header-width_pix = ''.
    ENDFORM.                               " build_hierarchy_header
    *&      Form  BUILD_REPORT_TITLE
          Build table for ALVtree header
    <->  p1        Header details
    <->  p2        Logo value
    FORM build_report_title CHANGING
          pt_report_title  TYPE slis_t_listheader
          pa_logo             TYPE sdydo_value.
      DATA: ls_line TYPE slis_listheader,
            ld_date(10) TYPE c.
    List Heading Line(TYPE H)
      CLEAR ls_line.
      ls_line-typ  = 'H'.
    ls_line-key     "Not Used For This Type(H)
      ls_line-info = 'PO ALVTree Display'.
      APPEND ls_line TO pt_report_title.
    Status Line(TYPE S)
      ld_date(2) = sy-datum+6(2).
      ld_date+2(1) = '/'.
      ld_date3(2) = sy-datum4(2).
      ld_date+5(1) = '/'.
      ld_date+6(4) = sy-datum(4).
      ls_line-typ  = 'S'.
      ls_line-key  = 'Date'.
      ls_line-info = ld_date.
      APPEND ls_line TO pt_report_title.
    Action Line(TYPE A)
      CLEAR ls_line.
      ls_line-typ  = 'A'.
      CONCATENATE 'Report: ' sy-repid INTO ls_line-info  SEPARATED BY space.
      APPEND ls_line TO pt_report_title.
    ENDFORM.
    *&      Form  BUILD_VARIANT
          Build variant
    form build_variant.
    Set repid for storing variants
      gd_variant-report = sy-repid.
    endform.                    " BUILD_VARIANT
    *Includes
    *include zdemo_alvtreeo01. "Screen PBO Modules
    *include zdemo_alvtreei01. "Screen PAI Modules
    *include zdemo_alvtreef01. "ABAP Subroutines(FORMS)
    *Start-of-selection.
    start-of-selection.
    Screen flow logic code
    PROCESS BEFORE OUTPUT.
    MODULE STATUS_0100.
    PROCESS AFTER INPUT.
    MODULE USER_COMMAND_0100.
    ***INCLUDE Z......O01 .
    *&      Module  STATUS_0100  OUTPUT
          PBO Module
    module status_0100 output.
    SET PF-STATUS 'xxxxxxxx'.
    SET TITLEBAR 'xxx'.
    endmodule.                 " STATUS_0100  OUTPUT
    ***INCLUDE Z......I01 .
    *&      Module  USER_COMMAND_0100  INPUT
          PAI Module
    module user_command_0100 input.
    endmodule.                 " USER_COMMAND_0100  INPUT
       INCLUDE Z......I01                                                *
    *&      Module  USER_COMMAND_0100  INPUT
          text
    module user_command_0100 input.
      DATA return TYPE REF TO cl_gui_event.
      save_ok = ok_code.
      case ok_code.
        when 'BACK' or '%EX' or 'RW'.
        Exit program
          leave to screen 0.
      Process ALVtree user actions     
        when others.
          call method cl_gui_cfw=>get_current_event_object
                  receiving
                     event_object = return.
          call method cl_gui_cfw=>dispatch.
      endcase.
    endmodule.                 " USER_COMMAND_0100  INPUT
    Add following code to 'STATUS_0100'(PBO module)
      Create container for alv-tree
        PERFORM create_alvtree_container.
    Add following code to 'Z......F01' INCLUDE
    *&      Form  CREATE_ALVTREE_CONTAINER
          Create container for alv-tree
    FORM create_alvtree_container.
      gd_tree_container_name = 'SCREEN_CONTAINER'.
      create object gd_custom_container
          exporting
                container_name = gd_tree_container_name
          exceptions
                cntl_error                  = 1
                cntl_system_error           = 2
                create_error                = 3
                lifetime_error              = 4
                lifetime_dynpro_dynpro_link = 5.
      if sy-subrc <> 0.
        message x208(00) with 'ERROR'.                        
      endif.
    ENDFORM.
    Add following code to 'STATUS_0100'(PBO module)
    Create tree control
    PERFORM create_object_in_container.
    Add following code to 'Z......F01' INCLUDE
    *&      Form  CREATE_OBJECT_IN_CONTAINER
          Create ALVtree control
    FORM create_object_in_container.
      create object gd_tree
        exporting
            parent              = gd_custom_container
            node_selection_mode = cl_gui_column_tree=>node_sel_mode_single
            item_selection      = 'X'
            no_html_header      = ''
            no_toolbar          = ''
        exceptions
            cntl_error                   = 1
            cntl_system_error            = 2
            create_error                 = 3
            lifetime_error               = 4
            illegal_node_selection_mode  = 5
            failed                       = 6
            illegal_column_name          = 7.
      if sy-subrc <> 0.
        message x208(00) with 'ERROR'.                        
      endif.
    ENDFORM.
    Add following code to 'STATUS_0100'(PBO module)
    Create empty ALVtree control ready for first display
      PERFORM create_empty_alvtree_control.
    Add following code to 'Z......F01' INCLUDE
    *&      Form  CREATE_EMPTY_ALVTREE_CONTROL
          Create empty tree control
    FORM create_empty_alvtree_control.
    Create emty tree-control
      CLEAR: it_emptytab.
      REFRESH: it_emptytab.
      CALL METHOD gd_tree->set_table_for_first_display
         EXPORTING
                   is_hierarchy_header  = gd_hierarchy_header
                   it_list_commentary   = gd_report_title
                   i_logo               = gd_logo
                  i_background_id      = 'ALV_BACKGROUND'
                   i_save               = 'A'
                   is_variant            = gd_variant
         CHANGING
                   it_outtab            =  it_emptytab      "Must be empty
                   it_fieldcatalog      =  gd_fieldcat.
    ENDFORM.                    " CREATE_EMPTY_ALVTREE_CONTROL
    Add following code to 'STATUS_0100'(PBO module)
    Create ALVtree Hierarchy
      PERFORM create_alvtree_hierarchy.
    Add following code to 'Z......F01' INCLUDE
    *&      Form  CREATE_ALVTREE_HIERARCHY
          text
          Builds ALV tree display, (inserts nodes, subnodes etc)
    form create_alvtree_hierarchy.
      data: ls_sflight type sflight,
            lt_sflight type sflight occurs 0.
      data: ld_ebeln_key type lvc_nkey,
            ld_ebelp_key type lvc_nkey.
      loop at it_ekko into wa_ekko.
        perform add_ekko_node using      wa_ekko
                                changing ld_ebeln_key.
        loop at it_ekpo into wa_ekpo where ebeln eq wa_ekko-ebeln.
          perform add_ekpo_line using      wa_ekpo
                                           ld_ebeln_key
                                  changing ld_ebelp_key.
        endloop.
      endloop.
    calculate totals
      call method gd_tree->update_calculations.
    this method must be called to send the data to the frontend
      call method gd_tree->frontend_update.
    endform.                    " CREATE_ALVTREE_HIERARCHY
    *&      Form  ADD_EKKO_NODE
          text
         -->P_WA_EKPO  text
         -->P_0553   text
         <--P_EBELN_KEY  text
    form add_ekko_node using    ps_ekko like wa_ekko
                                value(p_relate_key)
                       changing p_node_key.
    data: ld_node_text type lvc_value,
           ls_sflight type sflight.
    Set item-layout
      data: lt_item_layout type lvc_t_layi,
            ls_item_layout type lvc_s_layi.
      ls_item_layout-t_image   = '@3P@'.
      ls_item_layout-fieldname = gd_tree->c_hierarchy_column_name.
      ls_item_layout-style     = cl_gui_column_tree=>style_default.
      ld_node_text             = ps_ekko-ebeln.
      append ls_item_layout to lt_item_layout.
    Add node
      call method gd_tree->add_node
        exporting
              i_relat_node_key = p_relate_key
              i_relationship   = cl_gui_column_tree=>relat_last_child
              i_node_text      = ld_node_text
              is_outtab_line   = ps_ekko
              it_item_layout   = lt_item_layout
           importing
              e_new_node_key = p_node_key.
    endform.                    " ADD_EKKO_NODE
    *&      Form  ADD_EKPO_LINE
          text
         -->P_WA_EKPO  text
         -->P_LD_EBELN_KEY  text
         <--P_LD_EBELP_KEY  text
    form add_ekpo_line using    ps_ekpo like wa_ekpo
                                value(p_relate_key)
                       changing p_node_key.
    data: ld_node_text type lvc_value,
           ls_sflight type sflight.
    Set item-layout
      data: lt_item_layout type lvc_t_layi,
            ls_item_layout type lvc_s_layi.
      ls_item_layout-t_image   = '@3P@'.
      ls_item_layout-fieldname = gd_tree->c_hierarchy_column_name.
      ls_item_layout-style     = cl_gui_column_tree=>style_default.
      ld_node_text             = ps_ekpo-ebelp.
      append ls_item_layout to lt_item_layout.
    Add node
      call method gd_tree->add_node
        exporting
              i_relat_node_key = p_relate_key
              i_relationship   = cl_gui_column_tree=>relat_last_child
              i_node_text      = ld_node_text
              is_outtab_line   = ps_ekpo
              it_item_layout   = lt_item_layout
           importing
              e_new_node_key = p_node_key.
    endform.                    " ADD_EKPO_LINE
    ***INCLUDE ZDEMO_ALVTREEO01 .
    *&      Module  STATUS_0100  OUTPUT
          text
    MODULE status_0100 OUTPUT.
      SET PF-STATUS 'STATUS1'.
    SET TITLEBAR 'xxx'.
    If ALVtree already exists then it  mush not be re-created as this
    will cause a runtime error.
      IF gd_tree IS INITIAL.
      Create ALVtree (must be performed within screen PBO module)
        PERFORM create_alvtree_container.
        PERFORM create_object_in_container.
        PERFORM create_empty_alvtree_control.
        PERFORM create_alvtree_hierarchy.
      ENDIF.
      CALL METHOD cl_gui_cfw=>flush.
    ENDMODULE.                 " STATUS_0100  OUTPUT
    ***INCLUDE ZDEMO_ALVTREEO01 .
    *&      Module  STATUS_0100  OUTPUT
          text
    MODULE status_0100 OUTPUT.
      SET PF-STATUS 'STATUS1'.
    SET TITLEBAR 'xxx'.
    If ALVtree already exists then it  mush not be re-created as this
    will cause a runtime error.
      IF gd_tree IS INITIAL.
    Create ALVtree (must be performed within screen PBO module)
        PERFORM create_alvtree_container.
        PERFORM create_object_in_container.
        PERFORM create_empty_alvtree_control.
        PERFORM create_alvtree_hierarchy.
      ENDIF.
      CALL METHOD cl_gui_cfw=>flush.
    ENDMODULE.                 " STATUS_0100  OUTPUT
    or
    The following code allows the easy creation of the example ALVtree report. Simply copy and past it into
    the appropriate includes(PBO and FORM).
      INCLUDE ZDEMO_ALVTREEF01                                           *
    *&      Form  CREATE_ALVTREE_CONTAINER
          Create container for ALVtree report
    form create_alvtree_container.
    Create container for alv-tree
      gd_tree_container_name = 'SCREEN_CONTAINER'.
      create object gd_custom_container
          exporting
                container_name = gd_tree_container_name
          exceptions
                cntl_error                  = 1
                cntl_system_error           = 2
                create_error                = 3
                lifetime_error              = 4
                lifetime_dynpro_dynpro_link = 5.
      if sy-subrc <> 0.
        message x208(00) with 'ERROR'.
      endif.
    endform.                    " CREATE_ALVTREE_CONTAINER
    *&      Form  CREATE_OBJECT_IN_CONTAINER
          Create ALVtree object in container
    form create_object_in_container.
    Create tree control
      create object gd_tree
        exporting
            parent              = gd_custom_container
            node_selection_mode = cl_gui_column_tree=>node_sel_mode_single
            item_selection      = 'X'
            no_html_header      = ''
            no_toolbar          = ''
        exceptions
            cntl_error                   = 1
            cntl_system_error            = 2
            create_error                 = 3
            lifetime_error               = 4
            illegal_node_selection_mode  = 5
            failed                       = 6
            illegal_column_name          = 7.
      if sy-subrc <> 0.
        message x208(00) with 'ERROR'.
      endif.
    endform.                    " CREATE_OBJECT_IN_CONTAINER
    *&      Form  BUILD_REPORT_TITLE
          Build table for ALVtree header
    <->  p1        Header details
    <->  p2        Logo value
    FORM build_report_title CHANGING
          pt_report_title  TYPE slis_t_listheader
          pa_logo             TYPE sdydo_value.
      DATA: ls_line TYPE slis_listheader,
            ld_date(10) TYPE c.
    List Heading Line(TYPE H)
      CLEAR ls_line.
      ls_line-typ  = 'H'.
    ls_line-key     "Not Used For This Type(H)
      ls_line-info = 'PO ALVTree Display'.
      APPEND ls_line TO pt_report_title.
    Status Line(TYPE S)
      ld_date(2) = sy-datum+6(2).
      ld_date+2(1) = '/'.
      ld_date3(2) = sy-datum4(2).
      ld_date+5(1) = '/'.
      ld_date+6(4) = sy-datum(4).
      ls_line-typ  = 'S'.
      ls_line-key  = 'Date'.
      ls_line-info = ld_date.
      APPEND ls_line TO pt_report_title.
    Action Line(TYPE A)
      CLEAR ls_line.
      ls_line-typ  = 'A'.
      CONCATENATE 'Report: ' sy-repid INTO ls_line-info  SEPARATED BY space.
      APPEND ls_line TO pt_report_title.
    ENDFORM.                    " BUILD_REPORT_TITLE
    *&      Form  CREATE_EMPTY_ALVTREE_CONTROL
          Create empty tree control
    FORM create_empty_alvtree_control.
    Create emty tree-control
      CLEAR: it_emptytab.
      REFRESH: it_emptytab.
      CALL METHOD gd_tree->set_table_for_first_display
         EXPORTING
                   is_hierarchy_header  = gd_hierarchy_header
                   it_list_commentary   = gd_report_title
                   i_logo               = gd_logo
                  i_background_id      = 'ALV_BACKGROUND'
                   i_save               = 'A'
                   is_variant            = gd_variant
         CHANGING
                   it_outtab            =  it_emptytab      "Must be empty
                   it_fieldcatalog      =  gd_fieldcat.
    ENDFORM.                    " CREATE_EMPTY_ALVTREE_CONTROL
    *&      Form  CREATE_ALVTREE_HIERARCHY
          text
          Builds ALV tree display, (inserts nodes, subnodes etc)
    form create_alvtree_hierarchy.
      data: ls_sflight type sflight,
            lt_sflight type sflight occurs 0.
      data: ld_ebeln_key type lvc_nkey,
            ld_ebelp_key type lvc_nkey.
      loop at it_ekko into wa_ekko.
        perform add_ekko_node using      wa_ekko
                                changing ld_ebeln_key.
        loop at it_ekpo into wa_ekpo where ebeln eq wa_ekko-ebeln.
          perform add_ekpo_line using      wa_ekpo
                                           ld_ebeln_key
                                  changing ld_ebelp_key.
        endloop.
      endloop.
    calculate totals
      call method gd_tree->update_calculations.
    this method must be called to send the data to the frontend
      call method gd_tree->frontend_update.
    endform.                    " CREATE_ALVTREE_HIERARCHY
    *&      Form  ADD_EKKO_NODE
          text
         -->P_WA_EKPO  text
         -->P_0553   text
         <--P_EBELN_KEY  text
    form add_ekko_node using    ps_ekko like wa_ekko
                                value(p_relate_key)
                       changing p_node_key.
    data: ld_node_text type lvc_value,
           ls_sflight type sflight.
    Set item-layout
      data: lt_item_layout type lvc_t_layi,
            ls_item_layout type lvc_s_layi.
      ls_item_layout-t_image   = '@3P@'.
      ls_item_layout-fieldname = gd_tree->c_hierarchy_column_name.
      ls_item_layout-style     = cl_gui_column_tree=>style_default.
      ld_node_text             = ps_ekko-ebeln.
      append ls_item_layout to lt_item_layout.
    Add node
      call method gd_tree->add_node
        exporting
              i_relat_node_key = p_relate_key
              i_relationship   = cl_gui_column_tree=>relat_last_child
              i_node_text      = ld_node_text
              is_outtab_line   = ps_ekko
              it_item_layout   = lt_item_layout
           importing
              e_new_node_key = p_node_key.
    endform.                    " ADD_EKKO_NODE
    *&      Form  ADD_EKPO_LINE
          text
         -->P_WA_EKPO  text
         -->P_LD_EBELN_KEY  text
         <--P_LD_EBELP_KEY  text
    form add_ekpo_line using    ps_ekpo like wa_ekpo
                                value(p_relate_key)
                       changing p_node_key.
    data: ld_node_text type lvc_value,
           ls_sflight type sflight.
    Set item-layout
      data: lt_item_layout type lvc_t_layi,
            ls_item_layout type lvc_s_layi.
      ls_item_layout-t_image   = '@3P@'.
      ls_item_layout-fieldname = gd_tree->c_hierarchy_column_name.
      ls_item_layout-style     = cl_gui_column_tree=>style_default.
      ld_node_text             = ps_ekpo-ebelp.
      append ls_item_layout to lt_item_layout.
    Add node
      call method gd_tree->add_node
        exporting
              i_relat_node_key = p_relate_key
              i_relationship   = cl_gui_column_tree=>relat_last_child
              i_node_text      = ld_node_text
              is_outtab_line   = ps_ekpo
              it_item_layout   = lt_item_layout
           importing
              e_new_node_key = p_node_key.
    endform.                    " ADD_EKPO_LINE
    Reward if useful.
    Regards,
    Chitra

  • What is the best way to produce different report types out of the same SSRS Report

    So I have a request to produce different report types based on a "Line Of Business" Parameter that is provided. I know that SSRS sometimes struggles with gathering the Metadata based on IF Statements.
    What is the best way to provide multiple different report types with different data based on the "Line Of Business" Parameter that is provided? Can I simply do this via the SQL Stored Procedure? And how so that the Metadata is collected correctly?
    Just don't know what the generally accepted business principle is on this and how to go about doing it.
    Thanks in advance for your review and am hopeful for a reply.

    Hi ITBobbyP,
    Per my understanding that you have create an parameter (Line Of Businiess) to get diffetent types of report, I would like to confirm with you want do you mean about the different report types?
    Is that mean you have table and one column named Report type, you want to filtered on this column? Or the report type you mean is like Parameterized reports,Linked reports,Snapshot reports,Subreports and so on.
    If want you want is through the selection of the parameter to change the report type(Parameterized reports,Linked reports,Snapshot reports,Subreports ..),currently it is impossible to acheive this.
    If you still have any problem, please try to provide more details information about your reqirements, the sampe data in the table, the report structure you have designed and so on.
    Any problem, please feel free to ask.
    Regards,
    Vicky Liu
    Vicky Liu
    TechNet Community Support

  • Planned orders table/report

    Hi all,
    IS there any table/report which lists out the Planned orders and the converter Purchase requisitions from planned orders? I want a report/table which lists out Purchase requisitions and the related Planned orders.
    Thanks,
    Avani.

    Hi,
    no standard report for your reqirement
    pls check planned order table
    PLAF - planned order table
    once converted planned to pur. req, there is no table to store this converted data
    EBAN - Pur. req table
    Hope you understand
    Regards,
    Sankaran

  • MSS PCR(Personnel Change Request) Report

    Hi Experts,
    We have configured MSS successfully, Now the reqirement is that we require a report which keeps the track of all requests generated during MSS PCR, like which request, who requested, approver, status of the request....etc.....
    Is there any way out where I can track all these things.
    Please suggest.
    Thanks
    Rohit G

    @Rohit Gaharwar 
        Sorry, Rohit...yes, I understood you are on PCRs and not HCM P&F, but I wanted to mention that functionatlity is in fact there for HCM P&F since it was a big missing part for PCRs. And if you are actually on ECC6, you might want to look into it versus PCRs since PCRs are going the way of the dinosaur.
    @Suresh
       Is their some reporting off of workflow that could be done as well? I would think that could show who processes a request as well as where they are "held up". Reporting is a big missing part of PCRS, agreed.

  • Problem in RBDMIDOC report

    Hi,
    I am using Idoc to transfer HR Master data from SAP to CRM and am using message type HRMD_ABA.
    Iam using RBDMIDOC (TRAN - BD21) to create DIOC and the transfer the data which is schedule periodically.
    Now my reqirement is that i want to use INSERT transfer mode in RBDMIDOC report like how in PFAL we r having 2 option 'INSERT' and 'UPDATE' transfer mode. I don't want to schedule/use PFAL.
    Any idea how to run RBDMIDOC in Insert mode....?
    Thanks in advance.
    Regards.
    Hemant.

    Hi,
    First of all thanks Michael for your answer..
    Actually my requirement is that if an employee is inactivate on R/3 then in CRM business partner status gets block if i run RBDMIDOC report.
    But if i run PFAL in INSERT mode then business partner does not get block...
    I can schedule PFAL in background but here RBDMIDOC is periodically schedule in Production so i need to put logic based on RBDMIDOC report only.
    I hope you are clear......waiting for your reply......
    Regards.
    Hemant

Maybe you are looking for