Sample ECC 6.0 program to display table structure

As an exercise after taking a OO class, I created the following.  Hope some people can find it useful.  I have to admidt, I do not really understand everything it does.  It was created by reviewing some of the SAP Demo programs and some notes from class.  Comments are welcome.
Sorry about the formatting.  I tried using the formatting to display as code but it did not work.  Even tried to split it up into smaller sections and mark each as code, but it still did not work.  
REPORT  ZCA_BOB_CL_ABAP_STRUCTDESCR.
PARAMETERS P_TABNAM type TABNAME OBLIGATORY.
Data: wa_spfli type spfli,
      r_descr type REF TO cl_abap_structdescr,
      wa_comp TYPE abap_compdescr.
** Create references to the needed ALV Global Classes
  data: lr_events type ref to cl_salv_events_table.
  data: gr_table   type ref to cl_salv_table.
  Data: r_grid TYPE REF TO cl_salv_table.
  data: r_title_text TYPE REF TO cl_alv_variant,
        r_grid_title TYPE LVC_TITLE.
Data:  abap_compdescr_tab TYPE STANDARD TABLE OF abap_compdescr
                     WITH KEY name.
Data: wk_length(6) type n,
      wk_decimals(6) type n.
START-OF-SELECTION.
**         ?=   means cast
** r_descr ?= cl_abap_typedescr=>describe_by_data( wa_spfli ).
r_descr ?= cl_abap_typedescr=>describe_by_name( P_TABNAM ).
Loop at r_descr->components into wa_comp.
*   write:/ wa_comp-name, wa_comp-type_kind, wa_comp-length,
*            wa_comp-decimals.
  If wa_comp-type_kind = 'C'
   or wa_comp-type_kind = 'D'
   or wa_comp-type_kind = 'N'.
    Divide wa_comp-length by 2.
  Else.
** go out to table DD02L to get LENG and DECIMALS
   SELECT single LENG DECIMALS from DD03L
     into (wk_length, wk_decimals)
      where tabname = p_tabnam
        and fieldname = wa_comp-name.
    wa_comp-length = wk_length.
    wa_comp-decimals = wk_decimals.
  Endif.
   append wa_comp to abap_compdescr_tab.
EndLoop.
Call the method to create the ALV output
   TRY.
  CALL METHOD CL_SALV_TABLE=>FACTORY
    EXPORTING
      LIST_DISPLAY   = IF_SALV_C_BOOL_SAP=>FALSE
     R_CONTAINER    =
     CONTAINER_NAME =
    IMPORTING
      R_SALV_TABLE   = r_grid
    CHANGING
      T_TABLE        = abap_compdescr_tab.
   CATCH CX_SALV_MSG .
  ENDTRY.
*... §3 Functions
*... §3.1 activate ALV generic Functions
  data: lr_functions type ref to cl_salv_functions_list.
  lr_functions = r_grid->get_functions( ).
  lr_functions->set_default( abap_true ).
*... set the columns technical
  data: lr_columns type ref to cl_salv_columns.
  lr_columns = r_grid->get_columns( ).
  lr_columns->set_optimize( abap_true ).
  perform set_columns_technical using lr_columns.
this will overwrite the data element specified in the data dictionary
data: l_column TYPE REF TO CL_SALV_COLUMN.
l_column ?= lr_columns->get_column( 'LENGTH' ).
l_column->set_long_text( 'Length' ).
l_column->set_medium_text( 'LENGTH' ).
l_column->set_short_text( 'LEN' ).
l_column ?= lr_columns->get_column( 'NAME' ).
l_column->set_long_text( 'Field Name' ).
l_column->set_medium_text( 'Field Nm' ).
l_column->set_short_text( 'Field' ).
l_column ?= lr_columns->get_column( 'TYPE_KIND' ).
l_column->set_long_text( 'Type' ).
l_column->set_medium_text( 'Type' ).
l_column->set_short_text( 'Type' ).
l_column ?= lr_columns->get_column( 'DECIMALS' ).
l_column->set_long_text( 'Decimals' ).
l_column->set_medium_text( 'DECIMALS' ).
l_column->set_short_text( 'DEC' ).
perform create_header_and_footer .
code needed for Event Handling
*lr_events = r_grid->get_event( ).
create object gr_events.
set handler gr_events->on_double_click for lr_events.
  r_grid->display( ).
*&      Form  set_columns_technical
      text
form set_columns_technical using ir_columns type ref to cl_salv_columns.
  data: lr_column type ref to cl_salv_column.
  try.
      lr_column = ir_columns->get_column( 'MANDT' ).
      lr_column->set_technical( if_salv_c_bool_sap=>true ).
    catch cx_salv_not_found.                            "#EC NO_HANDLER
  endtry.
  try.
      lr_column = ir_columns->get_column( 'FLOAT_FI' ).
      lr_column->set_technical( if_salv_c_bool_sap=>true ).
    catch cx_salv_not_found.                            "#EC NO_HANDLER
  endtry.
  try.
      lr_column = ir_columns->get_column( 'STRING_F' ).
      lr_column->set_technical( if_salv_c_bool_sap=>true ).
    catch cx_salv_not_found.                            "#EC NO_HANDLER
  endtry.
  try.
      lr_column = ir_columns->get_column( 'XSTRING' ).
      lr_column->set_technical( if_salv_c_bool_sap=>true ).
    catch cx_salv_not_found.                            "#EC NO_HANDLER
  endtry.
  try.
      lr_column = ir_columns->get_column( 'INT_FIEL' ).
      lr_column->set_technical( if_salv_c_bool_sap=>true ).
    catch cx_salv_not_found.                            "#EC NO_HANDLER
  endtry.
  try.
      lr_column = ir_columns->get_column( 'HEX_FIEL' ).
      lr_column->set_technical( if_salv_c_bool_sap=>true ).
    catch cx_salv_not_found.                            "#EC NO_HANDLER
  endtry.
  try.
      lr_column = ir_columns->get_column( 'DROPDOWN' ).
      lr_column->set_technical( if_salv_c_bool_sap=>true ).
    catch cx_salv_not_found.                            "#EC NO_HANDLER
  endtry.
  try.
      lr_column = ir_columns->get_column( 'TAB_INDEX' ).
      lr_column->set_technical( if_salv_c_bool_sap=>true ).
    catch cx_salv_not_found.                            "#EC NO_HANDLER
  endtry.
endform.                    " set_columns_technical
*&      Form  set_columns_technical
      text
form set_columns_technical using ir_columns type ref to cl_salv_columns.
  data: lr_column type ref to cl_salv_column.
  try.
      lr_column = ir_columns->get_column( 'MANDT' ).
      lr_column->set_technical( if_salv_c_bool_sap=>true ).
    catch cx_salv_not_found.                            "#EC NO_HANDLER
  endtry.
  try.
      lr_column = ir_columns->get_column( 'FLOAT_FI' ).
      lr_column->set_technical( if_salv_c_bool_sap=>true ).
    catch cx_salv_not_found.                            "#EC NO_HANDLER
  endtry.
  try.
      lr_column = ir_columns->get_column( 'STRING_F' ).
      lr_column->set_technical( if_salv_c_bool_sap=>true ).
    catch cx_salv_not_found.                            "#EC NO_HANDLER
  endtry.
  try.
      lr_column = ir_columns->get_column( 'XSTRING' ).
      lr_column->set_technical( if_salv_c_bool_sap=>true ).
    catch cx_salv_not_found.                            "#EC NO_HANDLER
  endtry.
  try.
      lr_column = ir_columns->get_column( 'INT_FIEL' ).
      lr_column->set_technical( if_salv_c_bool_sap=>true ).
    catch cx_salv_not_found.                            "#EC NO_HANDLER
  endtry.
  try.
      lr_column = ir_columns->get_column( 'HEX_FIEL' ).
      lr_column->set_technical( if_salv_c_bool_sap=>true ).
    catch cx_salv_not_found.                            "#EC NO_HANDLER
  endtry.
  try.
      lr_column = ir_columns->get_column( 'DROPDOWN' ).
      lr_column->set_technical( if_salv_c_bool_sap=>true ).
    catch cx_salv_not_found.                            "#EC NO_HANDLER
  endtry.
  try.
      lr_column = ir_columns->get_column( 'TAB_INDEX' ).
      lr_column->set_technical( if_salv_c_bool_sap=>true ).
    catch cx_salv_not_found.                            "#EC NO_HANDLER
  endtry.
endform.                    " set_columns_technical
Edited by: Bob Ackerman on Oct 7, 2010 9:29 AM
Edited by: Bob Ackerman on Oct 7, 2010 9:31 AM
Edited by: Neil Gardiner on Oct 8, 2010 1:20 PM

This is a link to the code in the original post [https://doc-14-3k-docs.googleusercontent.com/docs/secure/ad8oc7ng8nd82tpkp8r54v1qsr81p1c3/h9parppirlu2qium8s2i9jbba47n8l6h/1286452800000/18076731927072634844/18076731927072634844/0B0hRsCI-bphRNjQ3ZDI3ZjAtM2MwMS00NzYwLWI3NTQtNjkxNzQ1YmMzNmY0?nonce=vvc7c51u8m01s&user=18076731927072634844&hash=k89v9fpcnmmj3bme88q9d9dbq9meavfm]

Similar Messages

  • Creating/Copying Z Objects and assign them to Tables/Structures/Programs...

    Dear Colleagues,
    I am failry new to ABAP,as I have mainly functional MM/SD/WM/
    I need to be creating a fileld such as the one seen below( ZZLOOM).This is already showing on the transactions CO02/CO03(production orders).
    Can you please therefore give me step by step rough guide how to create this field and assign it to the program and the table/structure?To which program needs this to be assigned on SE38? Is it the screen data program SAPLXCO1 or the field desciption for batch input program SAPLCOKO1-please see below.
    Can I create the new (ZRAL) object by copying from the above (ZZLOOM) and on which Tcode I can do this?The program SAPLCOK01 is used(according to se38) on programs,ckasses and BSP applications.
    Program Name SAPLXCO1
    Screen number 0100
    Program Name SAPLCOCU
    Status VVKOPF
    Table Name ZWRK_CI_AUFK
    Field Name ZZLOOM
    Data Element ZZLOOM
    DE Supplement 0
    Screen Field ZWRK_CI_AUFK-ZZLOOM
    Program Name SAPLCOKO1
    Screen Number 0115
    All help appreciated,
    PAPJ1.

    Hi Archana,
    I'm simply trying to add a field such as the existing ones showing up on the customer screen tab of CO02/CO03,so I copied ZZNESTNO (shown as NEST below) into a new field called ZZRALNO.
    Mec MBW Start 18.05.2011
            End   18.05.2011
    Ele SS  Start 23.05.2011
            End   23.05.2011
    Nest          17c
    CoilNest
    Pipe          16/05
    Loom
    COIL WIP
    COIL DATE
    Through F1,I found out the field details of ZZNESTNO,shown below:
    Program Name     SAPLXCO1
    Screen number    0100
    Program Name     SAPLCOCU
    Status           VVKOPF
    Table Name       ZWRK_CI_AUFK
    Field Name       ZZNESTNO
    Data Element     ZZNESTNO
    DE Supplement    0
    Screen Field     ZWRK_CI_AUFK-ZZNESTNO
    Program Name     SAPLCOKO1
    Screen Number    0115
    This is what I am trying to achieve-Is this any clearer?
    Thanks a million for your help.
    PAPJ1.
    Edited by: PAPJ1 on Jun 8, 2011 4:37 PM

  • Provide Sample Program for Display Symbol?

    Hi All,
    I want write program for display symbol in S94, but want to know which table i can refer, please provide me a sample program for that.
    Regards
    Avinav

    Hi,
    Do you mean the ICONS ?
    TYPE-POOLS : ICON
    In your code use the icon name.
    In case of ALV, in the fieldcatalog mention wa_fielcat-icon = 'X'.
    Thanks
    Swarna

  • Standard program to display which tables are used by Webdynpro ABAP program

    Hi Gurus,
    I am working on a couple of enhancements in SAP Promotion Management for Retail (SAP PMR) which works on the principle of Floor Plan Management.
    I was wondering if anyone would know of a standard program to display the tables used by Webdynpro ABAP?
    (or)
    Where can I get info of SAP Tables associated to SAP PMR?

    Hi,
    I am not aware of any standard reports that displays the tables.
    If I have to view the tables, I would go to se80, give the package and view all the tables in the package.
    Regards,
    Daz.

  • How to read a table/structure value in a container from a Z program

    Experts,
    I have a WF with one of the container element is a multiline table element of the strucuture BSEG. Now I have a report where given a WID, i need to read the contents of this structure from the workflow container and display in ALV grid.
    I'm using the FM SAP_WAPI_READ_CONTAINER or SWW_WI_CONTAINER_READ to read the container. No issues till here now.
    I'm able to read the contents of the attributes that are simple without being in a structure/table.
    But, how do i read the values from the table/structure in the container from this FM?
    I see lots of threads talking about SWC_GET_TABLE or something like that. But I don't know whether and how to use it in my scenario. Any sample programs will be greatly appreciated.
    Thanks,
    Sam

    Hey,
    No issues. I sorted out myself. Glory to God in the Heavens!
    -Sam

  • Displaying table using call function 'REUSE_ALV_GRID_DISPLAY'

    I have created a table which has product code, product description, and product level.  I am trying to display it using REUSE_ALV_GRID_DISPLAY.  When I Check it, I get the following error message: "PVS2" is not an internal table - the "Occurs n" specification is missing.
    Is it possible to copy PVS2 into another table, and then display that table using REUSE_ALV_GRID_DISPLAY?
    I have patched together code from sdn, a client program, and my own code and I am starting to get confused.  So, please help me.
    Regards,
    Al Lal
    REPORT  YABHINAV16.
    * program to display products at chosen level *
    Tables: T179, T179t.
    types:  begin of hierarchy,
            prodh type t179-prodh,
            vtext type t179t-vtext,
            stufe type t179-stufe,
            end of hierarchy.
    types: begin of text,
    prodh type t179t-prodh,
    vtext type t179t-vtext,
    end of text.
    data: pvs type standard table of hierarchy initial size 0.
    data: pvs2 type hierarchy.
    data: it_text type standard table of text,
    wa_text type text.
    TYPE-POOLS:SLIS.
    *For ALV
    DATA: GT_FLD TYPE SLIS_T_FIELDCAT_ALV,
          GT_EV TYPE SLIS_T_EVENT,
          GT_HDR TYPE SLIS_T_LISTHEADER,
          GT_SORT TYPE SLIS_T_SORTINFO_ALV.
    DATA: WA_FLD TYPE SLIS_FIELDCAT_ALV,
          WA_EV TYPE SLIS_ALV_EVENT,
          WA_HDR TYPE SLIS_LISTHEADER,
          WA_SORT TYPE SLIS_SORTINFO_ALV,
          WA_LAYOUT TYPE SLIS_LAYOUT_ALV.
    DEFINE FLD.
      WA_FLD-FIELDNAME   = &1.
      WA_FLD-TABNAME     = &2.
      WA_FLD-OUTPUTLEN   = &3.
      WA_FLD-SELTEXT_L   = &4.
      WA_FLD-SELTEXT_M   = &5.
      WA_FLD-SELTEXT_S   = &6.
      WA_FLD-COL_POS     = &7.
      WA_FLD-FIX_COLUMN  = &8.
      WA_FLD-DO_SUM      = &9.
      APPEND WA_FLD TO GT_FLD.
      CLEAR WA_FLD.
    END-OF-DEFINITION.
    CONSTANTS: C_TOP TYPE SLIS_FORMNAME VALUE 'TOP_OF_PAGE',
               C_USER_COMMAND            TYPE  SLIS_FORMNAME  VALUE 'USER_COMMAND'.
    DATA: MTRL LIKE SY-REPID,
          TITLE LIKE SY-TITLE.
    select-options level for t179-stufe no intervals.
    start-of-selection.
    Select prodh stufe from T179 into corresponding fields of table pvs where stufe in level.
    select prodh vtext from t179t into corresponding fields of table it_text for all entries in pvs where prodh = pvs-prodh.
    end-of-selection.
    sort pvs by prodh.
    sort it_text by prodh.
    loop at pvs into pvs2.
      read table it_text into wa_text with key prodh = pvs2-prodh.
      if sy-subrc eq 0.
        pvs2-vtext = wa_text-vtext.
        write: / pvs2-prodh, pvs2-vtext, pvs2-stufe.
      endif.
    *  modify pvs2.
    endloop.
    perform BUILD_FIELDCAT.
    perform GRID_DISPLAY.
    form BUILD_FIELDCAT .
        FLD 'PRODH'   'PVS2'   '20'     'Product Hierarchy'        ' ' ' '  '1'  ''   '' .
        FLD 'VTEXT'   'PVS2'   '40'     'Description '        ' ' ' '  '3'  ''   '' .
        FLD 'STUFE'   'PVS2'    '5'    'Level'        ' ' ' '  '2'  ''   '' .
    endform.                    " BUILD_FIELDCAT
    form GRID_DISPLAY .
      call function 'REUSE_ALV_GRID_DISPLAY'
        EXPORTING
          I_CALLBACK_PROGRAM      = MTRL
          I_CALLBACK_USER_COMMAND = 'C_USER_COMMAND'
          I_CALLBACK_TOP_OF_PAGE  = C_TOP
          I_STRUCTURE_NAME        = 'PVS2'
          IS_LAYOUT               = WA_LAYOUT
          IT_FIELDCAT             = GT_FLD
          IT_SORT                 = GT_SORT
          I_DEFAULT               = 'X'
          I_SAVE                  = 'U'
          IT_EVENTS               = GT_EV
        TABLES
          T_OUTTAB                = PVS2[]
        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

    TYPE-POOLS : SLIS.
    DATA : BEGIN OF WA_T001,
                 BUKRS LIKE T001-BUKRS,
                 BUTXT LIKE T001-BUTXT,
                 ORT01 LIKE T001-ORT01,
                 END OF WA_T001,
                 IT_T001 LIKE TABLE OF WA_T001.
    DATA : IT_FCAT TYPE SLIS_T_FIELDCAT_ALV,
                WA_FCAT LIKE LINE OF IT_FCAT.
    DATA : V_NAME LIKE  SY-REPID.
    SELECT BUKRS BUTXT ORT01 FROM T001 INTO TABLE IT_T001 UP TO 15 ROWS. V_NAME = SY-REPID.
    CALL FUCTION MODULE 'REUSE_ALV_FIELDCATLOG_MERGE. EXPORTING  I_CALBACK_PROGRAM =
    V_NAME I_INTERAL_TABNAME = 'WA_T001' I_INCLNAME = V_NAME CHANGING CT_FIELDCAT =
    IT_FCAT.
    CALL FUNCTION MODULE "REUSE_ALV_GRID_DISPLAY"
    EXPORTING
    I_CALLBACK_PROGRAM = V_NAME
    IT_FCAT = IT_FCAT.
    TABLES
         T_OUTTAB  = IT_T001
    SY-REPID IS THE SYSTEM VARIABLE WHICH IS HAVING THE ABAP PROGRAM 
    OR CURRENT MAIN PROGRAM.
    ----- Sample Progam -
    ***INCLUDE YRVR058_DEST_WISE_SUMMARY_DF01 .
    *&      Form  DISPLAY_DATA
          text      *-- Rajesh Vasudeva
    -->  p1        text
    <--  p2        text
    FORM DISPLAY_DATA .
      IF ITAB[] IS NOT  INITIAL.
        PERFORM F_APPEND_BLOCK.
      ELSE.
        MESSAGE 'Data not found for the selection
    criteria' TYPE 'S'.
        LEAVE LIST-PROCESSING.
      ENDIF.
    ENDFORM.                    " display_data
    *&      Form  f_append_block
          text
    -->  p1        text
    <--  p2        text
    FORM F_APPEND_BLOCK .
      DATA : L_WA_SORT    TYPE SLIS_SORTINFO_ALV,   "For
    sort
             L_WA_EVENTS  TYPE SLIS_ALV_EVENT.      "For
    events
    Event (Top of List)
      CLEAR L_WA_EVENTS.
      L_WA_EVENTS-NAME = SLIS_EV_TOP_OF_LIST.
      L_WA_EVENTS-FORM = C_TOPOFPAGE.
      APPEND L_WA_EVENTS TO I_EVENTS_PART.
    Event (Top of Page)
      CLEAR L_WA_EVENTS.
      L_WA_EVENTS-NAME = SLIS_EV_TOP_OF_PAGE.
      L_WA_EVENTS-FORM = 'F_DISPLAY_HEADER_PARTA'(031).
      "f_display_header_part
      APPEND L_WA_EVENTS TO I_EVENTS_PART.
    Event (End of List)
      CLEAR L_WA_EVENTS.
      L_WA_EVENTS-NAME = SLIS_EV_END_OF_LIST.
      L_WA_EVENTS-FORM = C_END_OF_LIST.
      APPEND L_WA_EVENTS TO I_EVENTS_PART.
    Set Layout Zebra
      STRUCT_LAYOUT-ZEBRA          = 'X'.
      STRUCT_LAYOUT-NUMC_SUM       = 'X'.
      STRUCT_LAYOUT-TOTALS_TEXT    = 'TOTAL:'(032).
    set field catalog
      PERFORM F_FIELD_CATALOG_PART.
      ASSIGN ITAB[] TO <F_OUTTAB>.
      V_PART = 'A'.  "initiating list is A
      PERFORM F_DISPLAY_BLOCK USING STRUCT_LAYOUT
                                   I_FIELD_CAT_PART[]
                                   C_TAB
                                   I_EVENTS_PART[]
                                   I_SORT_PART[].
    ENDFORM.                    " f_append_block
    *&      Form  f_field_catalog_part
          text
    -->  p1        text
    <--  p2        text
    FORM F_FIELD_CATALOG_PART .
      REFRESH I_FIELD_CAT_PART.
      CLEAR I_FIELD_CAT_PART.
      PERFORM F_CREATE_CATALOG USING :
    *Month
    C_TAB 'MONTH'  'MONTH'      SPACE 'L' 7
    I_FIELD_CAT_PART[],
    *OBD
    *C_TAB 'VBELN'  'Delivery'      SPACE 'L' 12
    I_FIELD_CAT_PART[],
    *DATE
    C_TAB 'WADAT_IST'  'Date'      SPACE 'L' 10
    I_FIELD_CAT_PART[],
    *Destination
    C_TAB 'CITY1'  'Destination'      SPACE 'L' 25
    I_FIELD_CAT_PART[],
    *Qty By Road
    C_TAB 'NTGEW_ROAD'  'Road Quantity'   SPACE 'R' 16
    I_FIELD_CAT_PART[],
    *Rail Qty
    C_TAB 'NTGEW_RAIL'  'Rail Quantity'  SPACE 'R' 16 I_FIELD_CAT_PART[],
    *Total  Qty C_TAB 'TOT'  'Total Quantity'  SPACE 'R' 16 I_FIELD_CAT_PART[], *RR/Trk No.
      C_TAB 'EXTI2'  'Truck/RR No.' SPACE 'L' 17 I_FIELD_CAT_PART[].
    ENDFORM.                    " f_field_catalog_part
    *&      Form  f_DISPLAY_block
          text
         -->P_STRUCT_LAYOUT  text
         -->P_I_FIELD_CAT_PART[]  text
         -->P_C_TAB  text
         -->P_I_EVENTS_PART[]  text
         -->P_I_SORT_PART[]  text
    FORM F_DISPLAY_BLOCK  USING  FP_LAYOUT         TYPE
    SLIS_LAYOUT_ALV
                                 FP_I_FCAT         TYPE
    SLIS_T_FIELDCAT_ALV
                                 VALUE(FP_TABNAME) TYPE
    ANY
                                 FP_I_EVENTS       TYPE
    SLIS_T_EVENT
                                 FP_I_SORT         TYPE
    SLIS_T_SORTINFO_ALV.
      DATA: V_REPID  TYPE SYREPID,                 
    "current Program id
            C_SAVE       TYPE CHAR1 VALUE 'A'.     
    "variant save
      V_REPID = SY-REPID.
      CALL FUNCTION 'REUSE_ALV_LIST_DISPLAY'
    *CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
        EXPORTING
          I_CALLBACK_PROGRAM = V_REPID
          IS_LAYOUT          = FP_LAYOUT
          IT_FIELDCAT        = FP_I_FCAT[]
          IT_SORT            = FP_I_SORT[]
          I_SAVE             = C_SAVE             "variant
    save
          IT_EVENTS          = FP_I_EVENTS[]
        TABLES
          T_OUTTAB           = <F_OUTTAB>
        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.                    " f_DISPLAY_block
    *&      Form  f_create_catalog
          text
         -->P_C_TAB  text
         -->P_0085   text
         -->P_0086   text
         -->P_SPACE  text
         -->P_0088   text
         -->P_5      text
         -->P_I_FIELD_CAT_PART[]  text
    FORM F_CREATE_CATALOG  USING  FP_I_TABNAME   TYPE
    SLIS_TABNAME
                                  FP_I_FIELDNAME TYPE SLIS_FIELDNAME
                                  FP_I_SELTEXT   TYPE
    SCRTEXT_L
                                  FP_I_DOSUM     TYPE
    CHAR1
                                  FP_I_JUST      TYPE C
                                  FP_I_OUTPUTLEN TYPE
    OUTPUTLEN
                                  FP_I_FCAT      TYPE
    SLIS_T_FIELDCAT_ALV.
    Record for field catalog
      DATA: L_REC_FCAT TYPE SLIS_FIELDCAT_ALV.
      L_REC_FCAT-TABNAME   = FP_I_TABNAME.
      L_REC_FCAT-FIELDNAME = FP_I_FIELDNAME.
      L_REC_FCAT-SELTEXT_L = FP_I_SELTEXT.
      L_REC_FCAT-DO_SUM    = 'X'.
    *l_rec_fcat-do_sum    = ' '.
      L_REC_FCAT-JUST      = FP_I_JUST.
      L_REC_FCAT-OUTPUTLEN = FP_I_OUTPUTLEN.
      L_REC_FCAT-DECIMALS_OUT = '2'.
      L_REC_FCAT-KEY          = '1'.
      APPEND L_REC_FCAT TO FP_I_FCAT.
    ENDFORM.                    " f_create_catalog
         Subroutines for Headings
    *&      Form  f_display_header_partA
          Display header for report for Part A
    *&      Form  top_of_page
          text
    -->  p1        text
    <--  p2        text
    FORM TOP_OF_PAGE .
      SKIP 1.
      WRITE:/25 ' Name of Company ',80 'RUN DATE' ,
    SY-DATUM.
    SKIP 1.
    WRITE:/60 'RUN DATE' , SY-DATUM.
      SKIP 1.
      DATA: YR(4) TYPE N,
             FIN_PRD(10) TYPE C.
      IF S_DTABF-LOW+4(2) LT '04'.
        YR = S_DTABF-LOW+0(4) - 1.
        CONCATENATE YR '-' S_DTABF-LOW+2(2) INTO FIN_PRD.
      ELSE.
        YR = S_DTABF-LOW+0(4) + 1.
        CONCATENATE S_DTABF-LOW0(4) '-' YR2(2) INTO
    FIN_PRD.
      ENDIF.
      WRITE:/5 'DETAILS OF THE MONTH/DATE WISE DESPATCHES
    MADE BY ROAD/RAIL DURING THE YEAR ' , FIN_PRD  .
      SKIP 1.
    WRITE :/ 'SALES OFFICE : ' , P_SALES,' ' , RNAME.
    SKIP 1.
    ENDFORM.                    " DISPLAY_DATA
    Award Points If Useful...

  • Maintenance view program for a table

    Hi All,
    How can i create a maintenance view program for a table. i did maintenance view in sm30 for that table. now it needs a transaction code for maintenance. can somebody help me with this.
    Thanks,
    Kiran

    Hi
    Create a new transaction Z**** linked to SM30 for that table:
    - trx SE93: while creating trx choose transaction with parameter and insert these data:
    - TRANSACTION = SM30
    - set the flag SKIP INITIAL SCREEN
    At the end of screen, section Default Value, if you want to open dialog for updating:
    NAME OF SCREEN FIELD     VALUE
    VIEWNAME                 <here insert the table name>
    UPDATE                    X
    ...for displaying:
    NAME OF SCREEN FIELD     VALUE
    VIEWNAME                 <here insert the table name>
    SHOW                      X
    Max

  • Could anyone provide sample of WebDynpro Java TableFilter for Dynamic Table

    Hi
    I have a dynamic table I have given a context node as a data source and it executes a Web Service and populates itself based on the resultset of query this node contains no of columns and rows
    The table changes dynamically everytime the user selects different table type
    When I created a TableFilter I used IWDTableColumn from the current view and looped though the context elements and binded the values of attributes of each context element to this column inside a loop. TableSort works, But I  am not able to get the Filter working for the Dynamic Table , when I click on Filter Button the Filter does not filterand  just sorts.
    Not sure what is wrong but if someone can give some inputs,leads I will highly appreciate if some one has  a  sample of WebDynpro Java TableFilter for Dynamic Table
    Thanks in advance,
    Ragu.

    Hi Ragu,
    Please check the link for table filtering.
    http://wiki.sdn.sap.com/wiki/display/WDJava/GenericTableFilter+Code
    since your dynamic table uses webservice I assume it has fixed context attributes, just put the filter into wdDoModify method everytime you execute/trigger the webservice.
    Regards,

  • Displaying tables with dynamic number of columns

    Hello,
    I'm pretty new to JSF. Currently I'm working on a project where I have to select a table from a list, and then make it browsable/editable. The problem I have is that the different tables also have a different number of columns.
    I have no problem displaying different tables if the number of coulumns stays the same (using h:datatable) but when it's dynamic, I don't know how I can have my JSP to adjust to support the varying number of columns.
    Has anyone got an example of dynamic datatable or maybe someone can point me in the right direction.
    Brimborian

    Hi daniel,
    1. There is an INDEPENDENT FORM
      whose inputs are FIELD LIST
      and from those, it consructs dynamic table.
    2. Here is the program.
    the dynamic table name will be
    <DYNTABLE>.
    3. U can use this program (FORM in this program)
    to generate any kind of internal table
    by specifying some inputs (ie. field list)
    4.
    REPORT abc.
    COMPULSORY
    FIELD-SYMBOLS: <dyntable> TYPE ANY TABLE.
    FIELD-SYMBOLS: <dynline> TYPE ANY.
    DATA: lt TYPE lvc_t_fcat.
    DATA: ls TYPE lvc_s_fcat.
    FIELD-SYMBOLS: <fld> TYPE ANY.
    DATA : fldname(50) TYPE c.
    PARAMETERS : infty(4) TYPE c OBLIGATORY.
    DATA : iname LIKE dd02l-tabname.
    START-OF-SELECTION.
    GET INFO
    CONCATENATE 'P' infty INTO iname.
    DATA : ddfields LIKE ddfield OCCURS 0 WITH HEADER LINE.
    CALL FUNCTION 'DD_NAMETAB_TO_DDFIELDS'
    EXPORTING
    tabname = iname
    TABLES
    ddfields = ddfields.
    CONSTRUCT FIELD LIST
    LOOP AT ddfields.
    ls-fieldname = ddfields-fieldname.
    APPEND ls TO lt.
    ENDLOOP.
    PERFORM
    PERFORM mydyntable USING lt.
    BREAK-POINT.
    INDEPENDENT FORM
    FORM mydyntable USING lt TYPE lvc_t_fcat .
    Create Dyn Table From FC
    FIELD-SYMBOLS: <fs_data> TYPE REF TO data.
    FIELD-SYMBOLS: <fs_1>.
    FIELD-SYMBOLS: <fs_2> TYPE ANY TABLE.
    DATA: lt_data TYPE REF TO data.
    ASSIGN lt_data TO <fs_data>.
    CALL METHOD cl_alv_table_create=>create_dynamic_table
    EXPORTING
    it_fieldcatalog = lt
    IMPORTING
    ep_table = <fs_data>
    EXCEPTIONS
    generate_subpool_dir_full = 1
    OTHERS = 2.
    IF sy-subrc <> 0.
    ENDIF.
    Assign Dyn Table To Field Sumbol
    ASSIGN <fs_data>->* TO <fs_1>.
    ASSIGN <fs_1> TO <fs_2>.
    ASSIGN <fs_1> TO <dyntable>.
    ENDFORM. "MYDYNTABLE
    regards,
    amit m.

  • Oracle Sample code table structure needed ...........

    Hi,
    I have downloaded sample code from oracle web site for connection pooling in java.
    some tables were used in that program like AVAILABLE_ROOM_TYPES, hotel_bookings etc....
    it was told that the table structures can be found in otn site. but i cud not find that.
    can ay one tell me where i can find all the table structures and dumps with data for those tables that are used in all the sample codes available for download.
    thanx in advance
    saro

    Saro,
    You can get it here : http://technet.oracle.com/sample_code/tech/java/travel/travelschema.htm
    Cheers,
    Srinivas.

  • SE16: Syntax error in program "/1BCDWB/DB table name "

    Hello experts,
    I am facing one problem with SE16 transaction code. I am getting a dump saying 'Syntax error in program "/1BCDWB/DB<Z table name> ". SE16 is giving dump only for few Z tables and not for all.
    We have created another transaction code ZZSE16 which resembles SE16 but with few authorizations.
    I am getting similar dump with ZZSE16 also. But this time for all tables Z tables and standard tables.
    It was working fine until yesterday. No code has been changed to the technical objects involved.
    The dump says :
    The following syntax error occurred in program "/1BCDWB/DB<table name> " in
    include "/1BCDWB/DB<table name> " in
    line 1060:
    "The field "%_ENQU_<table name>" is unknown.
    This is occurring in so many boxes with different landscapes.
    In some boxes it is working fine. The program "/1BCDWB/DB<table name> " has no field starting with %_ENQU. Instead at line 1060 the field is %_K<table name> which was defined.
    Can anybody please help me in solving this? Thanks in advance.
    Thanks & Regards,
    Paddu.

    Paddu,
    Please try these:
    Try to activate your Ztable from SE11. Of course you may see that the table is in active state, but still try to activate it.
    While activating the table if you get a pop-up saying "Display activation errors and warnings" (the message may be not exactly same) the click on No button.
    Now go to transaction SE14 (Database utility), provide table name and press enter
    Select Processing type as Direct, choose radio button Save data and click on "Activate and adjust database" button.
    You will get a pop-up with message "Request: Adjust". Click Yes button.
    Once it is completed, you can try opening the table in SE16.
    I hope this helps.
    Regards,
    Venkat

  • Is it possible to display table maintanence like SE80 object browser?

    Hi everyone, I'm trying to do something with table maintenance but I cannot achive it yet. Therefore, I'm asking it to you.
    In my program, I'm displaying table maintenance screens by using FM "VIEW_MAINTENANCE_CALL". It works fine.
    However, what I wanna do is that displaying table maintenance screens in different container.
    The first thing comes to my mind is the structure of SE80. When I double click on an item on the left side I want do display table maintenance screen on the right side.
    Thanks..

    Please check transaction code DWDM

  • Error message "This program cannot display the webpage when uploading images to Cafe Press

    I have had a Café Press shop for five years and except for sometimes being slow, no problems uploading images. Now, suddenly for 3 days I get the message "This program cannot display the webpage
    Most likely causes:
    • You are not connected to the Internet.
    • The website is encountering problems.
    • There might be a typing error in the address.
    What you can try:
    Check your Internet connection. Try visiting another website to make sure you are connected.
    Retype the address."
    I got the messsage about half way through the uploading of an image. People suggested using "firefox" instead of IE so I now get a similar error message from Firefox. I signed in, clicked on the image I wanted to upload and hit "upload" and get message as follows:
    Server not found
    Firefox can't find the server at members.cafepress.com.
    * Check the address for typing errors such as
    ww.example.com instead of
    [url=http://www.example.com]www.example.com[/url]
    * If you are unable to load any pages, check your computer's network connection.
    * If your computer or network is protected by a firewall or proxy, make sure that Firefox is permitted to access the Web.
    None of this makes sense because I WAS connected to the internet (obviously) or I wouldn't have been able to sign in, go to my media basket, browse for the image and click "upload" and watch as the progress bar showed percentage of upload such as 20%, etc. and even went to 100% at times before giving me the error message. Plus I couldn't make a typing error since I wasn't typing anything but uploading an image. Any suggestions?
    Whatever your suggestion, I need step by step instructions as I am totally computer illiterate. I don't even know what a "proxy" is and don't know if I have a "firewall" as the message suggests. I have "Comodo" security and am using Windows XP.
    I contacted CP which was no help at all. All they did was tell me to clear my cache which I do after every session. Thanks
    Nancy
    http://www.cafepress.com/calendarflr

    Sounds like your desktop application is in fact running from
    a server. CHMs were identified as a security risk by Microsoft and
    are best suited to the user's PC.
    Click
    here for more information.

  • Doubt in creating program to display application logs

    Hi,
    I have doubt in creating a program to display application logs.
    The standard transaction code SLG1 has been used to display Application logs till now by the user.
    They came up with the new requirement on this.
    <u>The requirements were:</u>
    1)New custom program shoud be created like SLG1 with limited selection fields( data from, date to, Program name and User)
    2) Detail list should be displyed immediately when this program is executed because SLG1 gives Basic list,Detailed list which is getting displayed when 'Detail view' is selected in the first list.
    I have created one program with limited selection fields as per the requirement using the below function modules .
    BAL_FILTER_CREATE
    BAL_DB_SEARCH
    BAL_DB_LOAD
    and BAL_DSP_LOG_DISPLAY
    <u>Issue :</u> still I am getting the firt list.
    both Basic and Detailled lists are getting triggered at the FM BAL_DSP_LOG_DISPLAY.
    Is it only the way to copy and modify this FM.
    Could you please suggest me?
    Thans in advace,
    babu.
    Message was edited by:
            babu v
    Message was edited by:
            babu v

    Hello All,
    Thanks for your valuable suggitions.
    I have seen most of the demo programs.
    I found one fm'BAL_DSP_PROFILE_NO_TREE_GET' which avoids the tree list which is getting listed above the profile list.
    I have been searching alot to omit the Profile list. I searched alot to find any function modules realted to that.
    The requirement was only the Detail list should only be listed.
    Could you please suggest me to avopid that profile list also?
    Thanks in advance,
    babu
    Message was edited by:
            babu v

  • Trying to display tables reusing same code.

    I'm probably being really naive but I just can't get this to work!
    I have a display table class that will only display a one table when a button is pressed in a GUI. I want to use the same code again to display another table but pressing another button this time. ie: press "Table 1" button and the SQL query SELECT * FROM Customer should be used. Press "Table 2" Button and SQL query SELECT * FROM Order should be used. I have tried creating a constructor for this but it keeps coming up with errors. Please can you have a look at my code. The bits that don't work are commented out. I want to be able to just change the query that is used each time a different button is pressed.
    Thanks in advance.
    import java.sql.*;
    import java.awt.*;
    import javax.swing.*;
    import java.util.*;
    public class TableDisplay extends JFrame{
    private Connection aConnection;
    private JTable cusTable;
    private String Query;
    private String Title;
    public TableDisplay() {
    //public TableDisplay (String Query,String Title){
    try {
    DriverManager.registerDriver(new sun.jdbc.odbc.JdbcOdbcDriver());
    aConnection = DriverManager.getConnection("jdbc:odbc:RelAlg", "", "");
    catch (SQLException e) { System.exit(11);}
    getTable();
    setSize(450,150);
    show();
    private void getTable(){
    Statement aStatement;
    ResultSet aSet;
    try{
    aStatement = aConnection.createStatement();
    aSet = aStatement.executeQuery("SELECT * FROM RelAlgCustomerTable");
    //aSet = aStatement.executeQuery(Query);
    displayResultSet(aSet);
    aStatement.close();
    catch (SQLException e) { System.exit(12);}
    private void displayResultSet(ResultSet rs)
    throws SQLException{
    //position to first record
    boolean moreRecords = rs.next();
    //if there is no records display a message
    if(!moreRecords){
    JOptionPane.showMessageDialog(this, "ResultSet unable to find table");
    setTitle("No table to display");
    return;
    setTitle("Customer Table");
    // setTitle(Title);
    Vector columnHeads = new Vector();
    Vector rows = new Vector();
    try{
    //get column heads
    ResultSetMetaData rsmd = rs.getMetaData();
    for(int i = 1;i <= rsmd.getColumnCount();i++)
    columnHeads.addElement(rsmd.getCatalogName(i));
    //get row data
    do{
    rows.addElement(getNextRow(rs,rsmd));
    while (rs.next());
    //display tabel with ResultSet contents
    cusTable = new JTable(rows, columnHeads);
    JScrollPane scroller = new JScrollPane(cusTable);
    getContentPane().add(scroller,BorderLayout.CENTER);
    validate();
    catch (SQLException e) { System.exit(13);}
    private Vector getNextRow(ResultSet rs, ResultSetMetaData rsmd)
    throws SQLException {
    Vector currentRow = new Vector();
    for (int i = 1; i<=rsmd.getColumnCount();++i)
    switch(rsmd.getColumnType(i)){
    case Types.VARCHAR:
    currentRow.addElement(rs.getString(i));
    break;
    case Types.INTEGER:
    currentRow.addElement(new Long(rs.getLong(i)));
    break;
    default:
    System.out.println("Type was:" +rsmd.getColumnTypeName(i));
    return currentRow;
    public void shutDown(){
    try{
    aConnection.close();
    catch (SQLException e) { System.exit(14);}
    public static void main(String args []){
    final TableDisplay app = new TableDisplay();
    This is the code from the gui that displays the table on the press of the table button
    void table1_mouseClicked(MouseEvent e) {
    TableDisplay tDisp = new TableDisplay();
    tDisp.show();
    }

    what errors are you getting?
    Where are you passing in the value for "Query" and assigning it to the class variable of the same name?
    do this in the constructor:
    public TableDisplay (String Query,String Title){
    /////new line
    this.Query = Query;
    ////end new line
    try {
    DriverManager.registerDriver(new sun.jdbc.odbc.JdbcOdbcDriver());
    aConnection = DriverManager.getConnection("jdbc:odbc:RelAlg", "", "");
    }

Maybe you are looking for

  • How to strip text formatting from text field value ??

    Hi everyone, Have tried to get some info on this but no luck.... I've created a simple contact form in Flash, but the URL which it's generating contains the text formatting from the text input fields. As a result the script that processes the mail se

  • Connecting 2 macs

    Hope this in the right area. I've got a friend with a 1.83ghz intel macbook (tiger) and I've got a G5 imac (leopard). The macbook came up with the dreaded question mark at startup. Everytime you put the software disc in hardware test/ disk utility is

  • Purchase order - multiple copies

    Hi all,     Is there any restriction / configuration at user level for not printing more than one copy of the purchase order. Even though the user has provided "3" in the field "number of messages" in the communication structure of the PO, the user i

  • RSS feed does not verify

    I ran the validate but it fails on the itunes:category. I am using exactly what the examples has. <itunes:category text="Religion & Spirituality"> <itunes:category text="Christianity" /> </itunes:category> but it says it is unbounded. So how do I fix

  • Compile using command line

    Hi, I'm using JBuilder, and now I'm trying to compile the project in command line, using javac, or jar. I want to create JAR file, and it is very complicated and contains many files. Is there any way to exctract the command from JBuilder? Or from Ant