Max no of records in select-options
Hi,
I have a select option for MATNR.
I want to perform a validation where in the values given for selection should not exceed 500 material Numbers.
How can I do that?
Regards,
Vinod.
Hi vinod,
Try this code yaar.
data:loop like I default '0'.
loop at itab occurs 500.
select matnr from table mara.
loop = loop + 1.
sy-tabix.
endloop.
if loop > 500.
Message 'e000'. (This message should be given in the message area and u have to include the msg area name inside the report.)
endif.
This should solve ur problem.
Regards,
Nagarajan.
Similar Messages
-
Multiple records with select option
i have to use select option in selection screen, which wl take the multiple values but that select option wont act as a range, the select option is a session name from sm35, the table from where data is retrieved is APQI, i have used a parameter before using select option ,like:
selection-screen begin of line.
parameters: P_grpid like apqi-groupid.
select-options: s_grpid like apqi-groupid.
selection-screen end of line.
AT-SELECTION SCREEN ON VALUE REQUEST FOR p-GRPID. " previous situation
{the code starts
FM F4 selection is called}
AT-SELECTION SCREEN ON VALUE REQUEST FOR S_GRPID-low. " CURRENT situation
FM F4 selection is called}
now when i give data in slection screen for s_grpid-low then it works as a parametr, but it doesnt take multiple values at s_grpid when i have alos mentioned the same for s_grpid-high.
Please tell me how to achive multiple records with select option, or u can also send a sample code if you have..
Thanks
SwarnaliHello Swarnali,
You need to fill internal table of select-option once you got into the event AT SELECTION-SCREEN ON VALUE REQUEST FOR so_carr-LOW.
so sudo code will be:
AT SELECTION-SCREEN ON VALUE REQUEST FOR so_carr-LOW.
Select data from table.
so_carr-LOW = value
append so_carr.
You can also use NO INTERVAL to suppress the so_carr-HIGH value on selection screen.
Thanks,
Augustin. -
How to get the max. and min. of a selection-option?
hi experters
I wonder if there is any way can fetch the max value and minimum value from a select-option?
please hint, many thanks
wanlei.suna®s wrote:
> Try this way
>
>
> SELECT-OPTIONS S_WERKS FOR T001W-WERKS.
>
> START-OF-SELECTION.
> SELECT * FROM T001W INTO IT_T001W
> WHERE WERKS IN S_WERKS.
>
> SORT IT_T001W BY WERKS ASCENDING.
> READ TABLE IT_T001W INDEX 1.
> MOVE IT_T001W-WERKS TO V_WERKS_MIN. " MIN Value
>
> SORT IT_T001W BY WERKS DESCENDING.
> READ TABLE IT_T001W INDEX 1.
> MOVE IT_T001W-WERKS TO V_WERKS_MAX. " MAx Value
>
>
> a®s
Please try this.
TABLES : t001w.
SELECT-OPTIONS S_WERKS FOR T001W-WERKS.
data: lv_min type T001W-WERKS,
lv_max type T001W-WERKS,
lv_count type i.
START-OF-SELECTION.
sort s_werks by low.
describe TABLE s_werks LINES lv_count.
if lv_count = 1.
lv_min = s_werks-low.
lv_max = s_werks-high.
elseif lv_count > 1.
read TABLE s_werks index 1.
lv_min = s_werks-low.
if not s_werks-high is INITIAL.
lv_max = s_werks-high.
endif.
READ TABLE s_werks INDEX lv_count.
if lv_max is INITIAL.
lv_max = s_werks-low.
else.
if lv_max < s_werks-low.
lv_max = s_werks-low.
endif.
endif.
endif.
write :/ lv_min,
lv_max. -
Multiple records in select options-Urgent help
Hi all,
Iam using the following function module to get the set values. I need to pass multiple values in select options(ie) select options with no intervals. to the function module parameter Shortname. I have declared the variable which has to be passed as
S_SETID FOR SETHEADER-SETNAME NO INTERVALS.
The problem is when i use S_SETID-LOW the value is passed to the function module , but if multiple data is entered in the input then how to pass all the data to the function module. Please Help.Hi,
Declare the Range in the Function module , then you can pass that Select-option fields to that ranges and use that in the Function module.
Or you can use the RANGE_C8 for the Select-optios in the Function module, you can declare the Internal table with the type of RANGE_C8 in the tables parameter, then pass the Select-option to this Internal table
If you want more length field then search based on RANGE_* then you will get all the Range Structure.
Regards
Sudheer -
Hi ,
If my slect option field have 10 values, if i want to fetch a particualr value....can i fetch that at the run time....because tempervary table of seelct otpion will contain onoy low and high values..then how can we get teh particalua value from there....thanks,
Ram.Hello Ram,
I created one sample program on this scenario and it is working fine.
here i tried to delete few records of select-option.
check this.
REPORT zssrtest .
TABLES: mara.
SELECT-OPTIONS: s_matnr FOR mara-matnr.
s_matnr-sign = 'I'.
s_matnr-option = 'EQ'.
s_matnr-low = '000000000000000001'.
APPEND s_matnr.
s_matnr-low = '000000000000000002'.
APPEND s_matnr.
s_matnr-low = '000000000000000003'.
APPEND s_matnr.
s_matnr-low = '000000000000000004'.
APPEND s_matnr.
s_matnr-low = '000000000000000005'.
APPEND s_matnr.
s_matnr-low = '000000000000000006'.
APPEND s_matnr.
s_matnr-low = '000000000000000007'.
APPEND s_matnr.
LOOP AT s_matnr WHERE low NE '000000000000000007'.
DELETE s_matnr.
ENDLOOP.
LOOP AT s_matnr." WHERE low NE '000000000000000007'.
WRITE: / s_matnr.
ENDLOOP.
Regards
Sasidhar Reddy Matli. -
How do you delete records from table with data in a select option
how do you delete records from table with relevant to data in a select option..how to write coding
Hi,
Try
if not s_select_option [ ] is initial.
delete * from table
where field in s_select_option.
endif.
commit work.
Be careful though. If select option is emty, you will delete the entire table.
Regards,
Arek -
Say in selection screeen (ie is in select-options) i have selected record r
say in selection screeen (ie is in select-options) i have selected record range from 1000 to 2000 but in the final display list i sholud not get 1200 to 1300 records it should be hide how is it posible
Thanks
BasuHello Math,
There are two ways of restricting the records with 1200 & 1300 values in output list display -
1. Either restrict the records while selecting the data from database using SELECT query. This can be achieved by ranges table populated with the values, which won't select the 1200 & 1300 records.
Find the following code for this -
TABLES: TAB1.
RANGES: R_FLD1 FOR TAB1-FLD1.
R_FLD1-SIGN = 'I' .
R_FLD1-OPTION = 'EQ'.
R_FLD1-LOW = '1000'.
R_FLD1-HIGH = '2000'.
APPEND R_FLD1.
R_FLD1-SIGN = 'I' .
R_FLD1-OPTION = 'NE'.
R_FLD1-LOW = '1200'.
R_FLD1-HIGH = '1300'
APPEND R_FLD1.
SELECT * FROM TAB1
INTO IT_TAB1
WHERE FLD1 IN R_FLD1.
2. Select the data first in internal table first and then delete the entries having 1200 & 1300 values.
Find the following code for this -
TABLES: TAB1.
RANGES: R_FLD1 FOR TAB1-FLD1.
SELECT * FROM TAB1
INTO IT_TAB1
WHERE FLD1 IN R_FLD1.
IF SY-SUBRC EQ 0.
SORT IT_TAB1 BY FLD1.
DELETE IT_TAB1 WHERE ( FLD1 = '1200' ) OR ( FLD1 = '1300' ).
ENDIF.
Hope this helps you.
PS If the answer solves your query, plz close the thread by rewarding each reply and marking it Solved.
Regards -
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 -
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 get all the values in the Select-option.
Hi,
I got the select-option field so_week, for eg. If I give 200923 to 200926 (year and week) in the selection screen and then I need to pass this value (200923) to the FM 'ZWEEK_GET_FIRST_DAY' to get the first day of the week.
My question is how can i get all the values from the select option, (i.e) i need to get 200923, 200924,200925, 200926.
Regards,
Anbu.Hello,
I will prefer Max's solution. But just for the sake of this req.
i need to get 200923, 200924,200925, 200926
i am proposing my soln:
DATA: V_WEEK TYPE RSCALWEEK.
SELECT-OPTIONS: S_WEEK FOR V_WEEK NO-EXTENSION OBLIGATORY.
AT SELECTION-SCREEN.
DATA:
V_COUNT TYPE I,
V_ADD TYPE I,
RT_WEEK TYPE RANGE OF RSCALWEEK,
RS_WEEK LIKE LINE OF RT_WEEK.
V_COUNT = ( S_WEEK-HIGH - S_WEEK-LOW ) + 1.
DO V_COUNT TIMES.
RS_WEEK-SIGN = 'I'.
RS_WEEK-OPTION = 'EQ'.
RS_WEEK-LOW = S_WEEK-LOW + V_ADD.
APPEND RS_WEEK TO RT_WEEK. "RT_WEEK--> Will contain the week values
CLEAR RS_WEEK.
V_ADD = V_ADD + 1.
ENDDO.
@Max: I was stupid enough not to think of your solution. Need to leave office
Cheers,
Suhas -
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. -
One search help for multiple select-options in webdynpro abap
Hi,
I need a way to use one search help for multiple select-options fields. My scenario is :
I have a table for keeping different organizational units' values of different systems. I have pasted some sample data from this table at the end of this mail. On the screen I want to have 1 select-options filed for werks, and 1 select-options filed for vkorg. (In fact I will have more org. unit fields...) In the beginning of my application the user will select sid.
If the user selects ADS as SID, when he opens search-help for the first org. unit (werks), he will see the records with SID: ADS, VARBL = $WERKS, LANGU = SY-LANGU.
If the user selects AGT as SID, when he opens search-help for the second org. unit (vkorg), he will see the records with SID: AGT, VARBL = $VKORG, LANGU = SY-LANGU.
I have created a search-help taking SIDD, VARBL and LANGU as import parameters; used field mapping and bound this search help to my table. I have created 2 context nodes : org1 and org2 having attributes SID, VARBL, VALUE, LANGU .
I have assigned related SID, VARBL and Langu values to these attributes at runtime as I needed. That way, if I use input field and reference to the related context attributes org1-value and org2-value2 accordingly, search help works well as I want.
However, when I use select-options field , I can not bind the field to the context data. I can give reference only to ddic structure. Is there any way to reference to a context attribute? I searched for this in SDN, but could find nothing.
I think I won't be able to use this way. What do you say?
As I read from forums maybe using OVS help will be suitable for me. But I have to use one search-help for all select-options fields. Do you know how I can determine the active select-options field and pass its name (for instance "werks" ) as parameter to this OVS search help. (Also I'll pass SID and LANGU.)
MY TABLE (ZBYYT080) CONTENTS:
SID VARBL VALUE LANGU VTEXT
ADS $WERKS 1 T Werk 0001
ADS $WERKS 11 T OZYAS GIDA URETIM YERI
ADS $WERKS 5501 T BOYA GEBZE FABRİKASI
ADS $WERKS 5502 T BOYA CIGLI FABRİKASI
AGT $WERKS 2301 T KAMLI DAMIZLIK
AGT $WERKS 9601 T PANAR DENIZ URETIM YERI
ADS $VKORG 22 T AA KİMYASALLAR
ADS $VKORG 8001 T İINSAAT BOYALARI
AGT $VKORG 6500 T DAMk St.Org
AGT $VKORG 5400 T PANAR St.Org.
I wish I'm clear enough..
I will be gald if someone answers me as soon as possible...
Thanks İn advance..
MERALHi,
Your ques is how to refer to a DDIC search help to refer to selection screen parameter ?
Am I right ?
If Yes, then in the interface IF_WD_SELECT_OPTIONS
method ADD_SELECTION_FIELD, ADD_PARAMETER_FIELD etc
have importing param like I_VALUE_HELP_TYPE and I_VALUE_HELP_ID, I_VALUE_HELP_MODE, I_VALUE_HELP_STRUCTURE
etc which may help you to link your create DDIC Search help to selection screen params.
this is just a clue from my side. I haven't tried it myself.
You can go to the where used list of this method and find some sample implementations which use these params.
Hope this helps.
Regards
Manas Dua -
How to set the parameter selection *optional* for each subreport?
Hi,
I am using Crystal Reprots 11.
I create 10 subreports, and each subreport contains a Parameters Field.
The 10 subreports are put in 10 footer sections in increasing order, i.e. subreport1, subreport2, subreport3, ..., subreport10.
When I use "Print Preview" to take a look at the whole report, CR prompts a "Edit Values" window for selecting parameter values for all 10 subreports.
For example, if I only select parameter values for subreport1 and click "OK", 9 error messages on the "Edit Values" window come out above the selection list box of every other subreports (i.e. subreport2 ~ subreport10) showing that: 'The value is not valid'.
Sometimes, I just want to review some specific subreports but not all.
How should I do to set the parameter selection optional (not mandatory) for each subreport?
Thank you in adavance.
Edited by: Holdup on Feb 17, 2012 3:44 PMHi,
Here's how you can make the prompts optional (Assuming you're using CR 2008 or higher):
1) Go into each subreport
2) You should see the parameter in the Field Explorer. Right-click the name and select Edit > Look for an option called 'Optional Prompt'. Set it to true
3) If you have a record selection in the subreport, then you need to modify the selection formula to something like this:
if not(hasvalue({?Parameter_Name})) then True else = {?Parameter_Name}
Hope this helps!
-Abhilash -
SELECT-OPTIONS in table maintenance generator screen
Hi
Is it possible to create SELECT-OPTIONS in table maintenance screen?
My requirement is to allow the user to enter single Company code and Range of G/L Accounts in the Table Maintenance input screen. Please let me know.
Thanks
Abdul HakimHello Tamas,
As a matter of fact we can add a custom selection-screen to the TMG screen & without manually modifying the TMG
You can do so by using the [Event AA: Instead of the Standard Data Read Routine|http://help.sap.com/saphelp_nw04s/helpdata/en/91/ca9f56a9d111d1a5690000e82deaaa/content.htm].
Please check the code snippet:
DATA: gv_fldate TYPE s_date.
* User-defined selection-screen
SELECTION-SCREEN: BEGIN OF SCREEN 9000.
PARAMETERS: p_carrid TYPE s_carr_id OBLIGATORY.
SELECT-OPTIONS: s_fldate FOR gv_fldate OBLIGATORY.
SELECTION-SCREEN: END OF SCREEN 9000.
*& Form sub_yvsflight_event_aa
* text
FORM sub_yvsflight_event_aa.
DATA: ls_temp_data TYPE yvsflight,
lt_temp_data TYPE STANDARD TABLE OF yvsflight.
* Call the user-defined selection-screen
CALL SELECTION-SCREEN 9000 STARTING AT 25 10.
* Populate the int. table TOTAL
PERFORM get_data_yvsflight.
* Delete the records which are not required
LOOP AT total.
ls_temp_data = <vim_total_struc>. "Copy to local struct.
IF ls_temp_data-carrid NE p_carrid OR
ls_temp_data-fldate NOT IN s_fldate.
DELETE total. "Remove the record from the TOTAL
ENDIF.
ENDLOOP.
ENDFORM. "sub_yvsflight_event_aa
BR,
Suhas -
Restrict Select-Options for Logical Database field
The way we restrict select options for custom defined select option fields on selection screen.. can we restrict select options for standard Logical Database fields?
i.e. report uses PNPCE logical database and has field called PERNR. I want to restrict select options for this PERNR field so that it has options for 'Select single values' only.
Thanks,
Falguni
Edited by: Falguni V on Nov 13, 2010 6:42 AMYou can user AT SELECTION-SCREEN event, and check whether any record is having high value for PNPPERNR.
Maybe you are looking for
-
Use Thunderbolt cable to transfer files from a mac to a Mac Mini Server
I want to transfer a large document folder of files from a MacBook Pro (MBP) to a Mac Mini Server (MMS) using Thunderbolt-to-Thunderbolt cable. How? Currently both the MBP and MMS are on the same Wireless-N network. Obviously the Mac Mini Server can
-
Proxy to Web Service Communication doesn't work
Hi, We configured the XI demo example Checking Flight Seat Availability (Proxy to Web Service Communication) (chapter 6.2) and everything works fine until we try to execute the szenario (chapter 6.2.3). When we try to execute the szenario, we get a
-
Play a podcast video on my iphone on my TV?
I have a podcast on my iphone but would like to play it on my vehicle DVD while traveling, short of creating a DVD, is there another way to play it from my iphone to my dvd player?
-
Recently im getting the following error Task 'mail.btinternet.com - Receiving' reported error (0x800CCC90) : 'Your incoming (POP3) e-mail server has reported an internal error. If you continue to receive this message, contact your server administrato
-
How to install find my iphone on my mac
I have downloaded the software but don't know how to install it