Select in an internal table

I realize that you can't do a select on an internal table but I need to do something identical to that.  I need to replicate the following code:
SELECT * FROM it_detail INTO it_temp WHERE matnr = wa_detail-matnr.
it_detail is of type ty_detail which joins field from three different tables.  Right now it_detail holds information about many different material numbers with all material numbers being repeated.  I am attempting to fill it_temp with all entries from it_detail that has the same material type.  I did a search but I couldn't find anything that seemed to work in this situation.
Regards,
Davis.

You must READ it, or LOOP at it.
Loop at it_detail into wa_detail where matnr = p_matnr.
    move-corresponding wa_detail to wa_temp.
    append wa_temp t0 it_temp.
endloop.
Regards,
RIch Heilman

Similar Messages

  • Can we apply select statement on internal table.

    can we apply select statement on internal table.if yes thrn let me know how to do.

    Dear Sachin,
    You cannot use SELECT statement on internal table.
    If you want to select some rows from internal table you can LOOP the table or you can READ the table.
    <u>Please check the following links for your kind reference:</u>
    <b>http://help.sap.com/saphelp_nw04/helpdata/en/fc/eb35de358411d1829f0000e829fbfe/content.htm
    http://www.sap-img.com/ab009.htm
    http://www.itsmarc.com/crs/Clas0302.htm
    http://www.sapdevelopment.co.uk/tips/tips_itab.htm
    http://searchsap.techtarget.com/search/1,293876,sid21,00.html?query=whatisinternaltable&bucket=ALL</b>
    Cheers !
    Moqeeth.

  • Passing SELECT-OPTIONS and Internal Tables to SUBROUTINES

    Hi Guys
    In the code below my colleague has created her own table types in order to pass a select option and internal tables to her subroutine. Is there an easier way of making them known to the subroutine.
    data : v_vbeln type vbeln_vf,
          it_bdoc type table of vbrp,
          it_t006 type table of t006a,
          wa_bdoc type vbrp,
          wa_t006 type t006a,
          it_bdoc2 type table of zsswathi_st_vbeln,
          wa_bdoc2 type zsswathi_st_vbeln
    select-options s_vbeln for v_vbeln matchcode object zswathi_vbeln obligatory.
    start-of-selection.
    perform bdoc using s_vbeln[]
                 changing it_bdoc
                          it_bdoc2
                          it_t006.
      loop at it_bdoc2 into wa_bdoc2.
    form bdoc using f_s_vbeln type ZSWATHI_ST_SELECT_OPTION_TA_TY       " all these are table types. for select options, a structure is created and then a table type for it is created.
            changing f_it_bdoc type zswathi_vbrp_ty_ta
                     f_it_bdoc2 type zswathi_vbeln_ty_ta
                      f_it_t006 type ZSWATHI_T006_TA_TY.
    select * from vbrp into table f_it_bdoc where vbeln in f_s_vbeln.
          if f_it_bdoc is not initial.
          select  vbeln sum( netwr ) prsdt from vbrp into table f_it_bdoc2 where vbeln in f_s_vbeln group by vbeln prsdt.
          sort f_it_bdoc2 by vbeln.
          "select * from t006a into table it_t006 for all entries in it_bdoc where msehi = it_bdoc-vrkme.
          select * from t006a into table f_it_t006 for all entries in f_it_bdoc where msehi = f_it_bdoc-vrkme.
       endif.
        endform.

    Hi Brett,
    1. you can use a select-options-range in a FORM subroutine also without passing it as a parameter because parameters and select-option range tables are global fields in their program.
    2. If you need a parameter, declare it as type table or type standard table or type any table. You do not need any special table type.
    Regards
    Clemens

  • How to get all values in the range of select option into internal table?

    Hi,
    I need to capture all entries coming in the range of select option into one internal table.
    How to do get that?
    For E.g
    select-options: matnr for mara-matnr.(select option)
    IF I enter G0100013507892 as lower value of matnr and G0100014873947 as higher value
    and if there are 10,000 materials in the above range, then I want to capture all theses 10000 materails in one internal table. How to do that?
    Regards,
    Mrunal

    Hello Mrunal Mhaskar  ,
    What i understand you can do one thing  go in debug mode
    Try this code : -
    LOOP AT s_matnr_ex.
      IF s_matnr_ex-low IS NOT INITIAL.
        i_matnr-matnr = s_matnr_ex-low.
        i_matnr-option = s_matnr_ex-option.
        APPEND i_matnr.
        CLEAR : i_matnr.
      ENDIF.
    ENDLOOP.
    LOOP AT s_matnr_ex.
      IF s_matnr_ex-high IS NOT INITIAL.
        i_matnr-matnr = s_matnr_ex-high.
        i_matnr-option = s_matnr_ex-option.
        APPEND i_matnr.
        CLEAR : i_matnr.
      ENDIF.
    ENDLOOP.
    In the i_matnr table high and low values are there.
    Regards,
    Vandana.

  • How to select columns from internal table using 'GUI_DOWNLOAD' ?

    Hi,
    i am running a report & the fields for output is saved in an internal table which has as many as 10 fields. But I want to select only a few fields for output. There is a option COL_SELECT in function 'GUI_DOWNLOAD'. How to use it. If possible with example.

    Hai VijayKumar
    Try with the following code
    tables : mara.
    data : begin of it_mara occurs 0,
           matnr like mara-matnr,
           mbrsh like mara-mbrsh,
           mtart like mara-mtart,
           meins like mara-meins,
           end of it_mara.
    parameters : P_mtart like mara-mtart default 'ROH'.
    start-of-selection.
    perform select_data.
    perform download_data.
    *&      Form  select_data
          text
    -->  p1        text
    <--  p2        text
    FORM select_data .
    select
          matnr
          mbrsh
          mtart
          meins
          from mara into table it_mara
          where mtart = p_mtart.
    ENDFORM.                    " select_data
    *&      Form  download_data
          text
    -->  p1        text
    <--  p2        text
    FORM download_data .
    CALL FUNCTION 'GUI_DOWNLOAD'
      EXPORTING
        FILENAME                        = 'c:\down.txt'
        FILETYPE                        = 'ASC'
        COL_SELECT                      = 'X'
        COL_SELECT_MASK                 = 'X XX'
      TABLES
        DATA_TAB                        = it_mara.
      IF SY-SUBRC = 0.
        SORT IT_MARA BY MATNR.
      ENDIF.
    ENDFORM.                    " download_data
    Thanks & Regards
    Sreenivasulu P

  • SELECT-OPTION to internal table

    Hi,
    I need to convert the select-option values into an internal table.
    For example, if there is a select-option S_WERKS... i need all the values entered for S_WERKS into the internal table. The internal table structure contains only WERKS.
    My actual requirement is, for the given plant values as select-option, i need to fetch all details of the plants. And I should not use any SELECT statements at any stage. Only through function module/ BAPI/BADI/Class methods.
    I found one function module T001W_READ, but i need to pass the plant for that.
    Please suggest.
    Thanks in advance.
    kishore

    Hi Kishore
    Why can't you use any SELECTs? If it is so required why not writing your own FM to select them? You can pass your select-option via a generic parameter and assign it to a range at the beginning of your FM. Or you can assign it to a select-option-like table (you can find structure names of similar type from DDIC)
    <i><b>e.g.</b></i>
    TABLES t001w .
    RANGES s_werks for t001w-werks .
    DATA: BEGIN OF lt_werks ,
            werks LIKE t001w-werks ,
          END OF lt_werks .
    s_werks[] = it_werks_so[] .
    SELECT werks FROM t001w
           INTO lt_werks
           WHERE werks IN s_werks .
    As another thing, let me introduce you the SDN Forums pointing system: You can assign points to posts which you find helpful while solving your problem. You can reward points by pressing the yellow star icon at header of each post. You can assign;
    - one 10 points (solved)
    - two 6 points (very helpful answer)
    - many 2 points (helpful answer)
    *--Serdar

  • Select options to internal table

    i have selected some values in the range say 100 to 200 using select options....is there any way to get these values in an internal table?
    also does select option work with alpha numeric values
    eg : if i want to select between a100 and b200?

    >
    VR ARVIND wrote:
    > i mean to say if i have 100 to 200.. i need 101 102 103 etc..continuosly till 200
    Select-options are really only useful for selecting data that matches the select-options from some other dataset.  They don "expand out" into a set of values.
    If you are always specifying a range in the selection screen, use two parameters - p_low, p_high.
    You then will need to build your itab entry by entry. So
    l_count = p_low.
    WHILE l_count LE p_high.
      INSERT l_count INTO t_itab.
      ADD 1 to l_count.
    ENDWHILE.
    For a100 to a200, you'd have to do some string slicing and concatenation to get the desired result.

  • Select (join) into internal table with nested structures

    Hello Experts,
    i wonder about the correct notation of a select statement.
    I have an internal table it_zoll including  two structures as defined below.
    The select is a join on the two tables zollp and zolls. As coded below the select is syntactically correct, but the fields
    in the nested structures are not filled ....
    Any ideas how to write the select statement ? (The internal table it_zoll must have the nested structures for other reasons ..)
    Declaration:
    TYPES: BEGIN OF ty_zollp,
      belnr     TYPE  zollp-belnr,
      werks     TYPE  zollp-werks,
      gebnr     TYPE  zollp-gebnr,
           END OF ty_zollp.
    TYPES: BEGIN OF ty_zolls,
      grnum     type  zolls-grnum,
      werks     type  zolls-werks,
      name1     TYPE  zolls-name1,
           END OF ty_zolls.
    DATA: BEGIN OF wa_zoll.
    DATA: zollp type ty_zollp.
    DATA: zolls type ty_zolls.
    DATA: END OF wa_zoll.
    DATA: it_zoll LIKE TABLE OF wa_zoll.
    Select:
      SELECT
        zollp~belnr   zollp~werks  zollp~gebnr
        zolls~grnum zolls~werks  zolls~name1
          FROM zollp
          JOIN zolls ON   zolls~werks = zollp~werks
                     AND  zolls~grnum = zollp~grnum
          INTO CORRESPONDING FIELDS OF TABLE it_zoll
          WHERE zollp~werks = werks
          AND   zollp~gebnr IN s-gebnr
          AND ...
    Thank you !

    DATA: BEGIN OF ty_zollp,
      belnr     TYPE  zollp-belnr,
      werks     TYPE  zollp-werks,
      gebnr     TYPE  zollp-gebnr,
           END OF ty_zollp.
    DATA: BEGIN OF ty_zolls,
      grnum     type  zolls-grnum,
      werks     type  zolls-werks,
      name1     TYPE  zolls-name1,
           END OF ty_zolls.
    DATA: BEGIN OF wa_zoll.
    Include structure ty_zollp.
    Include structure ty_zolls.
    DATA: END OF wa_zoll.
    The above declaration had worked. Please try.
    Regards,
    Satish Kanteti

  • Selecting into an internal table with deep structure

    Hi,
    I am working in ECC 6.0 now and it is giving me a syntax error for the following code.
    types: tt_bdc type standard table of bdcmsgcoll
          with default key.
    data:  begin of t_test occurs 0,
            vbeln like vbak-vbeln,
            tab   type tt_bdc,
          end of t_test.
    select vbeln from vbak into table t_test
      where aedat > '20081101'.
    The error is:
    +The work area (or internal table) "T_TEST" is not flat, or contains
    reference or internal tables as components . components. components.
    components. components.+
    I've done this in countless other programs in the past.  How can I use a deep structure this way?  What am I missing?
    Thanks very much!

    Will this solve ur requirement -
    types: tt_bdc type standard table of bdcmsgcoll
          with default key.
    data:  begin of t_test occurs 0,
            vbeln like vbak-vbeln,
            tab   type tt_bdc,
          end of t_test.
    select vbeln from vbak into
      CORRESPONDING FIELDS OF TABLE t_test
      where aedat > '20081101'.

  • How to make a row as selected in output internal table in oops ALV

    Hi All,
    I have ALV grid output using oops ALV concept, in my output i have a checkbox as first column when i select this checkbox and press a push button 'Print' which is there above ALV grid that particular line in output table should get selected and i need to code some logic for printing selected row.
    how to make the particluar row in the output internal table to be selected and where to write the logic for print once it is pressed?
    Thanks in advance
    Srilakshmi.

    but the checkbox is not getting set in internal table when i select some checkboxes.
    can anybody explain y the checkbox in internal table not set?
    Hi Srilakshmi,
    As explained by Uwe, when we change a field ( say check box ) in ALV grid, the view (frontend) changes (showing the tick mark) but the changed data ( normally ) is not transfered to the backend.
    We can initiate this data transfer by just registering the cl_gui_alv_grid=>mc_evt_modified  edit event
      go_grid->set_table_for_first_display( CHANGING  it_fieldcatalog      = pt_fieldcat
                                                      it_outtab            = pt_outtab ).
      go_grid->set_ready_for_input( 1 ).
      go_grid->register_edit_event( EXPORTING i_event_id = cl_gui_alv_grid=>mc_evt_modified ). " This does the trick
    Now as soon as we check a checkbox, the data_changed event is triggered.
    This initiates data transfer to the backend and the checkbox field in internal table is updated.
    check the below code for example.
    DATA: go_cont            TYPE REF TO cl_gui_custom_container,
          go_grid            TYPE REF TO cl_gui_alv_grid,
          gt_fieldcat        TYPE lvc_t_fcat,
          gv_language        TYPE spras VALUE 'E',
          gt_outtab          TYPE TABLE OF bus_loca_demo WITH HEADER LINE.
    START-OF-SELECTION.
      CALL SCREEN 100.
    *       MODULE PBO OUTPUT                                             *
    MODULE pbo OUTPUT.
      SET PF-STATUS 'BASIC'.
      SET TITLEBAR  '001'.
      PERFORM create_and_init_alv CHANGING gt_outtab[]
                                           gt_fieldcat.
    ENDMODULE.                    "pbo OUTPUT
    *       MODULE PAI INPUT                                              *
    MODULE pai INPUT.
      CASE sy-ucomm.
        WHEN 'BACK'.
          SET SCREEN 0. LEAVE SCREEN.
        WHEN 'PRINT'.
          BREAK-POINT.
      ENDCASE.
    ENDMODULE.                    "pai INPUT
    FORM create_and_init_alv CHANGING pt_outtab LIKE gt_outtab[]
                                      pt_fieldcat TYPE lvc_t_fcat.
      CHECK go_cont IS NOT BOUND.
      CREATE OBJECT go_cont
        EXPORTING
          container_name = 'CUSTOM'.
      CREATE OBJECT go_grid
        EXPORTING
          i_parent = go_cont.
      PERFORM build_display_table.
      PERFORM build_fieldcat CHANGING pt_fieldcat.
      go_grid->set_table_for_first_display( CHANGING  it_fieldcatalog      = pt_fieldcat
                                                      it_outtab            = pt_outtab ).
      go_grid->set_ready_for_input( 1 ).
      go_grid->register_edit_event( EXPORTING i_event_id = cl_gui_alv_grid=>mc_evt_modified ). " This does the trick
    ENDFORM.                               "CREATE_AND_INIT_ALV
    FORM build_display_table.
      FREE gt_outtab.
      DO 10 TIMES.
        gt_outtab-creation_partner = sy-index.
        gt_outtab-date_field       = sy-datum.
        APPEND gt_outtab.
      ENDDO.
    ENDFORM.                               "build_display_table
    FORM build_fieldcat CHANGING pt_fieldcat TYPE lvc_t_fcat.
      DATA ls_fcat TYPE lvc_s_fcat.
      CALL FUNCTION 'LVC_FIELDCATALOG_MERGE'
        EXPORTING
          i_structure_name = 'BUS_LOCA_DEMO'
        CHANGING
          ct_fieldcat      = pt_fieldcat.
      LOOP AT pt_fieldcat INTO ls_fcat.
        CASE ls_fcat-fieldname.
          WHEN 'CHECKBOX'.
            ls_fcat-checkbox = 'X'.
            ls_fcat-edit     = abap_true.
            MODIFY pt_fieldcat FROM ls_fcat.
          WHEN 'ENTER_FIELD' OR 'DBLCLICK_FIELD'.
            ls_fcat-no_out  = abap_true.
            MODIFY pt_fieldcat FROM ls_fcat.
        ENDCASE.
      ENDLOOP.
    ENDFORM.                               "build_fieldcat
    Cheers,
    Jose.

  • ALV - How to set selected rows into internal table

    Hi all,
    I am tying to set with an 'X' flag the selected rows in my ALV using an internal table that contains all rows showed.
    More exactly I have tried to follow these steps.
    1) I have added the filed SEL (type SEL) to my ALV structure zrt_bo_slabsend and I defined my internal table in this way
         DATA: gt_report TYPE STANDARD TABLE OF zrt_bo_slabsend,
                    gw_report TYPE zrt_bo_slabsend.
    2) I have set gw_layo-box_fname = 'SEL' to gw_layo (ALV layout)
    Pressing the "delete button" that I have insert on the top of the ALV, I intercept correctly my user command and I call a form (named "delete_lines") where I have this abap code
    FORM delete_lines.
        DATA: l_subrc          LIKE sy-subrc,
            lw_grid_settings LIKE lvc_s_glay.
    gw_layo-box_fname         = 'SEL'.
                                     "set field name to store row selection
      gw_layo-edit              = 'X'. "makes whole ALV table editable
      gw_layo-zebra             = 'X'.
    gv_repid = sy-repid.
      call function 'REUSE_ALV_GRID_DISPLAY_LVC'
      exporting
          i_callback_program       = gv_repid
         i_callback_pf_status_set = gc_status
         i_callback_user_command  = gc_user_command
         is_layout_lvc            = gw_layo
         it_fieldcat_lvc          = gw_fkat
         i_grid_settings          = lw_grid_settings
          i_save                   = 'X'
          is_variant               = variant
          it_events                = gt_events
        TABLES
          t_outtab                 = gt_report
        EXCEPTIONS
          program_error            = 1
          OTHERS                   = 2.
      LOOP AT gt_report ASSIGNING <report> WHERE SEL = 'X'.
        DELETE gt_report.
      ENDLOOP.
    ENDFORM.
    I'd like to select many rows in my ALV report, than by pressing the delete button I'd like to see a refresh of my ALV, without the selected rows. I want to save it only at the end of my action, only by pressing the save button.
    Any suggestion about the abap code will be well appreciated.
    Thanks in advance for your kind help.
    Regards.
        Giovanni

    Hi Giovanni,
    I am using the method:-
    CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY_LVC'
    EXPORTING
    *   I_INTERFACE_CHECK                 = ' '
    *   I_BYPASSING_BUFFER                =
    *   I_BUFFER_ACTIVE                   =
       I_CALLBACK_PROGRAM                = gd_REPID
       I_CALLBACK_PF_STATUS_SET          = 'UDIT'
       I_CALLBACK_USER_COMMAND           = 'USER_COMMAND'
    *   I_CALLBACK_TOP_OF_PAGE            = ' '
    *   I_CALLBACK_HTML_TOP_OF_PAGE       = ' '
    *   I_CALLBACK_HTML_END_OF_LIST       = ' '
    *   I_STRUCTURE_NAME                  =
    *   I_BACKGROUND_ID                   = ' '
       I_GRID_TITLE                      = 'Mainatin cell entry'
    *   I_GRID_SETTINGS                   =
       IS_LAYOUT_LVC                     = GS_LAYOUT
       IT_FIELDCAT_LVC                   = I_FIELDCAT[]
    *   IT_EXCLUDING                      =
    *   IT_SPECIAL_GROUPS_LVC             =
    *   IT_SORT_LVC                       =
    *   IT_FILTER_LVC                     =
    *   IT_HYPERLINK                      =
    *   IS_SEL_HIDE                       =
       I_DEFAULT                         = 'X'
    *   I_SAVE                            = 'X'
    *   IS_VARIANT                        =
       IT_EVENTS                         =
       IT_EVENT_EXIT                     =
    *   IS_PRINT_LVC                      =
    *   IS_REPREP_ID_LVC                  =
       I_SCREEN_START_COLUMN             = 30
       I_SCREEN_START_LINE               = 14
       I_SCREEN_END_COLUMN               = 120
       I_SCREEN_END_LINE                 = 25
    *   IT_EXCEPT_QINFO_LVC               =
    *   I_HTML_HEIGHT_TOP                 =
    *   I_HTML_HEIGHT_END                 =
    * IMPORTING
    *   E_EXIT_CAUSED_BY_CALLER           =
    *   ES_EXIT_CAUSED_BY_USER            =
      TABLES
        T_OUTTAB                          = IT_ZCP_DEMAND_SYS1
    * 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.
    I have made five buttons on my toolbar (add, delete, save, back, exit).
    Kindly tell me how can I catch the sy-ucomm of these buttons.
    NOTE: this FM is written inside an user-exit, so I cannot make forms.
    Thanks in advance.

  • Compare multiple variable selections between two internal tables

    I am trying to work out the syntax for the following, however i am stumped on the 2nd part of the requirement....
    I have two internal tables.  and i need to compare the records.
    1st, line by line, which i can do, however the 2nd requirement, i need to check a range of data against the same table...
    here is an example of the tables:
    Internal Table1 has the following records.
    TL1
    TL2
    TL3
    TL4
    TL5
    TL6
    Internal table 2 has the following records...
    LDOC1     TL1
    LDOC1     TL2
    LDOC1     TL3
    LDOC1     TL7
    LDOC2     TL1
    LDOC2     TL5
    LDOC3     TL6
    LDOC3     TL7
    but for the 2nd requirement, i have to group the LDOC1 (2, 3)  and search for all TL* and report if they all exist, some exist or none exist within the 1st internal table.
    so for requirement 1, the answer would be yes (as i can do a read table using the TL*), however i am not sure how i can check "for all entries" for TL1, Tl2, TL3, TL7 and return that only some entries exist....  LDOC1 should return "some", LDOC2 should return "all" and LDOC3 should return "none".
    Hopefully that makes sense???
    Can someone give me a keyword to investigate as i am not sure the At new would work....  Unless i do an at new and then loop and maybe add the record to a "range" to then compare and log the result as it runs through each result...
    so if Itab1 = itab2 then variable = yes. else None.
    if variable = yes, and itab1 = itab2 then variable = yes.
    if variable = yes and itab1 <> itab2 then variable = some.
    would that work??  i am worried about performance too as there could be 1000's of records....
    and can i have an "at end" so at end, if variable = yes, then variable = all?
    i have written all the rest of the report to get all the data into these tables...  i am just a little baffled as to how i can validate and compare the multiple selection....  :o(

    Hi,
    It is really confusing :-).. But i have tried to figure out.. may be this could be useful for you.
    Internal Table1 has the following records.
    TL1
    TL2
    TL3
    TL4
    TL5
    Internal table 2 has the following records...
    LDOC1 TL1
    LDOC1 TL2
    LDOC1 TL3
    LDOC1 TL7
    LDOC2 TL1
    LDOC2 TL5
    LDOC3 TL6
    LDOC3 TL7
    itab3[] = itab2[]
    sort itab3 by field1.
    delete adjacent duplicates from itab3 comparing field1.
    itab3
    LDCO1 
    LDCO2
    LDCO3
    loop at itab3.
    clear: lv_flag, index, ind.
    loop at itab2 where field1 = itab3-field1.
    index = index + 1.
    read table itab1 with key field1 = itab2-field2.
    if sy-subrc NE 0.
    lv_flag = 'X'.
    ind = ind + 1.
    endif.
    endloop.
    if lv_flag = 'X'.
    if ind = index.
      lv_val = 'NONE'.
    elseif ind NE index.
      lv_val = 'SOME'.
    endif.
    else.
      lv_val = 'ALL'.
    endif.
    "here you can modify itab3 with lv_val in one field, so that you can figure out which is SOME, NONE, ALL
    endloop.
    Regards,
    senthil

  • Create select-options using internal table

    Hello,
    I have number of table-fields in one internal table.
    I need to create select-options on screen for each of the table field in that internal table.
    Can anybody please provide a code for it ?
    Thanks.

    hi,
    you can create in this way :
    select-options: <name> for itab-<field name>.
    example code:
    TABLES: vbak.    " standard table
    TYPE-POOLS: slis.
    *-- Structure to hold data from table
    TYPES: BEGIN OF tp_itab1,
           vbeln LIKE vbap-vbeln,
           posnr LIKE vbap-posnr,
           werks LIKE vbap-werks,
           lgort LIKE vbap-lgort,
           END OF tp_itab1.
    *-- Data Declaration
    DATA: t_itab1 TYPE TABLE OF tp_itab1.
    DATA : i_fieldcat TYPE slis_t_fieldcat_alv.
    *                    Selection  Screen                                 *
    *--Sales document-block
    SELECTION-SCREEN BEGIN OF BLOCK b1 WITH FRAME TITLE text-t01.
    SELECT-OPTIONS: s_vbeln FOR vbak-vbeln,
                                 s_posnr FOR vbap-posnr,
                                 s_werks FOR vbap-werks,
                                s_lgort  FOR vbap-lgort.*
    SELECTION-SCREEN END OF  BLOCK b1.
    hope it will help you
    regards
    Rahul sharma
    Edited by: RAHUL SHARMA on Sep 19, 2008 8:25 AM

  • How to select and sum  internal table records

    Dear Friends
    I kindly ask you if we have select statement
       if s_mtart = 'z003'
          select single pvprs from ckmlcr into ckmlcr-pvprs
    where poper EQ s_poper and
          kalnr = itab2-kalnr  and
          bdatj = itab2-bdatj and
          curtp = itab2-curtp.
    like this how can I calculate how many record it got and I want to get summation of this field(pvprs).And for all poper's must contain.
      Please  Let me remind you my itab is already open I didn't put any thing for this situation

    it seems to be you written this SELECT in a loop. if so,
    instead of pushing the values into ckmlcr-pvprs ,create an internal table
    data : begin of itab,
         pvprs  type ckmlcr-pvprs ,
        end of itab.
    then just after that SELECT SINGLE,
    select single pvprs from ckmlcr <b>into ITAB-pvprs</b>
    where poper EQ s_poper and
    kalnr = itab2-kalnr and
    bdatj = itab2-bdatj and
    curtp = itab2-curtp.
    IF SY-SUBRC = 0.
      APPEND ITAB.
    here either you can use APPEND OR COLLECT.
    If you use COLLECT,all the values will get summed up and final sum will be in the table ITAB-pvprs.
    ENDIF.
    After all loops your itab will have the totals.
    DESCRIBE TABLE ITAB LINES V_LINES.
    V_LINES Will have total no of lines.
    Regards
    srikanth

  • Move the data in  select options to internal table

    I have  the code as in the fillowing
    SELECT-OPTION:S_MATNR FOR MARA-MATNR.
    DATA:BEGIN OF IT_MATNTR OCCURS 0,
    MATNR LIKE MARA-MATNR,
    END OF IT-MATNR.
    NOW HOW CAN I ADD THE MATNER VALUES IN THE SELECT-OPTIONS IN  INTERNAL TABLE

    Hi Vamsikrishna,
    Yes. You can move the values from S_MATNR to IT_MATNR.
    you can try either it_matnr[] = s_matnr[].
    if not then you can loop in to the select-options as follows.
    Define LS_MATNR as a structure type of s_matnr.
    Define LS_IT_MATNR as a structure type of it_matnr.
    LOOP S_MATNR INTO LS_MATNR.
      MOVE LS_MATNR to LS_IT_MATNR.
      APPEND LS_IT_MATNR to IT_MATNR.
      CLEAR: LS_MATNR, LS_IT_MATNR.
    ENDLOOP.
    <b>Reward points for helpful answers.</b>
    Best Regards,
    Ram.

Maybe you are looking for

  • CS3 Bridge, no files on right click (yes, I set preferences)

    I wrote this in previous thread, but it referred to CS5 so I'm pasting it in a new one. This is for CS3 Bridge. Since I finally uninstalled previous CS version, now when I open up Bridge and right-click PSD image to say, open in AI, my options are on

  • Frm-99999 error

    hi everybody i got a java error "java.lang.noclassdeffounderror" while trying to open my static web page using the internet explorer v4, i'm using OAS 4.0.8.1 and oracle developer server ver 6.0.5 installed on one machine called my_app_server , my or

  • JOBS IN LABVIEW

    Hi I have been doing a lot of programming in LABVIEW over the past one year and completed a lot of projects as part of my university research and classes. I am still not clear if there are a lot of jobs in LABVIEW. Do they pay well? Is it worth makin

  • Upgrading from Connect Enterprise 8 to 9, but switching servers as well

    Hi, I was wondering if I could get the recorded meetings from the server that currently hosts version 8 and put them on the new server? Does anyone know where those files are located, and are the recorded meetings one file? Please let em nkow. Thank

  • RME syslog msg filtered, where to set up do not filter?

    I have LMS 2.6 running in our system. Recently, I noticed that there is no syslog display from all of dev (It was working fine before). The syslog collector status shows that most of msg have been filtered out (means the server received syslog, but f