‎2009 Aug 21 12:29 PM
Hi,
I have a requirement where when i double click on the PO number in the report the ME23N screen should be displayed. The report is for PO and its details.
I set the hotspot value to X in fieldcatalog.
I passes user command in the REUSE_ALV_GRID_DISPLAY i.e. i_callback_user_command = 'USER_COMMAND'.
I have written this in the USER_COMMAND method.
IF p_r_ucomm EQ '&IC1'.
READ TABLE lt_final INTO ls_final INDEX rs_selfield-tabindex.
CASE rs_selfield-fieldname.
WHEN 'EBELN'.
IF rs_selfield-value IS NOT INITIAL.
SET PARAMETER ID: 'BES' FIELD rs_selfield-fieldname.
CALL TRANSACTION 'ME23N' AND SKIP FIRST SCREEN.
ENDIF.
ENDCASE.
ENDIF.
i am unable to go to ME23N screen on the double click on the PO number.
Please advice.
Regards
Zubair
‎2009 Aug 21 12:33 PM
Hi,
IF rs_selfield-value IS NOT INITIAL.
SET PARAMETER ID: 'BES' FIELD rs_selfield-fieldname.
here instead of field name pass the value
IF rs_selfield-value IS NOT INITIAL.
SET PARAMETER ID: 'BES' FIELD rs_selfield-Value.
Hope it'll work.
.
‎2009 Aug 21 12:34 PM
Hi,
When you use the skip first screen, you need to pass the value/contents in the set parameter.
SET PARAMETER ID: 'BES' FIELD <Field Value>.
CALL TRANSACTION 'ME23N' AND SKIP FIRST SCREEN.
Hope this helps you
Regards
Shiva
‎2009 Aug 21 12:38 PM
Thanks for your reply.
I tried value in the beginning it didnt work so later i changed to name to check if it works just incase.
However i checked once again. Its not working.
Regards,
Zubair.
‎2009 Aug 21 12:48 PM
‎2009 Aug 21 12:55 PM
Selva,
I am getting data in that final table which i am able to display as output. So i dont think thats the problem.
Can you please let me know when is the USER_COMMAND form called?
Regards,
Zubair
‎2009 Aug 21 12:42 PM
Correct the code into
.CASE p_r_uucomm.
WHEN '&IC1'.
READ TABLE lt_final INTO ls_final INDEX rs_selfield-tabindex.
CHECK sy-subrc EQ 0.
CASE rs_selfield-fieldname.
WHEN 'EBELN'.
IF rs_selfield-value IS NOT INITIAL.
SET PARAMETER ID 'BES' FIELD ls_final-ebeln.
CALL TRANSACTION 'ME23N' AND SKIP FIRST SCREEN.
ENDIF.
ENDCASE.
ENDCASE..Regards,
Raymond
‎2009 Aug 21 12:52 PM
Hi Raymond,
Thanks for your reply.
I tried that as well but no luck.
Regards,
Zubair.
‎2009 Aug 21 1:01 PM
Else try
FORM user_command USING r_ucomm LIKE sy-ucomm
rs_selfield TYPE slis_selfield.
CASE r_ucomm.
WHEN '&IC1'. " If you don't use F2CODE field in LAYOUT parameter
READ TABLE lt_final INTO ls_final INDEX rs_selfield-tabindex.
CHECK sy-subrc EQ 0.
CASE rs_selfield-fieldname.
WHEN 'EBELN'.
CALL FUNCTION 'ME_DISPLAY_PURCHASE_DOCUMENT'
EXPORTING
i_ebeln = ls_final-ebeln
i_enjoy = 'X'
i_display_only = 'X'
EXCEPTIONS
not_found = 1
no_authority = 2
invalid_call = 3
preview_not_possible = 4
OTHERS = 5.
IF sy-subrc NE 0.
MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
ENDIF.
ENDCASE.
ENDCASE.
ENDFORM.Regards,
Raymond
‎2009 Aug 21 2:13 PM
Hi,
I have tried this as well but its not working.
Regards,
Zubair
‎2009 Aug 21 2:17 PM
What do you pass in the call back program I_CALLBACK_PROGRAM parameter of the ALV function module?
Regards,
Naimesh Patel
‎2009 Aug 21 2:24 PM
Hi naimesh,
I am passing sy-repid.
Is there anything else i need to pass apart from program name and user command
regards,
Zubair
‎2009 Aug 22 2:46 AM
Hi,
just write the statement
break-point.
before the statement
IF p_r_ucomm EQ '&IC1'. in the user command subroutine.
now when it goes to the debugging mode, just check with the value of p_r_ucomm hope this will help you to analyze where exactly the issue is....
Regards,
Siddarth
‎2009 Aug 22 4:03 AM
Although I would advise against any hard-coding, try to hard-code the program name when passing the parameter I_CALLBACK_PROGRAM instead of using SY-REPID. Then, check if the debugger actually calls your user command form. If it does, then, you should be able to analyze the problem by seeing what value is being passed in the VALUE field.
By the way, you don't need to make the field a hot-spot for the double-click command to work.
Hope that helps you identify the problem.
‎2009 Aug 22 6:31 AM