2012 Sep 18 6:33 PM
Hi,
I have used a alv grid in which a row has to be selected and using the value in that row i have to display few values.
I have written a coding where the output is like alv grid is displayed but the user command does not work.can anyone please tell me what is wrong?
Thanks in advance.
Hi,
I have used a alv grid in which a row has to be selected and using the value in that row i have to display few values.
I have written a coding where the output is like alv grid is displayed but the user command does not work.can anyone please tell me what is wrong?
Thanks in advance.
2012 Sep 18 6:54 PM
Hi Sharon ,
i'm not sure about how you're using Events ,
have a look at the code at the following link.
http://www.erpgreat.com/abap/an-interactive-alv-report.htm
it's very well commented.
hope this helps .
good luck
2012 Sep 19 9:47 AM
I tried your code and it works fine. How come did you say that user command does not work?
Regards,
Jake
2012 Sep 19 4:47 PM
I tried to use a write statement to check whether its working inside my user command and top of page but nothing got displayed so i thought its not working...my actual requirement is that when i click on the value an order list should be displayed in smartform and when back button is pressed it has to be redirected to a screen..do u have any idea about it..thanks for replying Jake
2012 Sep 19 11:20 AM
Hello sharon..
please evaluate code...i have writing here.. just understand the logic... this is sample code.
(sample : Alv column click to navigate PO (me23n) )
FORM DISPLAY_ALV_REPORT.
GD_REPID = SY-REPID.
CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
EXPORTING
I_CALLBACK_PROGRAM = GD_REPID
* i_callback_top_of_page = 'TOP-OF-PAGE' "see FORM
i_callback_user_command = 'USER_COMMAND' <<<<<<< this is perform for below code
* i_grid_title = outtext
IS_LAYOUT = GD_LAYOUT
IT_FIELDCAT = FIELDCATALOG[]
* it_special_groups = gd_tabgroup
* IT_EVENTS = GT_XEVENTS
I_SAVE = 'X'
* is_variant = z_template
TABLES
T_OUTTAB = IT
EXCEPTIONS
PROGRAM_ERROR = 1
OTHERS = 2.
IF SY-SUBRC <> 0.
* MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
* WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
ENDFORM. " DISPLAY_ALV_REPORT
''
''
''
''
''
''
''
"
"
"
"
"
"
FORM USER_COMMAND USING UCOMM TYPE SY-UCOMM
SELFIELD TYPE SLIS_SELFIELD.
CASE UCOMM.
WHEN '&IC1'.
READ TABLE IT INDEX SELFIELD-TABINDEX INTO WA.
IF SY-SUBRC EQ 0.
IF SELFIELD-FIELDNAME = 'EBELN' ."AND NOT WA-LIFNR IS INITIAL.
SET PARAMETER ID 'BES' FIELD WA-EBELN.
CALL TRANSACTION 'ME23N' AND SKIP FIRST SCREEN.
ENDIF.
ENDIF.
ENDCASE.
ENDFORM.
hope this helps......
2012 Sep 19 11:46 AM
ur code is perfectly fine.
u can check by placing a break-point in the very begning of user_command form.
this subroutine (form ...end form ) will get fired when u double click on any cell or row of alv grid.
2012 Sep 19 4:49 PM
2012 Sep 19 5:15 PM
Hi Sharon,
Once you have created your smartform you can call it from your user command this way:
DATA: gv_fm_name TYPE rs38l_fnam.
DATA: gs_output TYPE ssfcompop.
DATA: gs_cparam TYPE ssfctrlop.
CALL FUNCTION 'SSF_FUNCTION_MODULE_NAME'
EXPORTING
formname = 'ZSMARTFORM'
* VARIANT = ' '
* DIRECT_CALL = ' '
IMPORTING
fm_name = gv_fm_name
EXCEPTIONS
no_form = 1
no_function_module = 2
OTHERS = 3
.
gs_output-tdnewid = 'X'.
gs_output-tdimmed = 'X'.
gs_output-tdfinal = 'X'.
gs_output-tdarmod = '1'.
gs_cparam-getotf = 'X'.
gs_cparam-no_dialog = 'X'.
***form call:
CALL FUNCTION gv_fm_name
EXPORTING
* archive_index = gs_arc
* ARCHIVE_INDEX_TAB =
* ARCHIVE_PARAMETERS =
control_parameters = gs_cparam
* MAIL_APPL_OBJ =
* MAIL_RECIPIENT =
* MAIL_SENDER =
output_options = gs_output
* USER_SETTINGS = 'X'
IMPORTING
* DOCUMENT_OUTPUT_INFO =
job_output_info = gs_job_info
* JOB_OUTPUT_OPTIONS =
* TABLES
EXCEPTIONS
formatting_error = 1
internal_error = 2
send_error = 3
user_canceled = 4
OTHERS = 5
.
Where ZSMARTFORM is the name of your smartform
I hope it helps
Regards
2012 Sep 19 7:31 PM
ya but how do i redirect it to a different screen when i press the back button in smartform ?
2012 Sep 19 7:38 PM
you could use SET screen or CALL screen after the smartform call.
best regards,
swanand
2012 Sep 19 7:38 PM
you could use SET screen or CALL screen after the smartform call.
best regards,
swanand
2012 Sep 19 7:41 PM
It should get redirected to a different screen only when i press the back button not always..
2012 Sep 19 7:53 PM
check sy-ucomm when u press back from smartform and do the coding for the screen call.
2012 Sep 19 8:17 PM
Do you mean i should check sy-ucomm in the program for the back which is in smartform ??
2012 Sep 19 8:19 PM
you should check what sy-ucomm returns when you press back of smartform and in your program code accordingly.
2012 Sep 19 8:24 PM
| User | Count |
|---|---|
| 4 | |
| 2 | |
| 2 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |