2005 Dec 06 3:14 PM
I have a database table which contains report name & report description as fields.based on the number of rows of data present in the table i have to display check box for each entry & the corresponding controls in the selection-screen.
I got answers like:
1.Declaring the checkboxes & hiding the same in runtime using user-command,which is not needed...
2.Declaring the checkbox in screen painter using function code & calling the same,where i need a clear explanation...
Is there any other method other than this plz let me know...
Reply is most urgent...
2005 Dec 08 11:32 AM
Hi,
The macro will not work for you. The parameters and also select-options have to be specified before the program starts.
Try my solution with the generated code instead. This will work!
Regards
Arjan
2005 Dec 06 3:30 PM
Can you use a drop down instead...The drop down can be filled with entries from the table....
use the following with parameters to get a drop down...
PARAMETERS: P_VAR(12) TYPE N as listbox visible length 15.
The FM VRM_SET_VALUES can be used to fill the drop down...
Regards,
Renjith
2005 Dec 06 3:33 PM
This isn't exactly what you need, but you get the idea.
Declare a bunch of checkbox's and then turn them on depending on the number that you have in the selection screen.
report zrich_0003 .
data: modif(3) type c.
parameters: p_num(3) type n modif id 000.
parameters: p_chk1 as checkbox modif id 001.
parameters: p_chk2 as checkbox modif id 002.
parameters: p_chk3 as checkbox modif id 003.
parameters: p_chk4 as checkbox modif id 004.
parameters: p_chk5 as checkbox modif id 005.
parameters: p_chk6 as checkbox modif id 006.
parameters: p_chk7 as checkbox modif id 007.
parameters: p_chk8 as checkbox modif id 008.
parameters: p_chk9 as checkbox modif id 009.
parameters: p_chk10 as checkbox modif id 010.
parameters: p_chk11 as checkbox modif id 011.
parameters: p_chk12 as checkbox modif id 012.
parameters: p_chk13 as checkbox modif id 013.
parameters: p_chk14 as checkbox modif id 014.
parameters: p_chk15 as checkbox modif id 015.
at selection-screen output.
modif = p_num.
loop at screen.
if screen-group4 > modif
and screen-group4 <> '000'.
screen-invisible = '1'.
screen-active = '0'.
modify screen.
endif.
endloop.
Regards,
Rich Heilman
2005 Dec 07 10:39 AM
Hello Rich,
Ur coding works only when U have 15 entries in the table...if it is more than that it will not work & moreover u have declared the checkboxes statically on the screen which is not needed...i want to display checkboxes on the screen based on the number of values in the table...
2005 Dec 07 10:42 AM
Hi Varadharajan,
1. can u elaborate ur requirement.
Regards,
Amit M.
2005 Dec 07 10:49 AM
Hello Varadarajan,
Can u explain more about your requirement? Is it on a selection screen or output of the report?
Sasi
2005 Dec 07 10:52 AM
Hi,
Normally when we use parameters on the screen we are clear about the functionality behind our declaration.
You have a table which contains report name and report description ,can you elaborate more on your requirement.
Because the best way to do this is to declare parameters and hide them at runtime depending on the number of entries which have to be fixed.
Thanks & Regards,
Vanita
2005 Dec 07 12:38 PM
Hi Everybody,
I have a table by name ZTBLMA where i have fields like Report Name & Report Description.I have two records in the table like ytest,ytest1 in the Report Name & the corresponding description in the Report Description...
Now in a selection-screen i want 2 check boxes to be displayed...If another record is added to the table like ytest3(Report Name) then that should also be displayed in the selection screen as a third check box added to the existing two checkboxes...So totally 3 checkboxes...So the no of records in the table & the no of checkboxes in the selection-screen should be the same...
I hope this will be somewhat clear...
Reply most URGENT...
2005 Dec 07 1:36 PM
Hi,
You can use macros to make this work.
define a macro like this say...
define my_macro.
***i have just shown the parameters statement
***you can use selection screen options like line,
***comment etc
parameters : p_&1 as checkbox.
end-of-definition.
make the selection from the table....in initialization and then do like this...
loop at <selection>.
my_macro <checkbox_name>.
endloop.
this should give you the parameters based on the no. of entries in the table.
Thanks,
Renjith
2005 Dec 07 3:46 PM
Hi Renjith,
This is my coding but i am not getting the required o/p...can u plz point out the mistake if there any...
REPORT YR_MM_SCREENS_VAR1.
tables ztblma.
define my_macro.
selection-screen begin of block b1 with frame title text-001.
parameters : p_&1 as checkbox.
selection-screen end of block b1.
end-of-definition.
initialization.
select * from ztblma.
my_macro rep.
endselect.
The o/p i am getting is one checkbox with name P_REP...
Reply most urgent...
2005 Dec 07 4:12 PM
Varadharajan, you seem to have hardcode the value 'REP'.. Try using the parameter field from ZTBLMA as ZTBLMA-f1 (where F1 is the parameter field name in table ZTBLMA)..
Also for now remove the code related to add the selection screen block (b1) and once you get the checkboxes, you can addit later..
2005 Dec 07 4:14 PM
The thing is the parameter passed to the macro is treated as a string only, and &1 is reoplaced with rep...
so each time you call the macro the value has to be different.
Thanks,
Renjith
2005 Dec 08 11:11 AM
Hi Renjith,
How can u assign different values to the parameter which is passed to the macro?I have tried using '&' and also concatenate statement...But still i couldn find the solution...can u plz give me an idea on this?
Also when i pass the field value of the table like ZTBLMA-RNAME then the whole field like 'ZTBLMA-RNAME' is taken as the parameter & not the value of that field...
2005 Dec 08 11:15 AM
Hi Varadharajan,
1. U have mentioned in ur query :
Now in a selection-screen i want 2 check boxes to be displayed...
Is it necessary to display the checkboxes in selection-screen only ?
2. Another approach (which is commonly used is )
As soon as we run the report,
the checkboxes will be shown
thru WRITE statement
(and not on selection screen)
3. After the user selects the checkboxes,
he will press a button on toolbar.
4. Then, in our program,
we can loop and detect which checkboxes
have been TICKED,
and accordingly take proper action.
5. If the above kind of architecture, is ok,
then let me know.
BCOS it will be quite easy for u!
regards,
amit m.
2005 Dec 09 3:04 PM
Hi Amit...
May i know how it can be done? Can u plz send me a sample coding to get a clear picture on the same?
2005 Dec 10 8:01 AM
REPORT ychatest .
TABLES : lfa1.
DATA:BEGIN OF it_lfa1 OCCURS 0,
chk(1),
lifnr LIKE lfa1-lifnr,
END OF it_lfa1.
START-OF-SELECTION.
SELECT lifnr
FROM lfa1
INTO CORRESPONDING FIELDS OF TABLE it_lfa1
WHERE lifnr = 'RASER' OR
lifnr = 'A100'.
END-OF-SELECTION.
LOOP AT it_lfa1.
WRITE 😕 it_lfa1-chk AS CHECKBOX , it_lfa1-lifnr.
ENDLOOP.
2005 Dec 10 12:22 PM
Hi...
The coding that u have mentioned will fetch the data from the table based on the condition & will print it with a checkbox in front of it...But i need to process the value of the checkbox that is clicked...can u plz read the msg posted in the same forum dated Dec 9, 2005 7:05 PM where i have mentioned my full requirement...If there is any clarification on it i can clear the same...
2005 Dec 07 1:19 PM
Hi,
Did you try generating programs dynamicly?
Here is an example.
The first report generates some source code lines into an internal table.
The source code table is used to insert an include program into the repository.
Then a second report is submitted which uses that new include.
See Source code below.
Regards,
Arjan Aalbers
&----
*
*& Report ZZSTART
*&
&----
*&
*&
&----
REPORT zzstart.
PARAMETER pa_times(6) TYPE n DEFAULT 10.
DATA: it_source TYPE STANDARD TABLE OF tdline,
wa_source TYPE tdline.
DATA: h_count(5) TYPE n,
h_parname(8) TYPE c.
DO pa_times TIMES.
h_count = sy-index.
CONCATENATE 'PA_' h_count INTO h_parname.
CONCATENATE 'PARAMETERS'
h_parname
'AS CHECKBOX.'
INTO wa_source SEPARATED BY space.
APPEND wa_source TO it_source.
ENDDO.
INSERT REPORT 'ZI_SEL_SCREEN' FROM it_source PROGRAM TYPE 'I'.
SUBMIT ZZFOLLOW VIA SELECTION-SCREEN.
&----
*& Report ZZFOLLOW
*&
&----
*&
*&
&----
REPORT ZZFOLLOW.
include ZI_SEL_SCREEN.
Start-of-selection.
Write: PA_00001.
2005 Dec 08 11:32 AM
Hi,
The macro will not work for you. The parameters and also select-options have to be specified before the program starts.
Try my solution with the generated code instead. This will work!
Regards
Arjan
2005 Dec 09 1:35 PM
Hi Arjan & Everybody...
Arjan ur answer was helpful...but the requirement has become quite complex...the requirement is mainly for background job scheduling for various reports in a single selection-screen...the requirement is as follows...
The user is allowed to enter into a table(ZTBLMA) for whatever reports he wants to schedule a job...the table consists of ReportName & ReportDescription as fields...Now based on the entries in the table u have to create a checkbox to identify which report,a text box for variant of the report,another checkbox which acts as an indicator for immediate scheduling,date & time boxes which is used to specify on which date & time the job is to be scheduled...all these in a single selection-screen...the selection-screen may look as follows...
cb1 -
variant -
cb2 -
date -
time
cb1 - check box for report name
variant - text box to fetch the variant of the report
cb2 - check box for immediate scheduling
date - date
time - time
the above structure is applicable only when the table consists of a single record...if the table contains more than one record then the above structure should be repeated on the second line for the other records also...the structure for two or more records in the table may look as follows...
cb1 -
variant -
cb2 -
date -
time
cb1 -
variant -
cb2 -
date -
time
,, -
,, -
,, -
,, -
,,
,, -
,, -
,, -
,, -
,,
,, -
,, -
,, -
,, -
,,
,, -
,, -
,, -
,, -
,,
i hope u all can understand the requirement...if there is any clarifications i am always here...
2005 Dec 09 2:57 PM
Hi Everybody...
Is the above requirement possible??? If it is so then let me know the result as quick as possible...
2005 Dec 10 7:42 AM
Hi Everybody...
Why no reply at all from anybody? Is the requirement clear or not? If not let me know...
Reply most URGENT...
2005 Dec 10 7:43 AM
2005 Dec 10 7:48 AM
Sir If u can plz read the msg being posted by me on
Dec 9, 2005 7:05 PM ie: 3 or 4 msg above...If u cant understand i am ready to explain u furthur in detail sir...
2005 Dec 10 7:51 AM
yeah,
i got it,
User should enter the report name then you can
get the data from table in the at selection-screen output and pass it to screen.
is that you are expecting or some thing else...
plz let me know..
2005 Dec 10 8:11 AM
Hi Vijay...
I think u r partially right...User enters the ReportName & ReportDesc in the ZTBLMA table...then based on the no of reports entered that many checkboxes has to be created for ReportName together with the options like a box for variant,a checkbox for immediate scheduling,a box for date of scheduling & another for time of scheduling...these options should be displayed in a single line of the corresponding ReportName checkbox...U can refer to the sample display of how the controls should be displayed in the selection-screen which i have mentioned in the same msg as above(Dec 9, 2005 7:05 PM)..
The requirement is mainly for Background Scheduling of various reports in a single selection-screen...
Am i clear Vijay...If not let me know...
2005 Dec 10 8:18 AM
I have a doubt,
<b>based on the no of reports entered that many checkboxes has to be created for ReportName together with the options like a box for variant,a checkbox for immediate scheduling,a box for date of scheduling & another for time of scheduling...these options should be displayed in a single line of the corresponding ReportName checkbox...</b>
can you explain once on the above
2005 Dec 10 8:28 AM
hi why can't you do like this...
Based on user entered data fetch the data of report(variant,date,time) and you can submit the data to background job as incase of single record by looping the data.
vijay
2005 Dec 10 10:18 AM
your requirement can only be achieved by placing an ALV grid control in the selection-screen.
for placing ALV grid control in the selection screen
you could
at selection-screen output.
create a docking container and place the grid control on it
or
when creating the container for grid control use parent as cl_gui_container=>screen0.
Hope this helps. if you need clarification on the steps mentioned do get back.
Regards
Raja
2005 Dec 10 12:08 PM
Hi Raja...
I have not tried the method that u have mentioned...can u plz explain it with an example...sample coding for the same will be very useful...
2005 Dec 10 12:36 PM
which portion you need help.
is it for alv with check boxes
refer std program BCALV_EDIT_05
Regards
Raja
2005 Dec 10 12:47 PM
Hi Vijay...
The selection screen should look like...
cb1 -
variant1 -
icb1 -
date1 -
time1
cb2 -
variant2 -
icb2 -
date2 -
time2
,, -
,, -
,, -
,, -
,,
,, -
,, -
,, -
,, -
,,
,, -
,, -
,, -
,, -
,,
,, -
,, -
,, -
,, -
,,
where...
cb1 - checkbox which indicates the first report(YRTEST) in the table...
variant1 - textbox for variant which has a help,on clicking should display all the variants of YRTEST report...
icb1 - checkbox which indicates the immediate background processing...
date1 - date on which the job should be scheduled...
time1 - time on which the job should be scheduled...
If icb1 is clicked then date1 & time1 should not be allowed to enter & vice-versa...
cb2 - checkbox which indicates the second report(YRTEST1) in the table...
variant2 - textbox for variant which has a help,on clicking should display all the variants of YRTEST1 report...
icb2 - checkbox which indicates the immediate background processing...
date2 - date on which the job should be scheduled...
time2 - time on which the job should be scheduled...
If icb2 is clicked then date2 & time2 should not be allowed to enter & vice-versa...
Its not like what u said...(Based on user entered data fetch the data of report(variant,date,time) and you can submit the data to background job as incase of single record by looping the data)
Because we have only ReportName,ReportDescription as fields in the table & not variant,date,time...The variant,date,time are all entered in the selection-screen only from which the background job is scheduled...
I hope the requirement is more clearer...