2007 Jul 13 5:13 AM
I hve radio button in selection screen . if i executet his prog by selecting any of this radio button it shuld go to alv list. here alv list using the concept of oop.
whether i need to add 2 screens to display this 2 ALV list.since the method to display the ALV is writing in PBO output of the screen.
is it possible to pass the internal table to same screen depends on the selection of radio button.
2007 Jul 13 5:18 AM
Hi Anu,
yes u can use the same screen, in PBO Passthe internal table to the method used for creating alv, based on the radiobutton pressed.
for ex:
if p_r1 = 'X'.
call method with itab1.
elseif p_r2 = 'X'.
call method with itab1.
endif.
regards,
Navneeth K.
2007 Jul 13 5:18 AM
Hi Anu,
yes u can use the same screen, in PBO Passthe internal table to the method used for creating alv, based on the radiobutton pressed.
for ex:
if p_r1 = 'X'.
call method with itab1.
elseif p_r2 = 'X'.
call method with itab1.
endif.
regards,
Navneeth K.
2007 Jul 13 5:23 AM
but wat im doing is
if p_r1 = c_x.
PERFORM fieldcatalog_init.
perform alv_grid_class.
elseif p_r2 = c_x.
endif.
perform alv_grid_class this perform will call screen 100. so PBO will call automatically. so how can i pass itab.
2007 Jul 13 5:38 AM
Hi Anu,
Can you paste the code of your perform "alv_grid_class" here.
regards,
Navneeth K.
2007 Jul 13 5:42 AM
FORM alv_grid_class .
CALL SCREEN 100.
ENDFORM. " alv_grid_class
2007 Jul 13 5:46 AM
Hi Anu,
what u could do is declare the internal table used in the screen 100 as global so that any screen in that program can use it. Once the radiobutton is pressed populate the inetrnal table you are using during creation of ALV and then call the fieldcatalog & alv_grid_class methods.
regards,
Navneeth K.
2007 Jul 13 5:54 AM
but in
MODULE PBO OUTPUT. (of the screen 100)
CALL METHOD GRID->SET_TABLE_FOR_FIRST_DISPLAY
exporting
I_BUFFER_ACTIVE =
I_BYPASSING_BUFFER =
I_CONSISTENCY_CHECK =
I_STRUCTURE_NAME =
IS_VARIANT =
I_SAVE = 'A'
I_DEFAULT = 'X'
IS_LAYOUT = gs_layout
IS_PRINT =
IT_SPECIAL_GROUPS =
IT_TOOLBAR_EXCLUDING =
IT_HYPERLINK =
IT_ALV_GRAPHICS =
IT_EXCEPT_QINFO =
CHANGING
IT_OUTTAB = t_output1[]
IT_FIELDCATALOG = w_gt_field
IT_SORT =
IT_FILTER =
EXCEPTIONS
INVALID_PARAMETER_COMBINATION = 1
PROGRAM_ERROR = 2
TOO_MANY_LINES = 3
others = 4
will call this method passing t_output1.
but for the next radiobutton internal table dat shuld pass to this method is t_output2.
can i pass internal table to module PBO output?
2007 Jul 13 6:14 AM
Hi,
do like this.
CALL METHOD GRID->SET_TABLE_FOR_FIRST_DISPLAY
exporting
I_SAVE = 'A'
IS_LAYOUT = gs_layout
CHANGING<b>
IT_OUTTAB = t_output1
IT_FIELDCATALOG = w_gt_field[]</b>.
rgds,
bharat.
2007 Jul 13 6:20 AM
Hi Anu,
If the structure of t_output1 and t_output2 is same then create a common internal table say t_output_common and pass this to the method. Populate this method once the radio butoon is clicked.
for ex:
if p_r1 = 'X'.
<b>t_output_common[] = t_output1[].</b>
//cal performs as above
elseif p_r2 = 'X'.
<b>t_output_common[] = t_output2[].</b>
//cal performs as above
endif.
Message was edited by:
Navneeth Bothra
2007 Jul 13 6:27 AM
2007 Jul 13 6:30 AM
ok then what u can do is call this method
GRID->SET_TABLE_FOR_FIRST_DISPLAY itself based on radiobutton selected.
capture which radiobutton selected in the first screen and store it in a variable and in the screen 100. use that variable to trigger this method.
2007 Jul 13 6:36 AM
so based on radio button selected , will this GRID->SET_TABLE_FOR_FIRST_DISPLAY need to write twice??
2007 Jul 13 6:39 AM
yes u need to write it twice with diff based on radio button selected. but will be triggered only one based on radiobutton.
2007 Jul 13 6:41 AM
2007 Jul 13 5:19 AM
Hi,
see the system defined programs
BCALV_GRID_* and BCALV_EDIT_* programs to learn Object Oriented ALV(alv using class).
rgds,
bharat.