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

selection-screen programming

Former Member
0 Likes
762

Hi all

I had a problem over selection-screen programming..

Having 2 fields 'Run_ID' and 'Run_date' at selection-screen level, here there is one to many relation i.e. for a Run-id there will be more Run-dates but not vice-verca, i mean to say one Run-date cannot be have multiple Run-ids....

Please suggest me, how to handle this.....

TIA

Regards

Andhari

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
734

Hi,

I think you can handle this easily at-selection-screen event.

see how many elements are present in run_id .


data: lw_id type i.
     
describe table run_id lines lw_id.


if lw_id > 1.

Message 'No more than one run id' type 'E'.

Edited by: Suresh Dorai on Apr 18, 2010 7:12 AM

5 REPLIES 5
Read only

Former Member
0 Likes
735

Hi,

I think you can handle this easily at-selection-screen event.

see how many elements are present in run_id .


data: lw_id type i.
     
describe table run_id lines lw_id.


if lw_id > 1.

Message 'No more than one run id' type 'E'.

Edited by: Suresh Dorai on Apr 18, 2010 7:12 AM

Read only

0 Likes
734

Suresh,

Thanks for your response.....

Here, i've to check Run ID against the field 'Run_date'...for example today 18.04.2010, if i run this program by giving values '01' for Run_ID and '18.04.2010' for Run_date at selection-screen and it's done for today, but if user again tries to execute this program on same day, it's supposed show error, But with same Run_id, we can run the program on any date except today.........hope you understand...

Pls do needful

Read only

former_member196299
Active Contributor
0 Likes
734

Hi Surender ,

Design your selection screen this way :

Make 'Run_id' as a parameter field and keep Run_date as a select-option .

This way you can restrict Run_id to one parameter entry only and for that Run_id , you can have multiple Run_dates .

Regards,

Ranjita

Read only

0 Likes
734

Hi Ranjita

Here, after execution of the program the Run_id and Run_date wil be stored to a Z-table, so by next time execution of the program it shoud check the selection-screen values against the ztable entries to avoid duplicate values of 'Run_ID' for the same date 'Run_date', at the same time we can have the same Run_ID for different dates in the other way this program should run only once per day

Thanks

Andhari

Read only

0 Likes
734

Andhari ,

Then take both the fields run_id and run_date as parameters in the selection screen .

For this you have to code in the 'At selection-screen ' event .

Write the logic this way :

at selection-screen.

select single run_id run_date from the z-table into a workarea

where run_date = sy-datum .

if sy-subrc = 0 .

throw an error message like " This program runs only once iper day " .

endif .

Hope this solves your query .

regards,

Ranjita