About the developemnt of the report in the alv........can any one help me..

Here is the requirement for a new Z report that lists customer addresses in an ALV display for customers with activity over a certain period. 
Use database table VBRK - the billing document header and customer master table KNA1.
1.            Selection on sales org.  VBRK-VKORG
2.            Selection on activity period based on Billing Date VBRK-FKDAT
3.            Selection on the payer customer  VBRK-KUNRG
4.            List u2013 Customer number,
                           country,
                           Name 1,
                           Name 2,
                           Street ,
                           Postal Code
                           city,
                           Region,
           PO Box,
           PO box postal code
                          last activity date ( last VBRK-FKDAT value fetched from VBRK selection )
So for each customer on the selection screen , there will be 1 record in the output.

dear friend,
i am seanding an address report for the case of vendor.
in case of vendor , vendor no. is lifnr
in case of customer, customer no. is  kunnr .
adjust this:
adrc table is responsible for the all the address.
pls go through the code and revert back.
if any problem keep in touch.
rewards are expecting.
vivek
START-OF-SELECTION.
  CALL FUNCTION 'SAPGUI_PROGRESS_INDICATOR'
    EXPORTING
      percentage = '99'
      text       = 'Processing ....'.
  PERFORM get_data.
  PERFORM process_data.
  PERFORM display_data.
*&      Form  get_data
      text
FORM get_data .
BREAK SILDEV01.
SELECT      lifnr
            NAME1
            ADRNR
            FROM lfA1
            INTO TABLE it_lfA1.
SORT it_lfA1.
SELECT      lifnr
            EKORG
            FROM lfM1
            INTO TABLE it_lfm1
            FOR ALL ENTRIES IN IT_LFA1
            WHERE LIFNR = IT_LFa1-LIFNR
            and EKORG in SALE.
SORT it_lfm1.
SELECT    addrnumber
          name1
          city1
          str_suppl1
          str_suppl2
          street
          str_suppl3
          post_code1
          country
          tel_number
          fax_number
          FROM adRC INTO TABLE it_ADRC
          FOR ALL ENTRIES IN IT_LFA1
          WHERE ADDRNUMBER = IT_LFA1-ADRNR.
  IF sy-subrc <> 0.
    MESSAGE 'No Data Available' TYPE 'S'.
  ELSE.
    SORT it_ADRC BY name1 .
    SELECT  LAND1
            landx
            from
            t005t into TABLE IT_T005T
            FOR ALL ENTRIES IN IT_ADRC
            where  land1 = IT_adrc-country
            and spras = 'EN'.
    ENDIF.
ENDFORM.                    "get_data
*&      Form  process_data
FORM process_data .
  PERFORM process_mchb_data.
  LOOP AT it_LFA1 INTO wa_LFA1.
wa_output-LIFNR             =         WA_LFA1-LIFNR.
READ TABLE it_lfM1 INTO wa_lfM1 WITH KEY lifnr = wa_LFA1-LIFNR.
   wa_output-EKORG          =         WA_LFM1-EKORG.
  READ TABLE it_ADRC INTO wa_ADRC WITH KEY ADDRNUMBER = wa_LFA1-ADRNR.
    wa_output-NAME1          =         WA_ADRC-NAME1.
    wa_output-city1          =         WA_ADRC-city1.
    wa_output-str_suppl1     =         WA_ADRC-str_suppl1.
    wa_output-str_suppl2     =         WA_ADRC-str_suppl2.
    wa_output-street         =         WA_ADRC-street.
    wa_output-str_suppl3     =         WA_ADRC-str_suppl3.
    wa_output-post_code1     =         WA_ADRC-post_code1.
    wa_output-country        =         WA_ADRC-country.
    wa_output-tel_number     =         WA_ADRC-tel_number.
    wa_output-fax_number     =         WA_ADRC-fax_number.
  READ TABLE it_T005T INTO wa_T005T WITH KEY LAND1 = wa_ADRC-COUNTRY.
    wa_output-LANDX  = wa_T005T-LANDX.
      IF wa_output-ekorg IS NOT INITIAL.
        APPEND  wa_output TO it_output.
CLEAR: wa_output,wa_LFM1, wa_lfa1 ,wa_AdRC, WA_T005T .
      ENDIF.
  ENDLOOP.
ENDFORM.                    " process_data
*&      Form  display_data
FORM display_data .
PERFORM field_cat.
  PERFORM alv_display.
ENDFORM.                    " display_data
*&      Form  process_mchb_data
FORM process_mchb_data .
ENDFORM.                    " process_mchb_data
*&      Form  field_cat
*FORM field_cat .
FORM topofpage.
  CALL FUNCTION 'REUSE_ALV_COMMENTARY_WRITE'
    EXPORTING
      it_list_commentary       = fheader[]
      i_logo                   = 'ENJOYSAP_LOGO'
     I_END_OF_LIST_GRID       = 'Hello '
ENDFORM.                    "TOPOFPAGE
*&      Form  alv_display
      text
FORM  alv_display .
  DATA: w_dthigh(20).
  fcat-fieldname = 'LIFNR'.
  fcat-outputlen = 15 .
  fcat-seltext_s = 'Vendor No.'.
  fcat-seltext_m = 'Vendor No.'.
  fcat-seltext_l = 'Vendor No.'.
  fcat-ddictxt = 'M'.
  fcat-inttype = 'C'.
  fcat-datatype = 'CHAR'.
  fcat-key = 'X'.
  APPEND fcat.
  CLEAR fcat.
  fcat-fieldname = 'NAME1'.
  fcat-outputlen = 15.
  fcat-seltext_s = 'Vendor Name'.
  fcat-seltext_m = 'Vendor Name'.
  fcat-seltext_l = 'Vendor Name'.
  fcat-ddictxt = 'M'.
  fcat-inttype = 'CHAR'.
  fcat-datatype = 'CHAR'.
  fcat-key = 'X'.
  APPEND fcat.
  CLEAR fcat.
  fcat-fieldname = 'STR_SUPPL1'.
  fcat-outputlen = 25.
  fcat-seltext_s = 'Street 1'.
  fcat-seltext_m = 'Street 1'.
  fcat-seltext_l = 'Street 1'.
  fcat-ddictxt = 'M'.
  fcat-inttype = 'C'.
  fcat-datatype = 'CHAR'.
  APPEND fcat.
  CLEAR fcat.
  fcat-fieldname = 'STR_SUPPL2'.
  fcat-outputlen = 25.
  fcat-seltext_s = 'Street 2'.
  fcat-seltext_m = 'Street 2'.
  fcat-seltext_l = 'Street 2'.
  fcat-ddictxt   = 'M'.
  fcat-inttype   = 'C'.
  fcat-datatype  = 'CHAR'.
  fcat-no_zero   = 'X' .
  APPEND fcat.
  CLEAR fcat.
  fcat-fieldname = 'STREET'.
  fcat-outputlen = 25.
  fcat-seltext_s = 'City'.
  fcat-seltext_m = 'City'.
  fcat-seltext_l = 'City'.
  fcat-ddictxt   = 'M'.
  fcat-inttype   = 'CHAR'.
  fcat-datatype  = 'CHAR'.
  fcat-no_zero   = 'X' .
  APPEND fcat.
  CLEAR fcat.
  fcat-fieldname = 'CITY1'.
  fcat-outputlen = 25.
  fcat-seltext_s = 'City1'.
  fcat-seltext_m = 'City1'.
  fcat-seltext_l = 'City1'.
  fcat-ddictxt   = 'M'.
  fcat-inttype   = 'CHAR'.
  fcat-datatype  = 'CHAR'.
  fcat-no_zero   = 'X' .
  APPEND fcat.
  CLEAR fcat.
  fcat-fieldname = 'STR_SUPPL3'.
  fcat-outputlen = 20.
  fcat-seltext_s = 'State'.
  fcat-seltext_m = 'State'.
  fcat-seltext_l = 'State'.
  fcat-ddictxt  = 'M'.
  fcat-inttype  = 'CHAR'.
  fcat-datatype = 'CHAR'.
  APPEND fcat.
  CLEAR fcat.
  fcat-fieldname = 'POST_CODE1'.
  fcat-outputlen = 10.
  fcat-seltext_s = 'Pin'.
  fcat-seltext_m = 'Pin'.
  fcat-seltext_l = 'Pin'.
  fcat-ddictxt   = 'M'.
  fcat-inttype   = 'CHAR'.
  fcat-datatype  = 'CHAR'.
  fcat-lowercase = 'X'.
  fcat-no_zero  = 'X' .
  APPEND fcat.
  CLEAR fcat.
  fcat-fieldname = 'LANDX'.
  fcat-outputlen = 20.
  fcat-seltext_s = 'Country'.
  fcat-seltext_m = 'Country'.
  fcat-seltext_l = 'Country'.
  fcat-ddictxt   = 'M'.
  fcat-inttype   = 'CHAR'.
  fcat-datatype  = 'CHAR'.
  fcat-lowercase = 'X'.
  fcat-no_zero   = 'X' .
  APPEND fcat.
  CLEAR fcat.
  fcat-fieldname = 'TEL_NUMBER'.
  fcat-outputlen = 20.
  fcat-seltext_s = 'Tele Phone No'.
  fcat-seltext_m = 'Tele Phone No'.
  fcat-seltext_l = 'Tele Phone No'.
  fcat-ddictxt   = 'M'.
  fcat-inttype   = 'CHAR'.
  fcat-datatype  = 'CHAR'.
  fcat-lowercase = 'X'.
  fcat-no_zero   = 'X' .
  APPEND fcat.
  CLEAR fcat.
  fcat-fieldname = 'FAX_NUMBER'.
  fcat-outputlen = 20.
  fcat-seltext_s = 'FAX'.
  fcat-seltext_m = 'FAX'.
  fcat-seltext_l = 'FAX'.
  fcat-ddictxt   = 'M'.
  fcat-inttype   = 'CHAR'.
  fcat-datatype  = 'CHAR'.
  fcat-lowercase = 'X'.
  fcat-no_zero   = 'X' .
  APPEND fcat.
  CLEAR fcat.
  fcat-fieldname = 'EKORG'.
  fcat-outputlen = 20.
  fcat-seltext_s = 'SALE ORG'.
  fcat-seltext_m = 'SALE ORG'.
  fcat-seltext_l = 'SALE ORG'.
  fcat-ddictxt   = 'M'.
  fcat-inttype   = 'CHAR'.
  fcat-datatype  = 'CHAR'.
  fcat-lowercase = 'X'.
  fcat-no_zero   = 'X' .
  APPEND fcat.
  fheader-typ = 'H'.
  fheader-info = 'VENDOR ADDRESS'.
  APPEND fheader.
  CLEAR fheader.
  gd_layout-no_input          = 'X'.
  gd_layout-colwidth_optimize = 'X'.
  gd_layout-totals_text       = 'Totals'(301).
  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'.
  CALL FUNCTION 'REUSE_ALV_EVENTS_GET'
    EXPORTING
      i_list_type     = 0
    IMPORTING
      et_events       = fevents[]
    EXCEPTIONS
      list_type_wrong = 1
      OTHERS          = 2.
  READ TABLE fevents WITH KEY name = 'TOP_OF_PAGE'.
  IF sy-subrc = 0.
    fevents-form = 'TOPOFPAGE'.
    MODIFY fevents INDEX sy-tabix.
    CLEAR fevents.
  ENDIF.
  rptname = sy-repid .
  CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
    EXPORTING
      i_callback_program = rptname
      it_fieldcat        = fcat[]
      i_default          = 'S'
      it_events          = fevents[]
      it_sort            = it_sortcat
      is_print           = gd_prntparams
      i_save             = 'X'
      is_layout          = gd_layout
    TABLES
      t_outtab           = it_output[].
                  EXCEPTIONS
                    PROGRAM_ERROR                     = 1
                    OTHERS                            = 2
ENDFORM .                   " alv_display .

Similar Messages

Maybe you are looking for

  • [SOLVED] Problem w/ lxdream after updating/reinstalling OS.

    Hi, Yesterday I've made update on OS and then I've got Kernel panic... So I've recovered data and reinstalled OS (it was the best option for me, because previous system was such a mess). After installing OS I've compiled by myself lxdream and after c

  • Credit card asia problem please help

    i am from philippines and i created my psn with singapore because there is no other option out there to register as a philippine based psn..my problem is i cant purchase thru ps store using my credit card because my credit card provider is from my co

  • Improving Oracle9i DB performance using IMPORT/EXPORT

    Hi, I'm experiencing wrong performance on Oracle9.2.0.6 DB for production system. I have one schema and two tablespaces: the first one for data (18 datafiles sized each 1GB), and the second one for indexes (15 datafiles sized each 1GB). I tryed to tu

  • Questions about database application tables connector

    Hi all, I need to manage with OIM several databases (each one with its custom tables). Also, one of them will be my trusted target on the initial load of users. The structure of our tables is not similar to the included in the example. The documentat

  • 6.1.2 and still wifi signal problem

    I bought iphone 5 yesterday in London.I update my iphone to 6.1.2 and i saw a problem.My wifi signal is too weak and its drops the connections few time later.I restore my phone but still same.What can i do for this problem.Is it a hardware problem ?