2008 Mar 08 7:56 AM
I am displaying a ALV report using classes, with fields VBELN POSNR ETENR ..... and i have a pushbutton on the main screen .when i click on the pushbutton it has to display the report (with fields CRD Qty,CPD Qty,CSD Qty) in the same screen overwritting the existing fields.. on the mainscreen..
eg....
main screen fields are ...
VBELN POSNR ETENR UPDATETIME EDATU WMENG
push button report has fields like
CRD Qty,CPD Qty,CSD Qty......
how can i do it..
points will be rewarded...
I am displaying a ALV report using classes, with fields VBELN POSNR ETENR ..... and i have a pushbutton on the main screen .when i click on the pushbutton it has to display the report (with fields CRD Qty,CPD Qty,CSD Qty) in the same screen overwritting the existing fields.. on the mainscreen..
eg....
main screen fields are ...
VBELN POSNR ETENR UPDATETIME EDATU WMENG
push button report has fields like
CRD Qty,CPD Qty,CSD Qty......
how can i do it..
points will be rewarded...
2008 Mar 08 8:03 AM
hi,
under the pushbutton,
if that button is clicked.
build a separate field catalog for it.
but dont forget to refresh the initial fieldcatalog
Regards,
Talwinder
2008 Mar 08 8:43 AM
1) handle user_command events.
2)at the push button click you can again call the different screen conatining the alv grid for the new filds. caryy the same steps as you did before for the initail screen display like craete field cateloge, final disdplay layout,internal table and display the alv.
the key point is you have to wrtite the user_command subroutine which will be called dynamically at runtime.
2008 Mar 08 9:03 AM
hi here iam sending the code for the push button and check this how i had written,
-
CLASS L_CL_EVENTS DEFINITION *
-
Class for inserting buttons on the toolbar *
-
CLASS l_cl_events DEFINITION.
PUBLIC SECTION.
METHODS:
toolbar FOR EVENT toolbar
OF cl_gui_alv_grid
IMPORTING e_object
e_interactive,
user_command FOR EVENT user_command
OF cl_gui_alv_grid
IMPORTING e_ucomm .
ENDCLASS. " L_CL_EVENTS DEFINITION
-
CLASS L_CL_EVENTS IMPLEMENTATION *
-
Implementation of class L_CL_EVENTS *
-
CLASS l_cl_events IMPLEMENTATION.
METHOD toolbar.
PERFORM event_toolbar USING e_object.
ENDMETHOD. " TOOLBAR
METHOD user_command.
PERFORM event_ucomm USING e_ucomm.
ENDMETHOD. " USER_COMMAND
ENDCLASS. " L_CL_EVENTS IMPLEMENTATION
DATA:
To create instance for cl_gui_custom_container
g_grid TYPE REF TO cl_gui_custom_container,
To create instance for cl_gui_alv_grid
g_alv TYPE REF TO cl_gui_alv_grid,
To create instance for l_cl_events
g_events TYPE REF TO l_cl_events,
To assign name for custom container
g_container TYPE scrfname VALUE 'CONTAINER',
To assign layout
g_fcatlayo TYPE lvc_s_layo.
-
FORM EVENT_TOOLBAR *
-
Setting toolbar in the alv grid *
-
-->E_OBJECT TYPE REF TO CL_ALV_EVENT_TOOLBAR_SET *
-
FORM event_toolbar USING e_object
TYPE REF TO cl_alv_event_toolbar_set.
Local declaration for the button.
DATA: ls_toolbar TYPE stb_button.
To add Approve button
ls_toolbar-function = c_app_rej
ls_toolbar-butn_type = c_zero.
ls_toolbar-text = text-001.
APPEND ls_toolbar TO e_object->mt_toolbar.
To add Reject button
CLEAR ls_toolbar.
ls_toolbar-function = c_fcode_rej.
ls_toolbar-butn_type = c_zero.
ls_toolbar-text = text-013.
APPEND ls_toolbar TO e_object->mt_toolbar.
ENDFORM. " EVENT_TOOLBAR
-
FORM EVENT_UCOMM *
-
After Input in the ALV grid,if user select record and press *
approve or reject then the record will get updated *
-
--> PR_ucomm type sy-ucomm *
-
FORM event_ucomm USING pr_ucomm LIKE sy-ucomm.
CASE pr_ucomm.
If e_ucomm contains 'APP' i.e.function code for Approve button
WHEN c_fcode_approve. " To approve selected record
PERFORM app_timesheet USING c_approve_status.
If e_ucomm contains 'REJ' i.e. function code for Reject
WHEN c_fcode_rej. " To reject selected record
PERFORM app_timesheet USING c_rej_status.
ENDCASE. " CASE E_UCOMM
ENDFORM. " EVENT_UCOMM
regards,
venkat.