Select option looping

i have 5 select options on the screen. i want to take each select option .e.g one to one correpondence... I have to use a select query looping on the select option and send mails depending on the select query. also i have to concatenate the select option values in a variable

hi
hope it will help you.
Pls reward if help.
SELECT-OPTIONS: BEDAT FOR EKKO-BEDAT.
SELECT-OPTIONS: EBELN FOR EKKO-EBELN.
SELECT-OPTIONS: MATNR FOR EKPO-MATNR.
SELECT-OPTIONS: EREKZ FOR EKPO-EREKZ.
SELECT-OPTIONS: KOSTL FOR EKKN-KOSTL.
SELECT-OPTIONS: AUFNR FOR EKKN-AUFNR
DATA: INT LIKE ZSIMM_PO_HISTORY OCCURS 0 WITH HEADER LINE.
DATA: LW_EKKO TYPE EKKO,
LW_EKPO TYPE EKPO,
LW_EKKN TYPE EKKN,
LW_LFA1 TYPE LFA1.
SELECT * FROM EKKO INTO LW_EKKO
WHERE ( EBELN IN EBELN ) AND
( BEDAT IN BEDAT ).
CLEAR: INT.
IF SY-SUBRC = 0.
MOVE-CORRESPONDING LW_EKKO TO INT.
ENDIF.
SELECT * FROM EKPO INTO LW_EKPO
WHERE ( EBELN = LW_EKKO-EBELN ) AND
( MATNR IN MATNR ) AND
( EREKZ IN EREKZ ).
CLEAR: INT.
MOVE-CORRESPONDING LW_EKKO TO INT.
IF SY-SUBRC = 0.
MOVE-CORRESPONDING LW_EKPO TO INT.
ENDIF.
*SELEKCIJSKI EKRAN ZA CC IN ORDER
CLEAR: EKKN.
SELECT SINGLE * FROM EKKN WHERE ( EBELN = LW_EKPO-EBELN ) AND
( EBELP = LW_EKPO-EBELP ) AND
( KOSTL IN KOSTL ) and
( AUFNR IN AUFNR ).
MOVE EKKN-KOSTL TO INT-KOSTL.
MOVE EKKN-AUFNR TO INT-AUFNR.
CALL FUNCTION 'ME_READ_HISTORY'
EXPORTING
EBELN = LW_EKPO-EBELN
EBELP = LW_EKPO-EBELP
WEBRE = ' '
TABLES
XEKBES = BETS.
LOOP AT BETS WHERE ZEKKN EQ SPACE.
MOVE-CORRESPONDING BETS TO INT.
APPEND INT.
ENDLOOP.
IF SY-SUBRC NE 0.
APPEND INT.
ENDIF.
REFRESH BETS.
CLEAR: LW_EKPO.
ENDSELECT.
CLEAR: LW_EKKO.
ENDSELECT.

Similar Messages

  • Select options and loop statement

    Dear forum,
    I have the scenario where i need to restrict the loop from the select-options.
    in the select-options, user enter currency.
    then in the loop i need to loop base on the currency user enter.
    may i know what steps should i use for the loop as loop cannot support where.
    thanks

    HI Gengis
    I have the scenario where i need to restrict the loop from the select-options.
    in the select-options, user enter currency.
    then in the loop i need to loop base on the currency user enter.
    may i know what steps should i use for the loop as loop cannot support where.
    as per your requirement.
    you have some data in your internal table also you have a select-options to input values.
    on the basis of the values in your select option you want to fetch the values from your internal table. right???
    then there should be a field like your select option in your internal table.
    select-option: s_matnr for mara-matnr.
    let assume you have an internal table with matnr and other fields also and your select-options is for mara-matnr.
    then you need to select the values in your internal table according to the values in your select-options like below.
    SELECT MATNR field1 field2........ from dbtable into table itab where matnr = s_matnr.
    the above code will give you the values matching the values in your select-options.
    you need not to apply loop becasue you already have only those values for which yo u have found records in the DBTABLE.
    in case you want to apply loop on an internal table on the basis of s_matnr's values, then you can write.
    in this scenario you need to define 2 internal table one with already fethced values and another in which we will fetch the values according to select-options.
    loop at itab into wa_itab.
    read table itab1 into wa_itab1 where matnr = wa_itab-matnr.
    write statement........
    endloop.
    before that youwill have to fetch values in itab according to s_matnr.
    I hope this will clear your query.
    Thanks
    Lalit Gupta.

  • Selection order to follow the select-option order rather than numerical ord

    Hi Gurus!
    I have created a program to print Form headers. The program selects the documents from nast table based on the document numbers eneterd in selection screen. When I eneter for example documents :
    10000007
    10000005
    10000001
    10000002
    10000004 and run the program it prints the headers in sequential order rather than the order I put the documents numbers in selection screen.
    It prints
    10000001
    10000002
    10000004
    10000005
    10000007.
    Is there by any chnace a way that I can print it exactly in the same order as the documents are entered in the selection screen?
    Thanks. Help will be greatly appreciated.

    Yes, I agree. But my suggestion was to display or call the Form FM within the Select-options loop and Read Nast internal table for details. Hope you have restricted the Select options to restrict the entries only for "=" with no extension.
      Loop at S_SELOPT.
         Read table GT_NAST into GS_NAST with key OBJKY = S_SELOPT-LOW.
         If Sy-Subrc eq 0.
    .....  your existing logic to display the form....
         endif.
      Endloop.

  • Validating select-options entries

    hi
    i need to check whether all entries in SELECT-OPTIONS range are valid or not.
    *my select-options field is s-pernr as below.
    SELECT-OPTIONS: s_pernr  FOR pernr-pernr.
    *all valid entries from PA0000 table will be selected into pernr_table.
    SELECT DISTINCT pernr
            FROM pa0000
            INTO TABLE pernr_table
            WHERE pernr IN s_pernr.
    now i have to check all invalid pernr's in s_pernr.
    s_pernr contains: 1, 5, 6, 7, 8, 9, 10.
    PA0000 contains: 1, 2, 5, 8, 10, 11, 13, 15...
    then pernr_table = 1, 5, 8, 10 only.
    that means pernr 6, 7, 9 in s_pernr were invalid.
    How to fetch these values  as s_pernr is SELECT-OPTIONS field and it may have any combination of values.

    Hi,
      As far as what i get from your question is, user put multiple values in the LOW field of the select-option and you have to
    check all the values entered in the select-option-LOW field.
      If this is the case, you can loop at select-option as show :-
    1) create an internal table of type
    BEGIN OF ty_pernr ,
       sign(1)   TYPE c,
       option(2) TYPE c,
       low       TYPE pa0000-pernr,
       high      TYPE pa0000-pernr,
    END   OF ty_pernr.
    2) create workarea of type ty_pernr.
    data wa_pernr type ty_pernr.
    3) loop at the select-option.
    loop at s_pernr into wa_pernr.
        SELECT single pernr
       FROM pa0000
        INTO TABLE pernr_table
        WHERE pernr eq wa_pernr-low.
      if sy-subrc ne 0.
         "give error message.
      endif.
    endloop.
    Hope this solves ur problem.
    Regards,
    Bhavesh.

  • Update a select-option From Table

    Hi,
    I'm originally a C++ developer trying to learn ABAP.
    I want to append values to a select-option from a table if another select-option is specified.  I wrote some code that I believe will work but looks very inefficient to me.  Any advice on how to streamline this process would appreciated.
    The following is pseudo code and I left out some tweaks for simplicity and understanding but the basic idea is there.  I want to add selection criteria to a select-option based upon a second select option (that may or may not be provided) table lookup.
    Example:
    DATA: groups TYPE table3.
    SELECT-OPTIONS:
         s_accountNo FOR table1-accountNo,
         s_accountGroupNo FOR table2-accountGroupNo.
    **** get the Account Groups that meet the selection criteria.
    START-OF-SELECTION
         SELECT * INTO TABLE groups
              FROM table3
              WHERE accountGroupNo IN s_accountGroupNo.
    **** Remove duplicate accounts from the Account Groups
    SORT groups BY accountNo.
    DELETE ADJACENT DUPLICATES FROM groups COMPARING accountNo.
    **** Append the account #'s onto the s_accountNo range/select-option
    LOOP AT groups.
         APPEND groups-accountNo TO s_accountNo.
    ENDLOOP.
    **** manually edit the  s_accountNo to have the correct option/sign for use in further select statements.
    LOOP AT s_accountNo.
         s_accountNo-sign = 'I'.
         s_accountNo-option = 'EQ'.
         MODIFY s_accountNo.
    ENDLOOP.
    Thanks much,
    -Chris

    The actual selection is fairly complicated from my point of view.  I wrote the accountNo example to make things less confusing for me as much as anyone else, not to hide anything.  I also didn't expect this amount of feedback, though it is appreciated.
    The eventual select statement that is done is the following:
      SELECT DISTINCT vttp~zseq_num
                      likp~vbeln
                      likp~lprio
                      likp~vstel
                      lips~werks
                      likp~lgnum
                      lips~posnr
                      lips~lgort
                      lips~vgbel
                      lips~vgpos
                      lips~sobkz
                      lips~lfimg
                      lips~vrkme
                      lips~matnr
                      lips~volum
                      mara~raube
                      vttk~dplbg
                      vttp~tknum
                      vttp~tpnum
                      likp~berot
                      likp~vkorg
                      likp~lfart
                      INTO TABLE temp_deliveries
      FROM vttk
           INNER JOIN vttp
           ON vttk~tknum = vttp~tknum
           INNER JOIN likpuk AS likp
           ON vttp~vbeln = likp~vbeln
           INNER JOIN lipsup AS lips
           ON likp~vbeln = lips~vbeln
           INNER JOIN mara
           ON lips~matnr = mara~matnr
      WHERE likp~vstel = p_vstel
        AND lips~werks = p_werks
        AND likp~lgnum IN s_lgnum
        AND likp~vbeln IN s_vbeln
        AND lips~vgbel IN s_vgbel
        AND vttk~dplbg IN s_dplbg
        AND vttk~tknum IN s_tknum
        AND mara~raube = p_raube
        AND likp~lfart IN ('ZLF', 'NL')
        AND lips~kosta <> 'C'
        AND lips~kosta <> ''
        AND likp~kostk <> 'C'
        AND likp~vbtyp = outbound.
    and the structure it is put into is the following:
    TYPES: BEGIN OF type_deliveries,
              zseq_num    TYPE vttp-zseq_num,
              vbeln       TYPE likp-vbeln,
              lprio       TYPE likp-lprio,
              vstel       TYPE likp-vstel,
              werks       TYPE likp-werks,
              lgnum       TYPE likp-lgnum,
              posnr       TYPE lips-posnr,
              lgort       TYPE lips-lgort,
              vgbel       TYPE lips-vgbel,
              vgpos       TYPE lips-vgpos,
              sobkz       TYPE lips-sobkz,
              lfimg       TYPE lips-lfimg,
              vrkme       TYPE lips-vrkme,
              matnr       TYPE lips-matnr,
              volum       TYPE lips-volum,
              raube       TYPE mara-raube,
              dplbg       TYPE vttk-dplbg,
              tknum       TYPE vttk-tknum,
              tpnum       TYPE vttp-tpnum,
              berot       TYPE likp-berot,
              vkorg       TYPE likp-vkorg,
              lfart       TYPE likp-lfart,
              sdabw       type likp-sdabw,
              orig_lgort  TYPE lips-zzorig_lgort,
              selected    TYPE flag,
              counter(15) TYPE n,
            END OF type_deliveries.
    Currently there is a select option for tknum and I am attempting (successfully with my change shown above, though as many have pointed out I may be misusing the intended functionality) to add another select-option for s_pickno which is a field of a custom table that has pickno as one of it's unique keys and tknum as another of it's fields.  The idea is to be able to take a pickno and use it to find all the tknum's associated and then use them in the select statement above as well as any tknum's provided as initial input by the user.  If there is a better method than modifying the s_tknum selection I'm open to feedback.
    Apologies that my initial example did not portray this, but being new I was a little overwhelmed myself and want something I can wrap my head around better.  There's my wall of text

  • Loop in select options

    Hi,
    In DEV in debugging mode, S_VENDO is showing three entries but
    in PRD in debugging mode it shows one table entry.
    and thats why looping in not happening in PRD properly.
    I am inserting three entries.
    So how to loop in select option field.
    Edited by: Anurodh Jindal on Jun 5, 2008 1:32 PM

    Hi Bala,
    Please let us know why you need to loop in the range table as you can directly use it in your query or condition. Still if you want to loop, you will have to check the low as well as high values, and then adjust the loop accordingly. For ex.
    LOOP AT s-vendo INTO ls_vendo.
       lv_vendo = s_vendo-low.
       IF s_vendo-high IS NOT INITIAL.
         WHILE lv_vendo <= s-vendo-high.
           "write your code here using lv_vendo
           lv_vendo = lv_vendo + 1.
         ENDWHILE.
       ELSE.
         "write your code here using lv_vendo
       ENDIF.
    ENDLOOP.
    Let me know if you have any further doubts.
    Regards,
    Rachna

  • How to hide some select-option of Logical Database in report?

    How to hide select-option of  Logical Database in report?eg . In Logical Database 'PNP' , my code is 'GET  PERNR' , excute the report , select-screen is displayed . I want to hide some select-options , such as PNPPERNR-LOW .
    Edited by: rongrong wang  on Mar 26, 2008 9:31 AM

    U need to write code in initialization as
    initialization.
    loop at screen.
    if screen-name = 'PNPPERNR-LOW'.
    screen-active = '0'.
    modify screen.
    endif.
    if screen-name = 'PNPPERNR-HIGH'.
    screen-active = '0'.
    modify screen.
    endif.
    endloop.

  • Select-option in ABAP objects

    Hi Guys,
               I need a small help from you. I want to know how to populate the value from select-option to abap object. Please help me, it is very important

    check this code
    REPORT ZSELOPT_TO_CLASS .
    TABLES: VBRK.
    SELECT-OPTIONS: S_VBELN FOR VBRK-VBELN.
    DATA: IT_VBELN TYPE RSELOPTION.
    DATA: X_VBELN TYPE RSDSSELOPT.
    CLASS C1 DEFINITION.
    PUBLIC SECTION.
    DATA: IT_VBRP TYPE VBRP_TAB,
          X_VBRP LIKE LINE OF IT_VBRP.
    METHODS: GET_DATA IMPORTING S_VBELN TYPE RSELOPTION.
    METHODS: DISP_DATA.
    ENDCLASS.
    CLASS C1 IMPLEMENTATION.
    METHOD GET_DATA.
      *SELECT * FROM VBRP*
       INTO TABLE IT_VBRP
       WHERE VBELN IN S_VBELN.
    ENDMETHOD.
    METHOD DISP_DATA.
      LOOP AT IT_VBRP INTO X_VBRP.
        WRITE:/ X_VBRP-VBELN,
                X_VBRP-POSNR.
      ENDLOOP.
    ENDMETHOD.
    ENDCLASS.
    START-OF-SELECTION.
    DATA OBJ TYPE REF TO ZCL_SELOPT.
    CREATE OBJECT OBJ.
    LOOP AT S_VBELN.
      MOVE S_VBELN-LOW TO X_VBELN-LOW.
      MOVE S_VBELN-HIGH TO X_VBELN-HIGH.
      MOVE S_VBELN-SIGN TO X_VBELN-SIGN.
      MOVE S_VBELN-OPTION TO X_VBELN-OPTION.
      APPEND X_VBELN TO IT_VBELN.
    ENDLOOP.
    CALL METHOD OBJ->GET_DATA
                        EXPORTING
                          S_VBELN = IT_VBELN.
    CALL METHOD OBJ->DISP_DATA.
    Edited by: moazam hai on May 17, 2008 6:17 AM
    Edited by: moazam hai on May 17, 2008 6:19 AM

  • 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 get the values of Select-options from the screen.

    The value of parameter can be obtained by function module 'DYNP_VALUES_READ' but How to get the values of Select-options from the screen? I want the F4 help values of select-options B depending on the values in Select-option A.So I want to read the Select-option A's value.

    Hi,
    Refer this following code..this will solve your problem...
    "Following code reads value entered in s_po select options and willprovide search
    "help for s_item depending upon s_po value.
    REPORT TEST.
    TABLES : ekpo.
    DATA: BEGIN OF itab OCCURS 0,
    ebelp LIKE ekpo-ebelp,
    END OF itab.
    SELECT-OPTIONS   s_po FOR ekpo-ebeln.
    SELECT-OPTIONS s_item FOR ekpo-ebelp.
    INITIALIZATION.
    AT SELECTION-SCREEN ON VALUE-REQUEST FOR s_item-low.
      DATA:
      dyn_field TYPE dynpread,
      temp_fields TYPE TABLE OF dynpread,
      zlv_dynpro TYPE syst-repid.
      zlv_dynpro = syst-repid.
      CALL FUNCTION 'DYNP_VALUES_READ'
        EXPORTING
          dyname     = zlv_dynpro
          dynumb     = syst-dynnr
          request    = 'A'
        TABLES
          dynpfields = temp_fields
        EXCEPTIONS
          OTHERS     = 0.
      LOOP AT temp_fields INTO dyn_field.
        IF dyn_field-fieldname EQ 'S_PO-LOW'.
            SELECT * INTO CORRESPONDING fields OF TABLE itab FROM ekpo
            WHERE ebeln EQ dyn_field-fieldvalue.
            EXIT.
        ENDIF.
      ENDLOOP.

  • Report text element as selection option

    Hi,
      I encounter a performance problem in a report program that include a self define fields in the selection option.  I use the FM READ_TEXT to read those fields and compare with the user input.Then, eliminates those unmatched records with if else statement.
    Here is my code:
    SELECT-OPTIONS: S_WADAT FOR LIKP-WADAT_IST.
      PARAMETERS: P_MAWB LIKE WA_REPORT-KZABE.
      PARAMETERS: P_HAWB LIKE LIKP-BOLNR.
      PARAMETERS: P_MATNR LIKE LIPS-MATNR.
      PARAMETERS: P_LOT(20) TYPE C.
      CLEAR: I_REPORT,I_DELIVERY,I_DELIVERY_INFO.
      REFRESH: I_REPORT,I_DELIVERY,I_DELIVERY_INFO.
      DATA WHERE_TAB(80) OCCURS 10 WITH HEADER LINE.
      DATA: BEGIN OF LTEXT OCCURS 50.
              INCLUDE STRUCTURE TLINE.
      DATA: END OF LTEXT.
      IF NOT P_HAWB IS INITIAL.
        CONCATENATE ' BOLNR = ' WHERE_TAB INTO WHERE_TAB.
        CONCATENATE WHERE_TAB '''' INTO WHERE_TAB.
        CONCATENATE WHERE_TAB P_HAWB INTO WHERE_TAB.
        CONCATENATE  WHERE_TAB '''' INTO WHERE_TAB.
        APPEND WHERE_TAB.
      ENDIF.
      IF NOT P_MATNR IS INITIAL.
        IF NOT WHERE_TAB IS INITIAL.
          CONCATENATE ' AND MATNR = ' WHERE_TAB INTO WHERE_TAB.
        ELSE.
          CONCATENATE ' MATNR = ' WHERE_TAB INTO WHERE_TAB.
        ENDIF.
        CONCATENATE WHERE_TAB '''' INTO WHERE_TAB.
        CONCATENATE WHERE_TAB P_MATNR INTO WHERE_TAB.
        CONCATENATE  WHERE_TAB '''' INTO WHERE_TAB.
        APPEND WHERE_TAB.
      ENDIF.
      SELECT A1~VBELN
             WADAT_IST
             BOLNR
             C1~LIFNR
             B1~MATNR
             LFIMG
             BTGEW
             B1~CHARG
        INTO CORRESPONDING FIELDS OF TABLE TMP_REPORT
        FROM LIKP AS A1 JOIN LIPS AS B1 ON A1~VBELN = B1~VBELN
            JOIN MCHA AS C1 ON B1~MATNR = C1~MATNR
                               AND
                               B1~WERKS = C1~WERKS
                               AND
                               B1~CHARG = C1~CHARG
         WHERE LFART = 'EL'
               AND
               WADAT_IST IN S_WADAT
               AND
               B1~CHARG NE ''
               AND
               B1~WERKS = 'ABC'
               AND
               (WHERE_TAB)
      SORT TMP_REPORT BY VBELN.
      DATA: V_FLAG TYPE I,
            V_EXCLUDE TYPE I,
            V_LOT_EXCLUDE TYPE I.
      V_FLAG = 0.
      V_EXCLUDE = 0.
      V_LOT_EXCLUDE = 0.
      IF SY-SUBRC = 0.
    * trim the parameter space
        SHIFT P_MAWB RIGHT DELETING TRAILING SPACE.
        SHIFT P_MAWB LEFT DELETING LEADING SPACE.
        SHIFT P_LOT RIGHT DELETING TRAILING SPACE.
        SHIFT P_LOT LEFT DELETING LEADING SPACE.
        LOOP AT TMP_REPORT.
          AT NEW VBELN.
            V_FLAG = 1.
            V_EXCLUDE = 0.
          ENDAT.
          IF V_FLAG = 1.
            PERFORM GET_HEADER_TEXT
                  TABLES
                       LTEXT
                  USING
                       'Z3IH'
                        TMP_REPORT-VBELN
            READ TABLE LTEXT INDEX 1.
            SPLIT LTEXT-TDLINE AT ':' INTO
            TMP_REPORT-VERUR TMP_REPORT-VERUR.
            READ TABLE LTEXT INDEX 2.
            SPLIT LTEXT-TDLINE AT ':' INTO
            TMP_REPORT-KZGBE TMP_REPORT-KZGBE.
            READ TABLE LTEXT INDEX 3.
            SPLIT LTEXT-TDLINE AT ':' INTO
            TMP_REPORT-KZABE TMP_REPORT-KZABE.
            READ TABLE LTEXT INDEX 4.
            SPLIT LTEXT-TDLINE AT ':' INTO
            TMP_REPORT-STABE TMP_REPORT-STABE.
            READ TABLE LTEXT INDEX 5.
            SPLIT LTEXT-TDLINE AT ':' INTO
            TMP_REPORT-PRONU TMP_REPORT-PRONU.
            READ TABLE LTEXT INDEX 6.
            SPLIT LTEXT-TDLINE AT ':' INTO
            TMP_REPORT-LADEL TMP_REPORT-LADEL.
            SHIFT TMP_REPORT-KZABE RIGHT DELETING TRAILING SPACE.
            SHIFT TMP_REPORT-KZABE LEFT DELETING LEADING SPACE.
            MOVE-CORRESPONDING TMP_REPORT TO WA_REPORT.
            MOVE-CORRESPONDING TMP_REPORT TO WA_TMPREPORT.
            V_FLAG = 0.
          ELSE.
            MOVE TMP_REPORT-VBELN TO WA_REPORT-VBELN.
            MOVE TMP_REPORT-LIFNR TO WA_REPORT-LIFNR.
            MOVE TMP_REPORT-MATNR TO WA_REPORT-MATNR.
            MOVE TMP_REPORT-LFIMG TO WA_REPORT-LFIMG.
          ENDIF.
          PERFORM GET_LOT_CODE USING
                                     WA_REPORT-MATNR
                                     '3LTU'
                                     WA_TMPREPORT-CHARG
                                     WA_REPORT-LOT.
          IF V_EXCLUDE  1 AND P_MAWB NE ''
            AND WA_TMPREPORT-KZABE NE P_MAWB .
            V_EXCLUDE = 1.
          ENDIF.
          SHIFT WA_REPORT-LOT RIGHT DELETING TRAILING SPACE.
          SHIFT WA_REPORT-LOT LEFT DELETING LEADING SPACE.
          IF P_LOT NE '' AND P_LOT NE WA_REPORT-LOT.
            V_LOT_EXCLUDE = 1.
          ELSE.
            V_LOT_EXCLUDE = 0.
          ENDIF.
          IF V_EXCLUDE  1 AND V_LOT_EXCLUDE  1.
            APPEND WA_REPORT TO I_REPORT.
            CLEAR WA_REPORT.
            CLEAR TMP_REPORT.
          ENDIF.
        ENDLOOP.

    Hi,
    i found one perfromance issue, try to remove the "INTO CORRESPONDING FIELDS OF TABLE " in your select statement, the order of the fields that you are fetching and the oreder for the fields in your internal table structure should be same, then you can remove "INTO CORRESPONDING FIELDS OF TABLE " and while fetching the fields reffer the table and fields you need to fetch here also you need to main the same order...like you have to do the same in where condition.
    Reward if needful.
    Thanks,
    Sreeram.

  • About select option

    Hi experts,
    In my alv report there is one field SERNR serial number, for this i have to put select option. My problem is this field doesn't exist in the table(Zmanifest) from where i'm fetching data. So i'm not able to mention this select option in my select query for that particular table. This field is existing in EQUI table and have no relation defined between zmanifest table & EQUI.
    In my internal table i have all fields of zmanifest & this sernr; to fulfill this field logic is
    Serial Number is combination of P_PREFIX-(dash)P_SERIAL fields in zmanifest. I have fetch all data including SERNR by above logic at my grid; but facing problem in defining SELECT-OPTIONS for Sernr.
    Please help.
    Points Sure.
    Anshuman

    Hi,
    do like this.
    take the lenght of P_PREFIX
    take the lenght of P_SERIAL
    add the length.
    for exmaple :
    P_PREFIX size is 4.
    P_SERIAL size is 10
    now declare the variable like this.
    data : v_selop(15).
    Note : 4101 = 15, so i declared the variable with lenght of 15.
    select-options : so_field for v_selop.
    now use off-set in your select query like this:
    where PREFIX = v_selop+0(4)
       and SERIAL = v_selop+5(10)
    it will work if you are using variable v_selop as a parameter else if you are using select option you have to break v_selop into two different select option like this:
    s_prefix type prefix,
    s_serial type serial.
    loop at v_selop.
    s_prefix-* = v_selop-. "      (  = sign, option)
    s_serial-* = v_selop-*.
    s_prefix-low = v_selop-low+0(4).
    s_serial-low = v_selop-low+5(10).
    s_prefix-high = v_selop-high+0(4).
    s_serial-high = v_selop-high+5(10).
    endloop.
    now use following select query
    where PREFIX in s_prefix
       and SERIAL in s_serial.
    it will surely wrok.
    Regards-
    Gagan Kumar
    Plz Reward if need full. also close the question.
    Edited by: Gagan Kumar on May 18, 2008 7:30 PM

  • Help on Dynamic values in select options

    Hi All,
    I need help for the following.
    1. I have two select options for fields VBAK-VBELN and VBAK-ERDAT one after the other.
    2. When I select VBELN through F4 in the first select option then the corresponding ERDAT should be displayed in second select option.
    Please let me know how to do this

    Use the below code
    tables: pa0000, pa0001.
    parameters: p_chk1 as checkbox user-command rusr,
    p_chk2 as checkbox user-command rusr,
    p_chk3 as checkbox user-command rusr,
    p_chk4 as checkbox user-command rusr,
    p_chk5 as checkbox user-command rusr.
    selection-screen: begin of block blk1 with frame.
    select-options: s_pernr for pa0000-pernr modif id ABC,
    s_stat2 for pa0000-stat2 modif id DEF,
    s_werks for pa0001-werks modif id GHI,
    s_persg for pa0001-persg modif id JKL,
    s_persk for pa0001-persk modif id MNO.
    selection-screen: end of block blk1.
    AT SELECTION-SCREEN output.
    LOOP AT SCREEN.
    IF SCREEN-GROUP1 = 'ABC'.
    IF p_chk1 = 'X'.
    SCREEN-ACTIVE = 1.
    ELSE.
    SCREEN-ACTIVE = 0.
    ENDIF.
    MODIFY SCREEN.
    ENDIF.
    IF SCREEN-GROUP1 = 'DEF'.
    IF p_chk2 = 'X'.
    SCREEN-ACTIVE = 1.
    ELSE.
    SCREEN-ACTIVE = 0.
    ENDIF.
    MODIFY SCREEN.
    ENDIF.
    IF SCREEN-GROUP1 = 'GHI'.
    IF p_chk3 = 'X'.
    SCREEN-ACTIVE = 1.
    ELSE.
    SCREEN-ACTIVE = 0.
    ENDIF.
    MODIFY SCREEN.
    ENDIF.
    IF SCREEN-GROUP1 = 'JKL'.
    IF p_chk4 = 'X'.
    SCREEN-ACTIVE = 1.
    ELSE.
    SCREEN-ACTIVE = 0.
    ENDIF.
    MODIFY SCREEN.
    ENDIF.
    IF SCREEN-GROUP1 = 'MNO'.
    IF p_chk5 = 'X'.
    SCREEN-ACTIVE = 1.
    ELSE.
    SCREEN-ACTIVE = 0.
    ENDIF.
    MODIFY SCREEN.
    ENDIF.
    ENDLOOP.
    *Note
    *Titles for check boxes and select options
    *P_CHK1 Personal Number
    *P_CHK2 Employment Status
    *P_CHK3 Personnel Area
    *P_CHK4 Employee Group
    *P_CHK5 Employee Sub group
    *S_PERNR Personal Number
    *S_PERSG Employee Group
    *S_PERSK Employee Sub group
    *S_STAT2 Employment Status
    *S_WERKS Personnel Area

  • Select-Options Help

    Hi.
    I have this small program with a select-options s_tran.
    I need to call function Z_UNLOCK for each entry in s_tran.
    How can I make that?
    Thanks
    Best regards
    PARAMETERS: p_warn TYPE ltap-LGNUM.
    SELECT-OPTIONS:  s_tran FOR LTAK-tanum.
    loop at ......................?????
        CALL FUNCTION 'Z_UNLOCK'
          EXPORTING
            iv_warehouse = p_warn
            iv_tanum     = s_tran-tanum
            language     = sy-langu
          IMPORTING
            return       = return.
        IF return-type = ''.
          EXIT.
        ENDIF.
    Endloop.

    hi,
    try to use this code:
    >PARAMETERS: p_warn TYPE ltap-LGNUM.
    >SELECT-OPTIONS: s_tran FOR LTAK-tanum.
    >data: lt_ltak type ltak occurs 0 with header line.
    >start-of-selection.
    >select * from ltak into table lt_ltak where tanum in s_tran.
    >
    >
    >loop at lt_ltak.
    >
    >CALL FUNCTION 'Z_UNLOCK'
    >EXPORTING
    >iv_warehouse = p_warn
    >iv_tanum = lt_ltak-tanum
    >language = sy-langu
    >IMPORTING
    >return = return.
    >
    >IF return-type = ''.
    >EXIT.
    >ENDIF.
    >
    >Endloop.
    bye
    Marco

  • SELECT OPTIONS DATE.

    Hello , I need your help ,  to access to  every date in an interval of the select option , in order to execute a function module that use date in one of its parameters .
    select-options : dat for sy-datum .
       CALL FUNCTION 'ZPRUEBA''
         EXPORTING
           offic                =
           chdsk                =
           inicio_periodo       =
         FIM_PERIODO          =  dat  "but i need here every date of the interval
         NO_UPDATE            =
       IMPORTING
         NR_COBRANCAS         =
       ENDSELECT.
    How can I do that ? , tnhx.

    hi
    put the function module in the loop.
    data : date like sy-datum.
    select-options : s_date for date.
    while ( s_date-low LE s_date-high ).
    CALL FUNCTION 'ZPRUEBA''
    EXPORTING
    offic =
    chdsk =
    inicio_periodo =
    FIM_PERIODO = s_date-low
    NO_UPDATE =
    IMPORTING
    NR_COBRANCAS =
    add 1 to s_date-low.
    endwhile.
    reward if helpful
    prasanth

Maybe you are looking for