Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

DYNP_VALUES_READ Limitations for multiple lines select options

Former Member
0 Likes
918

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

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
722

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

3 REPLIES 3
Read only

Former Member
0 Likes
723

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

Read only

0 Likes
722

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.

Read only

0 Likes
722

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?