WD -Select options - DUMP -Practicing Rich heilman's app

Hi,
I am practising the tutorial created by Rich heilman /people/rich.heilman2/blog/2005/12/20/using-select-options-in-a-web-dynproabap-application
I am getting following dump while running i browser.
Error when processing your request
What has happened?
The URL http://ssss.com/sap/bc/webdynpro/sap/ytest/ was not called due to an error.
Note
The following error text was processed in the system DV1 : Exception condition "TYPE_NOT_FOUND" raised.
The error occurred on the application server sape-dev_DV1_00 and in the work process 0 .
The termination type was: RABAX_STATE
The ABAP call stack was:
Method: DESCRIBE_BY_NAME of program CL_ABAP_TYPEDESCR=============CP
What can I do?
If the termination type was RABAX_STATE, then you can find more information on the cause of the termination in the system DV1 in transaction ST22.
If the termination type was ABORT_MESSAGE_STATE, then you can find more information on the cause of the termination on the application server sape-dev_DV1_00 in transaction SM21.
If the termination type was ERROR_MESSAGE_STATE, then you can search for more information in the trace file for the work process 0 in transaction ST11 on the application server sape-dev_DV1_00 . In some situations, you may also need to analyze the trace files of other work processes.
If you do not yet have a user ID, contact your system administrator.
Error code: ICF-IE-http -c: 180 -u: XXXXX -l: E -s: DV1 -i: sape-dev_DV1_00 -w: 0 -d: 20090112 -t: 162129 -v: RABAX_STATE -e: RAISE_EXCEPTION
All I did is i used a different table and follwed all steps.
Rich,
Thank you for the wonderful blog.
Any idea?
rgds
Vara
Edited by: Vara K on Jan 12, 2009 11:26 PM
Edited by: Vara K on Jan 12, 2009 11:34 PM

Rich,
Here is what I did.
I changed SFLIGHT TABLE to PROJ and tried to put only one select-options for field PSPNR.
Node name = PROJ.
I kept a break-point in these methods but  it got dumped before that only.
method WDDOINIT .
data:
lt_range_table type ref to data,
rt_range_table type ref to data,
read_only type abap_bool,
typename type string.
data:
lr_componentcontroller type ref to ig_componentcontroller,
l_ref_cmp_usage type ref to if_wd_component_usage.
* create the used component
l_ref_cmp_usage = wd_this->wd_cpuse_select_options( ).
if l_ref_cmp_usage->has_active_component( ) is initial.
l_ref_cmp_usage->create_component( ).
endif.
* get a pointer to the interface controller of the select options
*component
wd_this->m_wd_select_options =
wd_this->wd_cpifc_select_options( ).
* init the select screen
wd_this->m_handler =
wd_this->m_wd_select_options->init_selection_screen( ).
* create a range table that consists of this new data element
lt_range_table =
wd_this->m_handler->create_range_table(
i_typename = 'S_PSPNR_ID' ).
*add a new field to the selection
wd_this->m_handler->add_selection_field(
i_id = 'S_PSPNR_ID'
it_result = lt_range_table
i_read_only = read_only ).
endmethod.
method ONACTIONCONTINUE .
data: node_proj type ref to if_wd_context_node.
data: rt_pspnr type ref to data.
data: iproj type table of proj.
data: wproj type proj.
field-symbols: <fs_pspnr> type table.
* Retrieve the data from the select option
rt_pspnr = wd_this->m_handler->get_range_table_of_sel_field(
i_id = 'S_PSPNR_ID' ).
* Assign it to a field symbol
assign rt_pspnr->* to <fs_pspnr>.
* Retrieve that data from the database. Normally it is suggested to
* encapsulate the data retrieval in a separate class.
* For simplicity, the SELECT statement has been implemented here.
clear iproj. refresh iproj.
select * into corresponding fields of table iproj from proj
where pspnr in <fs_pspnr>.
* Bind the data to the context
node_proj = wd_context->get_child_node( name = `PROJ` ).
node_proj->bind_elements( iproj ).
endmethod.
rgds
vara
Edited by: Vara K on Jan 13, 2009 12:10 AM

Similar Messages

  • How to decipher value from hexa dump of select-options

    Hi
      Can someone tell me whether it is possible to interpret the value of select-option as entered in the report selection-screen from ABAP Dump as seen in ST22.
      Other variables are decipherable. They are stored as octets.
    In my sample program s_mtart is defined as a
    select-option
    I had put value "BULK" in s_mtart-low and executed.
    Dump snapshot.
    S_mtart header : IEQBULK
                     44545442222
                     95125CB0000
    s_mtart[]:    ###############################`########
                  0000000000000000000000000000000600000000
    ... +  40     ############################# ##À####¡#
                  00000000000000000000000000000200C0008A9A
                  000A000A000A000A00000B000002900000006180
    ... +  80     ########################################
                  0000000000000000000000000000000000000000
                  0000000000000000000000000000000000000000
    ... + 120     ################################
                  00000000
                  0000000 
    I was expecting octals of IEQBULK somewehere in s_mtart[] dump. But nowhere I could trace 49, 45, 51, 42, 52 etc.
    Moreover is there any way I can effect the way SAP write the dump content. I mean is there is some kind of system exit. I tried debugging with system debugging but no luck.
    We are in 4.6C
    Regards
    Saurav Choudhury

    Hi
      Can someone tell me whether it is possible to interpret the value of select-option as entered in the report selection-screen from ABAP Dump as seen in ST22.
      Other variables are decipherable. They are stored as octets.
    In my sample program s_mtart is defined as a
    select-option
    I had put value "BULK" in s_mtart-low and executed.
    Dump snapshot.
    S_mtart header : IEQBULK
                     44545442222
                     95125CB0000
    s_mtart[]:    ###############################`########
                  0000000000000000000000000000000600000000
    ... +  40     ############################# ##À####¡#
                  00000000000000000000000000000200C0008A9A
                  000A000A000A000A00000B000002900000006180
    ... +  80     ########################################
                  0000000000000000000000000000000000000000
                  0000000000000000000000000000000000000000
    ... + 120     ################################
                  00000000
                  0000000 
    I was expecting octals of IEQBULK somewehere in s_mtart[] dump. But nowhere I could trace 49, 45, 51, 42, 52 etc.
    Moreover is there any way I can effect the way SAP write the dump content. I mean is there is some kind of system exit. I tried debugging with system debugging but no luck.
    We are in 4.6C
    Regards
    Saurav Choudhury

  • DUMP Using Select options

    Hello ,
                 I have created select options in WDR  with
    IF_WD_SELECT_OPTIONS's method ADD_SELECTION_FIELD  in View A.
    I am navigating from View A to View B.In View B I have kept a BACK button to return back to View A.
    While navigating back it is giving me Dump in the View A
    Information on where terminated
        Termination occurred in the ABAP program "CL_WDR_SELECT_OPTIONS=========CP" -
    in "IF_WD_SELECT_OPTIONS~ADD_SELECTION_FIELD".*
        The main program was "SAPMHTTP ".
        In the source code you have the termination point in line 25
        of the (Include) program "CL_WDR_SELECT_OPTIONS=========CM00Q". 
    Regards,
    Sachin

    Hi sachin,
               Define the attribute in the attribute tab with  associated type IF_WD_SELECT_OPTIONS  and IWCI_WDR_SELECT_OPTIONS. Use these attributes for calling the methods of IF_WD_SELECT_OPTIONS. Please refer the below coding in the initialization part of first view.
    METHOD wddoinit .
      DATA : it_flights TYPE REF TO data.
      DATA : read_only TYPE abap_bool.
      DATA lo_cmp_usage TYPE REF TO if_wd_component_usage.
      lo_cmp_usage =   wd_this->wd_cpuse_select_options( ).
      IF lo_cmp_usage->has_active_component( ) IS INITIAL.
        lo_cmp_usage->create_component( ).
      ENDIF.
      DATA lo_interfacecontroller TYPE REF TO iwci_wdr_select_options .
      wd_this->m_wd_select_options =   wd_this->wd_cpifc_select_options( ).
      DATA lv_r_helper_class TYPE REF TO if_wd_select_options.*
      wd_this->m_handler = wd_this->m_wd_select_options->init_selection_screen(
      it_flights = wd_this->m_handler->create_range_table(
        EXPORTING*
          i_typename     = 'S_CARR_ID'
          i_length       =*
          i_decimals     =*
        receiving*
          rt_range_table =*
      wd_this->m_handler->add_selection_field(
        EXPORTING
          i_id                         = 'S_CARR_ID'
          i_within_block               = MC_ID_MAIN_BLOCK*
          i_description                =*
          i_is_auto_description        = ABAP_TRUE*
          it_result                    = it_flights
          i_obligatory                 = ABAP_FALSE*
          i_complex_restrictions       =*
          i_use_complex_restriction    = ABAP_FALSE*
          i_no_complex_restrictions    = ABAP_FALSE*
          i_value_help_type            = IF_WD_VALUE_HELP_HANDLER=>CO_PREFIX_NONE*
          i_value_help_id              =*
          i_value_help_mode            =*
          i_value_help_structure       =*
          i_value_help_structure_field =*
          i_help_request_handler       =*
          i_lower_case                 =*
          i_memory_id                  =*
          i_no_extension               = ABAP_FALSE*
          i_no_intervals               = ABAP_FALSE*
          i_as_checkbox                = ABAP_FALSE*
          i_as_dropdown                = ABAP_FALSE*
          it_value_set                 =*
          i_read_only                  = read_only
          i_dont_care_value            =*
          i_explanation                =*
          i_tooltip                    =*
    ENDMETHOD.
    Regards,
    Ragu.

  • Select-Option and Dump

    Hi All,
    I have select-option on selection screen.
    Entered 7000 values to select-option.
    When executed it dumps, but small input values report is executed.
    Is their any limitation for input values in select-option.
    Moderator message: FAQ, please search for previous discussions of this topic.
    Edited by: Thomas Zloch on Sep 14, 2011 3:02 PM

    Hi,
    problem is not with select option, it can contain milions of entries.
    You are propably using select option in where condition of your select statement. You should keep limit about 1000-2000 entries, it depends on db system and memory.
    Regards
    Matus

  • Using select-option in webdynpro for ABAP where I have two separate pages

    Hi Experts,
             I have a requirement where I have two pages. The first page is a selection screen that contains 2 select-options to select carrid and connid. There is also a button 'Submit'. The second page contains a ALV grid output based on the selection screen criteria.
    Second page is opened on the clicking the 'Submit' button in first page.
    How to design a ABAP webdynpro component for this scenario?
    How to pass select-option values to the next page?
    What nodes/attributes should I have to create in component controller?
    Please provide me the step by step info.
    I have seen the weblog by Rich Heilman at /people/rich.heilman2/blog/2005/12/20/using-select-options-in-a-web-dynproabap-application
    But it has only one page. So I am not able to recreate my scenario based on this.
    Thanks
    Gopal

    Hi Experts,
             I have a requirement where I have two pages. The first page is a selection screen that contains 2 select-options to select carrid and connid. There is also a button 'Submit'. The second page contains a ALV grid output based on the selection screen criteria.
    Second page is opened on the clicking the 'Submit' button in first page.
    How to design a ABAP webdynpro component for this scenario?
    How to pass select-option values to the next page?
    What nodes/attributes should I have to create in component controller?
    Please provide me the step by step info.
    I have seen the weblog by Rich Heilman at /people/rich.heilman2/blog/2005/12/20/using-select-options-in-a-web-dynproabap-application
    But it has only one page. So I am not able to recreate my scenario based on this.
    Thanks
    Gopal

  • How to fix a bug in Rich Heilman's weblog code?

    Dear all,
    I'm trying to create a report on a code given in the weblog by Rich Heilman:
    /people/rich.heilman2/blog/2005/07/27/dynamic-internal-tables-and-structures--abap
    Unfortunately, there is a bug in the code and a short dump occurs:
    A RAISE statement in the program "CL_ABAP_TYPEDESCR=============CP" raised the
    exception condition "TYPE_NOT_FOUND".
    I copied here the whole code:
    REPORT  Z_DYNAMIC.
    type-pools : abap.
    field-symbols: <dyn_table> type standard table,
                   <dyn_wa>,
                   <dyn_field>.
    data: dy_table type ref to data,
          dy_line  type ref to data,
          xfc type lvc_s_fcat,
          ifc type lvc_t_fcat.
    selection-screen begin of block b1 with frame.
    parameters: p_table(30) type c default 'T001'.
    selection-screen end of block b1.
    start-of-selection.
      perform get_structure.
      perform create_dynamic_itab.
      perform get_data.
      perform write_out.
    form get_structure.
    data : idetails type abap_compdescr_tab,
           xdetails type abap_compdescr.
    data : ref_table_des type ref to cl_abap_structdescr.
    * Get the structure of the table.
      ref_table_des ?=
          cl_abap_typedescr=>describe_by_name( p_table ).
      idetails[] = ref_table_des->components[].
      loop at idetails into xdetails.
        clear xfc.
        xfc-fieldname = xdetails-name .
        xfc-datatype = xdetails-type_kind.
        xfc-intlen = xdetails-length.
        xfc-decimals = xdetails-decimals.
        append xfc to ifc.
      endloop.
    endform.
    form create_dynamic_itab.
    * Create dynamic internal table and assign to FS
      call method cl_alv_table_create=>create_dynamic_table
                   exporting
                      it_fieldcatalog = ifc
                   importing
                      ep_table        = dy_table.
      assign dy_table->* to <dyn_table>.
    * Create dynamic work area and assign to FS
      create data dy_line like line of <dyn_table>.
      assign dy_line->* to <dyn_wa>.
    endform.
    form get_data.
    * Select Data from table.
      select * into table <dyn_table>
                 from (p_table).
    endform.
    form write_out.
    * Write out data from table.
      loop at <dyn_table> into <dyn_wa>.
        do.
          assign component  sy-index
             of structure <dyn_wa> to <dyn_field>.
          if sy-subrc <> 0.
            exit.
          endif.
          if sy-index = 1.
            write:/ <dyn_field>.
          else.
            write: <dyn_field>.
          endif.
        enddo.
      endloop.
    endform.
    Could someone fix a bug, please?
    Best regards,
    Eugene

    Hi Eugene,
    I made a small change to the code and it works even for MARA. See the code below..
    REPORT zsritest58 .
    TYPE-POOLS : abap.
    FIELD-SYMBOLS: <dyn_table> TYPE STANDARD TABLE,
                   <dyn_wa>,
                   <dyn_field>.
    DATA: dy_table TYPE REF TO data,
          dy_line  TYPE REF TO data,
          xfc TYPE lvc_s_fcat,
          ifc TYPE lvc_t_fcat.
    SELECTION-SCREEN BEGIN OF BLOCK b1 WITH FRAME.
    PARAMETERS: p_table(30) TYPE c DEFAULT 'T001'.
    SELECTION-SCREEN END OF BLOCK b1.
    START-OF-SELECTION.
      PERFORM get_structure.
      PERFORM create_dynamic_itab.
      PERFORM get_data.
      PERFORM write_out.
    *       FORM get_structure                                            *
    FORM get_structure.
    <b>*data : idetails type abap_compdescr_tab,
    *       xdetails type abap_compdescr.
    *data : ref_table_des type ref to cl_abap_structdescr.
    ** Get the structure of the table.
    *  ref_table_des ?=
    *      cl_abap_typedescr=>describe_by_name( p_table ).
    *  idetails[] = ref_table_des->components[].
    *  loop at idetails into xdetails.
    *    clear xfc.
    *    xfc-fieldname = xdetails-name .
    *    xfc-datatype = xdetails-type_kind.
    *    xfc-intlen = xdetails-length.
    *    xfc-decimals = xdetails-decimals.
    *    append xfc to ifc.
    *  endloop.
      SELECT SINGLE tabname INTO p_table FROM dd02l
      WHERE tabname EQ p_table
        AND as4local EQ 'A'
        AND as4vers EQ '0000'.
      IF sy-subrc NE 0.
        STOP.
      ENDIF.
      CALL FUNCTION 'LVC_FIELDCATALOG_MERGE'
       EXPORTING
    *   I_BUFFER_ACTIVE              =
         i_structure_name             = p_table
    *   I_CLIENT_NEVER_DISPLAY       = 'X'
    *   I_BYPASSING_BUFFER           =
        CHANGING
          ct_fieldcat                  = ifc[]
       EXCEPTIONS
         inconsistent_interface       = 1
         program_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.</b>
    ENDFORM.
    *       FORM create_dynamic_itab                                      *
    FORM create_dynamic_itab.
    * Create dynamic internal table and assign to FS
      CALL METHOD cl_alv_table_create=>create_dynamic_table
                   EXPORTING
                      it_fieldcatalog = ifc
                   IMPORTING
                      ep_table        = dy_table.
      ASSIGN dy_table->* TO <dyn_table>.
    * Create dynamic work area and assign to FS
      CREATE DATA dy_line LIKE LINE OF <dyn_table>.
      ASSIGN dy_line->* TO <dyn_wa>.
    ENDFORM.
    *       FORM get_data                                                 *
    FORM get_data.
    * Select Data from table.
      SELECT * INTO CORRESPONDING FIELDS OF TABLE <dyn_table>
                 FROM (p_table).
    ENDFORM.
    *       FORM write_out                                                *
    FORM write_out.
    * Write out data from table.
      LOOP AT <dyn_table> INTO <dyn_wa>.
        DO.
          ASSIGN COMPONENT  sy-index
             OF STRUCTURE <dyn_wa> TO <dyn_field>.
          IF sy-subrc <> 0.
            EXIT.
          ENDIF.
          IF sy-index = 1.
            WRITE:/ <dyn_field>.
          ELSE.
            WRITE: <dyn_field>.
          ENDIF.
        ENDDO.
      ENDLOOP.
    ENDFORM.
    Hope this helps..
    Sri

  • Set multi select-options

    Hi,
    Do you know how to set multi select-options in ABAP, i know i can use default to set single value. but is it possible set multi value for select-options. Thanks

    Hi ,
    Just like Rich Heilman said,
    with a litle modification:
    select-options: s_datum for sy-datum.
    initialization.
    s_datum-sign = 'I'.
    s_datum-option = 'BT'.
    s_datum-low = sy-datum.        s_datum-high = sy-datum+30.    append s_datum.
    s_datum-low = sy-datum + 1.  s_datum-high = sy-datum+31.    append s_datum.
    s_datum-low = sy-datum + 2.  s_datum-high = sy-datum+32.    append s_datum.
    s_datum-low = sy-datum + 3.  s_datum-high = sy-datum+33.    append s_datum.
    Regards,

  • Dynamic select options

    Hi,
    I need help in creating dynamic selections.
    I am working on a report program. My requirement is to generate the dynamic selection fields based on the
    name of table.
    There is a selection parameter as table name. When user enter table name and hit enter first 3 fields in the
    table should appear as select-options below the table name.
    Am not able to figure it out, plz help me.
    Thanks,

    Part 2
    PARAMETERS: p_table TYPE ddobjname DEFAULT 'T000'.
    SELECTION-SCREEN BEGIN OF SCREEN 500 AS WINDOW.
    SELECT-OPTIONS: s_fld01 FOR (lv_field01) MODIF ID f01.
    SELECT-OPTIONS: s_fld02 FOR (lv_field02) MODIF ID f02.
    SELECT-OPTIONS: s_fld03 FOR (lv_field03) MODIF ID f03.
    SELECT-OPTIONS: s_fld04 FOR (lv_field04) MODIF ID f04.
    SELECT-OPTIONS: s_fld05 FOR (lv_field05) MODIF ID f05.
    SELECT-OPTIONS: s_fld06 FOR (lv_field06) MODIF ID f06.
    SELECT-OPTIONS: s_fld07 FOR (lv_field07) MODIF ID f07.
    SELECT-OPTIONS: s_fld08 FOR (lv_field08) MODIF ID f08.
    SELECT-OPTIONS: s_fld09 FOR (lv_field09) MODIF ID f09.
    SELECT-OPTIONS: s_fld10 FOR (lv_field10) MODIF ID f10.
    SELECT-OPTIONS: s_fld11 FOR (lv_field11) MODIF ID f11.
    SELECT-OPTIONS: s_fld12 FOR (lv_field12) MODIF ID f12.
    SELECT-OPTIONS: s_fld13 FOR (lv_field13) MODIF ID f13.
    SELECT-OPTIONS: s_fld14 FOR (lv_field14) MODIF ID f14.
    SELECT-OPTIONS: s_fld15 FOR (lv_field15) MODIF ID f15.
    SELECT-OPTIONS: s_fld16 FOR (lv_field16) MODIF ID f16.
    SELECT-OPTIONS: s_fld17 FOR (lv_field17) MODIF ID f17.
    SELECT-OPTIONS: s_fld18 FOR (lv_field18) MODIF ID f18.
    SELECT-OPTIONS: s_fld19 FOR (lv_field19) MODIF ID f19.
    SELECT-OPTIONS: s_fld20 FOR (lv_field20) MODIF ID f20.
    SELECTION-SCREEN END OF SCREEN 500 .
    Regards,
    Rich Heilman
    Edited by: Rich Heilman on Dec 8, 2009 2:41 PM
    Edited by: Rich Heilman on Dec 8, 2009 2:41 PM

  • Select-options are not destroyed while calling view of used component popup

    Hi Friends ,
    I'm facing a unique problem. I'm calling a view of a component within another component. the view that I'm calling has some select-options. When I close the popup window ( using close 'X' of popup ) and then try to reopen the popup system give me a dump. I debugged and found that select-options are not destroyed by system and once it tries to create the select-options again it dumps because they are already there.  
    This is the source code extract of that dump for your reference .
    1 method if_wd_select_options~add_selection_field.
    2
    3   data:
    4     lr_table_descr       type ref to cl_abap_tabledescr,
    5     lr_struct_descr      type ref to cl_abap_structdescr,
    6     lr_value_field_descr type ref to cl_abap_elemdescr,
    7     added_field          like line of mt_added_fields,
    8     dfies                type dfies,
    9     description          type string,
    10     complex_restrictions type if_wd_select_options=>t_complex_restrictions.
    11
    12   field-symbols:
    13     <it_result> type index table.
    14
    15 * check of someone wants to add a field that already exists
    16   read table mt_fields
    17        with key m_id = i_id
    18        transporting no fields.
    19   if sy-subrc = 0.
    20 *   might be deleted - recreating a field with different setting is of course allowed
    21     read table mt_all_removed_fields
    22          with key table_line = i_id
    23          transporting no fields.
    24     if sy-subrc <> 0.
    >>>       message x000(00).
    26     endif.
    27
    28 *   remove the existing field in order to avoid duplicates
    29     delete table mt_fields with table key m_id = i_id.
    30   endif.
    I've already tried using REMOVE_ALL_SEL_SCREEN_ITEMS( ) method of interface IF_WD_SELECT_OPTIONS before creating new elements ( select-options ). If any one can help me in this It would really help and I'll appreciate it.
    Thanks in advance,
    Laeeq

    I've sloved the problem

  • Getting values from select option

    Hi,
    I have a requirement where the user is going to pass values in select-option  in low and high. lets say s_bwart(movement types).
    now i have to fetch this bwart values into an internal table.
    my internal table will be having only one field that is bwart. so how do i populate my internal table with those values. could any body help me in this.
    Thanks in advance
    neha

    Hi, when using SELECT-OPTIONS, use can pretty much do any kind of selection he wants, including ranges, and excluding values, so the best way to handle it is to select from the data base when the user executes the report.  for example.
    data: begin of ibwart occurs 0,
          bwart type mseg-bwart,
          end of ibwart.
    select-options: s_Bwart for mseg-bwart.
    start-of-selection.
    select bwart into table ibwart
               from <b>T156</b>
                     where bwart in s_bwart.
    Regards,
    Rich Heilman

  • 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 can i decleare select-options in module pool table control?

    Hi everybody!!
    Can anyone tell me how can I decleare select-options in module pool table control screen?. I have declared it in a screen with a table control but a dump is triggered due to an error when generating the selection screen.
    Regards...

    My suggestion will be try to use fm
        call function 'FREE_SELECTIONS_DIALOG'
    Please search this forum you can find lot of threads related to this.

  • How can i create a dynamic structure based on my input from a select-option

    Hello,
    This is to develop a custom report in FI for G/L Balance based on company code.
    I have an input select-option for Company code.
    Based on the range of company code my output layout should be modified.
    I am not very much sure to create a dynamic internal based on the input from a select-option.
    Can any one please let me know how can i do this.
    I would appreciate for anyone who turns up quickly.
    Thank you,
    With regs,
    Anitha Joss.

    See the following program, it builds a dynamic internal table based on the company codes from the select option. 
    report zrich_0001 .
    type-pools: slis.
    field-symbols: <dyn_table> type standard table,
                   <dyn_wa>.
    data: alv_fldcat type slis_t_fieldcat_alv,
          it_fldcat type lvc_t_fcat.
    data: it001 type table of t001 with header line.
    selection-screen begin of block b1 with frame title text-001.
    select-options: s_bukrs for it001-bukrs.
    selection-screen end of block b1.
    start-of-selection.
      select * into table it001 from t001
                     where bukrs in s_bukrs.
      perform build_dyn_itab.
    *  Build_dyn_itab
    form build_dyn_itab.
      data: index(3) type c.
      data: new_table type ref to data,
            new_line  type ref to data,
            wa_it_fldcat type lvc_s_fcat.
      clear wa_it_fldcat.
      wa_it_fldcat-fieldname = 'PERIOD' .
      wa_it_fldcat-datatype = 'CHAR'.
      wa_it_fldcat-intlen = 6.
      append wa_it_fldcat to it_fldcat .
      loop at it001.
        clear wa_it_fldcat.
        wa_it_fldcat-fieldname = it001-bukrs .
        wa_it_fldcat-datatype = 'CHAR'.
        wa_it_fldcat-intlen = 4.
        append wa_it_fldcat to it_fldcat .
      endloop.
    * Create dynamic internal table and assign to FS
      call method cl_alv_table_create=>create_dynamic_table
                   exporting
                      it_fieldcatalog = it_fldcat
                   importing
                      ep_table        = new_table.
      assign new_table->* to <dyn_table>.
    * Create dynamic work area and assign to FS
      create data new_line like line of <dyn_table>.
      assign new_line->* to <dyn_wa>.
    endform.
    Regards,
    Rich Heilman

  • Select Options in multiple views

    I am running into a problem.  I have an application with 2 views.  I use select-options in both views, but with different fields.  When I move from view 1 to view 2, it works correctly, displaying the select-options for view 2.  When I return to view 1 however, the container still shows the select-options for view 2.  Any help would be greatly appreciated.

    Alex, please explain what you mean by 'clear the nodes'.  All the setup for the select-options is currently done in the WDDOINIT in both views.
    Sarath, could you please explain what you mean by 'changing the lifetime'.  I've never heard this term.  Where would this be done.
    I copied the select-options code I had in my WDDOINIT into my HANDLEIN screen, and it dumps on the first 'ADD_SELECTION_FIELD' method call.  If I add a
       l_ref_comp_usage_so->delete_component( ).
    before my
        l_ref_comp_usage_so->create_component( ).
    the selection screen comes up blank.

  • SELECT OPTION in logical database PNP

    Hi,
    when i use ligical database PNP and i'm entering a range in personnel number, in which variables is that stored?
    The select option in pnppernr, but this one is initial in start-of-selection and get event.
    Is there any othe structure containing the range?
    Regards
      Rainer

    I think that PNPPERNR is the range.  This sample program works for me.
    report zrich_0001.
    TABLES: pernr.
    parameters: p_check.
    start-of-selection.
    GET pernr.
    write:/ pnppernr.
      check sy-subrc = 0.
    Regards,
    Rich Heilman

Maybe you are looking for

  • Java Not Working, And Still No Answers. What Gives?

    Okay, decided to start this topic anew, since the only response I got to the other one was a post calling me "rude and impatient" (I guess that's what they're calling "persistence" nowadays..) , instead of...well...ignoring my admittedly pushy and ha

  • CS6 How to create a photo gallery?

    CS6 How to create a photo Gallery?

  • Compare two strings in an array

    Hello! Please feel free to give me hints, but do not give me any code. Ok, here is what I am trying to do, I whant to compare my input string whith strings allready stored in the array. If my input string equals any of the allready excisting strings,

  • Problem with field-symbols in UNICODE conversion

    Hi all. I'm in a UNICODE conversion project and I have a problem with a program that uses field-symbols. DATA: BEGIN OF wa_data_aux,         mandt LIKE zindices-mandt,         kschl LIKE zindices-kschl,         datab LIKE zindices-datab,         valo

  • ISE Authentication cache in CWA for Guest

    Ciao, do you known how I can cache a guest authentication ?  For example a Guest connect to guest SSID (open); authenticate using CWA (ISE and WLC). After that every time the guest logoff and login,  no authentication is required during the same days