Display ALV List in Object Oriented Method

Dear Guru ,
I have encountered an issue which i am trying to resolve
I am using following custom code to display lists of the entries of  <F_FS>  in ALV GRID FORMAT
For display data in ALV GRID FORMAT i am using class cl_gui_alv_grid.
But the requirment is like this i have to show it in ALV LIST Display Format .
when i searched for class cl_gui_alv_list i found that Object Type CL_GUI_ALV_LIST does not exist
Please show me some guide line how to achieve this .....
DATA : gt_cust TYPE REF TO cl_gui_custom_container. "Custom Container
  DATA : cust TYPE scrfname VALUE 'CC_OUTPUT'. "Custom controller
  DATA : gt_grid TYPE REF TO cl_gui_alv_grid. "ALV List Viewer
  FIELD-SYMBOLS : <f_fs> TYPE table. "FieldSymbol for holding fields
  DATA  : t_cat     TYPE STANDARD TABLE OF lvc_s_fcat INITIAL SIZE 0."To hold Field Catalog
  IF gt_cust IS INITIAL.
    CREATE OBJECT gt_cust
      EXPORTING
        container_name = cust.
    CREATE OBJECT gt_grid
      EXPORTING
        i_parent = gt_cust.
**--Display the data in the grid control
    CALL METHOD gt_grid->set_table_for_first_display
    EXPORTING
        i_buffer_active       = 'X'
        i_bypassing_buffer    = ' '
    CHANGING
        it_outtab = <f_fs>
        it_fieldcatalog = t_cat
    EXCEPTIONS
        invalid_parameter_combination = 1
        program_error = 2
        too_many_lines = 3
    OTHERS = 4    .
    IF sy-subrc <> 0.
    ENDIF.
  ENDIF.

RECL_SALV_TABLE,     
CL_SALV_COLUMNS_TABLE,
CL_SALV_COLUMN_TABLE,

Similar Messages

  • Need class name to display ALV list (not Grid) in objects..

    hi,
    i need to display ALV list ( not ALV Grid ) in objects.. i dont the class name for tat.. so plz can anyone help me out for the same..
    thanks in advance..

    With cl_salv_table you can have both grid or list, depending what you want.
          cl_salv_table=>factory(
             EXPORTING
               list_display   = 'X'  "when space then GRID, when 'X' then LIST
             IMPORTING
               r_salv_table  = ref_table
             CHANGING
               t_table       = gt_sflight ).
    Regards
    Marcin

  • Can anyone give me document to devlop alv report  in object oriented

    hi
    hi i want document how to devlope alv report in object oriented.
    i need document .
    thanks .

    HI,
    Check these programs and links.
    OOPS ALV standard pgms
    BCALV_EDIT_01
    BCALV_EDIT_02
    BCALV_EDIT_03
    BCALV_EDIT_04
    BCALV_EDIT_05
    BCALV_EDIT_06
    BCALV_EDIT_07
    BCALV_EDIT_08
    ABAP_OBJECTS_ENJOY_0 Template for Solutions of ABAP Object Enjoy Course
    ABAP_OBJECTS_ENJOY_1 Model Solution 1: ABAP Objects Enjoy Course
    ABAP_OBJECTS_ENJOY_2 Model Solution 2: ABAP Objects Enjoy Course
    ABAP_OBJECTS_ENJOY_3 Model Solution 3: ABAP Objects Enjoy Course
    ABAP_OBJECTS_ENJOY_4 Model Solution 4: ABAP Objects Enjoy Course
    ABAP_OBJECTS_ENJOY_5 Model Solution 5: ABAP Objects Enjoy Course
    DEMO_ABAP_OBJECTS Complete Demonstration for ABAP Objects
    DEMO_ABAP_OBJECTS_CONTROLS GUI Controls on Screen
    DEMO_ABAP_OBJECTS_EVENTS Demonstration of Events in ABAP Objects
    DEMO_ABAP_OBJECTS_GENERAL ABAP Objects Demonstration
    DEMO_ABAP_OBJECTS_INTERFACES Demonstration of Interfaces in ABAP Objects
    DEMO_ABAP_OBJECTS_METHODS Demonstration of Methods in ABAP Objects
    DEMO_ABAP_OBJECTS_SPLIT_SCREEN Splitter Control on Screen
    some helful links.
    Go through the below links,
    For Materials:
    1) http://help.sap.com/printdocu/core/Print46c/en/data/pdf/BCABA/BCABA.pdf -- Page no: 1291
    2) http://esnips.com/doc/5c65b0dd-eddf-4512-8e32-ecd26735f0f2/prefinalppt.ppt
    3) http://esnips.com/doc/2c76dc57-e74a-4539-a20e-29383317e804/OO-abap.pdf
    4) http://esnips.com/doc/0ef39d4b-586a-4637-abbb-e4f69d2d9307/SAP-CONTROLS-WORKSHOP.pdf
    5) http://esnips.com/doc/92be4457-1b6e-4061-92e5-8e4b3a6e3239/Object-Oriented-ABAP.ppt
    6) http://esnips.com/doc/448e8302-68b1-4046-9fef-8fa8808caee0/abap-objects-by-helen.pdf
    7) http://esnips.com/doc/39fdc647-1aed-4b40-a476-4d3042b6ec28/class_builder.ppt
    8) http://www.amazon.com/gp/explorer/0201750805/2/ref=pd_lpo_ase/102-9378020-8749710?ie=UTF8
    1) http://www.erpgenie.com/sap/abap/OO/index.htm
    2) http://help.sap.com/saphelp_nw04/helpdata/en/ce/b518b6513611d194a50000e8353423/frameset.htm
    Regards
    Sudheer

  • What are object oriented methods?

    i dont seem to understand the term object oriented methods. i know that it is a technology which encompasses a body of methods,processes, and tools used to construct software systems from obejcts. i know that i provides a unifying paradigm for the three traditional phases of software development: analysis,design and implementation. so how do i get more information on this. i mean this is very limited information i have on my hands. how do i explain in detail about the major features of object oriented methods and their major benefits. is there a place where i can find out about it? please help me out?

    Object-Oriented Programming Concepts
    Object-oriented language basics
    Don't Fear the OOP

  • Explain an object-oriented method for a conversion between the E/R diagram

    Somebody can explain me with an example an object-oriented method for a conversion between the E/R diagram and a relational database schema.
    Thanks,

    Hello here are some tips regarding how to convert ERD into Relational objects.
    (1) One to many relationships:
    One to many relationships can be explained by following example.
    Take example of department and Employee. One employee can work in one department only but one department can have more then one employees. In one to many relationship Primary key of One side (here department table) goes to Many side as foreign key (here Employee table).
    (2) Many to Many relationships:
    Many to many relationships can be explained by following example.
    One student can take many subjects and one subject can be taken by more then one student.
    In this case one new table emerges which includes Primary keys of both the tables and establish composite primary key. e.g. here if PK of student is student_id and Pk of course is course_id then new table will emerge named (say) student_course with composite primary key of student_id and course_id (student_id and course_id are also foreign keys)
    (3) One to One:
    Example: A person can have only one tax file number and one tax file number can be allocated to only one person. In this case PK of any table can go to another table as foreign key.
    (4) Super class-sub class relationship:
    Example: person can be a man or woman. Such kinds of relationships are called super class- sub class relationship. There are many ways to convert such relationship into tables
    we can make one table for super class (eg Table Person) and we can put PK of super class in subclass as primary key (eg if person_id is pk of table person then it will go in both sub classes (man, woman) as Pk and it will also be foreign key of the super class (person)
    Note: This is just a way to solve super class relationships there are many other ways which you can choose.
    Thanks
    Ish

  • How to display ALV list with more than 1 structure?

    Hello everyone,
    I am using REUSE_ALV_LIST_DISPLAY to generate a report that displays vendor/customer items with purchases/sales total. I have 2 internal table for this. For every vendor/customer i need a total table right after, this have a different structure. I cannot use REUSE_ALV_BLOCK_LIST_ as this is not capable of calculating the subtotal per currency and from the documentation it says do not use.
    Any idea on how to proceed?
    Thanks!

    Call ALV list function module per table structure.
    Closing this thread.

  • HTTP post from ABAP using Object Oriented method

    Hi ,
    I want to call HTTP from ABAP. I came to know that using classes & objects is the best way to fulfill it.
    Interface:
    xml_document type ref to cl_xml_document
    method post_xml_document.
    data: client type ref to if_http_client,
    xml_response type ref to cl_xml_document.
    data: xml_string type string,
    xml_xstring type xstring.
    data: zsubrc type sy-subrc.
    cl_http_client=>create_by_url( exporting url = 'http://www.example.com/post-url.xml' importing client = client exceptions others = 1 ).
    client->request->set_header_field( exporting name = '~request_method' value = 'POST' ).
    client->request->set_header_field( exporting name = '~server_protocol' value = 'HTTP/1.1' ).
    client->request->set_header_field( exporting name = 'Content-Type' value = 'text/xml' ).
    xml_document->render_2_string( exporting pretty_print = 'X' importing stream = xml_string ).
    client->request->set_cdata( exporting data = xml_string offset = 0 ).
    client->authenticate( exporting proxy_authentication = space username = 'username' password = 'password' ).
    client->send( exceptions http_communication_failure = 1 http_invalid_state = 2 ).
    client->receive( exceptions http_communication_failure = 1 http_invalid_state = 2 http_processing_failed = 3 ).
    xml_xstring = client->response->get_data( ).
    zsubrc = xml_response->parse_xstring( stream = xml_xstring ).
    endmethod.
    Above code can be used to do my work.
    Apart from the code in ABAP, what are the configurational setting that we need to do ?
    Thanks,
    Shivaa..

    >
    mohammad afzal wrote:
    > apart from usin the code u should have configured the RFC destination
    Thats nonsense, create_by_url does not need an rfc connection. TA SICF is correct.

  • ALV grid using Object oriented programming

    Hi,
    I need to display a report with 14 fields of which some fields need sub totals and some fields need average values and some other fields require both subtotals and totals. But if I need only the subtotals. I'm not able to find a way for doing so. Please help.
    Thanks and regards
    Radhika

    You will have to specify DO_SUM = X for the fields which you want to totalled or sub-totalled and set DO_SUM = C for getting the average of the field. This needs to be done in the field catalog.
    Also, specify the SORT criteria for the doing the sub-totals in the IT_SORT table, of the SET_TABLE method or the user can do that himself in the report.
    Regards,
    Ravi
    Note - Please mark all the helpful answers

  • Display ALV list output in PDF format

    Hi All,
    My requirement is :
    I am displaying output using Function module 'REUSE_ALV_LIST_DISPLAY'. then i will click one button which placed in application tool bar say 'Download to PDF' when i click this button it will display the output in PDF format. I tried with exsting threads but i unable to get suitable solution.Anybody can send me the sample code please.
    Thanks in advance.
    Maheedhar

    please go throuh the below procedure and sample Code, this might help you.
    Procedure
    When we activate the Smartform the system generates a Function Module. The function module name we can get from Smartfrom screen from menubar
    “Environment => Function Module_Name” . In a report we can get this Function module name by calling a Function Module standard SSF_FUNCTION_MODULE_NAME. This function module at runtime calls the FM generated by smartform, which in turn is then used to pass data from the report to Smartform. In the report given below the FM generated is “ /1BCDWB/SF00000152 ”. In this FM we can see CONTROL_PARAMETERS in import tab. This is of type SSFCTRLOP. We need to set the GETOTF of this to be ‘X’. Setting this field will activate the OTF field in smartform.
    In export tab of the FM generated by smartform we can see a parameter JOB_OUTPUT_INFO which is of type SSFCRESCL. The SSFCRESCL is a structure of having one of fields as OTFDATA. OTFDATA in turn is a table of type ITCOO. ITCOO has two fields TDPRINTCOM and TDPRINTPAR. TDPRINTCOM represents command line of OTF format data and TDPRINTPAR contains command parameters of OTF format data.
    In every Smartform output in OTF format, TDPRINTCOM begins and ends with ‘//’. ‘EP’ represents the end-of-page value for TDPRINTCOM field.
    In addition we need to set few fields at the place where we call this FM(generated by smartform) in our program. While calling this FM we should set control_parameters, output_options, user_settings and job_putput_info fields as shown in program.
    Once these settings are done we can call Function Module CONVERT_OTF to convert the OTF data of smartfrom output to PDF data format. Once these are done we can call method “cl_gui_fronted_services=>file_save_dialog” to specify the directory path where we want to save the output PDF file. After this we can call Function Module GUI_DOWNLOAD to download the PDF file on our local system.
    Here is a sample code of program to perform the function.
    SAMPLE CODE
    *& Report ZAMIT_SMART_FORM_PDF *
    REPORT ZAMIT_SMART_FORM_PDF .
    data: carr_id type sbook-carrid,
    cparam type ssfctrlop,
    outop type ssfcompop,
    fm_name type rs38l_fnam.
    DATA: tab_otf_data TYPE ssfcrescl,
    pdf_tab LIKE tline OCCURS 0 WITH HEADER LINE,
    tab_otf_final TYPE itcoo OCCURS 0 WITH HEADER LINE,
    file_size TYPE i,
    bin_filesize TYPE i,
    FILE_NAME type string,
    File_path type string,
    FULL_PATH type string.
    parameter: p_custid type scustom-id default 1.
    select-options: s_carrid for carr_id default 'LH' to 'LH'.
    parameter: p_form type tdsfname default 'ZAMIT_SMART_FORM'.
    data: customer type scustom,
    bookings type ty_bookings,
    connections type ty_connections.
    start-of-selection.
    suppressing the dialog box for print preview****************************
    outop-tddest = 'LP01'.
    cparam-no_dialog = 'X'.
    cparam-preview = SPACE.
    cparam-getotf = 'X'.
    select single * from scustom into customer where id = p_custid.
    check sy-subrc = 0.
    select * from sbook into table bookings
    where customid = p_custid
    and carrid in s_carrid
    order by primary key.
    select * from spfli into table connections
    for all entries in bookings
    where carrid = bookings-carrid
    and connid = bookings-connid
    order by primary key.
    call function 'SSF_FUNCTION_MODULE_NAME'
    exporting formname = p_form
    variant = ' '
    direct_call = ' '
    importing fm_name = fm_name
    exceptions no_form = 1
    no_function_module = 2
    others = 3.
    if sy-subrc 0.
    message id sy-msgid type sy-msgty number sy-msgno
    with sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
    exit.
    endif.
    calling the generated function module
    call function fm_name
    exporting
    archive_index =
    archive_parameters =
    control_parameters = cparam
    mail_appl_obj =
    mail_recipient =
    mail_sender =
    output_options = outop
    user_settings = SPACE
    bookings = bookings
    customer = customer
    connections = connections
    importing
    document_output_info =
    job_output_info = tab_otf_data
    job_output_options =
    exceptions formatting_error = 1
    internal_error = 2
    send_error = 3
    user_canceled = 4
    others = 5.
    if sy-subrc 0.
    error handling
    message id sy-msgid type sy-msgty number sy-msgno
    with sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
    endif.
    tab_otf_final] = tab_otf_data-otfdata[.
    CALL FUNCTION 'CONVERT_OTF'
    EXPORTING
    format = 'PDF'
    max_linewidth = 132
    ARCHIVE_INDEX = ' '
    COPYNUMBER = 0
    ASCII_BIDI_VIS2LOG = ' '
    IMPORTING
    bin_filesize = bin_filesize
    BIN_FILE =
    TABLES
    otf = tab_otf_final
    lines = pdf_tab
    EXCEPTIONS
    err_max_linewidth = 1
    err_format = 2
    err_conv_not_possible = 3
    err_bad_otf = 4
    OTHERS = 5
    IF sy-subrc 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
    WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    ENDIF.
    CALL METHOD cl_gui_frontend_services=>file_save_dialog
    EXPORTING
    WINDOW_TITLE =
    DEFAULT_EXTENSION =
    DEFAULT_FILE_NAME =
    FILE_FILTER =
    INITIAL_DIRECTORY =
    WITH_ENCODING =
    PROMPT_ON_OVERWRITE = 'X'
    CHANGING
    filename = FILE_NAME
    path = FILE_PATH
    fullpath = FULL_PATH
    USER_ACTION =
    FILE_ENCODING =
    EXCEPTIONS
    CNTL_ERROR = 1
    ERROR_NO_GUI = 2
    NOT_SUPPORTED_BY_GUI = 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.
    ************downloading the converted PDF data to your local PC*******
    CALL FUNCTION 'GUI_DOWNLOAD'
    EXPORTING
    bin_filesize = bin_filesize
    filename = FULL_PATH
    filetype = 'BIN'
    APPEND = ' '
    WRITE_FIELD_SEPARATOR = ' '
    HEADER = '00'
    TRUNC_TRAILING_BLANKS = ' '
    WRITE_LF = 'X'
    COL_SELECT = ' '
    COL_SELECT_MASK = ' '
    DAT_MODE = ' '
    CONFIRM_OVERWRITE = ' '
    NO_AUTH_CHECK = ' '
    CODEPAGE = ' '
    IGNORE_CERR = ABAP_TRUE
    REPLACEMENT = '#'
    WRITE_BOM = ' '
    TRUNC_TRAILING_BLANKS_EOL = 'X'
    IMPORTING
    filelength = file_size
    TABLES
    data_tab = pdf_tab
    FIELDNAMES =
    EXCEPTIONS
    file_write_error = 1
    no_batch = 2
    gui_refuse_filetransfer = 3
    invalid_type = 4
    no_authority = 5
    unknown_error = 6
    header_not_allowed = 7
    separator_not_allowed = 8
    filesize_not_allowed = 9
    header_too_long = 10
    dp_error_create = 11
    dp_error_send = 12
    dp_error_write = 13
    unknown_dp_error = 14
    access_denied = 15
    dp_out_of_memory = 16
    disk_full = 17
    dp_timeout = 18
    file_not_found = 19
    dataprovider_exception = 20
    control_flush_error = 21
    OTHERS = 22
    IF sy-subrc 0.
    ENDIF.
    Check this link it will help you.
    https://forums.sdn.sap.com/click.jspa?searchID=5950895&messageID=2375150
    Reward points if useful.

  • Can we display ICONS in ALV list?

    Hi,
       Is it possible to display icons (ICON_GREEN_LIGHT) in the ALV list using the function module REUSE_ALV_LIST_DISPLAY.
       Is there any possibility of displaying a list using object oriented ALV?
    Thanks and Regards,
    Lakshmi.

    Hi Lakshmi,
    Just check this once.
    REPORT  Zxxx  MESSAGE-ID ZZ                       .
    *& TABLES DECLARATION                                                  *
    TABLES: VBAK.
    *& TYPE POOLS DECLARATION                                              *
    TYPE-POOLS: SLIS.
    *& INTERNAL TABLE DECLARATION                                          *
    DATA: BEGIN OF ITAB OCCURS 0,
           ICON TYPE ICON-ID,
           VBELN LIKE VBAK-VBELN,
           AUDAT LIKE VBAK-AUDAT,
           VBTYP LIKE VBAK-VBTYP,
           AUART LIKE VBAK-AUART,
           AUGRU LIKE VBAK-AUGRU,
           NETWR LIKE VBAK-NETWR,
           WAERK LIKE VBAK-WAERK,
        END OF ITAB.
    *INTERNAL TABLE FOR FIELD CATALOG
    DATA: WA_FIELDCAT TYPE SLIS_FIELDCAT_ALV,
        IT_FIELDCAT TYPE SLIS_T_FIELDCAT_ALV.
    IT_FIELDCAT TYPE STANDARD TABLE OF SLIS_FIELDCAT_ALV
               WITH HEADER LINE,
    *INTERNAL TABLE FOR EVENTS
    DATA:    IT_EVENT TYPE SLIS_T_EVENT,
          WA_EVENT TYPE SLIS_ALV_EVENT,
    *INTERNAL TABLE FOR SORTING
          IT_SORT TYPE SLIS_T_SORTINFO_ALV,
          WA_SORT TYPE SLIS_SORTINFO_ALV,
    *INTERNAL TABLE FOR LAYOUT
          WA_LAYOUT TYPE SLIS_LAYOUT_ALV.
    *& VARIABLE DECLARATION                                                *
    DATA : V_REPID TYPE SY-REPID,
           V_PAGNO(4) TYPE N,
           V_DATE(8)  TYPE C.
    *& CONSTANTS                                                           *
    CONSTANTS: C_X TYPE C VALUE 'X'.
    *& SELECTION SCREEN                                                    *
    SELECTION-SCREEN: BEGIN OF BLOCK B1 WITH FRAME TITLE TEXT-001.
    SELECT-OPTIONS: S_VBELN FOR VBAK-VBELN,
                    S_VBTYP FOR VBAK-VBTYP DEFAULT 'C'.
    SELECTION-SCREEN: END OF BLOCK B1.
    SELECTION-SCREEN: BEGIN OF BLOCK B2 WITH FRAME TITLE TEXT-002.
    SELECTION-SCREEN : BEGIN OF LINE.
    SELECTION-SCREEN  COMMENT 1(20) TEXT-003.
    PARAMETERS: P_LIST RADIOBUTTON GROUP RAD1 DEFAULT 'X'.
    SELECTION-SCREEN : END OF LINE.
    SELECTION-SCREEN : BEGIN OF LINE.
    SELECTION-SCREEN COMMENT 1(20) TEXT-004.
    PARAMETERS: P_GRID RADIOBUTTON GROUP RAD1.
    SELECTION-SCREEN : END OF LINE.
    SELECTION-SCREEN: END OF BLOCK B2.
    AT SELECTION-SCREEN.
      PERFORM VALIDATE_SCREEN.
    *& START OF SELECTION                                               *
    START-OF-SELECTION.
      CLEAR: ITAB, ITAB[].
    V_REPID = SY-REPID.
      PERFORM GET_DATA.
      PERFORM DISPLAY_DATA.
    *& END OF SELECTION                                                    *
    END-OF-SELECTION.
    *--DO ALV Process
      V_REPID = SY-REPID.
    *--Sort the Output Fields
      PERFORM SORT_FIELDS.
    *--Build Field catalog for the Output fields
    PERFORM BUILD_FIELDCAT.
    *--Set the Layout for ALV
      PERFORM SET_LAYOUT.
    *&      Form  GET_DATA
          text
    TO GET THE DATA FROM TABLES INTO ITAB
    FORM GET_DATA .
      SELECT VBELN
             AUDAT
             VBTYP
             AUART
             AUGRU
             NETWR
             WAERK
             INTO CORRESPONDING FIELDS OF TABLE ITAB
             FROM VBAK
             WHERE VBELN IN S_VBELN AND
             AUDAT > '04.04.2005'
             AND NETWR > 0.
      LOOP AT ITAB.
        IF ITAB-NETWR < 10000.
          ITAB-ICON = '@08@'.
        ELSEIF ITAB-NETWR > 10000 AND ITAB-NETWR < 100000.
          ITAB-ICON = '@09@'.
        ELSEIF ITAB-NETWR > 100000.
          ITAB-ICON = '@0A@'.
        ENDIF.
        MODIFY ITAB INDEX SY-TABIX.
      ENDLOOP.
    ENDFORM.                    " GET_DATA
    *&      Form  sort_fields
    FORM SORT_FIELDS .
      CLEAR WA_SORT.
      WA_SORT-FIELDNAME = 'VBTYP'.
      WA_SORT-SPOS = '1'.
      WA_SORT-UP = 'X'.
      APPEND WA_SORT TO IT_SORT.
      CLEAR WA_SORT.
      WA_SORT-FIELDNAME = 'NETWR'.
      WA_SORT-SPOS = '2'.
      WA_SORT-UP = 'X'.
      WA_SORT-SUBTOT = 'X'.
      APPEND WA_SORT TO IT_SORT.
    ENDFORM.                    " sort_fields
    *&      Form  build_fieldcat
    *FORM BUILD_FIELDCAT .
    IT_FIELDCAT-COL_POS    = '1'.
    IT_FIELDCAT-FIELDNAME  = 'ICON'.
    IT_FIELDCAT-KEY        = 'X'.
    IT_FIELDCAT-OUTPUTLEN  = '10'.
    IT_FIELDCAT-SELTEXT_L  = 'LIGHT'.
    APPEND IT_FIELDCAT.
    CLEAR  IT_FIELDCAT.
    IT_FIELDCAT-COL_POS    = '2'.
    IT_FIELDCAT-FIELDNAME  = 'VBELN'.
    IT_FIELDCAT-KEY        = 'X'.
    IT_FIELDCAT-OUTPUTLEN  = '10'.
    IT_FIELDCAT-SELTEXT_L  = 'SALES DOC NUMBER'(009).
    APPEND IT_FIELDCAT.
    CLEAR  IT_FIELDCAT.
    IT_FIELDCAT-COL_POS    = '3'.
    IT_FIELDCAT-FIELDNAME  = 'AUDAT'.
    IT_FIELDCAT-KEY        = 'X'.
    IT_FIELDCAT-OUTPUTLEN  = '4'.
    IT_FIELDCAT-SELTEXT_L  = 'DOCUMENT DATE'(010).
    APPEND IT_FIELDCAT.
    CLEAR  IT_FIELDCAT.
    IT_FIELDCAT-COL_POS    = '4'.
    IT_FIELDCAT-FIELDNAME  = 'VBTYP'.
    IT_FIELDCAT-KEY        = 'X'.
    IT_FIELDCAT-OUTPUTLEN  = '4'.
    IT_FIELDCAT-SELTEXT_L  = 'CATEGORY'(011).
    APPEND IT_FIELDCAT.
    CLEAR  IT_FIELDCAT.
    IT_FIELDCAT-COL_POS    = '5'.
    IT_FIELDCAT-FIELDNAME  = 'AUART'.
    IT_FIELDCAT-OUTPUTLEN  = '4'.
    IT_FIELDCAT-SELTEXT_L  = 'DOCUMENT TYPE'(012).
    APPEND IT_FIELDCAT.
    CLEAR  IT_FIELDCAT.
    IT_FIELDCAT-COL_POS    = '6'.
    IT_FIELDCAT-FIELDNAME  = 'AUGRU'.
    IT_FIELDCAT-OUTPUTLEN  = '12'.
    IT_FIELDCAT-SELTEXT_L  = 'Order reason'(013).
    APPEND IT_FIELDCAT.
    CLEAR  IT_FIELDCAT.
    IT_FIELDCAT-COL_POS    = '7'.
    IT_FIELDCAT-FIELDNAME  = 'NETWR'.
    IT_FIELDCAT-OUTPUTLEN  = '12'.
    IT_FIELDCAT-SELTEXT_L  = 'NET VALUE'(014).
    APPEND IT_FIELDCAT.
    CLEAR  IT_FIELDCAT.
    IT_FIELDCAT-COL_POS    = '8'.
    IT_FIELDCAT-FIELDNAME  = 'WAERK'.
    IT_FIELDCAT-OUTPUTLEN  = '12'.
    IT_FIELDCAT-SELTEXT_L  = 'SD DOC CURR'(015).
    APPEND IT_FIELDCAT.
    CLEAR  IT_FIELDCAT.
    *ENDFORM.                    " build_fieldcat
    *&      Form  set_layout
    FORM SET_LAYOUT .
      IF P_LIST = C_X .
        WA_LAYOUT-WINDOW_TITLEBAR = 'LIST DISPLAY'(016).
        WA_LAYOUT-ZEBRA = 'X'.
    *-- ALV LIST DISPLAY
        PERFORM LIST_DISPLAY TABLES ITAB.
    *-- ALV GRID DISPLAY
      ELSEIF P_GRID = C_X.
        WA_LAYOUT-WINDOW_TITLEBAR = 'GRID DISPLAY'(017).
        WA_LAYOUT-ZEBRA = 'X'.
        PERFORM GRID_DISPLAY TABLES ITAB.
      ENDIF.
    ENDFORM.                    " set_layout
    *&      Form  list_display
    FORM LIST_DISPLAY  TABLES   P_ITAB .
      CALL FUNCTION 'REUSE_ALV_LIST_DISPLAY'
        EXPORTING
          I_CALLBACK_PROGRAM = V_REPID
          IS_LAYOUT          = WA_LAYOUT
          IT_FIELDCAT        = IT_FIELDCAT[]
          IT_SORT            = IT_SORT[]
          I_SAVE             = 'U'
        TABLES
          T_OUTTAB           = ITAB
        EXCEPTIONS
          PROGRAM_ERROR      = 1
          OTHERS             = 2.
      IF SY-SUBRC <> 0.
        MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
                WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
      ENDIF.
    ENDFORM.                    " list_display
    *&      Form  GRID_DISPLAY
    FORM GRID_DISPLAY  TABLES   P_ITAB .
      CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
        EXPORTING
          I_CALLBACK_PROGRAM = V_REPID
          IS_LAYOUT          = WA_LAYOUT
          IT_FIELDCAT        = IT_FIELDCAT[]
          IT_SORT            = IT_SORT[]
          IT_EVENTS          = IT_EVENT
        TABLES
          T_OUTTAB           = ITAB
        EXCEPTIONS
          PROGRAM_ERROR      = 1
          OTHERS             = 2.
      IF SY-SUBRC <> 0.
        MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
                WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
      ENDIF.
    ENDFORM.                    " GRID_DISPLAY
    *&      Form  VALIDATE_SCREEN
          text
    -->  p1        text
    <--  p2        text
    FORM VALIDATE_SCREEN .
      DATA: LV_VBELN LIKE VBAK-VBELN.
      IF NOT S_VBELN IS INITIAL.
        SELECT VBELN
        INTO LV_VBELN
        UP TO 1 ROWS
        FROM VBAK
        WHERE VBELN IN S_VBELN.
        ENDSELECT.
        IF SY-SUBRC <> 0.
          MESSAGE E000 WITH 'INVALID SALES DOC'.
        ENDIF.
      ENDIF.
    ENDFORM.                    " VALIDATE_SCREEN
    *&      Form  display_data
          text
    -->  p1        text
    <--  p2        text
    FORM DISPLAY_DATA .
      DEFINE M_FIELDCAT.
        ADD 1 TO WA_FIELDCAT-COL_POS.
        WA_FIELDCAT-FIELDNAME   = &1.
        WA_FIELDCAT-REF_TABNAME = 'VBAK'.
        WA_FIELDCAT-DO_SUM      = &2.
        WA_FIELDCAT-CFIELDNAME  = &3.
        APPEND WA_FIELDCAT TO IT_FIELDCAT.
      END-OF-DEFINITION.
    DATA:
        ls_fieldcat TYPE slis_fieldcat_alv,
        lt_fieldcat TYPE slis_t_fieldcat_alv.
      m_fieldcat 'ICON' ''  ''.
      m_fieldcat 'VBELN' ''  ''.
      m_fieldcat 'AUDAT' ''  ''.
      m_fieldcat 'VBTYP' ''  ''.
      m_fieldcat 'AUART' ''  ''.
      m_fieldcat 'AUGRU' ''  ''.
      m_fieldcat 'NETWR' 'C' 'WAERK'.
      m_fieldcat 'WAERK' ''  ''.
    ENDFORM.                    " display_data
    hope it helps u
    regards
    laxmi

  • Is it Possible to display the output of the ALV list as POP-UP

    Hi Experts,
                     Is it Possible to display the output of the ALV list as POP-UP, if yes then provide some ideas on it.
    thanking in advance,
    Samad.

    Hi samad, it is possible to display alv list as pop-up by using the FM " REUSE_ALV_POPUP_TO_SELECT"
    try this sample code
    CALL FUNCTION 'REUSE_ALV_POPUP_TO_SELECT'
          EXPORTING
       I_TITLE                       =  P1_TITLE
           I_SELECTION                   = 'X'
           I_ZEBRA                       = 'X'
      I_CHECKBOX_FIELDNAME          =
      I_LINEMARK_FIELDNAME          =
      I_SCROLL_TO_SEL_LINE          = 'X'
            I_TABNAME                     = 'T_VBAP'
           I_STRUCTURE_NAME              =  'T_VBAP'
           IT_FIELDCAT                   =  T_FCAT2
           I_CALLBACK_PROGRAM            = 'ZTEST_ALV_POPUP'
       IMPORTING
           ES_SELFIELD                   = I_SELFIELD
           E_EXIT                        = W_EXIT
          TABLES
            T_OUTTAB                      = T_VBAP.
    i think it will solve your problem
    Regards,
    Vijay

  • Object Oriented Vs Function modules

    Anyone have the list of function modules with corresponding object oriented methods (classes)??
    any link for source of information?

    Not all function modules have their equivalent OO methods.
    Anyway why not you do some research and present us with the list?
    Read the [Forum Rules|http://wiki.sdn.sap.com/wiki/x/FgQ] before posting more.
    Regards
    Karthik D

  • From ALV list to Selection-screen

    Hi,
    I have problem in coming back to selection screen after displaying ALV List.
    In ALV list i'm using check box option to delete selected records. After deletion I'm displaying the remaining records with one more call to ALV function module.
    As this is not a secondary list i'm not able to use SY-LSIND and even call selection-screen or leave to screen 0 are not working.
    could you please help me out.
    Thanks,
    Vinay.

    Hi
      You don't have to show the remaining records in another ALV.
      In the user command sub-routine we will be passing the parameter RS_SELFIELD TYPE SLIS_SELFIELD.
      When you delete the rows from the internal table in the user command set the refresh field to on.
      RS_SELFIELD-REFRESH = 'X'.
      Please let me know if it works.
    Thanks,
    Naren

  • Time field in alv list

    Hi all ,
    i want to display alv list with time field . if no data exists in that field its showing 00:00:00 , i have to show it blank. if i change time field as type c in my internal table its showing like this 121314, i need to display it 12:13:14 . if no data it should display balnk . can any one help me out to reslove this issue?

    Hi priya,
    do this:
    declare in your itab a field like sy-uzeit.
    as example.
    move sy-uzeit to itab-uzeit.
    In fieldcat do this:
        MOVE  'X'                        TO   WA_FIELDCAT-NO_ZERO.
    Hope it helps.
    regards, Dieter

  • How to convert the alv list data into pdf format

    Hi Expersts,
                      Is it possible to convert the alv list output data into PDF format? if yes, then please help me with this issue.
    thanks in advance,
    Regards,
    Samad

    hii samad,
    you can go through these link.i hope it ll solve your purpose
    How to convert list output to PDF
    Display ALV list output in PDF format
    regards,
    Shweta

Maybe you are looking for