2016 Mar 15 6:06 AM
Hello,
I need to generate a report using SDRQCR21 program in ABAP editor, but i need to remove the interval for materials ( for eg. The input field for entering material number should be one input box instead of 2 input box)
iam using the below code to generate the report.
DATA: seltab type table of rsparams,
seltab_wa like line of seltab.
DATA: S_MATNR TYPE MARA-MATNR,
S_WERKS TYPE WERKS.
DATA: lt_report TYPE TABLE OF rsparams.
DATA: lw_report TYPE rsparams.
SUBMIT SDRQCR21 via SELECTION-SCREEN WITH SELECTION-TABLE SELTAB.
Thanks in Advance,
Sanjay D
2016 Mar 15 7:38 AM
Hi
Yeah,it will not be possible to change a select-option(2 input box) to a parameter(1 input box),while calling/submitting a standard program.Only thing we can do is,we can work round and fill the select-option field of program SDRQCR21 with a single value in the calling program.Below piece of code may be helpful.
parameters : p_matnr type matnr.
data : rspar_tab TYPE TABLE OF rsparams,
rspar_line LIKE LINE OF rspar_tab.
start-of-selection.
rspar_line-selname = 'S_MATNR'.
rspar_line-kind = 'S'.
rspar_line-sign = 'I'.
rspar_line-option = 'EQ'.
rspar_line-low = P_MATNR.
APPEND rspar_line TO rspar_tab.
submit SDRQCR21 via selection-screen
with selection-table rspar_tab
and return.
Regards
Pallavi.
Hello,
I need to generate a report using SDRQCR21 program in ABAP editor, but i need to remove the interval for materials ( for eg. The input field for entering material number should be one input box instead of 2 input box)
iam using the below code to generate the report.
DATA: seltab type table of rsparams,
seltab_wa like line of seltab.
DATA: S_MATNR TYPE MARA-MATNR,
S_WERKS TYPE WERKS.
DATA: lt_report TYPE TABLE OF rsparams.
DATA: lw_report TYPE rsparams.
SUBMIT SDRQCR21 via SELECTION-SCREEN WITH SELECTION-TABLE SELTAB.
Thanks in Advance,
Sanjay D
2016 Mar 15 7:08 AM
May i know what is the problem. If the itnerval is having two like
From and to.
if u give only one material it will treat as single ,
if u give range definitely It will behave like from and to.
May i know what is the problem. pass only single value. Only that values will come.
2016 Mar 15 7:38 AM
Hi
Yeah,it will not be possible to change a select-option(2 input box) to a parameter(1 input box),while calling/submitting a standard program.Only thing we can do is,we can work round and fill the select-option field of program SDRQCR21 with a single value in the calling program.Below piece of code may be helpful.
parameters : p_matnr type matnr.
data : rspar_tab TYPE TABLE OF rsparams,
rspar_line LIKE LINE OF rspar_tab.
start-of-selection.
rspar_line-selname = 'S_MATNR'.
rspar_line-kind = 'S'.
rspar_line-sign = 'I'.
rspar_line-option = 'EQ'.
rspar_line-low = P_MATNR.
APPEND rspar_line TO rspar_tab.
submit SDRQCR21 via selection-screen
with selection-table rspar_tab
and return.
Regards
Pallavi.
2016 Mar 15 11:02 AM
You can restrict select_options options, use FM SELECT_OPTIONS_RESTRICT
FORM restrict_select.
DATA: restrict TYPE sscr_restrict,
opt_list TYPE sscr_opt_list,
ass TYPE sscr_ass.
* Défine the selection modes
* - ALL standard one
CLEAR opt_list.
MOVE 'ALL' TO opt_list-name.
MOVE 'X' TO: opt_list-options-bt,
opt_list-options-cp,
opt_list-options-eq,
opt_list-options-ge,
opt_list-options-gt,
opt_list-options-le,
opt_list-options-lt,
opt_list-options-nb,
opt_list-options-ne,
opt_list-options-np.
APPEND opt_list TO restrict-opt_list_tab.
* - KEY for SQl selection no exclusion
CLEAR opt_list.
MOVE 'KEY' TO opt_list-name.
MOVE 'X' TO: opt_list-options-bt,
opt_list-options-cp,
opt_list-options-eq,
opt_list-options-ge,
opt_list-options-gt,
opt_list-options-le,
opt_list-options-lt.
APPEND opt_list TO restrict-opt_list_tab.
* - EQU Only list of values
CLEAR opt_list.
MOVE 'EQU' TO opt_list-name.
MOVE 'X' TO opt_list-options-eq.
APPEND opt_list TO restrict-opt_list_tab.
* Affect modes to actual selec-options
* ALL by default
CLEAR ass.
MOVE: 'A' TO ass-kind,
'*' TO ass-sg_main,
'ALL' TO ass-op_main.
APPEND ass TO restrict-ass_tab.
* KEY for primary key
CLEAR ass.
MOVE: 'B' TO ass-kind,
'B02' TO ass-name, " here a selection block
'I' TO ass-sg_main,
'KEY' TO ass-op_main.
APPEND ass TO restrict-ass_tab.
* I/EQ for material number
CLEAR ass.
MOVE: 'S' TO ass-kind,
'SO_MATNR' TO ass-name, " a single parameter name
'I' TO ass-sg_main,
'EQU' TO ass-op_main.
APPEND ass TO restrict-ass_tab.
* Execute
CALL FUNCTION 'SELECT_OPTIONS_RESTRICT'
EXPORTING
restriction = restrict
EXCEPTIONS
OTHERS = 0.
ENDFORM. " restrict_select
Regards,
Raymond
2016 Mar 15 12:09 PM
Thanks a lot everyone for providing solution on such a short notice, Highly appreciate your support. My question may sound silly but this is what the client requested us for.