Reg select-options

HI All,
       Can anyone of you tell me wat is wrong in the below code.
TABLES:
  EKKO,                           "Purchasing Document Header
  EKPO,                           "Purchasing Doc Item
  MARA,                           "Material
  MARC,                           "Material at plant
  USR02,                          "User address data
  T024E,                          "Purchasing Organization
  EORD.                           "Purchasing Source List
tables : kna1.
                   GLOBAL DATA
DATA:                                  " Work fields definition
     W_SPONO         LIKE RSPOTYPE-RQNUMBER,
     W_MAIL_SUBJECT(50)  TYPE C,
     W_MAIL_REPT(1),
     W_TIME LIKE SY-UZEIT.
DATA  W_CNTRFLG.
DATA :W_HEADFLG.
DATA W_NETWR(16).
Counters
DATA: W_COUNT_READ(6)              TYPE N,       "Records Read
      W_COUNT_SKIP(6)              TYPE N,       "Records Skipped
      W_COUNT_NEW(6)               TYPE N,       "New Records to create
      W_COUNT_PO(6)                TYPE N,       "Number of PO records
      W_COUNT_CALL_TXN_ERR(6)      TYPE N,       " # of CALL TXN errors
      W_COUNT_CALL_TXN(6)          TYPE N,       "Total # Call Trans
      W_COUNT_BDC_RECORDS(6)       TYPE N,       "Total # BDC Trans
      W_COUNT_LINES(2)             TYPE N,       "number lines on T/O
      W_COUNT_SESS_TOT(4)          TYPE N.       "Total session count
General Data
DATA: W_REQ_DATE_N     TYPE D,         "Req date converted to DAT
      W_REQ_DATE(10)   TYPE C,         "Req date converted to CHAR
      W_DONE_FILE(85)  TYPE C,         "Output done file name
      W_MESSAGE(60)    TYPE C,         "Work message field
      W_PAGE           TYPE C VALUE '1', "report type: 1=audit, 2=error
      W_QTY          LIKE EBAN-MENGE,  "Qty converted to numeric field
      W_TAX_CODE     LIKE EKPO-MWSKZ,  "Tax Code
      W_RETCODE(2)   TYPE N,
      W_MAXLNS      TYPE N.
DATA:W_CONTRACT_PREV LIKE EKKO-KONNR.
                                     CALL TRANSACTION fields
DATA: W_TRANSACTION LIKE TSTC-TCODE.   "Transaction to call
                           Constants
CONSTANTS: C_PO_TYPE    LIKE EKKO-BSART   VALUE 'NB',
          C_PLANT      LIKE EKPO-WERKS   VALUE '5050',   "V01
           C_PO_CREATE  LIKE TSTC-TCODE   VALUE 'ME21',
           C_X(1)       TYPE C VALUE 'X',
           C_TRANS(10) TYPE C VALUE  '.transfer',
           C_2300      LIKE EKPO-WERKS  VALUE '2300'.               "V02
CONSTANTS:C_CREATEDPO(15) TYPE C VALUE 'Created PO',
          C_CALLTRAX(20) TYPE C VALUE 'Call Txn error'.
   Record Layout                                                     *
Input File Layout
DATA: BEGIN OF R_INPUT1,
        REC_TYPE(32)     TYPE C,         "Record Type
        VERSION(4)       TYPE C,         "Version
        EBELN(20)        TYPE C,         "Order Number
        EMPTY1(20)       TYPE C,         "Empty Field
        ORDER_LINE(5)    TYPE C,         "Order Line Number
        EMPTY2(4)        TYPE C,         "Empty Field
        BSART(4)         TYPE C,         "PO type
        EKORG(4)         TYPE C,         "Purchasing Org
        EKGRP(3)         TYPE C,         "Purchasing Group
        EMPTY3(4)        TYPE C,         "Empty Field
        VENDOR(10)       TYPE C,         "Vendor
        MATNR(18)        TYPE C,         "Material
        MENGE(17)        TYPE C,         "Purch Order Quantity
        REQ_DATE(8)      TYPE N,         "Requested Date (yyyymmdd)
        WERKS(4)         TYPE C,         "Plant
        EMPTY4(4)        TYPE C,         "Empty Field
        CONTRACT(10)     TYPE C,         "Contract Number
        CONTR_ITEM(5)    TYPE C,         "Contract Item Number
        EMPTY5(10)       TYPE C,         "Empty Field
        LGORT(4)         TYPE C,         "Storage Location
      END OF R_INPUT1.
   Internal Table Definition With Structure Included                 *
DATA: IT_INPUT  LIKE R_INPUT1 OCCURS 0 WITH HEADER LINE.
DATA: BEGIN OF IT_MARC OCCURS 0,
        MATNR LIKE MARC-MATNR,
        WERKS LIKE MARC-WERKS,
        EKGRP LIKE MARC-EKGRP,
      END OF IT_MARC.
JIT Purchase Order Table
DATA: BEGIN OF IT_JIT_PO  OCCURS 10.
        INCLUDE STRUCTURE R_INPUT1.
DATA: TAXCODE(2) TYPE C.   "V01
DATA: END OF IT_JIT_PO.
DATA:IT_JIT_PO1 LIKE TABLE OF IT_JIT_PO WITH HEADER LINE.
Messages Table (errors & success)
DATA: BEGIN OF IT_MSGTAB OCCURS 10.
DATA:   RKEY(2)  TYPE C.                  "Record type key
        INCLUDE STRUCTURE R_INPUT1.
DATA:   MSG(60)  TYPE C.
DATA:   NAME1     LIKE LFA1-NAME1.        "Vendor Name
DATA:   PONUMBER  LIKE EKPO-EBELN.
DATA:   BCODEDESC LIKE T024-EKNAM.
DATA:   NETWR     LIKE EKPO-NETWR.      "Total PO $ Value
DATA: END OF IT_MSGTAB.
Temp Table to save data for one PO at a time
DATA: BEGIN OF IT_PODAT  OCCURS 10.
        INCLUDE STRUCTURE R_INPUT1.
DATA: END OF IT_PODAT.
DATA: IT_MSGTAB_E LIKE IT_MSGTAB OCCURS 0 WITH HEADER LINE.
DATA: IT_MSGTAB_O LIKE IT_MSGTAB OCCURS 0 WITH HEADER LINE.
DATA: IT_MSGTAB_ERR LIKE IT_MSGTAB OCCURS 0 WITH HEADER LINE.
                                     For F4 at Event Name
DATA: BEGIN OF LV_EVT  OCCURS 0,
        EVENTID     LIKE BTCUEV-EVENTID,
      END OF LV_EVT.
                                     To print selections
DATA: BEGIN OF SELECTIONS  OCCURS 0,
        Z(2)   TYPE C,
        LINE   LIKE RALDB-INFOLINE,
      END OF SELECTIONS.
DATA: BEGIN OF T_MESSAGE OCCURS 10.                               "#EC *
        INCLUDE STRUCTURE BDCMSGCOLL.
DATA: END OF T_MESSAGE.
DATA:  BEGIN OF IT_NETWR OCCURS 0,
       NETWR LIKE EKPO-NETWR,
      END   OF IT_NETWR.
DATA: BEGIN OF IT_BDC OCCURS 0.
        INCLUDE STRUCTURE BDCDATA.
DATA: END OF IT_BDC.
DATA: W_MATNR    LIKE MARC-MATNR,
      W_LNUM(6)  TYPE N,
      INT_MATNR  LIKE MARA-MATNR,      "Internal format
      W_TFILE(60).
DATA: BEGIN OF IT_RECEIVERS OCCURS 0.
        INCLUDE STRUCTURE SOOS1.
DATA: END OF IT_RECEIVERS.
                 SELECTION SCREEN
SELECT-OPTIONS: S_EKORG   FOR EKKO-EKORG  OBLIGATORY
                                          NO INTERVALS
                                          DEFAULT '9000'.
SELECT-OPTIONS: S_WERKS FOR MARC-WERKS OBLIGATORY ."NO INTERVALS.   "V01
SELECTION-SCREEN  SKIP 1.
PARAMETERS:
  P_INPUT(80)   TYPE C                 "Input file from DRP
                DEFAULT '/sapdaemon/I2/spp/in/daily/po_upload_spk21.dat'
                OBLIGATORY  LOWER CASE,
  P_OUTPUT(80)  TYPE C                 "Error/warning error records
                DEFAULT '/sapdaemon/I2/spp/in/daily/po_upload_spk21.err'
                LOWER CASE.
SELECTION-SCREEN  SKIP 1.
SELECTION-SCREEN  COMMENT 01(53) TEXT-005.
SELECTION-SCREEN SKIP 1.
PARAMETERS:
  P_DONEFL      AS CHECKBOX DEFAULT 'X',    "Create .done file?
  P_UPDT        AS CHECKBOX DEFAULT ' '.    "Simulation Run only?(x=yes)
SELECTION-SCREEN  SKIP 1.
PARAMETERS:
  P_MODE(1)     TYPE C DEFAULT 'N'
                OBLIGATORY,
  P_UPDATE(1)   TYPE C DEFAULT 'S'
                OBLIGATORY,
  P_BDCERR LIKE APQI-GROUPID DEFAULT 'ZMXU510',
  P_USERID LIKE APQI-USERID  DEFAULT SY-UNAME
                             MATCHCODE OBJECT USER_ADDR.
PARAMETERS : P_MAXLNS(3) TYPE N DEFAULT 10 OBLIGATORY.
select-options:  S_MAXLNS   for kna1-kunnr.
SELECTION-SCREEN  COMMENT 42(40) TEXT-011.
PARAMETERS:
  P_STOP(6)     TYPE N.     "MAX # of records to read from input file
SELECTION-SCREEN  COMMENT 42(40) TEXT-003.
SELECTION-SCREEN  SKIP 1.
PARAMETERS:
  P_REPTD  AS CHECKBOX  DEFAULT 'X',
  P_REPTP  AS CHECKBOX  DEFAULT ' ',
  P_SPOOL  AS CHECKBOX  DEFAULT ' ',
  P_EMAIL  AS CHECKBOX  DEFAULT ' '.
SELECTION-SCREEN  SKIP 1.
PARAMETERS:
  P_EVENT  AS CHECKBOX  DEFAULT 'X',
  P_EVNAM  LIKE BTCUEV-EVENTID  DEFAULT 'Z_ITWO_START_ZI2X14'.
SELECTION-SCREEN  SKIP 1.
PARAMETERS: P_TRANS AS CHECKBOX DEFAULT 'X',
            P_TFILE(80) TYPE C DEFAULT
            '/sapdaemon/I2/spp/in/daily/zi2spk21.trig'(099)
                        LOWER CASE.

Hi,
You have writen the Selsection screen comments, but that is over writing some of the parameters, so it is not genarating the selection screen, you need use the / for every comment on the selection screen, so that it will print in the next line
Here is the changed code
TABLES:
EKKO, "Purchasing Document Header
EKPO, "Purchasing Doc Item
MARA, "Material
MARC, "Material at plant
USR02, "User address data
T024E, "Purchasing Organization
EORD. "Purchasing Source List
tables : kna1.
GLOBAL DATA
DATA: " Work fields definition
W_SPONO LIKE RSPOTYPE-RQNUMBER,
W_MAIL_SUBJECT(50) TYPE C,
W_MAIL_REPT(1),
W_TIME LIKE SY-UZEIT.
DATA W_CNTRFLG.
DATA :W_HEADFLG.
DATA W_NETWR(16).
Counters
DATA: W_COUNT_READ(6) TYPE N, "Records Read
W_COUNT_SKIP(6) TYPE N, "Records Skipped
W_COUNT_NEW(6) TYPE N, "New Records to create
W_COUNT_PO(6) TYPE N, "Number of PO records
W_COUNT_CALL_TXN_ERR(6) TYPE N, " # of CALL TXN errors
W_COUNT_CALL_TXN(6) TYPE N, "Total # Call Trans
W_COUNT_BDC_RECORDS(6) TYPE N, "Total # BDC Trans
W_COUNT_LINES(2) TYPE N, "number lines on T/O
W_COUNT_SESS_TOT(4) TYPE N. "Total session count
General Data
DATA: W_REQ_DATE_N TYPE D, "Req date converted to DAT
W_REQ_DATE(10) TYPE C, "Req date converted to CHAR
W_DONE_FILE(85) TYPE C, "Output done file name
W_MESSAGE(60) TYPE C, "Work message field
W_PAGE TYPE C VALUE '1', "report type: 1=audit, 2=error
W_QTY LIKE EBAN-MENGE, "Qty converted to numeric field
W_TAX_CODE LIKE EKPO-MWSKZ, "Tax Code
W_RETCODE(2) TYPE N,
W_MAXLNS TYPE N.
DATA:W_CONTRACT_PREV LIKE EKKO-KONNR.
CALL TRANSACTION fields
DATA: W_TRANSACTION LIKE TSTC-TCODE. "Transaction to call
Constants
CONSTANTS: C_PO_TYPE LIKE EKKO-BSART VALUE 'NB',
C_PLANT LIKE EKPO-WERKS VALUE '5050', "V01
C_PO_CREATE LIKE TSTC-TCODE VALUE 'ME21',
C_X(1) TYPE C VALUE 'X',
C_TRANS(10) TYPE C VALUE '.transfer',
C_2300 LIKE EKPO-WERKS VALUE '2300'. "V02
CONSTANTS:C_CREATEDPO(15) TYPE C VALUE 'Created PO',
C_CALLTRAX(20) TYPE C VALUE 'Call Txn error'.
Record Layout *
Input File Layout
DATA: BEGIN OF R_INPUT1,
REC_TYPE(32) TYPE C, "Record Type
VERSION(4) TYPE C, "Version
EBELN(20) TYPE C, "Order Number
EMPTY1(20) TYPE C, "Empty Field
ORDER_LINE(5) TYPE C, "Order Line Number
EMPTY2(4) TYPE C, "Empty Field
BSART(4) TYPE C, "PO type
EKORG(4) TYPE C, "Purchasing Org
EKGRP(3) TYPE C, "Purchasing Group
EMPTY3(4) TYPE C, "Empty Field
VENDOR(10) TYPE C, "Vendor
MATNR(18) TYPE C, "Material
MENGE(17) TYPE C, "Purch Order Quantity
REQ_DATE(8) TYPE N, "Requested Date (yyyymmdd)
WERKS(4) TYPE C, "Plant
EMPTY4(4) TYPE C, "Empty Field
CONTRACT(10) TYPE C, "Contract Number
CONTR_ITEM(5) TYPE C, "Contract Item Number
EMPTY5(10) TYPE C, "Empty Field
LGORT(4) TYPE C, "Storage Location
END OF R_INPUT1.
Internal Table Definition With Structure Included *
DATA: IT_INPUT LIKE R_INPUT1 OCCURS 0 WITH HEADER LINE.
DATA: BEGIN OF IT_MARC OCCURS 0,
MATNR LIKE MARC-MATNR,
WERKS LIKE MARC-WERKS,
EKGRP LIKE MARC-EKGRP,
END OF IT_MARC.
JIT Purchase Order Table
DATA: BEGIN OF IT_JIT_PO OCCURS 10.
INCLUDE STRUCTURE R_INPUT1.
DATA: TAXCODE(2) TYPE C. "V01
DATA: END OF IT_JIT_PO.
DATA:IT_JIT_PO1 LIKE TABLE OF IT_JIT_PO WITH HEADER LINE.
Messages Table (errors & success)
DATA: BEGIN OF IT_MSGTAB OCCURS 10.
DATA: RKEY(2) TYPE C. "Record type key
INCLUDE STRUCTURE R_INPUT1.
DATA: MSG(60) TYPE C.
DATA: NAME1 LIKE LFA1-NAME1. "Vendor Name
DATA: PONUMBER LIKE EKPO-EBELN.
DATA: BCODEDESC LIKE T024-EKNAM.
DATA: NETWR LIKE EKPO-NETWR. "Total PO $ Value
DATA: END OF IT_MSGTAB.
Temp Table to save data for one PO at a time
DATA: BEGIN OF IT_PODAT OCCURS 10.
INCLUDE STRUCTURE R_INPUT1.
DATA: END OF IT_PODAT.
DATA: IT_MSGTAB_E LIKE IT_MSGTAB OCCURS 0 WITH HEADER LINE.
DATA: IT_MSGTAB_O LIKE IT_MSGTAB OCCURS 0 WITH HEADER LINE.
DATA: IT_MSGTAB_ERR LIKE IT_MSGTAB OCCURS 0 WITH HEADER LINE.
For F4 at Event Name
DATA: BEGIN OF LV_EVT OCCURS 0,
EVENTID LIKE BTCUEV-EVENTID,
END OF LV_EVT.
To print selections
DATA: BEGIN OF SELECTIONS OCCURS 0,
Z(2) TYPE C,
LINE LIKE RALDB-INFOLINE,
END OF SELECTIONS.
DATA: BEGIN OF T_MESSAGE OCCURS 10. "#EC *
INCLUDE STRUCTURE BDCMSGCOLL.
DATA: END OF T_MESSAGE.
DATA: BEGIN OF IT_NETWR OCCURS 0,
NETWR LIKE EKPO-NETWR,
END OF IT_NETWR.
DATA: BEGIN OF IT_BDC OCCURS 0.
INCLUDE STRUCTURE BDCDATA.
DATA: END OF IT_BDC.
DATA: W_MATNR LIKE MARC-MATNR,
W_LNUM(6) TYPE N,
INT_MATNR LIKE MARA-MATNR, "Internal format
W_TFILE(60).
DATA: BEGIN OF IT_RECEIVERS OCCURS 0.
INCLUDE STRUCTURE SOOS1.
DATA: END OF IT_RECEIVERS.
SELECTION SCREEN
SELECT-OPTIONS: S_EKORG FOR EKKO-EKORG OBLIGATORY
NO INTERVALS
DEFAULT '9000'.
SELECT-OPTIONS: S_WERKS FOR MARC-WERKS OBLIGATORY ."NO INTERVALS. "V01
SELECTION-SCREEN SKIP 1.
PARAMETERS:
P_INPUT(80) TYPE C "Input file from DRP
DEFAULT '/sapdaemon/I2/spp/in/daily/po_upload_spk21.dat'
OBLIGATORY LOWER CASE,
P_OUTPUT(80) TYPE C "Error/warning error records
DEFAULT '/sapdaemon/I2/spp/in/daily/po_upload_spk21.err'
LOWER CASE.
SELECTION-SCREEN SKIP 1.
SELECTION-SCREEN COMMENT /01(53) TEXT-005.
SELECTION-SCREEN SKIP 1.
PARAMETERS:
P_DONEFL AS CHECKBOX DEFAULT 'X', "Create .done file?
P_UPDT AS CHECKBOX DEFAULT ' '. "Simulation Run only?(x=yes)
SELECTION-SCREEN SKIP 1.
PARAMETERS:
P_MODE(1) TYPE C DEFAULT 'N'
OBLIGATORY,
P_UPDATE(1) TYPE C DEFAULT 'S'
OBLIGATORY,
P_BDCERR LIKE APQI-GROUPID DEFAULT 'ZMXU510',
P_USERID LIKE APQI-USERID DEFAULT SY-UNAME
MATCHCODE OBJECT USER_ADDR.
PARAMETERS : P_MAXLNS(3) TYPE N DEFAULT 10 OBLIGATORY.
select-options: S_MAXLNS for kna1-kunnr.
SELECTION-SCREEN COMMENT /42(40) TEXT-011.
PARAMETERS:
P_STOP(6) TYPE N. "MAX # of records to read from input file
SELECTION-SCREEN COMMENT /42(40) TEXT-003.
SELECTION-SCREEN SKIP 1.
PARAMETERS:
P_REPTD AS CHECKBOX DEFAULT 'X',
P_REPTP AS CHECKBOX DEFAULT ' ',
P_SPOOL AS CHECKBOX DEFAULT ' ',
P_EMAIL AS CHECKBOX DEFAULT ' '.
SELECTION-SCREEN SKIP 1.
PARAMETERS:
P_EVENT AS CHECKBOX DEFAULT 'X',
P_EVNAM LIKE BTCUEV-EVENTID DEFAULT 'Z_ITWO_START_ZI2X14'.
SELECTION-SCREEN SKIP 1.
PARAMETERS: P_TRANS AS CHECKBOX DEFAULT 'X',
P_TFILE(80) TYPE C DEFAULT
'/sapdaemon/I2/spp/in/daily/zi2spk21.trig'(099)
LOWER CASE.
Regards
Sudheer

Similar Messages

  • Reg: select-options to be displayed as LISTBOX

    Hi All,
    I have a selection screen & one Select option. for this select option, i am attaching F4 help using one Inetrnal table data. Now i want to make this select option field as a LISTBOX (Drop Down - as avaiable with PARAMETER), so that user can't enter the values other that List Box.
    Kindly suggest.
    Regards,

    Hi Salil,
    I thnk its not possible to make select-options look like a list box.
    U have to create list box separately.
    for creating a list box
    PARAMETERS l_carrid TYPE spfli-carrid  AS LISTBOX VISIBLE LENGTH 15
                            USER-COMMAND onli    DEFAULT 'AA'.
    For populating the values use VRMSET_VALUES
    Regards,
    Lakshman.

  • Reg: select-option

    Hi,
    can anyone explain me the internal format of the select-option...
    Thanks in advance..

    Hi Raj,
    Select-options are just like internal tables. they are used to give user a multi selection option.
    <b>Example:
    tables: sflight.
    select-options: carrid for sflight-CARRID.</b>
    <b>select-option have.</b>
    LOW : lower range limit
    HIGH : high range limit
    SIGN : operator used like =, <> , <= , >=.
    OPTION : I = inclulde, E = exclude.
    following are the addition for it.
    SELECT-OPTIONS sel FOR f.
    1. ... DEFAULT g
    2. ... DEFAULT g ... OPTION xx ... SIGN s
    3. ... DEFAULT g TO h
    4. ... DEFAULT g TO h ... OPTION op ... SIGN s
    5. ... MEMORY ID pid
    6. ... MATCHCODE OBJECT mobj
    7. MODIF ID key
    8. ... NO-DISPLAY
    9. ... LOWER CASE
    10. ... OBLIGATORY
    11. ... NO-EXTENSION
    12. ... NO INTERVALS
    13. ... NO DATABASE SELECTION
    14. ... VALUE-REQUEST
    15. ... VALUE-REQUEST FOR LOW/HIGH
    16. ... HELP-REQUEST
    17. ... HELP-REQUEST FOR LOW/HIGH
    18. ... VISIBLE LENGTH vlen
    <b>Reward points... if you feel helpful,
    Cheers !
    Moqeeth.</b>

  • Reg : Multiple Select Option with validation.

    Hi Abap Guru's,
            In my report iam giving the Input using the select option : Movement type in which i need to take only few mov.types like 101,105,321,344 in my report .Pls help me how to do ASAP..?

    Hi ,
    refer the below code.
    First it defaults the required values to selection screen ( at initialization event ).
    and then if user enters any other value then this value will be ignored.
    *& Report  ZRTESTTEST
    REPORT  ZRTESTTEST.
    data: mtype(3) type c.
    select-options: s_mtype for mtype.
    Types: begin of ty_range,
                 sign type bapisign,
                Option type bapioption,
                low(3) type c,
                high(3) type c,
         End of ty_range.
    Data: i_range type standard table of ty_range,
               wa_range type ty_range.
    initialization. " initialization.
    s_mtype-sign ='I'.
    s_mtype-option = 'EQ'.
    s_mtype-low    = '101'.
    append s_mtype.
    clear s_mtype.
    s_mtype-sign ='I'.
    s_mtype-option = 'EQ'.
    s_mtype-low    = '105'.
    append s_mtype.
    clear s_mtype.
    s_mtype-sign ='I'.
    s_mtype-option = 'EQ'.
    s_mtype-low    = '321'.
    append s_mtype.
    clear s_mtype.
    s_mtype-sign ='I'.
    s_mtype-option = 'EQ'.
    s_mtype-low    = '344'.
    append s_mtype.
    Clear wa_range.
    Wa_range-sign = 'I'.
    wa_range-option = 'EQ'.
    wa_range-low = '101'.
    Append wa_range to i_range.
    start-of-selection.
    Clear wa_range.
    Wa_range-sign = 'I'.
    Wa_range-option = 'EQ'.
    Wa_range-low = '105'.
    Append wa_range to i_range.
    Clear wa_range.
    Wa_range-sign = 'I'.
    Wa_range-option = 'EQ'.
    Wa_range-low = '321'.
    Append wa_range to i_range.
    Clear wa_range.
    Wa_range-sign = 'I'.
    Wa_range-option = 'EQ'.
    Wa_range-low = '344'.
    Append wa_range to i_range.
    delete s_mtype[] where low not in i_range[].
    If  s_mtype[] is initial.
    break-point.
    *“ raise the error here.
    Endif.
    Hope this helps you.
    Kind Regards,
    Ravi Sankar.Z

  • Reg: Date in Select-options

    Hello All,
          I have a date field in the SSCRN as select-options.
    Now I want to give a default value to the date-low and date-high.
    Those default values must be :
    1. For s_date-low the value must be the START DATE of the current Week ( MONDAY )
    2. For S_date_high the value must be the END DATE of the Week ( SUNDAY )
    Eg: today is 07.11.2007 then my s_date-low must be 05.11.2007 (Monday) and my s_date-high must be 11.11.2007 (Sunday).
    Can anyone know how to pass these as default values ?
    Regards,
    Deepu.K

    Hi Deepu,
    Try the following code.
    SELECT-OPTIONS : s_date FOR sy-datum.
    DATA : l_date LIKE sy-datum.
    DATA : h_date LIKE sy-datum.
    INITIALIZATION.
    CALL FUNCTION 'GET_WEEK_INFO_BASED_ON_DATE'
    EXPORTING
       DATE          = SY-DATUM
    IMPORTING
      WEEK          =
       MONDAY        = l_date
       SUNDAY        = h_date.
    s_date-low = l_date.
    s_date-high = h_date.
    append s_date.
    If it is usefull pls reward it.
    Regards
    Srimanta

  • Reg: EQ Operator for Select-Options..

    Normally we use IN Operator for comparing selection-screen fields for select-options, Rarely we use EQ also when working with Select-Options, why we go for this EQ operator.
    Kindly let me know.
    Thanx in Advance.
    Akshitha.

    Hi there. You should use IN when you know that there will be or may be multiple values chosen for the select-option.  For instance, if the user is going to enter a range of personnel numbers on the selection screen, you could use something like:
    IF ws_pernr IN p_pernr
    (where p_pernr is your select-option selection screen field).
    But if you know that the select-option field will only have one value assigned to it (or you are referencing either the high value or the low value of the select-option) then you can use EQ; the term EQ checks for equality against a single value.
    - April King

  • 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 function module

    hi friends, pls help me reg my query.
    I have wERKS select-options
    on the selection screen.
    (This same thing, i want to pass in FM)
    2. So in FM, I have used the
    TABLES parameter (Not import, nor export)
    3. And the type given is
    WERKS_RANG
    i defined it like
    plant type WERKS_RANG
    (This WERKS_RANG has 4 fields,
    just like a select option
    SIGN
    OPTION
    LOW
    HIGH
    4. Then inside fm,
    i used SELECT Query,
    and use IN WERKS.
    below is my code in FM.
    select lgort labst
    from mard
    into table imard1
    where PLANT in werks
    and material1 = matnr.
    but i am getting an error "field plant is unknown". i have defined it under tables parameter..pls help
    how shud i get the values i enter in select option for main program in se38 to function module field 'plant'...

    Hi
    You can define your TABLE parameter WERK without reference and define a range in your fm:
    FUNCTION Z_PROVA_PROVA.
    ""Interfaccia locale:
    *"  IMPORTING
    *"     REFERENCE(MATNR) TYPE  MATNR
    *"  TABLES
    *"      SEL_WERKS
      RANGES R_WERKS FOR MARD-WERKS.
      R_WERKS[] = SEL_WERKS[].
      DATA: BEGIN OF IMARD1 OCCURS 0,
               LGORT LIKE MARD-LGORT,
               LABST LIKE MARD-LABST,
            END   OF IMARD1.
      SELECT LGORT LABST FROM MARD  INTO TABLE IMARD1
      WHERE WERKS IN R_WERKS
      AND MATNR = MATNR.
    Max

  • How to attach FCODE to select option in Module Pool

    Hi all,
          I have created Select option in Module pool by attaching a Subscreen. Now when user enters any value into the select option I need to fetch values from the database in to the table control based on the value entered in select option.
    Is it possible and how?
    Thanks.

    <b>Hi
    If u have one select options in module pool programming,Then there is no need for FCODE
    bcoz FCODE is needed for push button,check box..like etc.
    But select option is a input field.
    So u can trace the input as u have done in report
    Like
    select * from dtab1 into corresponding fields of table itab where field1 in <b>selectoption.</b>
    Or if u want that program to be executed after giving input in select option then user will press F8
    So Use FCODE 'F8'.
    Regs
    Manas Ranjan Panda
    Message was edited by:
            MANAS PANDA</b>
    Message was edited by:
            MANAS PANDA

  • Filling the Bucket of Select-option as DEFAULT??

    Hi Experts,
    Pls. clarify my doubt reg. Selection screen,
    When I, <i><b>F8</b></i> the my_z_report, the selection screen is coming with default values (say,  A; B; C; D) in the bucket of <i><b>multiple selection</b></i> of the <b><i>select option s_doctype</i></b>.
    I know, its possible, by coding in prog. it self, by filling the <i><b>SELTAB</b></i> explicitly as A; B; C; D after populating <b><i>SIGN; OPTION; LOW; HIGH</i></b> values!
    but, when I see the code of my_z_prog., I did not find any such code, all over??
    1) So, How the prevoius programmer filled it? bcoz, now I need add E;F;G etc. to the same!
    2) Wht r the other altrnatives (other than I mentioned above) to get it done?
    thanq.

    Hi,
    Check the following..
    1) Put a where-used list of the select-options variable..and check if it getting appended.
    2) If you execute the program with a transaction code..Then in the transaction code setup in SE93..You can start the report with a variant..If so..modify the report variant to add more values..
    Thanks
    Naren

  • Report help for multiple Date Select options

    Hi Friends,
    For a particular year wise report, the client wants 12 date select-options which are changeable and informal every year .The report will also be displayed as per the given date selection period wise. Please help me how to fetch the datas from the table as per the given selection period. Currently the report have one date select-option where the user gives selection range as 1.04 to 31.03. It's related to EB power consumption report and hence the new requirement on date selection which are informal and not a fixed date of every year.
    Ex:Selection-Screen
    Period 1 : 08.04.2008 to 12.05.2008
    Period 2: 12.05.2008 to 20.06.2008
    Period 3: 21.06.2008 to 28.07.2008
    Period 4: 29.07.2008 to 15.08.2008
    Period 5: 15.08.2008 to 21.09.2008
    Period 6 : 21.09.2008 to 14.10.2008
    The data will derive as per the above selection ranges.......
    Please advise with example.
    thanks & regards
    Sankar.

    >
    sankar babu wrote:
    > Ex:Selection-Screen
    > Period 1 : 08.04.2008 to 12.05.2008
    > Period 2: 12.05.2008 to 20.06.2008
    > Period 3: 21.06.2008 to 28.07.2008
    > Period 4: 29.07.2008 to 15.08.2008
    > Period 5: 15.08.2008 to 21.09.2008
    > Period 6 : 21.09.2008 to 14.10.2008
    Hi,
    In this case just derive all records matching dates between 08.04.2008 (low in first select-options) and 14.10.2008(high in last select-options.
    Also my advice is to use a single select-options and prompt the user to give the dates as ranges in the multiple entries dialog which can be opened by clicking the button on the right side of the select-options.
    Regards
    Karthik D

  • How To... Change the Data Type for a SELECT-OPTIONS at run time.

    Hello,
    I am trying to restrict the values available for entry into a SELECT-OPTIONS at run time depending on user input.
    The logic is as follows. The user has two input fields. A PARAMETER field which has the type RSDIOBJNM and allows them to choose an InfoObject. And the user has a SELECT-OPTIONS field to allow them to select the Characteristic values for that InfoObject.
    I would like the following example to be possible:
    The user enters 0MATERIAL into the PARAMETER. When the user clicks on the SELECT-OPTIONS control code will derive a list of possible options the user can enter in the SELECT-OPTIONS. In this case only values found in the master data or at least no values greater than 18 characters.
    I have looked at the following function module SELECT_OPTIONS_RESTRICT and this do not appear to be helpful as they only restrict on the signs allowed for the values (unless I misunderstand, it is a complex function module!).
    The code I have so far is (thus the user enters a InfoObject into p_char1 and the select options so_char1 should only accept active values of that InfoObject):
    declaration of variables for user interface
      DATA c_char(32) TYPE c.
    declaration of count variable
      DATA i_count TYPE i.
    declaration of user interface
      SELECTION-SCREEN BEGIN OF BLOCK a1 WITH FRAME TITLE text-001.
        PARAMETERS: p_ipack TYPE RSLOGDPID.
      SELECTION-SCREEN END OF BLOCK a1.
      SELECTION-SCREEN BEGIN OF BLOCK b1 WITH FRAME TITLE text-002.
        PARAMETERS: p_char1 TYPE RSDIOBJNM.
        SELECT-OPTIONS: so_char1  for c_char NO INTERVALS.
        PARAMETERS: p_char2 TYPE RSDIOBJNM.
        SELECT-OPTIONS: so_char2  for c_char NO INTERVALS.
        PARAMETERS: p_char3 TYPE RSDIOBJNM.
        SELECT-OPTIONS: so_char3  for c_char NO INTERVALS.
      SELECTION-SCREEN END OF BLOCK b1.
    Is what I am trying to do possible???
    Thanks for any help. Ross.

    You really want to restrict possible values of a select-option based on another field, not change the length of type of the select-option field, right?
    Here is what you do:  Code a custom F4 value help for the select-option at event AT SELECTION-SCREEN ON VALUE REQUEST FOR..  The first thing you do here is read the value of the parameter field (p_ipack in your example).  You can use function module DYNP_VALUES_READ.  Based on this value, you can propose values for the select-option fields.  Note that the use can still enter whatever s(he) wishes in to the select-option field without pressing F4. In this case, you will have to code some input validations taking into account the value in the p_ipack field.

  • Select-options in SELECT query - syntax error

    Hi all,
      I get the error below when I try to use the select options in a SELECT query . Please help me.
    "The IN operator with "SO_AWART" is followed neither by an internal
    table nor by a value list."
    The code i have used(Logical database  PNP is used):
    TABLES: pernr,
            catsdb.
    INCLUDE ztime_cwtr_top.    " global Data
    INCLUDE ztime_cwtr_f01.
    SELECTION-SCREEN BEGIN OF BLOCK B1 WITH FRAME.
    SELECT-OPTIONS SO_AWART FOR CATSDB-AWART.
    PARAMETERS P_THRES TYPE I.
    SELECTION-SCREEN END OF BLOCK B1.
    Get data from CATSDB table. Workdates within the date interval are considered.
      SELECT pernr workdate awart catsquantity beguz enduz status
      FROM catsdb
      INTO TABLE it_catsdb
      WHERE pernr  = pernr-pernr    AND
           workdate GE pn-begda     AND
           workdate LE pn-endda     AND
           status   IN ('20', '30') AND
           awart    IN  so_awart .
          awart    IN ('1100', '1137', '1138', '1139', '1140',
                      '1147', '1148', '1149', '1157', '2003' ).
    when I give the values directly i do not get any syntax error, but when I use select options in the where condition I get the syntax error.
    I have tried different options like using only the select-options in the where condition.
    Thanks in advance.....
    Madhu

    Solved.
    Code with syntax error:
    include z...top .
    include z...fo1.
    select-options: xxxxxxx
    Code  with no syntax error:
    select-options: xxxxxxx
    include z...top .
    include z...fo1.
    Thanks for all your help,
    Madhu

  • 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.

  • Re : select-options in abap-objects program

    Dear friends,
                      I want to give select-options in abap-objects program. How to give that.
                                 Thanking You
    with regards,
    Mani

    In the transaction SE24, enter your class name, click modify.
    in the tab named "Types" you have to declare two types. By example, if you want to receive one select-options that in your program that uses this class is declared like:
    " P_SAKNR FOR SKAT-SAKNR".
    you've got to declare two types in the class:
    a- TYPES:  begin of E_S_SAKNR,
                          sign(1),
                          option(2),
                          low(10),
                          high(10),
                      end of E_S_SAKNR.
    b - TYPES E_T_SAKNR type standard table of E_S_SAKNR.
    so, in the class method that you want to receive P_SAKNR as importing parameter. You got to do this:
    method TEST importing ET_SAKNR type E_T_SAKNR.
    now, in the implementation of this method you should be able to use ET_SAKNR as the same way as you usually use a parameter or a select-option. You could use it in a select with the operator IN by example..

Maybe you are looking for

  • Problem with installing OS. hal.dll missing or corrupt

    I feel I have a hardware issue with this laptop. It is a M115-S3095. I had XP home installed but had driver issues. Now I have the recovery disk with it I get "Error 10DD0A0057". One time I did get my retail XP copy to install it gave me "hal.dll is

  • Open file Dialog!!!

    Hello folks, In my program I am using the FM TMP_GUI_FILE_OPEN_DIALOG for opening a file. My additional requirement is I want to add some types to FILE TYPE LIST BOX on the dialog. For example...when we try to open a file on windows...we get a dialog

  • **Urgent**Errors at Travel and Expenses

    Hi, I have configured ESS and also all the backend configurations done.. But when i navigate ESS screens in portal..few of the screens are opening.. few are throughing errors.. kindly help me to rectify bewlo errors.... 1) Travel and Expenses Every l

  • How can i open and edit microsoft documents in macbook pro

    how can i open and edit microsoft documents in macbook pro with retina display? I am a new user to mac book

  • Do I need to enter Pipeline URL in SLD for Business System in PI ?

    Hi PI experts , I am having problems with my file adapter sender adapter .There is error : 2008-09-30 18:40:17 Success The message status set to DLNG. 2008-09-30 18:40:17 Error Transmitting the message to endpoint http://xxxxxx2230.wdf.sap.corp:51080