Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

ALV problem

Former Member
0 Likes
1,494

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

14 REPLIES 14
Read only

Former Member
0 Likes
1,435

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.

.

Read only

Former Member
0 Likes
1,435

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

Read only

0 Likes
1,435

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.

Read only

0 Likes
1,435

HI,

Debug and check whether u r getting value in that field.

Read only

0 Likes
1,435

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

Read only

RaymondGiuseppi
Active Contributor
0 Likes
1,435

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

Read only

0 Likes
1,435

Hi Raymond,

Thanks for your reply.

I tried that as well but no luck.

Regards,

Zubair.

Read only

0 Likes
1,435

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

Read only

0 Likes
1,435

Hi,

I have tried this as well but its not working.

Regards,

Zubair

Read only

naimesh_patel
Active Contributor
0 Likes
1,435

What do you pass in the call back program I_CALLBACK_PROGRAM parameter of the ALV function module?

Regards,

Naimesh Patel

Read only

0 Likes
1,435

Hi naimesh,

I am passing sy-repid.

Is there anything else i need to pass apart from program name and user command

regards,

Zubair

Read only

0 Likes
1,435

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

Read only

0 Likes
1,435

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.

Read only

matt
Active Contributor
0 Likes
1,435

Please use a more meaningful subject in future

thanks

matt