2006 May 05 4:27 PM
Hi all !
First post here, but a tough one I think. Here is my inquiry :
I have worked on an specific abap function used in many long abap list reports. Theses reports are launched in background processing. The aim of this routine is to stop the report execution if a background job with the same selection parameters is already launched for the current user (to Prevent useless several launch of a time-expensive program).
Because this routine is dynamic, I read the selection screen of the current report with the function 'DYNP_VALUES_READ'. And I compare the result with the variant of the backgroung job (read with function 'RS_VARIANT_CONTENTS').
The real problem is that function "DYNP_VALUES_READ" only extract the first line of select-options. I found an alternative solution to extract the select options values (a dynamic assign with field symbols), but external conversions (for WBS elements for example ) are lost, so the comparison detects differences between the background job's variant values and the current selection screen values.
Does anybody know a way to get entire select options values from a selection screen just as they are displayed on screen ?
Thanks for reading my message
Message was edited by: Thomas BRICOUT
2006 May 05 5:24 PM
Thomas,
Perhaps the following code will help you. A function module in the code captures everything on the selection screen into an internal table. It doesn't actually capture the information the way you want it, but I believe you will be able to work with it to achieve your desired result. If it doesn't meet your needs, it is still useful for printing selection screen fields and their values.
Bruce
report zybttes2.
tables: zf137, " 137 General Ledger Document Details Table
zf137a. " 137 General Ledger Document Details Table, Archive
selection-screen begin of block b1 with frame title text-004." BCT003
parameters: p_zf137 radiobutton group xxx, " BCT003
p_zf137a radiobutton group xxx. " BCT003
selection-screen end of block b1. " BCT003
*
selection-screen begin of block parameter with frame title text-001.
selection-screen skip 1.
select-options: s_date for zf137-zzpostdat.
selection-screen skip 1.
selection-screen begin of line.
selection-screen comment 3(6) text-002.
selection-screen end of line.
selection-screen skip 1.
select-options: s_loan for zf137-zzloan.
selection-screen skip 1.
selection-screen begin of line.
selection-screen comment 3(6) text-003.
selection-screen end of line.
selection-screen skip 1.
select-options: s_ccentr for zf137-zzcostctr.
selection-screen skip 1.
selection-screen end of block parameter.
data: ww(3) type n.
data: zz(3) type c.
data: c1(1) type c value '0'.
do 2 times.
ww = ww + 1.
zz = ww. shift zz left deleting leading c1.
write: / zz.
enddo.
************************************************************************
Capture and then print the selection screen fields and their values
************************************************************************
data: begin of i_info occurs 20,
flag,
olength type x,
line like raldb-infoline,
end of i_info.
call function 'PRINT_SELECTIONS'
exporting
mode = 'TABLE'
rname = sy-cprog
rvariante = sy-slset
tables
infotab = i_info.
loop at i_info.
write: / i_info-line.
endloop.
write: / 'end'.
Hi all !
First post here, but a tough one I think. Here is my inquiry :
I have worked on an specific abap function used in many long abap list reports. Theses reports are launched in background processing. The aim of this routine is to stop the report execution if a background job with the same selection parameters is already launched for the current user (to Prevent useless several launch of a time-expensive program).
Because this routine is dynamic, I read the selection screen of the current report with the function 'DYNP_VALUES_READ'. And I compare the result with the variant of the backgroung job (read with function 'RS_VARIANT_CONTENTS').
The real problem is that function "DYNP_VALUES_READ" only extract the first line of select-options. I found an alternative solution to extract the select options values (a dynamic assign with field symbols), but external conversions (for WBS elements for example ) are lost, so the comparison detects differences between the background job's variant values and the current selection screen values.
Does anybody know a way to get entire select options values from a selection screen just as they are displayed on screen ?
Thanks for reading my message
Message was edited by: Thomas BRICOUT
2006 May 05 5:24 PM
Thomas,
Perhaps the following code will help you. A function module in the code captures everything on the selection screen into an internal table. It doesn't actually capture the information the way you want it, but I believe you will be able to work with it to achieve your desired result. If it doesn't meet your needs, it is still useful for printing selection screen fields and their values.
Bruce
report zybttes2.
tables: zf137, " 137 General Ledger Document Details Table
zf137a. " 137 General Ledger Document Details Table, Archive
selection-screen begin of block b1 with frame title text-004." BCT003
parameters: p_zf137 radiobutton group xxx, " BCT003
p_zf137a radiobutton group xxx. " BCT003
selection-screen end of block b1. " BCT003
*
selection-screen begin of block parameter with frame title text-001.
selection-screen skip 1.
select-options: s_date for zf137-zzpostdat.
selection-screen skip 1.
selection-screen begin of line.
selection-screen comment 3(6) text-002.
selection-screen end of line.
selection-screen skip 1.
select-options: s_loan for zf137-zzloan.
selection-screen skip 1.
selection-screen begin of line.
selection-screen comment 3(6) text-003.
selection-screen end of line.
selection-screen skip 1.
select-options: s_ccentr for zf137-zzcostctr.
selection-screen skip 1.
selection-screen end of block parameter.
data: ww(3) type n.
data: zz(3) type c.
data: c1(1) type c value '0'.
do 2 times.
ww = ww + 1.
zz = ww. shift zz left deleting leading c1.
write: / zz.
enddo.
************************************************************************
Capture and then print the selection screen fields and their values
************************************************************************
data: begin of i_info occurs 20,
flag,
olength type x,
line like raldb-infoline,
end of i_info.
call function 'PRINT_SELECTIONS'
exporting
mode = 'TABLE'
rname = sy-cprog
rvariante = sy-slset
tables
infotab = i_info.
loop at i_info.
write: / i_info-line.
endloop.
write: / 'end'.
2006 May 09 9:03 AM
Many Thanks bruce !
I found in this function the way to get the current programm variant's data (and it's exactly the same function I use to get the selections parameters of the background job).
I really could not have found it without your help !
I've rewared the corresponding point as my problem is solved
Regards,
Thomas.
Message was edited by: Thomas B.
2013 May 23 3:35 PM
I'm trying to retrieve values on the event "AT SELECTION-SCREEN ON VALUE REQUEST FOR" .
In this event I use the function module RS_REFRESH_FROM_SELECTOPTIONS, but it doesn't give me the values of the SELECT-OPTIONS on the screen, just the values that have been entered (like when you click enter or other button on the screen).
Does anyone have any suggest, please?
| User | Count |
|---|---|
| 3 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |