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 User command problem

Former Member
0 Likes
1,400

Hi,

I am displaying the report using ALV grid FM. I have added the button in application toolbar with my own PF status.

I want to write another report when user click on this button. But write statements are not working when i click that button. No new screen gets displyed. In debug mode i can see it is writting.

looks problem with events.

any suggestions???

4 REPLIES 4
Read only

Former Member
0 Likes
749

If the new report goes into ALV, I think you would need to duplicate your various ALV elements. I once had a tabstrip with four tabs and four different ALVs, and thus had four sets of objects. On the other hand, if you're doing a list report, you're not going to see that until you exit the ALV...( and you may have to adjust how you leave that...)/

Read only

Former Member
0 Likes
749

hello,

first it will be displayed after pressing back from ALV...

second why do not you go for ALV in second report also?

that time there will be no problem...

Thanks

K.

Read only

Former Member
0 Likes
749

Hi

Please mention your logic under the event AT USER-COMMAND. It will works fine.

Read only

I355602
Product and Topic Expert
Product and Topic Expert
0 Likes
749

Hi,

Refer the below code snippet:-


  CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
    EXPORTING
      i_callback_program       = v_repid
      i_callback_pf_status_set = 'PF'
      i_callback_user_command  = 'COMMAND'
      it_fieldcat              = it_field_catalog
    TABLES
      t_outtab                 = it_output
    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.

FORM pf USING im_extab TYPE slis_t_extab.
  SET PF-STATUS 'TEST1'.
ENDFORM. "pf

FORM command USING im_ucomm TYPE sy-ucomm
                      im_selfield TYPE slis_selfield.
  CASE im_ucomm .
    WHEN 'REPORT'.
      LEAVE TO LIST-PROCESSING.
      WRITE / 'hello'.
  ENDCASE.
ENDFORM.                    "command

Hope this helps you.

Regards,

Tarun