ALV Classic - How to extract the selection long text of TYPE LVC_T_FCAT?

DATA: e_dyntab_tb  TYPE lvc_t_fcat,
          e_dyntab_wa TYPE lvc_s_fcat,
          t_line_reftab   TYPE REF   TO data.
*Populate ALV fiels of TYPE LVC_T_FCAT
MOVE: c_matnr      TO e_dyntab_wa-fieldname.
MOVE: c_material   TO e_dyntab_wa-scrtext_l.
APPEND e_dyntab_wa TO e_dyntab_tb.
LOOP AT t_hwk_date ASSIGNING <fs_hwk_date>. "t_hwk_date is DYNAMIC
    CONCATENATE c_hwk <fs_hwk_date>-index           INTO  e_dyntab_wa-fieldname.
    CONCATENATE c_hwk <fs_hwk_date>-calender_wk INTO  e_dyntab_wa-scrtext_l.
    APPEND e_dyntab_wa TO e_dyntab_tb.
ENDLOOP.
*Create dynamic itab from dynamic ALV output
CALL METHOD cl_alv_table_create=>create_dynamic_table
    EXPORTING
      it_fieldcatalog = e_dyntab_tb          "Pass alv_fcat here
    IMPORTING
      ep_table        = i_reftab.
* Create Dynamic Work Area and assign to FS
ASSIGN i_reftab->* TO <fs_final_itab>.      "Assigning the Final Table,
CREATE DATA t_line_reftab LIKE LINE OF <fs_final_itab>.
  ASSIGN t_line_reftab->* TO <fs_line_reftab>.  "Create a Work Area
QUESTION:
e_dyntab_wa-fieldname   = this is the fieldname / column heading for the dynamic internal table
e_dyntab_tb-scrtext_l     = this "should" be the 1st row(Column Heading Title) for the dynamic itab
                                    = this data will be used for MS Excel Functionality as always as the first row as
                                       column heading in the MS Excel
Legend:
How can I extract the entries of e_dyntab_tb-scrtext_l to an internal table containing the same structure of <fs_line_reftab>?

Maybe I missed something, but you already have the long text for the columns in your FCAT structure.  The problem you will have is that you will NOT be able to place those fields in the table that you have created because the headings will always be text and the columns may or may not be text (i.e. placing a heading into a numeric).  You will be required to use a different structure.
Since you are writing a custom export, you will need to do one of the following:
Option A:
1.  Retrieve the layout from the ALV as it will not necessarily be the same as when the original was created.  The user may have moved a column or hidden one.
2.  Create a structure for the export file that has only text fields.  It should contain all of the columns from the FCAT.  This can be done by creating another dynamic table and using the original FCAT and current layout.
3.  Insert the headings as the first row of the export file.
4.  Loop thru the internal table, compare it with the layout, and only insert the requested records into the export file.
5.  Export the file.
or Option B:
1.  Make sure the internal table has only text fields and insert the headings as the first record.
2.  Insert all other records with fields converted to alphanumeric.
3.  Use the standard export function.
Hope this helps,
Brian

Similar Messages

  • How to Extract the selected line in alv?

    Hi,
      I am learning ABAP and i have a doubt.It is as follows.
    In interactive reports, by clicking on a ROW we can display the line by using SY_LISEL in AT LINE_SELECTION event .
    Now i want to have a pop up window when we click on a selected row of ALV  report I want that single ROW to be displayed . How can i do this?

    Hi Ravindra,
    I think this is not possible with ALV reports because these use field catalogs unlike Interactive reports. Interactive reports only has the capability of popping up the data in the next list when clicked on row with the help of the events.
    Hope this helps.
    Please reward if useful.
    Thanks,
    Srinivasa

  • How to extract the Fast Formula Body through database?

    Hi All
    The Oracle fast formulas are stored in the ff_formulas_f table under the column formula_text having the datatype long. I want to extract the formula text through back end. When I use the statement, Select formula_text from ff_formulas_f, I am getting only the first line.
    How to extract the full formula text?
    Regards
    Rahman

    Here's a unix shell script to do it for you based on the info given by the other posters.
    #!/bin/sh
    if \[ "$1" == "" \]; then
    echo Syntax: $0 FAST_FORMULA_NAME
    exit 1
    fi
    ffname=`echo $1|tr \[:lower:\] \[:upper:\]`; export ffname
    sqlplus -silent $ORAUSER/$ORAPASSWD <<END
    set define off serveroutput on format wrapped linesize 512 pagesize 0 feedback off verify off heading off echo off pause off long 100000
    column formula_text format a512;
    select formula_text from ff_formulas_f where formula_name = '$ffname';
    exit;
    END
    Also this will list the formula names given a substring:
    #!/bin/sh
    if \[ "$1" == "" \]; then
    echo Syntax: $0 FAST_FORMULA_NAME
    exit 1
    fi
    ffname=`echo $1|tr \[:lower:\] \[:upper:\]`; export ffname
    sqlplus -silent $ORAUSER/$ORAPASSWD <<END
    set define off serveroutput on format wrapped linesize 512 pagesize 0 feedback off verify off heading off echo off pause off long 5000
    select formula_name from ff_formulas_f where formula_name like '%$ffname%';
    exit;
    END

  • How to extract the column width in ALv report if its executed in background

    I am executing an ALV report in background , in front end i am getting data properly, in back end for some columns some of the digits are missing.For example if PO no is of 10 digits it will display only 8 becos column size is like that , how to extract coulmns in back ground.
    I have executed in background and checked the spool and  for some of the columns width is not sufficient to display comeplete data so please suggest how to extract the columns sizes if executed inj background for an ALV

    Hi Deepthi,
    you can try with the above mentioned suggestions ,if its worked its fine ,
    If not use Docking container instead of custom container, For ALV in back ground jobs, its suggest to use docking container instead of custom container , below you can find the declaration for docking container and code to use docking and custom container in your program for fore and back ground.
    or you can use docking container alone for both operations.
    Data : G_DOCK1 TYPE REF TO CL_GUI_DOCKING_CONTAINER,
    IF CCON IS INITIAL. (ccon is container name )
    *Check whether the program is run in batch or foreground
        IF CL_GUI_ALV_GRID=>OFFLINE( ) IS INITIAL.
    *Run in foreground
          CREATE OBJECT CCON
            EXPORTING
              CONTAINER_NAME = 'CON1'.
        CREATE OBJECT GRID1
            EXPORTING
              I_PARENT = parent_1.
    ELSE.
    *Run in background
          CREATE OBJECT GRID1
            EXPORTING
              I_PARENT = G_DOCK1.
        ENDIF.
      ENDIF.
    B&R,
    Saravana.S

  • How to find the selected item in alv grid or table control

    can any one tell me please
    how to find the selected item in alv grid or table control

    In table control, If you goto screen painter and goto table control properties ( f2 ), there is one check-box w/selColumn check that and give column name. Then add that column to your internal table.
    IN PAI
      LOOP AT it_tkhdr.
        FIELD it_tkhdr-sel_row
          MODULE tab_tkhdr_mark ON REQUEST.
      ENDLOOP.
    MODULE tab_tkhdr_mark INPUT.
      MODIFY it_tkhdr INDEX tc_tkhdr-current_line.
    ENDMODULE.                 " tab_tkhdr_mark  INPUT
    here it_TKHDR is internal table sel_row is field for selection
    After that, you can loop at it_tkhdr where sel_row is 'X' to get selected rows.
    regards,
    Gagan

  • How to use the select option to get the multiple bom explosion

    hi friends,
              i have completed the bom exp using parameters to get one material
    input,but i need to adopt select option to give from and to materials
    i ll gives from and to materials with description and bom deails
    i here gave the coding also, pl give me a suggestion how to adpot the select
    optoins instead of parameters ,very urgent
    REPORT PP_BOM_EXPLOSION.
    tables :mara,marc,stpo.
    TYPE-POOLS : SLIS.
    *parameters: p_werks like t001w-werks obligatory.
    SELECT-OPTIONS : p_matnr FOR mara-matnr obligatory.
    **select-options : p_matnr for mara-matnr obligatory.
    PARAMETERS : P_WERKS LIKE T001W-WERKS OBLIGATORY,
            P_MATNR LIKE MARA-MATNR OBLIGATORY.
    *parameters: p_werks like marc-werks obligatory,
    *p_matnr like marc-matnr obligatory.
    constants c_x value 'X'.
    data: begin of it_comp occurs 0,
    matnr like mara-matnr,
    maktl like makt-maktx,
    idnrk like stpox-idnrk,
    ojtxp like stpox-ojtxp,
    menge like stpox-menge,
    meins like stpox-meins,
    matkl like stpox-matmk,
    end of it_comp.
    data : topmat like cstmat.
    data: w_topmat like cstmat.
    DATA : IT_MARA LIKE MARA OCCURS 0 WITH HEADER LINE.
    DATA : IT_FIELDCAT TYPE SLIS_T_FIELDCAT_ALV.
    DATA : WA_FIELDCAT_LN LIKE LINE OF IT_FIELDCAT.
    DATA : IT_EVENTCAT  TYPE SLIS_T_EVENT.
    DATA : WA_EVENTCAT_LN  LIKE LINE OF IT_EVENTCAT.
    DATA : IT_LAYOUT TYPE SLIS_LAYOUT_ALV.
    DATA: S_COL_POS TYPE I.
    start-of-selection.
    perform explode_assembly.
    PERFORM BUILD_FIELDCATALOG.
    PERFORM DATA_DISPLAY.
    *end-of-selection.
    *perform write_report.
    *top-of-page.
    *perform print_header.
    *form print_header.
    *write: /(18) 'Component'(h00),
    *(40) 'Description'(h01),
    *'Mat.Group'(h02),
    *(18) 'Quantity'(h03).
    *uline.
    *endform.
    *form write_report.
    *write: / w_topmat-matnr under text-h00 color col_heading,
    *w_topmat-maktx under text-h01 color col_heading.
    *loop at it_comp.
    *write: /
    *it_comp-idnrk under text-h00,
    *it_comp-ojtxp under text-h01,
    *it_comp-matkl under text-h02,
    *it_comp-menge unit it_comp-meins under text-h03,
    *it_comp-meins.
    *endloop.
    *uline.
    *endform.
    form explode_assembly.
    data: it_stb like stpox occurs 0 with header line,
    it_stb2 like stpox occurs 0 with header line,
    it_stb3 like stpox occurs 0 with header line,
    w_msg(255) type c.
    SELECT MATNR FROM MARA INTO CORRESPONDING FIELDS OF TABLE IT_MARA
                               WHERE MATNR IN P_MATNR.
    Explode highest level:
    *LOOP AT IT_MARA.
    call function 'CS_BOM_EXPL_MAT_V2'
    exporting
    auskz = c_x
    capid = 'PP01'
    cuols = c_x
    datuv = sy-datum
    knfba = c_x
    ksbvo = c_x
    mbwls = c_x
    mdmps = c_x
    BGIXO = c_x
    MKMAT = c_x
    MMAPS = c_x
    FBSTP = c_x
    FTREL = c_x
    mtnrv = P_MATNR
    werks = p_werks
    importing
    topmat = w_topmat
    tables
    stb = it_stb
    exceptions
    alt_not_found = 1
    call_invalid = 2
    material_not_found = 3
    missing_authorization = 4
    no_bom_found = 5
    no_plant_data = 6
    no_suitable_bom_found = 7
    conversion_error = 8
    others = 9.
    if sy-subrc <> 0.
    message id sy-msgid type sy-msgty number sy-msgno
    with sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4
    into w_msg.
    *write: / w_msg.
    exit.
    endif.
    Don't process documents
    delete it_stb where idnrk is initial.
    Don't process valid from furure:
    delete it_stb where datuv >= sy-datum.
    Explode phantom assemblies up to last level
    *do.
    it_stb2[] = it_stb[].
    *delete it_stb2 where dumps is initial.
    *if it_stb2[] is initial.
    *exit.
    *endif.
    *delete it_stb where not dumps is initial.
    delete it_stb where VPRSV <> 'S' OR MMSTA = '61'.
    loop at it_stb2.
    call function 'CS_BOM_EXPL_MAT_V2'
    exporting
    capid = 'PP01'
    auskz = c_x
    cuols = c_x
    datuv = sy-datum
    knfba = c_x
    ksbvo = c_x
    mbwls = c_x
    mdmps = c_x
    FBSTP = c_x
    FTREL = c_x
    mtnrv = it_stb2-idnrk
    werks = p_werks
    tables
    stb = it_stb3
    exceptions
    alt_not_found = 1
    call_invalid = 2
    material_not_found = 3
    missing_authorization = 4
    no_bom_found = 5
    no_plant_data = 6
    no_suitable_bom_found = 7
    conversion_error = 8
    others = 9.
    if sy-subrc <> 0.
    message id sy-msgid type sy-msgty number sy-msgno
    with sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4
    into w_msg.
    *write: / w_msg.
    else.
    delete it_stb3 where idnrk is initial.
    delete it_Stb3 where sobsl = 50.
    loop at it_stb3 .
    multiply it_stb3-menge by it_stb2-menge.
    modify it_stb3 transporting menge.
    endloop.
    append lines of it_stb3 to it_stb.
    endif.
    *ENDLOOP.
    endloop.
    *enddo.
    Build table of components collecting the same components from
    all levels
    loop at it_stb.
    it_comp-matkl = it_stb-matmk.
    it_comp-idnrk = it_stb-idnrk.
    it_comp-ojtxp = it_stb-ojtxp.
    it_comp-menge = it_stb-menge.
      CALL FUNCTION 'CONVERSION_EXIT_CUNIT_OUTPUT'
        EXPORTING
        INPUT                = IT_STB-MEINS
        LANGUAGE             = SY-LANGU
        IMPORTING
      LONG_TEXT            =
       OUTPUT               = IT_STB-MEINS
      SHORT_TEXT           =
    EXCEPTIONS
       UNIT_NOT_FOUND       = 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.
    it_comp-meins = it_stb-meins.
    collect it_comp.
    clear it_comp.
    endloop.
    *READ TABLE IT_COMP INDEX 1.
    *IF SY-SUBRC = 0.
    IT_COMP-MATNR = w_topmat-matnr.
    IT_COMP-MAKTL = w_topmat-maktx.
    INSERT IT_COMP index 1.
    *ENDIF.
    ENDFORM.
    FORM TO APPEND DATA INTO ALV FORM
    FORM BUILD_FIELDCATALOG.
    PERFORM BUILD_FIELDCAT USING 'MATKL' 'Component'.
    PERFORM BUILD_FIELDCAT USING 'MATKL' 'Component'.
    *loop at it_comp.
       PERFORM BUILD_FIELDCAT USING 'MATNR' 'Material'.
      PERFORM BUILD_FIELDCAT USING 'MAKTL' 'Material Description'.
      PERFORM BUILD_FIELDCAT USING 'IDNRK' 'Component'.
      PERFORM BUILD_FIELDCAT USING 'OJTXP' 'Description'.
      PERFORM BUILD_FIELDCAT USING 'MATKL' 'Material Group'.
      PERFORM BUILD_FIELDCAT USING 'MENGE'  'Quantity'.
      PERFORM BUILD_FIELDCAT USING 'MEINS' 'Unit Of MEASUREMENT'.
    *endloop.
    ENDFORM.
    FORM TO BUILD IN FIELD CATALOG FOR ALV FORM
    FORM BUILD_FIELDCAT USING L_FIELDNAME LIKE DD03L-FIELDNAME S_TEXT LIKE DD03P-SCRTEXT_M.
      CLEAR WA_FIELDCAT_LN.
      ADD 1 TO S_COL_POS.
      WA_FIELDCAT_LN-REF_TABNAME  = 'IT_COMP'.
      WA_FIELDCAT_LN-FIELDNAME    = L_FIELDNAME.
      WA_FIELDCAT_LN-SELTEXT_M    = S_TEXT.
      WA_FIELDCAT_LN-COL_POS      = S_COL_POS.
      WA_FIELDCAT_LN-QFIELDNAME   = SPACE.
      WA_FIELDCAT_LN-HOTSPOT      = SPACE.
      WA_FIELDCAT_LN-JUST         = 'R'.
      APPEND WA_FIELDCAT_LN TO IT_FIELDCAT.
    ENDFORM.
    FORM TO BUILD IN FIELD CATALOG FOR ALV FORM
    FORM DATA_DISPLAY.
    CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
    EXPORTING
      I_CALLBACK_HTML_END_OF_LIST       = ' '
      I_STRUCTURE_NAME                  =
      I_BACKGROUND_ID                   = ' '
       I_GRID_TITLE                      = TEXT-001
      I_GRID_SETTINGS                   =
      IS_LAYOUT                         =
       IT_FIELDCAT                       = IT_FIELDCAT
    IMPORTING
      E_EXIT_CAUSED_BY_CALLER           =
      ES_EXIT_CAUSED_BY_USER            =
      TABLES
        T_OUTTAB                          = IT_COMP
       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.
    Thanks in advance
                                                                                    Regards
    senthilkumar D

    tables :mara,marc,stpo.
    parameters: p_werks like t001w-werks obligatory.
    *p_matnr like mara-matnr obligatory.
    *select-options : p_matnr for mara-matnr obligatory.
    select-options : P_matnr for mara-matnr.
    *parameters: p_werks like marc-werks obligatory,
    *p_matnr like marc-matnr obligatory.
    constants c_x value 'X'.
    data: begin of it_comp occurs 0,
    idnrk like stpox-idnrk,
    ojtxp like stpox-ojtxp,
    menge like stpox-menge,
    meins like stpox-meins,
    matkl like stpox-matmk,
    end of it_comp.
    data: w_topmat like cstmat.
    data : begin of itab occurs 0,
            matnr like mara-matnr,
            end of itab.
    *data : itab type table of mara with header line.
    start-of-selection.
    perform explode_assembly.
    end-of-selection.
    perform write_report.
    top-of-page.
    perform print_header.
    form print_header.
    write: /(18) 'Component'(h00),
    (40) 'Description'(h01),
    'Mat.Group'(h02),
    (18) 'Quantity'(h03).
    uline.
    endform.
    form write_report.
    write: / w_topmat-matnr under text-h00 color col_heading,
    w_topmat-maktx under text-h01 color col_heading.
    loop at it_comp.
    write: /
    it_comp-idnrk under text-h00,
    it_comp-ojtxp under text-h01,
    it_comp-matkl under text-h02,
    it_comp-menge unit it_comp-meins under text-h03,
    it_comp-meins.
    endloop.
    uline.
    endform.
    form explode_assembly.
    data: it_stb like stpox occurs 0 with header line,
    it_stb2 like stpox occurs 0 with header line,
    it_stb3 like stpox occurs 0 with header line,
    w_msg(255) type c.
    select matnr from mara into table itab where matnr  between p_matnr-low and p_matnr-high.
    loop at p_matnr.
      itab-matnr = p_matnr-low.
       append itab.
       itab-matnr = p_matnr-high.
       append itab.
       clear itab.
       endloop.
    Explode highest level:
    loop at itab.
    call function 'CS_BOM_EXPL_MAT_V2'
    exporting
    auskz = c_x
    capid = 'PP01'
    cuols = c_x
    datuv = sy-datum
    knfba = c_x
    ksbvo = c_x
    mbwls = c_x
    mdmps = c_x
    BGIXO = c_x
    MKMAT = c_x
    MMAPS = c_x
    FBSTP = c_x
    FTREL = c_x
    mtnrv = itab-matnr
    werks = p_werks
    importing
    topmat = w_topmat
    tables
    stb = it_stb
    exceptions
    alt_not_found = 1
    call_invalid = 2
    material_not_found = 3
    missing_authorization = 4
    no_bom_found = 5
    no_plant_data = 6
    no_suitable_bom_found = 7
    conversion_error = 8
    others = 9.
    if sy-subrc <> 0.
    message id sy-msgid type sy-msgty number sy-msgno
    with sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4
    into w_msg.
    write: / w_msg.
    exit.
    *else.
    endif.
    loop at it_stb.
    it_comp-matkl = it_stb-matmk.
    it_comp-idnrk = it_stb-idnrk.
    it_comp-ojtxp = it_stb-ojtxp.
    it_comp-menge = it_stb-menge.
    it_comp-meins = it_stb-meins.
    collect it_comp.
    clear it_comp.
    endloop.
    endloop.
    endform.
    i got the low and high from selectoption and then move it into itab.
    then i pass itab-matnr into fm. using loop.
    but i got only one output
    but ineet to got from and to output.
    give me a solution
    Regards
    ds

  • How to extract the date value of IBOR date="12/12/2009"

    I have the following query, but do not get the date value out:
    WITH ibors AS (
    SELECT xmltype('<?xml version="1.0" encoding="utf-8"?>
    <IBOR date="12/12/2009">
    <LIBOR currency="USD">
    <OneYear>1.38875</OneYear>
    </LIBOR>
    </IBOR>
    ') ibor_xml
    FROM dual
    SELECT i.ibor_date, i.ibor_oneyear
    FROM ibors,
    XMLTABLE(
    '//IBOR'
    PASSING ibors.ibor_xml
    COLUMNS ibor_date VARCHAR2(20) PATH '/IBOR/date',
    ibor_oneyear VARCHAR2(20) PATH '/IBOR/LIBOR/OneYear'
    ) i;
    How to extract the date value of <IBOR date="12/12/2009">?

    Hi,
    The date is an attribute of element IBOR. So you must use "@date" in the xpath expression :
    WITH ibors AS (
    SELECT xmltype('<?xml version="1.0" encoding="utf-8"?>
    <IBOR date="12/12/2009">
    <LIBOR currency="USD">
    <OneYear>1.38875</OneYear>
    </LIBOR>
    </IBOR>
    ') ibor_xml
    FROM dual
    SELECT i.ibor_date, i.ibor_oneyear
    FROM ibors,
    XMLTABLE(
    '//IBOR'
    PASSING ibors.ibor_xml
    COLUMNS
    ibor_date VARCHAR2(20) PATH '/IBOR/@date',
    ibor_oneyear VARCHAR2(20) PATH '/IBOR/LIBOR/OneYear'
    ) i;

  • How to extract the customer's list

    Hi,
    Please help me how to extract the list of customers (sold-to-party) for whom email id is not maintained in contact person's details.
    Waiting for ur replies..
    Thanks in advance.
    Regards,
    Rahul

    Hi,
    You can select the data from KNVK..
    Get the customers..
    Then use the personnel numbers KNVK-PRSNR
    to get the email address from the table ADR6..
    If there is no value in the ADR6-SMTP_ADDR ..Then the email address is not maintained..
    Thanks,
    Naren

  • How to extract the details of the stored procedures in the database?

    Dear all,
    How to extract the details of them?
    Bst Rgds,
    Edward

    Hi Wa-Man Edward Chan,
    Following is the PLSQL Block Which Will Give Package, Procedure, Function Source
    set verify off
    undefine which_object;
    undefine which_line;
    declare
    Shows lines with context of:
    VIEW
    FUNCTION
    PROCEDURE
    TRIGGER
    PACKAGE SPECIFICATION
    PACKAGE BODY
    The script uses to temporary tables ERROR_TABLE_TEMP and ERROR_CLOB_TEMP created with:
    CREATE GLOBAL TEMPORARY TABLE ERROR_TABLE_TEMP(line number, text varchar2(4000));
    CREATE GLOBAL TEMPORARY TABLE ERROR_CLOB_TEMP(TEXT CLOB);
    v_offset number:= 5; -- Controls how many lines before and after the line in focus are to be shown
    v_obj_name varchar2(100);
    v_obj_type varchar2(100);
    v_obj_type_new varchar2(100);
    v_obj_line number;
    v_counter number := 0;
    v_text varchar2(32767);
    v_subtext varchar2(1000);
    v_from number;
    v_len number;
    v_marker varchar2(10);
    v_found number;
    v_line_from number;
    v_line_to number;
    v_long_text clob;
    procedure ins_line (p_text in varchar2) is
    begin
    v_counter := v_counter + 1;
    insert into error_table_temp(line,text)
    values (v_counter,p_text);
    end;
    begin
    delete error_table_temp;
    select ltrim(rtrim(upper('&which_object'))), nvl(to_number('&which_line'),0)
    into v_obj_name, v_obj_line
    from dual;
    begin
    select decode(object_type,'PACKAGE','PACKAGE BODY',object_type)
    into v_obj_type
    from user_objects
    where object_name = v_obj_name
    and nvl(v_obj_line,0) > 0
    and rownum = 1;
    exception when no_data_found then
    ins_line('ERROR: Object/line not found');
    return;
    end;
    ins_line(v_obj_name||' ('||v_obj_type||')');
    if v_obj_type in ('PACKAGE BODY','PACKAGE','FUNCTION','PROCEDURE') then
    v_obj_type_new := v_obj_type;
    ins_line('----------------------- PROGRAM LISTING -------------------------');
    for code in (select trim(text) text, lpad(line,4,' ')||' '||decode(line,v_obj_line,'>>>>> ',' ') marker, type
    from user_source
    where name = v_obj_name
    and line between v_obj_line-v_offset and v_obj_line+v_offset
    order by decode(type,v_obj_type,1,2),line) loop
    if v_obj_type_new != code.type then
    ins_line(null);
    v_obj_type_new := code.type;
    v_counter := -100000; -- In order to show specification before body
    ins_line(v_obj_name||' ('||v_obj_type_new||')');
    ins_line('----------------------- PROGRAM LISTING -------------------------');
    end if;
    ins_line(code.marker||code.text);
    end loop;
    elsif v_obj_type = 'VIEW' then
    select text
    into v_text
    from user_views
    where view_name = v_obj_name;
    v_line_from := v_obj_line-v_offset;
    v_line_to := v_obj_line+v_offset;
    v_obj_line := v_obj_line -1;
    ins_line('------------------------------- PROGRAM LISTING -------------------------------');
    for i in v_line_from..v_line_to loop
    begin
    if i = v_obj_line then
    v_marker := '>>>>> ';
    else
    v_marker := ' ';
    end if;
    if i = 0 then
    v_from := 0;
    v_len := instr(v_text,chr(10));
    else
    v_from := instr(v_text,chr(10),1,i);
    v_len := instr(v_text,chr(10),1,i+1) - v_from;
    end if;
    v_subtext := substr(v_text,v_from+1,v_len-1);
    if v_len > 0 then
    ins_line(lpad(to_char(i+1),4,' ')||' '||v_marker||v_subtext);
    end if;
    exception when others then
    null;
    end;
    end loop;
    elsif v_obj_type = 'TRIGGER' then
    ins_line('----------------------- PROGRAM LISTING -------------------------');
    delete error_clob_temp;
    execute immediate 'insert into error_clob_temp (text) '||
    'select to_lob(trigger_body) '||
    'from user_triggers ' ||
    'where trigger_name = '''||v_obj_name||'''';
    select text
    into v_long_text
    from error_clob_temp;
    v_obj_line := v_obj_line-1;
    v_line_from := v_obj_line-v_offset;
    v_line_to := v_obj_line+v_offset;
    for i in v_line_from..v_line_to loop
    begin
    if i = v_obj_line then
    v_marker := '>>>>> ';
    else
    v_marker := ' ';
    end if;
    if i = 0 then
    v_from := 0;
    v_len := dbms_lob.instr(v_long_text,chr(10));
    else
    v_from := dbms_lob.instr(v_long_text,chr(10),1,i);
    v_len := dbms_lob.instr(v_long_text,chr(10),1,i+1) - v_from;
    end if;
    v_subtext := dbms_lob.substr(v_long_text,v_len-1,v_from+1);
    if v_len > 0 then
    ins_line(lpad(to_char(i+1),4,' ')||' '||v_marker||v_subtext);
    end if;
    exception when others then
    null;
    end;
    end loop;
    end if;
    if v_counter = 0 then
    ins_line('*********** NO CODE FOUND ***********');
    else
    ins_line(null);
    end if;
    exception when others then
    ins_line('*********** ERROR: NOT POSSIBLE TO SHOW THE CODE ***********');
    ins_line(' FEJL: '||sqlerrm);
    end;
    set linesize 4000
    set heading off
    set feedback off
    set verify on
    select text
    from error_table_temp
    order by line;
    set linesize 80
    set heading on
    set feedback on
    Prashant

  • How to handle the selected record

    how to handle the selected record when using alv classes

    Hi,
    use method : get_current_cell                    
      CALL METHOD grid1->get_current_cell                    
                          IMPORTING es_row_id = ls_row_id     
                                    es_col_id = ls_col_id     
                                     e_value  = l_value.     

  • In BI how to filter the selection options based on inputs on top field

    Hi Friends,
    In BI, How to filter the selection options based on inputs on top field.
    The system should automatically filter the lower level drop downs based on the selection of a higher level.
    For e.g. :
    If a user selects a Country then the States drop down should only display the State's belongs to the Country. Similarly when a State is selected, the District drop down should display only those District's belongs to the State.
    Thanks in Advance.
    Regards
    Jayaram M

    Hi Anil,
    Thanks for reply but I couldn't use Compounding Characteristic here. Need some other solution.
    Regards
    Jayaram M

  • How to get the selected values from the shuttle

    Hi
    Please tell me how to get the selected option values from the shuttle leading list.
    Thanks

    you can also obtain the option values present in the leading and trailing lists using the
    following methods:
    public String[] getLeadingListOptionValues(OAPageContext pageContext, OAWebBean
    webBean)
    public String[] getTrailingListOptionValues(OAPageContext pageContext, OAWebBean
    webBean)For example, the following code sample returns an array of values in the trailing list, ordered according to the
    order in which they appear in the list:
    String[] trailingItems =
    shuttle.getTrailingListOptionValues(pageContext, shuttle);Thanks
    --Anil                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       

  • How to Retrieve the Selected Values from selectOrderShuttle using ADF 11g

    Hi Every One,
    Does anyone has idea how to retrieve the selected Items using shuttle and Order of the items using 'SelectOrderShuttle' component ?
    Thanks

    shuttle's valuechangeevent would fire when you shuttle items back and forth.
        public void selectOrderShuttle1_valueChangeListener(ValueChangeEvent valueChangeEvent) {
            ArrayList list = new ArrayList(Arrays.asList(valueChangeEvent.getNewValue()));
            if (list != null){
                for (int i=0; i<list.size(); i++) {
                    int l = list.size()-1;
                    val = list.get(l).toString(); //returns , delimited string
                    if (val != null){
                        val = val.replaceAll("[\\[\\]]", "");
                        StringTokenizer st = new StringTokenizer (val, ",");
                        int nto = st.countTokens ();
                        for (int j = 0; j < nto; j++)
                            String token = st.nextToken ();                     
                ..........

  • How to delete the selected rows in a JTable on pressing a button?

    How to delete the selected rows in a JTable on pressing a button?

    You are right. I did the same.
    Following is the code where some of them might find it useful in future.
    jTable1.selectAll();
    int[] array = jTable1.getSelectedRows();
    for(int i=array.length-1;i>=0;i--)
    DefaultTableModel model = (DefaultTableModel)jTable1.getModel();
    model.removeRow(i);
    }

  • How to get the selected rows & columns in the table?

    hi everybody,
                         In my application the table is kept inside the event structure.I select the cells  in the table (using mouse) on running time.How to get the selected number of rows & columns in that table?

    Hello,
    You can fill selected values of the table by writing to it or the corresponding property using a property node - the table is just a 2D array of strings.  I think for your "disable" question you are referring to the shortcut menu (when you right click).  If you are using LabVIEW 8.x, you can edit or disable that shortcut menu - just right click on your table at edit time and choose Advanced >> Run-Time Shortcut Menu.
    Best Regards,
    JLS
    Best,
    JLS
    Sixclear

Maybe you are looking for