Headings in the output data

i am using dynamic field catalog in one if the report.
in the selection screen i have MONTH/YEAR AS SELECT OPTION.IF I ENTER 200801 FROM THERE TO TILL
SYDATUM DATA WILL DISPLAY SO I CANNT DECIDE how many month/year columns will come depends on selection
criteria.
i am getting  all the data into final internal table lt_final as below .
MONTH/YEAR BUKRS BELNR  GJAHR WRBTR
JAN/2008    1001  3456   2008   100
FEB/2008    1001  3456   2008   200
MAR/2008    1001  3456   2008   300
THE output should be as
BUKRS BELNR   GJAHR   JAN/2008    FEB/2008    MAR/2008
1001    3456   2008    100          200         300
BUT NOW i am getting the output as
BUKRS BELNR   GJAHR
1001    3456   2008    100          200         300
the headings JAN/2008    FEB/2008    MAR/2008 not getting displayyed.
the headings are dynamically created.
please see below my code
LOOP AT lt_final.
l_index = l_index + sytabix.
     ASSIGN COMPONENT 'BUKRS' OF STRUCTURE <f_line> TO <f_field>.
    <f_field> = lt_final-bukrs.
     ASSIGN COMPONENT 'belnr' OF STRUCTURE <f_line> TO <f_field>.
    <f_field> = lt_final-belnr.
     ASSIGN COMPONENT 'gjahr' OF STRUCTURE <f_line> TO <f_field>.
    <f_field> = lt_final-gjahr.
     ASSIGN COMPONENT l_index OF STRUCTURE <f_line> TO <f_field>.
    <f_field> = lt_final-wrbtr.
INSERT <f_line> INTO  TABLE <f_tab>.
ENDLOOP.
DATA: lo_alv TYPE REF TO cl_salv_table.
TRY.
  cl_salv_table=>factory(
  EXPORTING
    list_display = abap_false
    IMPORTING
      r_salv_table = lo_alv
      CHANGING
        t_table      = <f_tab> ).
  CATCH cx_salv_msg .
    ENDTRY.
please let me know how to get MONTH/YEAR HEADINGS in output data.

Hi,
You are creating dynamic filed cat,
so pass the data
if it is dynamic, loop the internal table which contains the date
for ex:
SORT IT_TAB BY LIFNR.
  LOOP AT IT_TAB INTO WA_TAB.
    ON CHANGE OF WA_TAB-LIFNR.
      LS_LVC_CAT-FIELDNAME = WA_TAB-LIFNR.
      LS_LVC_CAT-TABNAME  =  'LFA1'.
      LS_LVC_CAT-REPTEXT  = WA_TAB-LIFNR.
      LS_LVC_CAT-NO_ZERO = 'X'.
      LS_LVC_CAT-JUST    = 'R'.
      LS_LVC_CAT-OUTPUTLEN = '35'.
      APPEND LS_LVC_CAT TO LT_LVC_CAT.
      CLEAR LS_LVC_CAT.
    ENDON.
  ENDLOOP.
Edited by: Aeda N on Nov 17, 2009 8:33 AM

Similar Messages

  • How to get the output data of Standard drill down report into z-program?

    HI every one,
            I want to get the output data of drill down report into z-program.
           Actually,if the output is only one, I can get into z-program,
          But, Here the report consists 3 alv outputs. when double clicking function happens, it will direct to another alv output.
        Those, all the outputs of report i want to get into z-program.
    PLease , give reply as early as possible.
    Thank u in advance,
    karthik

    HI,
      When i download,only one output i will get.
      But,if i double-click the particular record it will show another output. I want that output also.
      Like that,when i double-click particular record, it will show some other alv ouput based on record,     
    i wanted all those outputs.
    If  i copy the code, whether i face any problems?

  • Can I get a query to get the output data like 4th column instead of 3rd col

    Can I get a query to get the output data like 4th column instead of 3rd column ?
    SQL&gt; select emp.deptno, empno, rownum from emp, dept where emp.deptno=dept.deptno;
    DEPTNO EMPNO ROWNUM
    10 7782 *1* *1*
    10 7839 *2* *2*
    10 7934 *3* *3*
    20 7369 *4* *1*
    20 7876 *5* *2*
    20 7902 *6* *3*
    20 7788 *7* *4*
    20 7566 *8* *5*
    30 7499 *9* *1*
    30 7698 *10* *2*
    30 7654 *11* *3*
    30 7900 *12* *4*
    30 7844 *13* *5*
    30 7521 *14* *6*
    14 rows selected.

    SQL> select emp.deptno, emp.empno,
      2    row_number() over(order by emp.deptno, emp.empno) rn,
      3    row_number() over(partition by emp.deptno order by emp.empno) dept_rn
      4  from emp, dept
      5  where emp.deptno=dept.deptno
      6  order by emp.deptno, emp.empno;
        DEPTNO      EMPNO         RN    DEPT_RN
            10       7782          1          1
            10       7839          2          2
            10       7934          3          3
            20       7369          4          1
            20       7566          5          2
            20       7788          6          3
            20       7876          7          4
            20       7902          8          5
            30       7499          9          1
            30       7521         10          2
            30       7654         11          3
            30       7698         12          4
            30       7844         13          5
            30       7900         14          6
    14 rows selected.Regards,
    Dima

  • ALV- Changing the output data and saving in database

    hi friends,
    I have to change the material description in the output and have to save the changes in database..
    For changing the description I have to raise a pop-up, then I have to give the required change and then save..
    How to do it?
    My code is as follows:
    TABLES : vbrk,vbrp,vbpa,adrc.
    TYPE-POOLS : slis.
    DATA: w_report_id  LIKE sy-repid.
    DATA: w_title    TYPE lvc_title VALUE      'DIPLAY CUSTOMER BILLING DOCUMENT'.
    DATA: w_layout   TYPE slis_layout_alv.
    DATA: w_fieldcat TYPE slis_t_fieldcat_alv.
    DATA: w_events   TYPE slis_t_event.
    DATA: w_header   TYPE slis_t_listheader.
    DATA: sum LIKE vbrk-netwr.
    SELECT-OPTIONS:
         erdat FOR vbrk-erdat,
         vkorg FOR vbrp-vkorg_auft,
         kunag FOR vbrk-kunag.
    DATA : BEGIN OF itab OCCURS 0,
           fkdat TYPE vbrk-fkdat,
           kunrg TYPE vbrk-kunrg,
           name1 TYPE adrc-name1,
           vbeln TYPE vbrk-vbeln,
           augru_auft TYPE vbrp-augru_auft,
           netwr TYPE vbrk-netwr,
           waerk TYPE vbrk-waerk,
           vbtyp TYPE vbrk-vbtyp,
           fkart TYPE vbrk-fkart,
           END OF itab.
    DATA itab1 LIKE STANDARD TABLE OF itab.
    SELECT vbrkfkdat vbrkkunrg adrcname1 vbrkvbeln vbrp~augru_auft
           vbrknetwr vbrkwaerk
           INTO TABLE itab1
           FROM ( ( ( vbrk INNER JOIN vbrp ON vbrkvbeln = vbrpvbeln )
           INNER JOIN vbpa ON vbpavbeln = vbrkvbeln )
           INNER JOIN adrc ON adrcaddrnumber = vbpaadrnr )
           WHERE vbtyp = 'O'
           AND vbrk~erdat IN erdat
           AND vbrp~vkorg_auft IN vkorg
           AND vbrk~kunag IN kunag.
    w_report_id = sy-repid.
    PERFORM i_layout CHANGING w_layout.
    PERFORM i_fieldcat CHANGING w_fieldcat.
    SORT itab1 BY waerk fkart .
    CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
      EXPORTING
        i_callback_program = 'ZTRAINING2'
        i_grid_title       = w_title
        is_layout          = w_layout
        it_fieldcat        = w_fieldcat
        i_save             = 'A'
      TABLES
        t_outtab           = itab1
      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.
    *&      Form  i_fieldcat
          text
         -->P_W_FEILDCAT  text
    FORM i_fieldcat  CHANGING p_w_feildcat.
      DATA: l_line_fieldcat TYPE slis_fieldcat_alv.
      CLEAR l_line_fieldcat.
      l_line_fieldcat-fieldname = 'FKDAT'.
      l_line_fieldcat-ref_tabname = 'ITAB1'.
      l_line_fieldcat-edit_mask  = '__-__-____'.
      l_line_fieldcat-seltext_m = 'Billing Document date '.
      APPEND l_line_fieldcat TO w_fieldcat.
      CLEAR l_line_fieldcat.
      l_line_fieldcat-fieldname = 'KUNRG'.
      l_line_fieldcat-ref_tabname = 'ITAB1'.
      l_line_fieldcat-seltext_m = 'Cust no'.
      APPEND l_line_fieldcat TO w_fieldcat.
      CLEAR l_line_fieldcat.
      l_line_fieldcat-fieldname = 'NAME1'.
      l_line_fieldcat-ref_tabname = 'ITAB1'.
      l_line_fieldcat-seltext_m = 'Name of the reseller'.
      APPEND l_line_fieldcat TO w_fieldcat.
      CLEAR l_line_fieldcat.
      l_line_fieldcat-fieldname = 'VBELN'.
      l_line_fieldcat-ref_tabname = 'ITAB1'.
      l_line_fieldcat-seltext_m = 'Billing document number'.
      APPEND l_line_fieldcat TO w_fieldcat.
      CLEAR l_line_fieldcat.
      l_line_fieldcat-fieldname = 'AUGRU_AUFT'.
      l_line_fieldcat-ref_tabname = 'ITAB1'.
      l_line_fieldcat-seltext_m = 'Order reason'.
      APPEND l_line_fieldcat TO w_fieldcat.
      CLEAR l_line_fieldcat.
      l_line_fieldcat-fieldname = 'NETWR'.
      l_line_fieldcat-ref_tabname = 'ITAB1'.
      l_line_fieldcat-seltext_m = 'Amount'.
      APPEND l_line_fieldcat TO w_fieldcat.
      CLEAR l_line_fieldcat.
      l_line_fieldcat-fieldname = 'WAERK'.
      l_line_fieldcat-ref_tabname = 'ITAB1'.
      l_line_fieldcat-seltext_m = 'Currency'.
      APPEND l_line_fieldcat TO w_fieldcat.
    ENDFORM.                    "i_fieldcat
    *&      Form  i_layout
          text
         -->P_W_LAYOUT text
    FORM i_layout  CHANGING p_w_layout.
      CLEAR w_layout.
      w_layout-colwidth_optimize = 'X'.
      w_layout-edit = 'X'.
    ENDFORM.                    " i_layout
    Thanks,
    Revathi Raju.

    Check out the following link for top_of_page event in OOPs ALV.
    https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/e8a1d690-0201-0010-b7ad-d9719a415907
    You can also check out the following program.
    DATA: save_ok LIKE sy-ucomm,
    g_container TYPE scrfname VALUE 'CC1',
    g_grid TYPE REF TO cl_gui_alv_grid,
    g_custom_container TYPE REF TO cl_gui_custom_container,
    gt_fieldcat TYPE lvc_t_fcat,
    g_max TYPE i VALUE 100.
    * declarations for top of page event
    Data: gv_c_split type ref to cl_gui_splitter_container,
    gv_c_ptv type ref to cl_gui_container,
    gv_alv_ptv type ref to cl_gui_alv_grid,
    o_dd_doc TYPE REF TO cl_dd_document,
    text TYPE sdydo_text_element,
    o_split type ref to cl_gui_easy_splitter_container,
    o_top type ref to cl_gui_container,
    o_bot type ref to cl_gui_container,
    gv_c_vp type ref to cl_gui_container.
    * end of declaration for top of page.
    CLASS lcl_event_receiver DEFINITION DEFERRED.
    *class lcl_application_dc definition deferred.
    DATA: o_event_receiver TYPE REF TO lcl_event_receiver.
    * g_dc type ref to lcl_application_dc.
    DATA: gt_outtab TYPE TABLE OF sbook.
    * CLASS lcl_event_receiver DEFINITION
    CLASS lcl_event_receiver DEFINITION.
    PUBLIC SECTION.
    METHODS: handle_f4 FOR EVENT onf4 OF cl_gui_alv_grid
    IMPORTING e_fieldname
    es_row_no
    er_event_data
    et_bad_cells
    e_display,
    handle_top_of_page FOR EVENT top_of_page OF cl_gui_alv_grid
    IMPORTING e_dyndoc_id.
    METHODS: reset.
    METHODS: show_f4.
    PRIVATE SECTION.
    * attributes for creating an own F4-Help
    * (using a second ALV Grid Control
    DATA: f4_grid TYPE REF TO cl_gui_alv_grid,
    f4_custom_container TYPE REF TO cl_gui_custom_container.
    TYPES: BEGIN OF ty_f4.
    TYPES: value TYPE s_class.
    TYPES: descr(20) TYPE c.
    TYPES: END OF ty_f4.
    DATA: f4_itab TYPE TABLE OF ty_f4.
    DATA: f4_fieldcatalog TYPE lvc_t_fcat.
    * attributes to store event parameters
    * (after the CALL SCREEN command, the event parameters
    * are not accessible)
    TYPES: BEGIN OF onf4_event_parameters_type.
    TYPES: c_fieldname TYPE lvc_fname.
    TYPES: cs_row_no TYPE lvc_s_roid.
    TYPES: cr_event_data TYPE REF TO cl_alv_event_data.
    TYPES: ct_bad_cells TYPE lvc_t_modi.
    TYPES: c_display TYPE char01.
    TYPES: END OF onf4_event_parameters_type.
    DATA: f4_params TYPE onf4_event_parameters_type.
    * Methods to create own F4-Help
    * (This is done using a second ALV Grid Control)
    METHODS: init_f4.
    METHODS: build_fieldcatalog.
    METHODS: fill_f4_itab .
    METHODS: on_double_click FOR EVENT double_click OF cl_gui_alv_grid
    IMPORTING es_row_no.
    ENDCLASS. "lcl_application_f4 DEFINITION
    * CLASS lcl_event_receiver IMPLEMENTATION
    CLASS lcl_event_receiver IMPLEMENTATION.
    *§2. Implement an event handler method for event ONF4.
    METHOD handle_f4.
    * Save event parameter as global attributes of this class
    * (maybe solved differently if you use a function module!)
    f4_params-c_fieldname = e_fieldname.
    f4_params-cs_row_no = es_row_no.
    f4_params-cr_event_data = er_event_data.
    f4_params-ct_bad_cells = et_bad_cells.
    f4_params-c_display = e_display.
    *§3. Call your own f4 help. To customize your popup check
    * first if the cell is ready for input (event parameter E_DISPLAY).
    * (parameter E_DISPLAY is checked later in method on_double_click)
    * (Probably, you would call a function module at this point,
    * pass the needed event parameter and call the popup screen
    * within that function module. This is not done in this example
    * to avoid scattering its code).
    CALL SCREEN 101 STARTING AT 10 10.
    *§7. Inform the ALV Grid Control that an own f4 help has been processed
    * to suppress the standard f4 help.
    er_event_data->m_event_handled = 'X'.
    ENDMETHOD. "on_f4
    METHOD show_f4.
    * DATA: ls_outtab TYPE sbook.
    * initialize own f4 help if needed
    IF f4_custom_container IS INITIAL.
    CALL METHOD init_f4.
    ENDIF.
    CALL METHOD fill_f4_itab.
    * refresh list of values in f4 help and show it
    CALL METHOD f4_grid->refresh_table_display.
    * CAUTION: Do not use method REFRESH_TABLE_DISPLAY for
    * your editable ALV Grid instances while handling events
    * DATA_CHANGED or ONf4. You would overwrite intermediate
    * values of your output table on frontend.
    * 'f4_grid' is a non-editable ALV Grid Control for the
    * application specific F4-Help. Therefore, calling
    * REFRESH_TABLE_DISPLAY for this instance has no
    * negative effect.
    CALL METHOD cl_gui_cfw=>flush.
    ENDMETHOD. "show_f4
    METHOD init_f4.
    DATA: ls_f4_layout TYPE lvc_s_layo.
    * build fieldcatalog entries for f4
    CALL METHOD build_fieldcatalog.
    * create controls
    CREATE OBJECT f4_custom_container
    EXPORTING container_name = 'CC_ONF4'.
    CREATE OBJECT f4_grid
    EXPORTING i_parent = f4_custom_container.
    * hide toolbar
    ls_f4_layout-no_toolbar = 'X'.
    CALL METHOD f4_grid->set_table_for_first_display
    EXPORTING
    is_layout = ls_f4_layout
    CHANGING
    it_fieldcatalog = f4_fieldcatalog
    it_outtab = f4_itab.
    * register event double click on backend
    SET HANDLER me->on_double_click FOR f4_grid.
    * flush since 'ls_layout' is local!
    CALL METHOD cl_gui_cfw=>flush.
    ENDMETHOD. "init_f4
    METHOD fill_f4_itab.
    DATA ls_f4_itab TYPE ty_f4.
    * Delete all entries in f4_itab to determine
    * offered values dynamically
    CLEAR f4_itab[].
    ls_f4_itab-value = 'C'.
    ls_f4_itab-descr = text-t03. "Business Class
    APPEND ls_f4_itab TO f4_itab.
    ls_f4_itab-value = 'Y'.
    ls_f4_itab-descr = text-t04. "Economie Class
    APPEND ls_f4_itab TO f4_itab.
    ls_f4_itab-value = 'F'.
    ls_f4_itab-descr = text-t05. "First Class
    APPEND ls_f4_itab TO f4_itab.
    ENDMETHOD. "fill_f4_itab
    METHOD build_fieldcatalog.
    DATA: ls_fcat TYPE lvc_s_fcat.
    CLEAR ls_fcat.
    ls_fcat-fieldname = 'VALUE'.
    ls_fcat-coltext = text-t02.
    * ls_fcat-inttype = 'S_CLASS'.
    ls_fcat-outputlen = 5.
    APPEND ls_fcat TO f4_fieldcatalog.
    CLEAR ls_fcat.
    ls_fcat-fieldname = 'DESCR'.
    ls_fcat-coltext = text-t01.
    ls_fcat-inttype = 'C'.
    ls_fcat-outputlen = 20.
    APPEND ls_fcat TO f4_fieldcatalog.
    ENDMETHOD. "build_fieldcatalog
    METHOD on_double_click.
    *§5. If not already caught by your own f4 help, check whether
    * the triggered cell was ready for input by using E_DISPLAY
    * and if not, exit.
    IF f4_params-c_display EQ 'X'.
    LEAVE SCREEN.
    ENDIF.
    *§6. After the user selected a value, pass it to the ALV Grid Control:
    *§ 6a. Define a field symbol of type: LVC_T_MODI and a structure of
    * type LVC_S_MODI to pass the value later on.
    FIELD-SYMBOLS <itab> TYPE lvc_t_modi.
    DATA: ls_modi TYPE lvc_s_modi,
    ls_f4_itab TYPE ty_f4.
    *§ 6b. Dereference attribute M_DATA into your field symbol and add
    * the selected value to the table to which this symbol points to.
    ASSIGN f4_params-cr_event_data->m_data->* TO <itab>.
    ls_modi-row_id = f4_params-cs_row_no-row_id.
    ls_modi-fieldname = f4_params-c_fieldname.
    READ TABLE f4_itab INTO ls_f4_itab INDEX es_row_no-row_id.
    ls_modi-value = ls_f4_itab-value.
    APPEND ls_modi TO <itab>.
    LEAVE TO SCREEN 0.
    ENDMETHOD. "on_double_click
    METHOD reset.
    FIELD-SYMBOLS <itab> TYPE lvc_t_modi.
    ASSIGN f4_params-cr_event_data->m_data->* TO <itab>.
    CLEAR <itab>[].
    ENDMETHOD. "reset
    METHOD handle_top_of_page.
    text = 'Top of page for program ZAMIT_SPLIT_CONTAINER'.
    CALL METHOD e_dyndoc_id->add_text
    EXPORTING text = text
    sap_fontsize = 'LARGE'
    sap_style = 'HEADING'.
    CALL METHOD e_dyndoc_id->display_document
    EXPORTING parent = o_top.
    ENDMETHOD. "handle_top_of_page
    ENDCLASS. "lcl_application_f4 IMPLEMENTATION
    END-OF-SELECTION.
    CALL SCREEN 100.
    * MODULE PBO OUTPUT *
    MODULE pbo OUTPUT.
    SET PF-STATUS 'MAIN100'.
    SET TITLEBAR 'MAIN100'.
    IF g_custom_container IS INITIAL.
    PERFORM create_and_init_alv CHANGING gt_outtab[]
    gt_fieldcat.
    ENDIF.
    ENDMODULE. "pbo OUTPUT
    * MODULE PAI INPUT *
    MODULE pai INPUT.
    save_ok = sy-ucomm.
    CLEAR sy-ucomm.
    CASE save_ok.
    WHEN 'EXIT' OR 'BACK' OR 'CANCEL'.
    PERFORM exit_program.
    WHEN 'SWITCH'.
    PERFORM switch_edit_mode.
    WHEN OTHERS.
    * do nothing
    ENDCASE.
    ENDMODULE. "pai INPUT
    * FORM EXIT_PROGRAM *
    FORM exit_program.
    LEAVE PROGRAM.
    ENDFORM. "exit_program
    *& Form build_fieldcat
    * text
    * -->PT_FIELDCAT text
    FORM build_fieldcat CHANGING pt_fieldcat TYPE lvc_t_fcat.
    DATA ls_fcat TYPE lvc_s_fcat.
    CALL FUNCTION 'LVC_FIELDCATALOG_MERGE'
    EXPORTING
    i_structure_name = 'SBOOK'
    CHANGING
    ct_fieldcat = pt_fieldcat.
    LOOP AT pt_fieldcat INTO ls_fcat.
    * Exchange smoker field with invoice field - just to
    * make the dependance between SMOKER and CLASS more transparent
    * (Smoking is only allowed in the first class).
    IF ls_fcat-fieldname EQ 'SMOKER'.
    ls_fcat-col_pos = 11.
    ls_fcat-outputlen = 10.
    ls_fcat-edit = 'X'.
    * Field 'checktable' is set to avoid shortdumps that are caused
    * by inconsistend data in check tables. You may comment this out
    * when the test data of the flight model is consistent in your system.
    ls_fcat-checktable = '!'. "do not check foreign keys
    MODIFY pt_fieldcat FROM ls_fcat.
    ELSEIF ls_fcat-fieldname EQ 'INVOICE'.
    ls_fcat-col_pos = 7.
    MODIFY pt_fieldcat FROM ls_fcat.
    ELSEIF ls_fcat-fieldname EQ 'CLASS'.
    ls_fcat-edit = 'X'.
    ls_fcat-outputlen = 5.
    ls_fcat-checktable = '!'. "do not check foreign keys
    MODIFY pt_fieldcat FROM ls_fcat.
    ENDIF.
    ENDLOOP.
    ENDFORM. "build_fieldcat
    *& Form create_and_init_alv
    * text
    * -->PT_OUTTAB text
    * -->PT_FIELDCAT text
    FORM create_and_init_alv CHANGING pt_outtab TYPE STANDARD TABLE
    pt_fieldcat TYPE lvc_t_fcat.
    DATA: lt_exclude TYPE ui_functions,
    ls_layout TYPE lvc_s_layo.
    CREATE OBJECT g_custom_container
    EXPORTING container_name = g_container.
    * CREATE OBJECT g_grid
    * EXPORTING i_parent = g_custom_container.
    CREATE OBJECT gv_c_split
    EXPORTING
    * link_dynnr = lv_dynnr
    * link_repid = lv_repid
    parent = g_custom_container
    rows = 2
    columns = 1
    EXCEPTIONS
    cntl_error = 1
    cntl_system_error = 2
    others = 3 .
    CALL METHOD gv_c_split->set_border
    EXPORTING
    border = space.
    CALL METHOD gv_c_split->get_container
    EXPORTING
    row = 1
    column = 1
    RECEIVING
    container = gv_c_ptv.
    CALL METHOD gv_c_split->set_row_height
    EXPORTING
    id = 1
    height = 20
    EXCEPTIONS
    cntl_error = 1
    cntl_system_error = 2
    OTHERS = 6 .
    CALL METHOD gv_c_split->get_container
    EXPORTING
    row = 2
    column = 1
    RECEIVING
    container = gv_c_vp .
    CALL METHOD gv_c_split->set_row_height
    EXPORTING
    id = 2
    height = 10
    EXCEPTIONS
    cntl_error = 1
    cntl_system_error = 2
    OTHERS = 3 .
    CREATE OBJECT o_split
    EXPORTING
    parent = gv_c_ptv
    with_border = 1
    EXCEPTIONS
    cntl_error = 1
    cntl_system_error = 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.
    ENDIF.
    o_top = o_split->top_left_container.
    o_bot = o_split->bottom_right_container.
    CREATE OBJECT gv_alv_ptv
    EXPORTING
    i_parent = o_bot
    EXCEPTIONS
    error_cntl_create = 1
    error_cntl_init = 2
    error_cntl_link = 3
    error_dp_create = 4
    others = 5 .
    CREATE OBJECT g_grid
    EXPORTING
    i_parent = gv_c_vp
    EXCEPTIONS
    error_cntl_create = 1
    error_cntl_init = 2
    error_cntl_link = 3
    error_dp_create = 4
    others = 5 .
    PERFORM build_fieldcat CHANGING pt_fieldcat.
    * Optionally restrict generic functions to 'change only'.
    * (The user shall not be able to add new lines).
    PERFORM exclude_tb_functions CHANGING lt_exclude.
    PERFORM build_data CHANGING pt_outtab.
    ls_layout-grid_title = 'F4 help implemented for field CLASS'.
    CREATE OBJECT o_event_receiver.
    SET HANDLER o_event_receiver->handle_top_of_page FOR gv_alv_ptv.
    SET HANDLER o_event_receiver->handle_top_of_page FOR g_grid.
    CREATE OBJECT o_dd_doc EXPORTING style = 'ALV_GRID'
    no_margins = 'X'.
    CALL METHOD gv_alv_ptv->set_table_for_first_display
    EXPORTING
    is_layout = ls_layout
    CHANGING
    it_outtab = pt_outtab[]
    it_fieldcatalog = pt_fieldcat
    EXCEPTIONS
    invalid_parameter_combination = 1
    program_error = 2
    too_many_lines = 3
    OTHERS = 4.
    CALL METHOD g_grid->set_table_for_first_display
    EXPORTING
    it_toolbar_excluding = lt_exclude
    is_layout = ls_layout
    CHANGING
    it_fieldcatalog = pt_fieldcat
    it_outtab = pt_outtab[].
    CALL METHOD gv_alv_ptv->list_processing_events
    EXPORTING
    i_event_name = 'TOP_OF_PAGE'
    i_dyndoc_id = o_dd_doc.
    * register f4 for field CLASS
    PERFORM register_events.
    * Set editable cells to ready for input initially
    CALL METHOD g_grid->set_ready_for_input
    EXPORTING
    i_ready_for_input = 1.
    ENDFORM. "CREATE_AND_INIT_ALV
    *& Form exclude_tb_functions
    * text
    * -->PT_EXCLUDE text
    FORM exclude_tb_functions CHANGING pt_exclude TYPE ui_functions.
    * Only allow to change data not to create new entries (exclude
    * generic functions).
    DATA ls_exclude TYPE ui_func.
    ls_exclude = cl_gui_alv_grid=>mc_fc_loc_copy_row.
    APPEND ls_exclude TO pt_exclude.
    ls_exclude = cl_gui_alv_grid=>mc_fc_loc_delete_row.
    APPEND ls_exclude TO pt_exclude.
    ls_exclude = cl_gui_alv_grid=>mc_fc_loc_append_row.
    APPEND ls_exclude TO pt_exclude.
    ls_exclude = cl_gui_alv_grid=>mc_fc_loc_insert_row.
    APPEND ls_exclude TO pt_exclude.
    ls_exclude = cl_gui_alv_grid=>mc_fc_loc_move_row.
    APPEND ls_exclude TO pt_exclude.
    ENDFORM. " EXCLUDE_TB_FUNCTIONS
    *& Form build_data
    * text
    * --> p1 text
    * <-- p2 text
    FORM build_data CHANGING pt_outtab TYPE STANDARD TABLE.
    DATA: ls_sbook TYPE sbook,
    l_index TYPE i.
    SELECT * FROM sbook INTO TABLE gt_outtab UP TO g_max ROWS.
    IF sy-subrc NE 0.
    PERFORM generate_entries CHANGING pt_outtab.
    ENDIF.
    LOOP AT pt_outtab INTO ls_sbook.
    l_index = sy-tabix.
    CLEAR ls_sbook-class.
    * Alternate between smoker and non smoker to make
    * it more obvious what this example is about
    l_index = l_index MOD 2.
    IF l_index EQ 1.
    ls_sbook-smoker = 'X'.
    ELSE.
    ls_sbook-smoker = ' '.
    ENDIF.
    MODIFY pt_outtab FROM ls_sbook.
    ENDLOOP.
    ENDFORM. " build_data
    *& Form generate_entries
    * text
    * -->PT_SBOOK text
    FORM generate_entries CHANGING pt_sbook TYPE STANDARD TABLE.
    DATA: ls_sbook TYPE sbook,
    l_month(2) TYPE c,
    l_day(2) TYPE c,
    l_date(8) TYPE c,
    l_prebookid TYPE i.
    ls_sbook-carrid = 'LH'.
    ls_sbook-connid = '0400'.
    ls_sbook-forcurkey = 'DEM'.
    ls_sbook-loccurkey = 'USD'.
    ls_sbook-custtype = 'B'.
    DO 110 TIMES.
    l_prebookid = sy-index.
    ls_sbook-forcuram = sy-index * 10.
    ls_sbook-loccuram = ls_sbook-loccuram * 2.
    ls_sbook-customid = sy-index.
    ls_sbook-counter = 18.
    ls_sbook-agencynum = 11.
    l_month = sy-index / 10 + 1.
    DO 2 TIMES.
    l_day = 3 + l_month + sy-index * 2.
    l_date+0(4) = '2000'.
    l_date+4(2) = l_month.
    l_date+6(2) = l_day.
    ls_sbook-fldate = l_date.
    SUBTRACT 3 FROM l_day.
    ls_sbook-order_date+0(6) = l_date+0(6).
    ls_sbook-order_date+6(2) = l_day.
    ls_sbook-bookid = l_prebookid * 2 + sy-index.
    IF sy-index EQ 1.
    ls_sbook-smoker = 'X'.
    ELSE.
    ls_sbook-smoker = space.
    ENDIF.
    ls_sbook-luggweight = l_prebookid * 10.
    IF ls_sbook-luggweight GE 1000.
    ls_sbook-wunit = 'G'.
    ls_sbook-class = 'C'.
    ELSE.
    ls_sbook-wunit = 'KG'.
    ls_sbook-class = 'Y'.
    ENDIF.
    IF ls_sbook-bookid > 40 AND ls_sbook-wunit EQ 'KG'.
    ls_sbook-invoice = 'X'.
    ENDIF.
    IF ls_sbook-bookid EQ 2.
    ls_sbook-cancelled = 'X'.
    ls_sbook-class = 'F'.
    ENDIF.
    APPEND ls_sbook TO pt_sbook.
    ENDDO.
    ENDDO.
    ENDFORM. " generate_entries
    *& Form register_events
    * text
    FORM register_events.
    *§1. Register event ONF4 at frontend using method
    * register_f4_for_fields. For this purpose, you pass a table
    * with all fields, for which you want to implement your own
    * f4 help.
    * remark: If you want to use an own f4 help for fields where
    * no standard f4 help exists set field F4AVAILABL for
    * this field in the fieldcatalog.
    DATA: lt_f4 TYPE lvc_t_f4 WITH HEADER LINE.
    CLEAR lt_f4.
    lt_f4-fieldname = 'CLASS'.
    * If you would like to deregister the field again,
    * pass value SPACE with field 'register'.
    lt_f4-register = 'X'.
    *§ 1b. If the value range in your f4 help depends on other
    * values of cells that are input enabled, set the
    * GETBEFORE parameter.
    * The consequence is that the ALV Grid Control raises
    * event DATA_CHANGED before the f4 help is called to
    * check values that the f4 help depends on.
    lt_f4-getbefore = 'X'.
    * The next parameter is used to change values after onf4 has
    * been processed. The ALV Grid Control will raise
    * event DATA_CHANGED afterwards, if you set it.
    lt_f4-chngeafter = space.
    INSERT TABLE lt_f4.
    CALL METHOD g_grid->register_f4_for_fields
    EXPORTING
    it_f4 = lt_f4[].
    * register events for abap objects (backend)
    SET HANDLER o_event_receiver->handle_f4 FOR g_grid.
    ENDFORM. " register_events
    * MODULE status_0101 OUTPUT
    MODULE status_0101 OUTPUT.
    SET PF-STATUS 'POPUP'.
    SET TITLEBAR 'POPUP'.
    CALL METHOD o_event_receiver->show_f4.
    ENDMODULE. " STATUS_0101 OUTPUT
    *& Module USER_COMMAND_0101 INPUT
    * text
    MODULE user_command_0101 INPUT.
    PERFORM user_command.
    ENDMODULE. " USER_COMMAND_0101 INPUT
    *& Form user_command
    * text
    FORM user_command.
    DATA: save_ok TYPE sy-ucomm.
    save_ok = sy-ucomm.
    CLEAR sy-ucomm.
    CASE save_ok.
    WHEN 'CANCEL'.
    CALL METHOD o_event_receiver->reset.
    LEAVE TO SCREEN 0.
    ENDCASE.
    ENDFORM. "user_command
    *& Form switch_edit_mode
    * text
    FORM switch_edit_mode.
    IF g_grid->is_ready_for_input( ) EQ 0.
    * set edit enabled cells ready for input
    CALL METHOD g_grid->set_ready_for_input
    EXPORTING
    i_ready_for_input = 1.
    ELSE.
    * lock edit enabled cells against input
    CALL METHOD g_grid->set_ready_for_input
    EXPORTING
    i_ready_for_input = 0.
    ENDIF.
    ENDFORM. "switch_edit_mode
    For popup try this
    reward if helpfull
    Regards
    Pavan

  • How to change the font size of the output data ?

    Hi,
    In my sap script, I have an include statement which fetches the data based on some input values. It so happens that the value fetched is displayed in very small font and is not readable. I want to increase the font size of that particular output. Is there any function to increase the output text size, may be relative to current size ??
    Hope I am clear.
    thanks

    Hi Rad,
    If you want to change the font for a particular O/P then
    YOu can use IF condition
    /: IF &NAST-KSCHL& EA 'ZNEU'.  ( Your O/P type
    PD   & TEXT&
    /: ELSE
    GD  &TEXT&
    /:ENDIF.
    PD : Paragraph with default font 8
    GD is paragraph of default font 12
    For Include text:
    /: IF &NAST-KSCHL& EA 'ZNEU'.  ( Your O/P type
    /: INCLUDE 'ADRS_HEADER' OBJECT TEXT ID ADRS LANGUAGE &PRINT_LANGUAGE&  Paragraph  PD
    /: ELSE
    /: INCLUDE 'ADRS_HEADER' OBJECT TEXT ID ADRS LANGUAGE &PRINT_LANGUAGE&  Paragraph  GD
    /:ENDIF.
    Hope this will help you.
    Lanka
    Message was edited by: Lanka Murthy

  • Issue with usage of Clob variable to hold the output data...

    Hi All,
    we are getting the output of the sql query out from a function and this function return type is defined as CLOB.
    because of the volume of data being fetched we are getting the below mentioned error message when this Function is getting executed.
    “ORA-06502: PL/SQL: numeric or value error”. : character string buffer too small
    Now even with CLOB if we are getting the buffer too small error message ...is there any other way or approach we could handle this..
    our requirement is to fetch the complete value from this function in one shot and we don't want to split the data based on the size / number of characters...
    This is causing us lot of issues...could someone please suggest as to what could be done regards this ...

    Post your script. How can we tell when we can't see your code.
    Also, better to post the table ddl's script and some demo insert statement here. And, please provide the DB version, too.
    Generally, you should not get such error. So, please post these details.
    Regards.
    Satyaki De.

  • Bind the output data (Xml) from BPEL process to ADF SelectOneChoice Control

    Hello,
    My requirement is to invoke a BPEL process from ADF page and display returned results in a select one choice (drop down box).
    I have created a Data Control for the BPEL process through Web service data control and tried to invoke the BPEL process. I could see from the BPEL console that BPEL process is getting invoked. But the ADF doesn't bind any of the output to Select one choice.
    It doesn't even show any error.
    Can you plz help me how to bind the output of the BPEL process to ADF SelectOneChoice control.
    The Xml Which I recieve from BPEL process is
    <outputVariable><part xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" name="payload"><DBConnectDemoProcessResponse xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://xmlns.oracle.com/DBConnectDemo">
    <StatusTrans xmlns="http://xmlns.oracle.com/pcbpel/adapter/db/top/DBSelect">
    <transId>1</transId>
    <fromStatus>Open</fromStatus>
    <toStatus>Assigned</toStatus>
    </StatusTrans>
    <StatusTrans xmlns="http://xmlns.oracle.com/pcbpel/adapter/db/top/DBSelect">
    <transId>2</transId>
    <fromStatus>Open</fromStatus>
    <toStatus>Pending</toStatus>
    </StatusTrans>
    <StatusTrans xmlns="http://xmlns.oracle.com/pcbpel/adapter/db/top/DBSelect">
    <transId>3</transId>
    <fromStatus>Open</fromStatus>
    <toStatus>Closed</toStatus>
    </StatusTrans>
    <StatusTrans xmlns="http://xmlns.oracle.com/pcbpel/adapter/db/top/DBSelect">
    <transId>4</transId>
    <fromStatus>Open</fromStatus>
    <toStatus>Cancelled</toStatus>
    </StatusTrans>
    </DBConnectDemoProcessResponse>
    </part></outputVariable>
    And the toStatus node values viz, Assigned, Pending, Closed, Cancelled should get binded to the SelectOneChoice control
    Waiting for your valuable inputs,
    Regards,
    babloo.

    I have been still trying for the solution. I have modified the XSD created by the jdeveloper to,
    <schema attributeFormDefault="unqualified"
         elementFormDefault="qualified"
         targetNamespace="http://xmlns.oracle.com/StateTransitions"
         xmlns="http://www.w3.org/2001/XMLSchema">
         <element name="StateTransitionsProcessRequest">
              <complexType>
                   <sequence>
                   <element name="input" type="string"/>
                   </sequence>
              </complexType>
         </element>
         <element name="StateTransitionsProcessResponse">
              <complexType>
                   <sequence maxOccurs="unbounded">
    <element name="stateChanges">
    <complexType>
    <sequence>
    <element name="fromState" type="string" />
    <element name="toState" type = "string" />
    </sequence>
    </complexType>
    </element>
    </sequence>
              </complexType>
         </element>
    </schema>
    And I have given this XSD url while creating the Web Service Data Control by deploying it into the Oracle App server.
    So, I can see the tree structure of "Return" as "StateTransitionsProcessResponse->StateChanges->toState,fromState"
    I have binded the toState field of the Data Control to the SelectOneChoice ADF control in a jspx page by using List binding editor.
    I have selected,
    Base data source as "Variables" (Currently I don't need to update any table),
    List Data source as "process: getStateTransitions.process.StateTransitionsProcessResponse.stateChanges" (Web Service Data Control)
    Base Data source attribute as "process_input"
    List Data Source Attribute as "toState"
    I can initiate the web service (BPEL process) by providing the necessary input value like 'Open' or 'Pending' or 'Assigned' but the SelectOneChoice control doesn't populate with any values.
    Waiting for valuable inputs!
    Thanks and Regards,
    babloo.

  • Query to refresh the output data.

    Hi,
    I have displayed an hierarchy list using 'REUSE_ALV_HIERSEQ_LIST_DISPLAY'  FM.  Now I am trying to refresh the output screen, I have tried the selfield-refresh = 'X' functionality but its is not working.
    Have thought of other ways like getting the screen instance and then call the refresh method etc, but don't know if that's feasible.
    Please suggest..
    Thanks,
    Ketan

    Please find my piece code below..
    **Function module to display the ALV output.
      CALL FUNCTION 'REUSE_ALV_HIERSEQ_LIST_DISPLAY'
           EXPORTING
                i_callback_program        = ws_repid
                i_callback_user_command   = 'F0009_USER_COMMAND'
                i_callback_pf_status_set  = 'f0008_set_pf_stat'
                is_layout                 = wa_layo
                it_fieldcat               = i_fieldcat[]
                is_variant                = wa_vari
                i_tabname_header          =  'I_VTTK_1'
                i_tabname_item            =  'I_HEADER'
                is_keyinfo                = ws_keyinfo
           TABLES
                t_outtab_header           = i_vttk_1
                t_outtab_item             = i_header
           EXCEPTIONS
                program_error             = 1
                OTHERS                    = 2.
    FORM f0009_user_command  USING ucomm LIKE sy-ucomm
                                   selfield TYPE slis_selfield. "#EC CALLED
    to handle the user commands if different from standard ALV
      CASE ucomm.
         WHEN 'REFRESH'.
    Here I am reselecting the data again to get the new changes done.
          PERFORM f0002_get_selection_data.
    Here the flag is getting set.
          selfield-refresh = 'X'.
      ENDCASE.
    ENDFORM.

  • Specify the output date to be of a Specified date format.

         DateFormat  formatter = new SimpleDateFormat("MM/dd/yyyy");
         String dateString = "12/12/2006";
         Date dateStringInDateFormat = formatter.parse(dateString);
         System.err.println("the date"+dateStringInDateFormat);
         String str1 = formatter.format(dateStringInDateFormat);
         System.err.println("the date in string format"+str1);
         DateFormat df = DateFormat.getDateInstance(DateFormat.SHORT);
         df.setLenient(false);
         Date stick = df.parse(str1);
          System.err.println("The final date to be passed"+stick);The output that i get on screen:
    the date Tue Dec 12 00:00:00 GMT 2006
    the date in String format 12/12/2006
    The final date to be passed Tue Dec 12 00:00:00 GMT 2006
    I want the final date to be passed i.e, Date stick to be 12/12/2006
    Can anyone helpme in this issue

    DateFormats do not change what a Date object contains or how it is displayed. They are only used to format the output when you use them with format(Date). The Date object itself is unchanged and you cannot change it.
    So whereever you want to display a date in your particular format you will need to use your DateFormat.

  • In the output data is coming in two rows instead of the onerow using report

    HI ,
    I am trying include two cloumns in the existing report layout ,But the output is coming in two rows.
    I tried to increase page width in the layout sections and also rebulid the layout using the test data ,For test data is coming fine ,when i ran the concurrent program some records is coming in two rows .
    Can any one help ,how to map the columns according the data and increase the width in the report layout .
    Thanks
    Narendra.

    Do a right mouse click on the left, gray row marker => "Insert Row"=> "Inside Group
    - Above or Below", then you get a second detail row.
    Olaf Helper
    [ Blog] [ Xing] [ MVP]

  • SELECT stmt required to retrieve the output data as specified.

    source table:
    Origin      Destination      Miles
    Sydney           Melbourne      1000
    Perth           Adelaide      3000
    Canberra      Melbounre      700
    Melbourne      Sydney      1000
    Brisbane      Sydney      1000
    Perth      Darwin      4000
    Sydney      Brisbane      1000
    Duplicate routes are to be ignored so the output is
    out put:
    Origin           Destination      Miles
    Sydney           Melbourne      1000
    Perth           Adelaide      3000
    Canberra      Melbounre      700
    Brisbane      Sydney           1000
    Perth           Darwin           4000
    Please suggest a select query / sub query with out using any subprograms or functions/pkgs to get the out put table.

    Hi Pawan,
    Try this document
    <b>https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/f0de1eb8-0b98-2910-7996-8a3c2fcf6785</b>
    Regards,
    ABY

  • How to go from the output data to a standard t code

    Hi ,
    I have created  an alv report .
    The fields of output are :
    vendor num I cocode I PO number .
    0011             2001       450003201
    I want that when i double click on PO num 450003201 , then the standard screen of ME23n conatined the data of this PO number should be open .
    Kindly advice , how is this possible .
    Thanks
    Sheetal

    Hi,
    Have a look at tthe code,
    form user_command using p_ucomm type sy-ucomm
                            rs_selfield type slis_selfield.
      data : vbeln type vbeln_va.
      case p_ucomm.
        when 'BACK'.
          leave program.
        when '&IC1'.
          clear : vbeln.
          vbeln = rs_selfield-value.
          set parameter id: 'AUN' field vbeln.
          call transaction 'VA03' and skip first screen.
      endcase.
    In user command, write the above code as per ur po number.
    for me23n , for po number,
    parameter id is BES
    reward if helpful.
    regards,
    Pritha.

  • Column headings are missing in the output for ALV?

    Hi all,
    i have coded a small report in ALV mode. i am getting the data but the column headings are missing.
    iam not getting the column headings in the output. it is coming as blank. Could you all please help me out in this?
    below is the code of my program:
                     Includes                                            *
    *---Standard header and footer routines
    INCLUDE zsrepthd.
    *--- ALV Routines
    INCLUDE zvsdi_alv_routines_ver3.
    *--- Authorization Check
    INCLUDE z_selection_auth_check.
                     Types Declarations                                  *
    tables : ekpo.
                     Types Declarations                                  *
    TYPES: BEGIN OF ty_ekpo,
            EBELN(18) TYPE C,
            EBELP(20) TYPE C,
            MATNR(18) TYPE C,
            WERKS(11) TYPE C,
          END OF ty_ekpo.
    *-Output field name
    TYPES: BEGIN OF ty_output,
            EBELN(18) TYPE C,
            EBELP(20) TYPE C,
            MATNR(18) TYPE C,
            WERKS(11) TYPE C,
          END OF ty_output.
    *-Output field name
    TYPES: BEGIN OF ty_fields,
            fname(60) TYPE c,
           END OF ty_fields.
                     Internal Table Declarations                         *
    DATA:it_ekpo TYPE STANDARD TABLE OF ty_ekpo,
    *--- Alv parameters
        it_out_alvp TYPE typ_alv_form_params, "for alv parameters
    *-Field catalog  for ALV display
        it_fcat TYPE slis_t_fieldcat_alv WITH HEADER LINE,
    *-Field names for Excel column headings
    it_ekpo_fields TYPE STANDARD TABLE OF ty_fields WITH HEADER LINE.
    **--To store output for Principial Pegging data
    DATA: BEGIN OF it_output occurs 0,
            EBELN(18) TYPE C,
            EBELP(20) TYPE C,
            MATNR(18) TYPE C,
            WERKS(11) TYPE C,
          END OF it_output.
    **--To store output for 2nd
    DATA: BEGIN OF it_output1 occurs 0,
            text(2000),
           END OF it_output1.
                     Data Declarations                                   *
    data: v_ebeln TYPE ekpo-ebeln,
          v_ebelp TYPE ekpo-ebelp,
          v_matnr TYPE ekpo-matnr,
          v_werks TYPE ekpo-werks.
                     Constants Declarations                              *
    CONSTANTS:
         c_0    TYPE i     VALUE  0,
         c_x    TYPE char1 VALUE  'X',
         c_i    TYPE char1 VALUE  'I',
         c_eq   TYPE char2 VALUE  'EQ',
         c_ekpo  TYPE char4 VALUE 'EKPO',
         c_hyfn  TYPE char1 VALUE '-'.
                     Work Area Declarations                              *
    DATA: x_output_ekpo type ty_output,
          x_ekpo type ty_ekpo.
                     Selection Screen                                    *
    SELECTION-SCREEN BEGIN OF BLOCK b1 WITH FRAME TITLE text-f01.
    SELECT-OPTIONS:
          s_ebeln FOR v_ebeln OBLIGATORY,
          s_ebelp FOR v_ebelp,
          s_matnr FOR v_matnr,
          s_werks FOR v_werks.
    SELECTION-SCREEN END OF BLOCK b1.
                     At Selection Screen                                 *
    AT SELECTION-SCREEN.
                     Start-of-Selection                                  *
    START-OF-SELECTION.
    *--- Check Authorizations for Selection-screen
      PERFORM  z_selection_auth_check.
    *--- Fetch Purchasing Document Item data
      PERFORM  fetch_status_pp.
                     End-of-Selection                                    *
    END-OF-SELECTION.
    **-- Download data to final internal table.
      PERFORM data_output.
      IF NOT it_output[] IS INITIAL.
    *--- Fill the structure for calling the ALV form
        PERFORM initialize_alv_params.
    **-- Display ALV Report
        PERFORM setup_and_display_alv_ver2
           USING
         it_out_alvp        "Parameter structure
         it_output[]        "Internal Data table(header table)
         it_output[].       "Dummy table for Hierarchical ALV!!(item table)
        ENDIF.
      IF it_output[] IS INITIAL.
        MESSAGE i999(zi) WITH 'No data found for selection'(i02).
      ENDIF.
    *&      Form  FETCH_STATUS_PP
    Get data from ekpo table
    FORM FETCH_STATUS_PP .
    *-Fetch PP Data from ekpo table
      REFRESH it_ekpo.
      SELECT EBELN
             EBELP
             MATNR
             WERKS
             FROM ekpo
             INTO TABLE it_ekpo
             WHERE ebeln IN s_ebeln
               AND ebelp IN s_ebelp.
      IF sy-subrc = c_0.
        SORT it_ekpo BY ebeln ebelp.
      ENDIF.
    ENDFORM.                    " FETCH_STATUS_PP
    *&      Form  f_top_of_page
    *This is to write the top of page
    FORM top_of_page.
      DATA:  lt_list TYPE slis_t_listheader,
             lx_list TYPE slis_listheader.
    *--- Title name
      CLEAR lx_list.
      lx_list-typ  = 'S'.
      lx_list-key  = 'Title name'(t13).
      lx_list-info = sy-title.
      APPEND lx_list TO lt_list.
      IF NOT lt_list IS INITIAL.
        CALL FUNCTION 'REUSE_ALV_COMMENTARY_WRITE'
          EXPORTING
            it_list_commentary = lt_list.
      ENDIF.
    ENDFORM.                    "top_of_page
    *&      Form  init_page_head
    Description : This subroutine initializes the fields in table BHDGD  *
                  for printing the report heading.                       *
    FORM init_page_head.
      bhdgd-line1  = 'SLA Status Report'(h04).
      bhdgd-line2  = sy-title.
      bhdgd-lines  = sy-linsz.
      bhdgd-fcpyrt = sy-uline.
      bhdgd-inifl  = '0'.
    ENDFORM.                    "init_page_head
    *&      Form  initialize_alv_params
    Description : Form to initialize ALV Params
    FORM initialize_alv_params.
      CONSTANTS: lc_alv_grid  TYPE char1 VALUE 'G',  "Grid
                 lc_u         TYPE char1 VALUE 'U'.
      MOVE 'IT_OUTPUT' TO   it_out_alvp-tablname.   "final table
      MOVE sy-repid    TO   it_out_alvp-repid.
      MOVE lc_alv_grid TO   it_out_alvp-alvtype.
      MOVE c_x         TO   it_out_alvp-bringdefaultvar.
      MOVE lc_u        TO   it_out_alvp-variantsavetype.
    ENDFORM.                    " initialize_alv_params
          FORM it_out_init_events                                       *
    -->this is form is to modify the events
    FORM it_out_init_events
          CHANGING
           alevnts TYPE slis_t_event.
      FIELD-SYMBOLS <alevnt> TYPE slis_alv_event.
      LOOP AT alevnts ASSIGNING <alevnt>.
        CASE <alevnt>-name.
          WHEN  slis_ev_top_of_page.
            MOVE 'TOP_OF_PAGE'  TO <alevnt>-form.
        ENDCASE.
      ENDLOOP.
    ENDFORM.                    "it_out_init_events
    *&      Form  DATA_OUTPUT
    Download data to final internal table
    FORM DATA_OUTPUT .
      loop at it_ekpo into x_ekpo.
        x_output_ekpo-ebeln = x_ekpo-ebeln.
        x_output_ekpo-ebelp = x_ekpo-ebelp.
        x_output_ekpo-matnr = x_ekpo-matnr.
        x_output_ekpo-werks = x_ekpo-werks.
        append x_output_ekpo to it_output.
      endloop.
    ENDFORM.                    " DATA_OUTPUT
          FORM it_out_alv_fieldcat_before                               *
    -->  PT_FCAT                                                       *
    -->  ALVP                                                          *
    FORM it_out_alv_fieldcat_before  CHANGING
        pt_fcat TYPE slis_t_fieldcat_alv
        alvp TYPE typ_alv_form_params.
      DATA: lx_fcat TYPE slis_fieldcat_alv.
      CLEAR lx_fcat.
      lx_fcat-tabname        = 'IT_OUTPUT'.
      lx_fcat-fieldname      = 'EBELN'.
      lx_fcat-col_pos        = '1'.
      lx_fcat-ddictxt        = 'M'.
      lx_fcat-seltext_l      = 'Purchasing Doc No'(018).
      lx_fcat-seltext_m      = 'Purchasing Doc No'(018).
      lx_fcat-seltext_s      = 'Purchasing Doc No'(018).
      lx_fcat-reptext_ddic   = 'Purchasing Doc No'(018).
      APPEND lx_fcat TO pt_fcat.
      CLEAR lx_fcat.
      lx_fcat-tabname        = 'IT_OUTPUT'.
      lx_fcat-fieldname      = 'EBELP'.
      lx_fcat-col_pos        = '1'.
      lx_fcat-ddictxt        = 'M'.
      lx_fcat-seltext_l      = 'Item No Purchasing Doc'(020).
      lx_fcat-seltext_m      = 'Item No Purchasing Doc'(020).
      lx_fcat-seltext_s      = 'Item No Purchasing Doc'(020).
      lx_fcat-reptext_ddic   = 'Item No Purchasing Doc'(020).
      APPEND lx_fcat TO pt_fcat.
      CLEAR lx_fcat.
      lx_fcat-tabname        = 'IT_OUTPUT'.
      lx_fcat-fieldname      = 'MATNR'.
      lx_fcat-col_pos        = '1'.
      lx_fcat-ddictxt        = 'M'.
      lx_fcat-seltext_l      = 'Material'(010).
      lx_fcat-seltext_m      = 'Material'(010).
      lx_fcat-seltext_s      = 'Material'(010).
      lx_fcat-reptext_ddic   = 'Material'(010).
      APPEND lx_fcat TO pt_fcat.
      CLEAR lx_fcat.
      lx_fcat-tabname        = 'IT_OUTPUT'.
      lx_fcat-fieldname      = 'WERKS'.
      lx_fcat-col_pos        = '1'.
      lx_fcat-ddictxt        = 'M'.
      lx_fcat-seltext_l      = 'Supply plant'(013).
      lx_fcat-seltext_m      = 'Supply plant'(013).
      lx_fcat-seltext_s      = 'Supply plant'(013).
      lx_fcat-reptext_ddic   = 'Supply plant'(013).
      APPEND lx_fcat TO pt_fcat.
    ENDFORM.                    " it_out_alv_fieldcat_before.
    Regards,
    Shalini
    Edited by: shalini reddy on Oct 7, 2008 5:08 PM

    Hi,
    The heading are in the table pt_fcat - you don't seem to be passing that in form....
    PERFORM setup_and_display_alv_ver2
    USING
    it_out_alvp "Parameter structure
    it_output[] "Internal Data table(header table)
    it_output[]. "Dummy table for Hierarchical ALV!!(item table)
    which I guessing in in one of the includes?
    Saying that the extract pof code does not show where you are calling form it_out_alv_fieldcat_before ...which populates the headings...
    Regards
    Stu

  • How can I convert output data (string?) from GPIB-read to an 1D array?

    Hello all,
    I am reading a displayed waveform from my Tektronix Oscilloscope (TDS3032) via the GPIB Read VI. The format of the waveform data is: positive integer data-point representation with the most significant byte transferred first (2 bytes per data point).
    The output data of GPIB-Read looks like a string(?) where the integer numbers and a sign like the euro-currency sign are seperated by spaces e.g. #5200004C3 4 4 4 4 3C3C3........ (C represents the euro-currency sign).
    How can I convert this waveform data into a 1D/2D array of real double floatingpoint numbers (DBL) so I can handle the waveform data for data-analysis?
    It would be very nice if someone know the solution for this.
    t
    hanks

    Hi,
    First of all, I'm assuming you are using LabVIEW.
    The first you need to do is parse the string returned by the instrument. In this case you need to search for the known symbols in the string (like the euro sign) and chop the string to get the numeric strings. Here are some examples on parsing from www.ni.com:
    Keyword Search: parsing
    Once you parse the numeric strings you can use the "String/number conversion VIs" in the String pallette.
    Hope this helps.
    DiegoF.Message Edited by Molly K on 02-18-2005 11:01 PM

  • How to handle Output Data Association when no row returned?

    In BPM 11g, I'm using a Service to select a row from an external database passing a parameter using a Database Adapter.  Works fine when a row is returned.  But if no row is returned (which can happen because no match is found on the Select based on the parameter value), I'm getting an error on the composite because the Output Data Association has the return values, including integers, mapped to a Data Object I defined in the process.  Well if no row is found, the integer value is empty, and errors out trying to save it.
    How do I handle this situation?
    The specific message is this:
    The expression bpmn:getDataOutput('wm91AInterfaceMainCollection')/ns:Wm91AInterfaceMain[1]/ns:board is empty. An attempt to read or copy data referenced or computed by the XPath expression either had invalid data, according to the XML schema, or did not contain certain optional data. Ensure that the variable or expression result named in the error message is not empty. Enable XML schema validation of related data elements to ensure the run-time data is valid.
    I must be missing something obvious here, but cannot find a way to handle this.  Thanks in advance!

    Dan - Never mind about my request for an example.  I figured it out.  My problem was that the destination variable was a primitive process variable of type Integer, thus not allowing the creation of an XSLT.  Once I created a Complex process data object containing that Integer, I could create an XSLT with an If statement.  Thanks again.

Maybe you are looking for

  • Error While Building Attribute Dimension in ASO Cube

    Hi all, Cuurently I'm trying to bulit an ASO application in Oracle EPM 11.1.1.3 When I'm building an attribute dimension "QSize" in ASO cube ,I'm Getting some Warnings I'm using Flat file as my source AND MY RULE FILE IS GEN2,QSIZE, ALIAS2,QSIZE 1, "

  • I am getting error code -1074130544

    I am using a NI USB 5132 and NIScope ver 3.8 and am having some issues with errors.  The errors don't show up every time but the code I am getting says: niScope Configure Vertical.vi 3<ERR>The session handle is I am not sure where to start with this

  • How can I publish my iweb site using Jumpline as a host?  Anyone done it?

    My dad has a hosting account with Jumpline and can have an infinite amount of websites with unlimited storage (type of account is no long available fyi), so we have it set up on his end (thanks to help from a true IT guy, but he is a PC IT guy) but n

  • Archive backup error

    Hi, we are taking archive backup for that i getting below error plz help me to resolve the error. BR0002I BRARCHIVE 7.00 (32) BR0006I Start of offline redo log processing: aecmkecv.cds 2010-02-02 10.51.45 BR0484I BRARCHIVE log file: /oracle/KBP/sapar

  • When installing iOS 7.2 my iPhone 4 would not switch back on and said connect to iTunes

    I Connected to iTunes and it asked me to restore factory settings, I tried to do this but it said there was an unknown error.