ALV Report for multiple headers with Line Items

Hi Sap All.
here i have got a requirement to change the exisiting Zprogram which writes all the header information with line items in a normal simple report,now i have got to change the program in order to display in an ALV Format .
in the exisiting program they are using EXTRACT ,INSERT Statement and multiple select statements for getting the values into each field ofheader and line items for writing in a simple report.
so ijust want to know how i can populate all the data into alv grid.
can any one help me in this.
regards.
Varma

you have to store all header records in an internal table and all item records in a second table
then you call function module REUSE_ALV_HIERSEQ_LIST_DISPLAY with both parameters T_OUTTAB_HEADER and T_OUTTAB_ITEM

Similar Messages

  • One pr for multiple materials with line items while running mrp

    Hi SAP gurus,
                  I am config the system for MRP as per my client requerement.
                     We use CBP for different RAW materialsfor example they having a 10 materials for planning,were,
             MRP type is VB,
              LOT size is FX,with Different Reorder points and fix order quantity for all materials,
             My client whant run MRP for all these materials in single time that means they whant multiple item at single levels,
            i soles these requirement with the help of Product Group(sop) and its working but when we running md02 for product group all materials have planed and they give different purchase requistion numbers for all these materials but my client Wants single purchase requistion with line items for all these materials.
         Pls give me the solution for that requirement.
    thanks and Regards,
    abhi

    this is not the way SAPs MRP run works.
    Where is the benefit for this?
    the requisitions are not even split into header and item table, it is just one table EBAN, and either way you would get exact the same number of records in EBAN.

  • Standard report for FI Special Ledger Line Item report

    is there any standard report for FI Special Ledger Line Item report

    Hi
    GD23 for Display of SPL Document
    GD13 for Trail Balance of SPL
    GCAC for Ledger Comparision
    GVTR Balance Carry forward in SPl.
    Assign Points if useful.

  • Taking too much time for saving PO with line item more than 600

    HI
    We are trying to save PO with line items more than 600, but it is taking too much time to save. It is taking more than 1 hour to save the PO.
    Kindly let me know is there any restriction for no. of line items in the PO. Pls guide
    regards
    Sanjay

    Hi,
    I suggest you to do a trace (tcode ST05) to identify the bottleneck.
    You can know some reasons in Note 205005 - Performance composite note: Purchase order.
    I hope this helps you
    Regards
    Eduardo

  • Alv report for multiple record insertion

    hi,
    i'm new to abap. i'm using alv report for record display and insertion. how can i insert multiple records from alv to my table??

    well that can be achieved only by running BDC inside alv report to enter the entries.and in that too you can append or edit single entries only
    reward if useful
    regards
    vivek

  • Table or report for TLB Shipments with header & item details

    Hi,
       Anyone can tell whats the table to view TLB Shipments with header & item details OR any other reports available to view?
    regards
    Arasu

    Hi
    I think following information might be helpful to you.
    http://help.sap.com/saphelp_sm40/helpdata/en/42/cb4e7efb0a136ae10000000a1553f7/content.htm
    Amol

  • Report for multiple IDOCs with multiple POs

    Hi,
    In our project PO goes out to vendor through EDI 850 and Outbound IDOC is generated for this.Some times its failed due to connection issue at vendors end. so sometimes  we need to send  PO nos and its related IDOC nos  to EDI team as per their request.I can get IDOC number for a particular PO from WE09.But that transaction is for single PO i belief.But sometimes there are  20-30 pos and if we want to search its related IDOC at a single time then how can i search this in SAP?Is there any standard SAP functionality or i have go custom report?

    you need to copy the idoc failed idoc numbers, and segment name in which your PO resides
    Go to table EDID4, pass Segment name and idoc numbers, you will find all related PO numbers in
    Application data column, please note this column is a merged column
    You will need to download it as unconverted Text , call in Excel -Text column and get the records
    There is no other easy way for this
    Thanks
    DD

  • Cost center  report with line items by date

    Hi guys,
    i need to create a report by date, for cost centers that displays individual line items?,
    do u know if there is a bapi or  RFC for this?
    what tables are related for line items dates?
    i already know that coep but this table has period and not by date
    any ideas?
    tks in advance

    Hi,
    You can check out std reports like KSB1, KSB2, KSBP, KSB5.
    Also check Accounting-> controllong-> Cost center accounting-> Info system-> Reports for cost center accounting-> line items/more reports.
    Tables: COSP, COEP, COBK
    FM: K_KKB_KKBCS_COST_CENTER_REPORT
    Regards,
    Amit

  • [svn] 889: Add test case for BLZ-82 where HttpService should return multiple headers with the same name .

    Revision: 889
    Author: [email protected]
    Date: 2008-03-21 13:08:05 -0700 (Fri, 21 Mar 2008)
    Log Message:
    Add test case for BLZ-82 where HttpService should return multiple headers with the same name.
    Ticket Links:
    http://bugs.adobe.com/jira/browse/BLZ-82
    Added Paths:
    blazeds/trunk/qa/apps/qa-regress/remote/MultipleHeadersTest.jsp
    blazeds/trunk/qa/apps/qa-regress/testsuites/mxunit/tests/proxyService/httpservice/MultiHe aderTest.mxml

    Hi again,
    this may be old news to some people, but I just realized we can have the desired benefits I originally listed (encapsulation, reuse, maintainability, security) TODAY by using pipelined functions and using the table() function in Apex report region queries.
    So the report query basically becomes, for example (if get_employees is a pipelined function)
    select * from table(my_package.get_employees(:p1_deptno))
    The only downside compared to a (weakly typed) sys_refcursor is that you have to define the type you are returning in your package spec (or as an SQL type). So it's a bit more coding, but it's still worth it for the other benefits it provides.
    I like Apex even better now! :-)
    - Morten

  • Report for CS15 tcode with multiple material nos. in selection screen.

    I want to develop a report for cs15 but with multiple materials.
    Like in cs15 we enter the material and its plant, then click on multi level check box and get the output. But cs15 works only for a single material. I want to develop a report in which i'll give multiple material nos. and then i should get the output for each material entered just as the output that would appear in cs15 for that material.
    How do i do it.
    I have tried but i'm not able to track back.

    Hi Priti,
          try develop a interactive report which lists all the materials in the first screen and when you double click on each of the material then call transaction CS15 output by skipping the first screen .Use set parameter to pass the material .
    Regards,
    Sirisha

  • Availability Check at Multiple Plants for the Sales Order line Item.

    Hi Friends,
    We are having two plants, Plant A and Plant B. Plant A is used to issue the orders to the vendors and stock them, while Plant B is used to manufacture the Product and Stock.
    When we create the sales order, we want to check the Current Stock Plus Incomming Purchase order stock for plant A and also check current stock plus Production orders in plant B.
    for ex if the current stock is 100 in Plant A and No physical stock in Plant B but there are some production orders for 400 Qty which will be ready in 1 week.
    If i create a sales order for 500 qty which is scheduled for delivery 10 days later.  then we want to commit to the customer ( Looking at both the plants stock situation )  the system should check the stock availability for both the plants and automatically create two different line items , Line item 1 for plant A and line item 2 for plant b.
    I know there is a user exit for Multiple plant selection USEREXIT_PLANT_SELECTION  in program RV03VFZZ. The Description of the USer exit says ( This user exit may be used to provide a list of plants for which availability is to be checked)  But we have never used this one. Will this user exit do exactly what i want ??
    Did any of you, have used the above User exit in your implementations ? If so please let me know whats the purpose of this user exit
    Your reply is much appreciated.
    Thanks & Regards
    Srinivas

    Hi
    I dont know about the userexit which you are referring about
    But this is not available in R3 The system makes a Availability Check only in the plant which has got determined in the item details shipping tab and stops there
    The same is available in APO
    If there are 2 plants say 1000 and 2000
    In sales order the plant determined is 1000 and there is no stock
    In R3 system stops there
    But in APO  system checks the plant 2000 and if stocks are available it creates an STO in the background automatically from 2000 to 1000 if configured accordingly
    Even if the material is maintained in 10 plants the system will make a  Availability Check at all 10 plants and act accordingly
    Regards
    Raja

  • ALV report for individual fields (urgent...........)

    Hi all,
    using this ZUS_SDN_THREE_ALV_GRIDS program structure i have generated the all the fields from table.
    could you please guide me how to generate the ALV report for splecific fileds from  individual tables.
    if i click in click on grid1 (that is sales header details) we need populate the item details in grid2 and paralally customer details in grid3.
    please guide me how to resolve the issuee..
    thanks in advance
    Srinivas...

    Hi,
    I have done an example, like on 1st grid it displays header data (EKKO) and when you double click on any record, for that PO you will get item details (EKPO) on 2nd grid,
    In the similar way, you can add one more grid and populate it with your own data simultaneously along with 2nd grid.
    *& Report  ZOOABAP1_SOW
    report  zabap2.
    *                     TABLES
    tables:ekko.
    *                     DATA DECLARATIONS
    data: grid1 type ref to cl_gui_alv_grid,
          grid2 type ref to cl_gui_alv_grid,
          container1 type ref to cl_gui_custom_container,
          container2 type ref to cl_gui_custom_container,
          flag.
    *                     INTERNAL TABLES
    data: it_ekko type table of ekko.
    data: wa_ekko like line of it_ekko.
    data: it_ekpo type table of ekpo.
    data: it_fcat1 type lvc_t_fcat,
          wa_fcat1 type lvc_s_fcat,
          it_fcat2 type lvc_t_fcat,
          wa_fcat2 type lvc_s_fcat,
          wa_layout1 type lvc_s_layo,
          wa_layout2 type lvc_s_layo,
          wa_variant type disvariant.
    *                     SELECTION-SCREEN
    selection-screen begin of block b with frame title text-s01.
    select-options: s_ebeln for ekko-ebeln.
    selection-screen end of block b.
    *       CLASS lcl1 DEFINITION
    class lcl1 definition.
      public section.
        methods:
          handler_dbl_clk for event double_click
                                      of cl_gui_alv_grid
                                         importing e_row.
    endclass.                    "lcl1 DEFINITION
    *       CLASS lcl1 IMPLEMENTATION
    class lcl1 implementation.
      method handler_dbl_clk.
        read table it_ekko into wa_ekko index e_row-index.
        if sy-subrc = 0.
          perform get_ekpo.
        endif.
      endmethod.                    "handler_dbl_clk
    endclass.                    "lcl1 IMPLEMENTATION
    *                     START_OF_SELECTION
    start-of-selection.
    * Get PO header data
      perform get_ekko.
    * screen for container
      call screen 100.
    *&      Module  STATUS_0100  OUTPUT
    *       text
    module status_0100 output.
      set pf-status 'PFS'.
      set titlebar 'TIT'.
      data: obj type ref to lcl1.
      if flag is initial.
        create object container1
          exporting
            container_name = 'CONT1'.
        create object container2
          exporting
            container_name = 'CONT2'.
        create object grid1
          exporting
            i_parent = container1.
        create object grid2
          exporting
            i_parent = container2.
        create object obj.
        set handler obj->handler_dbl_clk for grid1.
        perform build_fcat.
        perform build_layout.
        call method grid1->set_table_for_first_display
           exporting
    *        i_buffer_active               =
    *        i_bypassing_buffer            =
    *        i_consistency_check           =
    *          i_structure_name              = 'EKKO'
    *        is_variant                    = wa_variant
            i_save                        = 'X'
    *        i_default                     = 'X'
            is_layout                     = wa_layout1
    *        is_print                      =
    *        it_special_groups             =
    *        it_toolbar_excluding          =
    *        it_hyperlink                  =
    *        it_alv_graphics               =
    *        it_except_qinfo               =
    *        ir_salv_adapter               =
              changing
                it_outtab                     = it_ekko
                it_fieldcatalog               = it_fcat1
    *        it_sort                       =
    *        it_filter                     =
    *      EXCEPTIONS
    *        invalid_parameter_combination = 1
    *        program_error                 = 2
    *        too_many_lines                = 3
    *        others                        = 4
        if sy-subrc <> 0.
    * MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
    *            WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
        endif.
        flag = 'X'.
      endif.
    endmodule.                 " STATUS_0100  OUTPUT
    *&      Form  get_ekko
    *       text
    *  -->  p1        text
    *  <--  p2        text
    form get_ekko .
      select ebeln bsart lifnr
             from ekko
             into corresponding fields of table it_ekko
             where ebeln in s_ebeln.
    endform.                    " get_ekko
    *&      Form  GET_EKPO
    *       text
    *  -->  p1        text
    *  <--  p2        text
    form get_ekpo .
      select ebeln ebelp menge meins peinh from ekpo
       into corresponding fields of table it_ekpo
       where ebeln = wa_ekko-ebeln.
      if not it_ekpo[] is initial.
        call method grid2->set_table_for_first_display
      exporting
    *    i_buffer_active               =
    *    i_bypassing_buffer            =
    *    i_consistency_check           =
    *    i_structure_name              =
    *    is_variant                    =
    *    i_save                        =
    *    i_default                     = 'X'
        is_layout                     = wa_layout2
    *    is_print                      =
    *    it_special_groups             =
    *    it_toolbar_excluding          =
    *    it_hyperlink                  =
    *    it_alv_graphics               =
    *    it_except_qinfo               =
    *    ir_salv_adapter               =
          changing
            it_outtab                     = it_ekpo
            it_fieldcatalog               = it_fcat2
    *    it_sort                       =
    *    it_filter                     =
    *  EXCEPTIONS
    *    invalid_parameter_combination = 1
    *    program_error                 = 2
    *    too_many_lines                = 3
    *    others                        = 4
        if sy-subrc <> 0.
    * MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
    *            WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
        endif.
      endif.
    endform.                    " GET_EKPO
    *&      Module  USER_COMMAND_0100  INPUT
    *       text
    module user_command_0100 input.
      case sy-ucomm.
        when 'BACK' or 'EXIT' or 'CANC'.
          call method container1->free.
          call method container2->free.
          leave to screen 0.
      endcase.
    endmodule.                 " USER_COMMAND_0100  INPUT
    *&      Form  build_fcat
    *       text
    *  -->  p1        text
    *  <--  p2        text
    form build_fcat .
    * fieldcatalog for EKKO table
      wa_fcat1-col_pos = '1'.
      wa_fcat1-fieldname = 'EBELN'.
      wa_fcat1-tabname = 'EKKO'.
      wa_fcat1-coltext = 'PO No.'.
      append wa_fcat1 to it_fcat1.
      clear wa_fcat1.
      wa_fcat1-col_pos = '2'.
      wa_fcat1-fieldname = 'BSART'.
      wa_fcat1-tabname = 'EKKO'.
      wa_fcat1-coltext = 'PO Type'.
      append wa_fcat1 to it_fcat1.
      clear wa_fcat1.
      wa_fcat1-col_pos = '3'.
      wa_fcat1-fieldname = 'LIFNR'.
      wa_fcat1-tabname = 'EKKO'.
      wa_fcat1-coltext = 'Vendor No.'.
      append wa_fcat1 to it_fcat1.
      clear wa_fcat1.
    * fieldcatalog for EKPO table
      wa_fcat2-col_pos = '1'.
      wa_fcat2-fieldname = 'EBELN'.
      wa_fcat2-tabname = 'EKPO'.
      wa_fcat2-coltext = 'PO No.'.
      append wa_fcat2 to it_fcat2.
      clear wa_fcat2.
      wa_fcat2-col_pos = '2'.
      wa_fcat2-fieldname = 'EBELP'.
      wa_fcat2-tabname = 'EKPO'.
      wa_fcat2-coltext = 'PO Item'.
      append wa_fcat2 to it_fcat2.
      clear wa_fcat2.
      wa_fcat2-col_pos = '3'.
      wa_fcat2-fieldname = 'MENGE'.
      wa_fcat2-tabname = 'EKPO'.
      wa_fcat2-coltext = 'Quantity'.
      append wa_fcat2 to it_fcat2.
      clear wa_fcat2.
      wa_fcat2-col_pos = '4'.
      wa_fcat2-fieldname = 'MEINS'.
      wa_fcat2-tabname = 'EKPO'.
      wa_fcat2-coltext = 'UOM'.
      append wa_fcat2 to it_fcat2.
      clear wa_fcat2.
      wa_fcat2-col_pos = '5'.
      wa_fcat2-fieldname = 'PEINH'.
      wa_fcat2-tabname = 'EKPO'.
      wa_fcat2-coltext = 'Price Unit'.
      append wa_fcat2 to it_fcat2.
      clear wa_fcat2.
    endform.                    " build_fcat
    *&      Form  build_layout
    *       text
    *  -->  p1        text
    *  <--  p2        text
    form build_layout .
      clear wa_layout1.
      wa_layout1-grid_title = 'Header data'.
    *  wa_layout-sel_mode = 'A'.             "allow to select multiple lines
      clear wa_layout2.
      wa_layout2-grid_title = 'Item Data'.
    endform.                    " build_layout
    If you have any poblems while doing this, post it.
    Do reward points for all helpful answers
    Regards,
    Sowjanya

  • Alv Report for invoice details

    Dear All,
                 I need to develop one alv report for following details. i developed coding for this requirment but i am getting some error.kindley help me to how to move data from different internal table to final internal table. I used LOOP AT and READ Statement even i didn't get any output.
    kindley help me out.
    TYPES: BEGIN OF XT_TAB,
             LIFNR  LIKE LFA1-LIFNR,
             NAME1  LIKE LFA1-NAME1,
             STCD1  LIKE LFA1-STCD1,
             STCD2  LIKE LFA1-STCD2,
             STCD3  LIKE LFA1-STCD3,
             STCD4  LIKE LFA1-STCD4,
           END OF XT_TAB.
    TYPES: BEGIN OF YT_TAB,
            BUKRS LIKE BSEG-BUKRS,
            BELNR LIKE BSEG-BELNR,
            BUZEI LIKE BSEG-BUZEI,
            LIFNR LIKE BSEG-LIFNR,
            GJAHR LIKE BSEG-GJAHR,
           END OF YT_TAB.
    TYPES: BEGIN OF ZT_TAB,
            LIFNR  LIKE LFA1-LIFNR,
            NAME1  LIKE LFA1-NAME1,
            STCD2  LIKE LFA1-STCD2,
            BELNR  LIKE BSEG-BELNR,
            BUZEI  LIKE BSEG-BUZEI,
            GJAHR  LIKE BSEG-GJAHR,
           END OF ZT_TAB.
           I N T E R N A L   T A B L E   D E C L A R A T I O N S         *
    *-----Internal table to store data
    DATA: ITAB1   TYPE STANDARD TABLE OF XT_TAB INITIAL SIZE 0,
          WA_TAB1 TYPE XT_TAB.
    DATA: ITAB2   TYPE STANDARD TABLE OF YT_TAB INITIAL SIZE 0,
          WA_TAB2 TYPE YT_TAB.
    DATA:   ITAB  TYPE STANDARD TABLE OF  ZT_TAB  WITH HEADER LINE,
            WA_ITAB TYPE ZT_TAB,
            ITAB_FINAL2 TYPE STANDARD TABLE OF ZT_TAB.
    DATA: ITAB_TEMP1 TYPE STANDARD TABLE OF ZT_TAB  WITH HEADER LINE.
                    Selection Screen Declarations                        *
    SELECTION-SCREEN BEGIN OF BLOCK bk1 WITH FRAME TITLE text-001.
    SELECTION-SCREEN SKIP.
    SELECTION-SCREEN begin OF LINE.
    SELECTION-SCREEN COMMENT (23) text-003 FOR FIELD P_LIFNR.
    PARAMETERS P_LIFNR LIKE LFA1-LIFNR OBLIGATORY.
    SELECTION-SCREEN END OF LINE.
    SELECTION-SCREEN SKIP.
    SELECTION-SCREEN END OF BLOCK bk1.
    START-OF-SELECTION.
          PERFORM XTRACT_DATA.
    END-OF-SELECTION.
    *-----Filling the Output table
      PERFORM populate_main_table.
          PERFORM BUILD_FIELDCATALOG.
         PERFORM SORTING.
          PERFORM BUILD_LAYOUT.
          PERFORM BUILD_ALV_GRID_DISPLAY.
         Form  XTRACT_DATA
    FORM XTRACT_DATA .
    *SELECT
          a~LIFNR
          a~NAME1
          a~STCD2
          b~BELNR
          b~BUZEI
          b~GJAHR
    INTO TABLE ITAB
    FROM LFA1 as a INNER JOIN BSEG as b
      ON  aLIFNR = bLIFNR
    WHERE  a~LIFNR = P_LIFNR.
    SELECT LIFNR
           NAME1
           STCD1
           STCD2
           STCD3
           STCD4
      FROM LFA1
      INTO TABLE ITAB1
      WHERE LIFNR = P_LIFNR.
    IF NOT ITAB1[] IS INITIAL.
        SORT ITAB1 BY LIFNR.
        SELECT BELNR
               BUZEI
               LIFNR
               GJAHR
    INTO TABLE ITAB2
          FROM BSEG
    FOR ALL ENTRIES IN ITAB1
    WHERE LIFNR = ITAB1-LIFNR.
    ENDIF.
    ENDFORM.                    " XTRACT_DATA
    *&      Form  POPULATE_MAIN_TABLE
          text
    -->  p1        text
    <--  p2        text
    FORM POPULATE_MAIN_TABLE .
       LOOP AT ITAB1 INTO WA_TAB1.
               ITAB-LIFNR = ITAB1-LIFNR.
               ITAB-NAME1 = ITAB1-NAME1.
               ITAB-STCD2 = ITAB1-STCD2.
       READ TABLE ITAB2 INTO WA_TAB2 WITH KEY LIFNR = WA_TAB1-LIFNR.
               IF sy-subrc = 0.
               ITAB-BELNR = ITAB1-BELNR.
               ITAB-BUZEI = ITAB1-BUZEI.
               ITAB-GJAHR = ITAB1-GJAHR.
               ENDIF.
      ENDLOOP.
      ENDFORM.                    " POPULATE_MAIN_TABLE
         Form  BUILD_FIELDCATALOG
    FORM BUILD_FIELDCATALOG .
      REFRESH t_fcat.
      CLEAR t_fcat.
      wa_fcat-col_pos = 1.
      wa_fcat-row_pos = 1.
      wa_fcat-seltext_s = 'Vendor Number'.
      wa_fcat-seltext_m = 'Vendor Number'.
      wa_fcat-seltext_l = 'Vendor Number'.
      wa_fcat-fieldname = 'LIFNR'.
      wa_fcat-tabname = 'ITAB'.
      APPEND wa_fcat TO t_fcat.
      CLEAR t_fcat.
      wa_fcat-col_pos = 2.
      wa_fcat-row_pos = 1.
      wa_fcat-seltext_s = 'Vendor Name'.
      wa_fcat-seltext_m = 'Vendor Name'.
      wa_fcat-seltext_l = 'Vendor Name'.
      wa_fcat-fieldname = 'NAME1'.
      wa_fcat-tabname = 'ITAB'.
      APPEND wa_fcat TO t_fcat.
      CLEAR t_fcat.
      wa_fcat-col_pos = 3.
      wa_fcat-row_pos = 1.
      wa_fcat-seltext_s = 'Vendor TIN Number'.
      wa_fcat-seltext_m = 'Vendor TIN Number'.
      wa_fcat-seltext_l = 'Vendor TIN Number'.
      wa_fcat-fieldname = 'STCD2'.
      wa_fcat-tabname = 'ITAB'.
      APPEND wa_fcat TO t_fcat.
      CLEAR t_fcat.
      wa_fcat-col_pos = 4.
      wa_fcat-row_pos = 1.
      wa_fcat-seltext_s = 'Document No'.
      wa_fcat-seltext_m = 'Document No'.
      wa_fcat-seltext_l = 'Document No'.
      wa_fcat-fieldname = 'BELNR'.
      wa_fcat-tabname = 'ITAB'.
      APPEND wa_fcat TO t_fcat.
      CLEAR t_fcat.
      wa_fcat-col_pos = 5.
      wa_fcat-row_pos = 1.
      wa_fcat-seltext_s = 'Item Number'.
      wa_fcat-seltext_m = 'Item Number'.
      wa_fcat-seltext_l = 'Item Number'.
      wa_fcat-fieldname = 'BUZEI'.
      wa_fcat-tabname = 'ITAB'.
      APPEND wa_fcat TO t_fcat.
      CLEAR t_fcat.
      wa_fcat-col_pos = 6.
      wa_fcat-row_pos = 1.
      wa_fcat-seltext_s = 'Fiscal Year'.
      wa_fcat-seltext_m = 'Fiscal Year'.
      wa_fcat-seltext_l = 'Fiscal Year'.
      wa_fcat-fieldname = 'GJAHR'.
      wa_fcat-tabname = 'ITAB'.
      APPEND wa_fcat TO t_fcat.
      CLEAR t_fcat.
    ENDFORM.                    " BUILD_FIELDCATALOG
         Form  BUILD_LAYOUT
    FORM BUILD_LAYOUT .
    GD_LAYOUT-NO_INPUT = 'X'.
    GD_LAYOUT-COLWIDTH_OPTIMIZE = 'X'.
    GD_LAYOUT-TOTALS_TEXT = 'TOTALS'.
    ENDFORM.                    " BUILD_LAYOUT
         Form  BUILD_ALV_GRID_DISPLAY
    FORM BUILD_ALV_GRID_DISPLAY .
    gd_repid = sy-repid.
      CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
           EXPORTING
                i_callback_program      = gd_repid
                i_callback_top_of_page  = 'TOP-OF-PAGE'  "see FORM
                i_callback_user_command = 'USER_COMMAND'
                is_layout               = gd_layout
                it_fieldcat             = t_fcat[]
                it_events               = gt_events
                is_print                = gd_prntparams
                it_sort                 = it_sortcat[]
                i_save                  = 'X'
           TABLES
                t_outtab                = ITAB
           EXCEPTIONS
                program_error           = 1
                OTHERS                  = 2.
    thanks and regards
    Murugesh

    TYPES: BEGIN OF XT_TAB,
             LIFNR  LIKE LFA1-LIFNR,
             NAME1  LIKE LFA1-NAME1,
             STCD1  LIKE LFA1-STCD1,
             STCD2  LIKE LFA1-STCD2,
             STCD3  LIKE LFA1-STCD3,
             STCD4  LIKE LFA1-STCD4,
           END OF XT_TAB.
    TYPES: BEGIN OF YT_TAB,
            BUKRS LIKE BSEG-BUKRS,
            BELNR LIKE BSEG-BELNR,
            BUZEI LIKE BSEG-BUZEI,
            LIFNR LIKE BSEG-LIFNR,
            GJAHR LIKE BSEG-GJAHR,
           END OF YT_TAB.
    TYPES: BEGIN OF ZT_TAB,
            LIFNR  LIKE LFA1-LIFNR,
            NAME1  LIKE LFA1-NAME1,
            STCD2  LIKE LFA1-STCD2,
            BELNR  LIKE BSEG-BELNR,
            BUZEI  LIKE BSEG-BUZEI,
            GJAHR  LIKE BSEG-GJAHR,
           END OF ZT_TAB.
           I N T E R N A L   T A B L E   D E C L A R A T I O N S         *
    *-----Internal table to store data
    DATA: ITAB1   TYPE STANDARD TABLE OF XT_TAB INITIAL SIZE 0,
          WA_TAB1 TYPE XT_TAB.
    DATA: ITAB2   TYPE STANDARD TABLE OF YT_TAB INITIAL SIZE 0,
          WA_TAB2 TYPE YT_TAB.
    DATA:   ITAB  TYPE STANDARD TABLE OF  ZT_TAB  WITH HEADER LINE,
            WA_ITAB TYPE ZT_TAB,
            ITAB_FINAL2 TYPE STANDARD TABLE OF ZT_TAB.
    DATA: ITAB_TEMP1 TYPE STANDARD TABLE OF ZT_TAB  WITH HEADER LINE.
                    Selection Screen Declarations                        *
    SELECTION-SCREEN BEGIN OF BLOCK bk1 WITH FRAME TITLE text-001.
    SELECTION-SCREEN SKIP.
    SELECTION-SCREEN begin OF LINE.
    SELECTION-SCREEN COMMENT (23) text-003 FOR FIELD P_LIFNR.
    PARAMETERS P_LIFNR LIKE LFA1-LIFNR OBLIGATORY.
    SELECTION-SCREEN END OF LINE.
    SELECTION-SCREEN SKIP.
    SELECTION-SCREEN END OF BLOCK bk1.
    START-OF-SELECTION.
          PERFORM XTRACT_DATA.
    END-OF-SELECTION.
    *-----Filling the Output table
      PERFORM populate_main_table.
          PERFORM BUILD_FIELDCATALOG.
         PERFORM SORTING.
          PERFORM BUILD_LAYOUT.
          PERFORM BUILD_ALV_GRID_DISPLAY.
         Form  XTRACT_DATA
    FORM XTRACT_DATA .
    *SELECT
          a~LIFNR
          a~NAME1
          a~STCD2
          b~BELNR
          b~BUZEI
          b~GJAHR
    INTO TABLE ITAB
    FROM LFA1 as a INNER JOIN BSEG as b
      ON  aLIFNR = bLIFNR
    WHERE  a~LIFNR = P_LIFNR.
    SELECT LIFNR
           NAME1
           STCD1
           STCD2
           STCD3
           STCD4
      FROM LFA1
      INTO TABLE ITAB1
      WHERE LIFNR = P_LIFNR.
    IF NOT ITAB1[] IS INITIAL.
        SORT ITAB1 BY LIFNR.
        SELECT BELNR
               BUZEI
               LIFNR
               GJAHR
    INTO TABLE ITAB2
          FROM BSEG
    FOR ALL ENTRIES IN ITAB1
    WHERE LIFNR = itab1-lifnr.
    ENDIF.
    ENDFORM.                    " XTRACT_DATA
    *&      Form  POPULATE_MAIN_TABLE
          text
    -->  p1        text
    <--  p2        text
    FORM POPULATE_MAIN_TABLE .
      LOOP AT ITAB1 INTO WA_TAB1.
              ITAB-LIFNR = ITAB1-LIFNR.
              ITAB-NAME1 = ITAB1-NAME1.
              ITAB-STCD2 = ITAB1-STCD2.
      READ TABLE ITAB2 INTO WA_TAB2 WITH KEY LIFNR = WA_TAB1-LIFNR.
              IF sy-subrc = 0.
              ITAB-BELNR = ITAB1-BELNR.
              ITAB-BUZEI = ITAB1-BUZEI.
              ITAB-GJAHR = ITAB1-GJAHR.
              ENDIF.
    ENDLOOP.
    LOOP AT itab1 INTO wa_tab1.
       MOVE:  wa_tab1-lifnr TO itab-lifnr,
              wa_tab1-name1 TO itab-name1,
              wa_tab1-stcd2 TO itab-stcd2.
          Append itab.
      READ TABLE itab2 TRANSPORTING NO FIELDS WITH KEY lifnr = wa_tab1-lifnr.
      IF sy-subrc eq 0.
        MOVE: wa_tab2-lifnr TO itab-lifnr,
              wa_tab2-belnr TO itab-belnr,
              wa_tab2-buzei TO itab-buzei,
              wa_tab2-gjahr TO itab-gjahr.
      Append itab.
    endif.
    endloop.
    *LOOP AT t_agr_tcodes INTO s_agr_tcodes.
    READ TABLE t_tstc
    TRANSPORTING NO FIELDS
    WITH KEY tcode = s_agr_tcodes-tcode.
    IF sy-subrc eq 0.
       MOVE: s_agr_tcodes-tcode TO it_agr_tcodes-tcode,
             s_agr_tcodes-agr_name to it_agr_tcodes-agr_name,
             t_tstc-pgmna to it_agr_pgmna.
    *Append it_agr_tcodes.
    *endif.
    *endloop.
      ENDFORM.                    " POPULATE_MAIN_TABLE
         Form  BUILD_FIELDCATALOG
    FORM BUILD_FIELDCATALOG .
      REFRESH t_fcat.
      CLEAR t_fcat.
      wa_fcat-col_pos = 1.
      wa_fcat-row_pos = 1.
      wa_fcat-seltext_s = 'Vendor Number'.
      wa_fcat-seltext_m = 'Vendor Number'.
      wa_fcat-seltext_l = 'Vendor Number'.
      wa_fcat-fieldname = 'LIFNR'.
      wa_fcat-tabname = 'ITAB'.
      APPEND wa_fcat TO t_fcat.
      CLEAR t_fcat.
      wa_fcat-col_pos = 2.
      wa_fcat-row_pos = 1.
      wa_fcat-seltext_s = 'Vendor Name'.
      wa_fcat-seltext_m = 'Vendor Name'.
      wa_fcat-seltext_l = 'Vendor Name'.
      wa_fcat-fieldname = 'NAME1'.
      wa_fcat-tabname = 'ITAB'.
      APPEND wa_fcat TO t_fcat.
      CLEAR t_fcat.
      wa_fcat-col_pos = 3.
      wa_fcat-row_pos = 1.
      wa_fcat-seltext_s = 'Vendor TIN Number'.
      wa_fcat-seltext_m = 'Vendor TIN Number'.
      wa_fcat-seltext_l = 'Vendor TIN Number'.
      wa_fcat-fieldname = 'STCD2'.
      wa_fcat-tabname = 'ITAB'.
      APPEND wa_fcat TO t_fcat.
      CLEAR t_fcat.
      wa_fcat-col_pos = 4.
      wa_fcat-row_pos = 1.
      wa_fcat-seltext_s = 'Document No'.
      wa_fcat-seltext_m = 'Document No'.
      wa_fcat-seltext_l = 'Document No'.
      wa_fcat-fieldname = 'BELNR'.
      wa_fcat-tabname = 'ITAB'.
      APPEND wa_fcat TO t_fcat.
      CLEAR t_fcat.
      wa_fcat-col_pos = 5.
      wa_fcat-row_pos = 1.
      wa_fcat-seltext_s = 'Item Number'.
      wa_fcat-seltext_m = 'Item Number'.
      wa_fcat-seltext_l = 'Item Number'.
      wa_fcat-fieldname = 'BUZEI'.
      wa_fcat-tabname = 'ITAB'.
      APPEND wa_fcat TO t_fcat.
      CLEAR t_fcat.
      wa_fcat-col_pos = 6.
      wa_fcat-row_pos = 1.
      wa_fcat-seltext_s = 'Fiscal Year'.
      wa_fcat-seltext_m = 'Fiscal Year'.
      wa_fcat-seltext_l = 'Fiscal Year'.
      wa_fcat-fieldname = 'GJAHR'.
      wa_fcat-tabname = 'ITAB'.
      APPEND wa_fcat TO t_fcat.
      CLEAR t_fcat.
    ENDFORM.                    " BUILD_FIELDCATALOG
         Form  BUILD_LAYOUT
    FORM BUILD_LAYOUT .
    GD_LAYOUT-NO_INPUT = 'X'.
    GD_LAYOUT-COLWIDTH_OPTIMIZE = 'X'.
    GD_LAYOUT-TOTALS_TEXT = 'TOTALS'.
    ENDFORM.                    " BUILD_LAYOUT
         Form  BUILD_ALV_GRID_DISPLAY
    FORM BUILD_ALV_GRID_DISPLAY .
    gd_repid = sy-repid.
      CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
           EXPORTING
                i_callback_program      = gd_repid
                i_callback_top_of_page  = 'TOP-OF-PAGE'  "see FORM
                i_callback_user_command = 'USER_COMMAND'
                is_layout               = gd_layout
                it_fieldcat             = t_fcat[]
                it_events               = gt_events
                is_print                = gd_prntparams
                it_sort                 = it_sortcat[]
                i_save                  = 'X'
           TABLES
                t_outtab                = ITAB
           EXCEPTIONS
                program_error           = 1
                OTHERS                  = 2.
    Edited by: Murugesh P on Apr 6, 2009 10:54 AM
    Edited by: Murugesh P on Apr 6, 2009 10:54 AM

  • Customer/Vendor A/C with line item details and with opening and closing Bal

    Dear Sir / Madam,
    Is it possible to have a customer and / or vendor Sub-Ledger account-
    with line item details and with opening and closing balance detail
    for a particular period.?
    Regards
    Chirag Shah
    I thank for the given below thread which has solved the same problem for G/L Account
    Re: Report to get the ledger printout with opening balances

    Hello Srinujalleda,
    Thanks for your precious time.
    I tried the referred T-Code
    But this report is not showing Opening balance, closing balance detail.
    It only gives transactions during the specified posting period and total of it.
    Please guide me further in case if I need to give proper input at selection screen or elsewhere.
    Client Requires Report in a fashion
    Opening Balance as on Date
    + / -  Transactions during the period
    = Closing Balance as on date
    As that of appearing for G/L Account by S_ALR_87012311
    Thanks once again & Regards
    Chirag Shah

  • Work Order to cost center settlement with line item detail

    Iu2019m having difficulty finding a method to settle from a work order to a cost center with line item detail.  When an order is settled with KO88 or KO8G the total value for that work order/cost element combination is combined and posted to the cost center as a lump sum with the description of CTR\######.  Users would like to see the individual values that posted to the work order in a cost center report such as  KSB1.
    I donu2019t see anything in the settlement rule, settlement profile or allocation structure that will allow line item settlement from work order to cost center.     Is line item settlement possible when settling to a cost center?   Is there an alternate way to see these expenses as line items in KSB1?
    Thanks,
    Jeff

    Thanks Christian,
    We've defined an allocation structure that we use for Project System and Work Order settlement and have Receiver Categories established as FXA, CTR and WBS with "by Cost Element"  checked.  Work order costs do settle to the cost center entered in the settlement rule, the problem is it combines all items values as a single amount when posting to the cost center.
    For example:  
    expenses post to the work order under cost element 500000 for $500, $200, $300 and cost element 600000 for $250 and $250.  The settlement rule says to settle to cost center 170000.  When the settlement takes place cost center 170000 is debited $1000 to cost element 500000 and $500 to cost element 600000.  We would prefer to see individual posting of $500, $200, $300 to 500000  and $250, $250 to 600000.
    Thanks,
    Jeff

Maybe you are looking for

  • Problem using Hotmail with Mail

    I recently installed leopard and configured a hotmail account to use with mail, but the problem is that every time I open Mail, it downloads all the emails from the account, and even if I delete them or mark them as read, the next time I open mail, t

  • Mac Book Pro Visually Deformed Battery

    Here is the another example with so called, Visually Deformed Battery. You can see it for yourself on this link. http://www.flickr.com/photos/moth3r/sets/72157622678416670/ I have already contacted Apple through Local Apple Representative in Croatia,

  • Can't Measure Broadband Usage

    I am on unlimited usage, but still like to use the Broadband monitor to measure my useage. But today on checking, I got a page which says because I'm on unlimited I can't look at my usage. Why? How can I get at the figures?

  • BAPI or FM for geting  all sales master data, header data , item data etc

    Hi experts,       In my requirement  i need a BAPI  (or) Function module for getting all "Sales information" data means header data , item data, scheduled data  etc    . Thank you, Dinesh Reddy.

  • 2.1.1 is it good or bad?

    You are bound to be dominated by problems on a Forum and so it would be useful to know if there are people working well and productively with 2.1.1. Given the preponderance of negative input I am not going to try it until I am convinced that this is