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

REUSE_ALV_GRID_DISPLAY / i_callback_user_command / write statements

rainer_hbenthal
Active Contributor
0 Likes
3,896

Hi,

i would like to output some log within the form defined by i_callback_user_command . Therefor i used some simple write statements, i expected the output after going back. But - nothing is shown. Where it is going?


FORM alv_user_command
  USING ucomm               TYPE syucomm
        selfield            TYPE slis_selfield.                          "#EC_CALLED

  FIELD-SYMBOLS:
    <p>                     type t_out.

  IF ucomm = '&DATA_SAVE'.

    loop at it_out ASSIGNING <p_out> where sel = 'X'.
      write:/ <p_out>-region, <p_out>-area.
    endloop.

    selfield-refresh    = 'X'.
    selfield-row_stable = 'X'.
    selfield-col_stable = 'X'.

  ENDIF.

ENDFORM.                    "alv_user_command

13 REPLIES 13
Read only

Former Member
0 Likes
2,101

When you are going "BACK" then user command is set to "BACK" and in this case your code for writing the output is not fired since it is writing for "SAVE" command.

Read only

Former Member
0 Likes
2,101

Hi,

FORM alv_user_command
  USING ucomm               TYPE syucomm
        selfield            TYPE slis_selfield.                          "#EC_CALLED
 
  FIELD-SYMBOLS:
    <p>                     type t_out.
 
  IF ucomm = '&DATA_SAVE'.
    LEAVE TO LIST-PROCESSING AND RETURN.   " Add this and check
    loop at it_out ASSIGNING <p_out> where sel = 'X'.
      write:/ <p_out>-region, <p_out>-area.
    endloop.
 
    selfield-refresh    = 'X'.
    selfield-row_stable = 'X'.
    selfield-col_stable = 'X'.
 
  ENDIF.
 
ENDFORM.

Read only

0 Likes
2,101

Thanks, that was helpful to switch to the list display, but after that the green, yellow and red "ball" are no longer working, neither back, cancel or end list processing.

A LEAVE LIST-PROCESSING after the endloop wasnt helpful, too. Any idea?

(theres no difference between leave to list-processing and return to screen 1000 and without return.)

Read only

0 Likes
2,101

hi,

prepare your status gui ZSTATS for list with ok_code BACK/ENDE/CANC..

and change code:

loop at it_out ASSIGNING <p_out> where sel = 'X'.

write:/ <p_out>-region, <p_out>-area.

endloop.

set pf-status ZSTATS'.

leave to list-processing.

regards,darek

Read only

0 Likes
2,101

hi,

prepare your status gui ZSTATS for list with ok_code: BACK/ENDE/CANC..

and change code:

loop at it_out ASSIGNING <p_out> where sel = 'X'.

write:/ <p_out>-region, <p_out>-area.

endloop.

set pf-status 'ZSTATS'.

leave to list-processing.

regards,darek

Read only

0 Likes
2,101

hi,

prepare your status gui ZSTATS for list with ok_code: BACK/ENDE/CANC..

and change code:

loop at it_out ASSIGNING <p_out> where sel = 'X'.

write:/ <p_out>-region, <p_out>-area.

endloop.

set pf-status 'ZSTATS'.

leave to list-processing.

regards,darek

Read only

Former Member
0 Likes
2,101

hi,

add to your code:

loop at it_out ASSIGNING <p_out> where sel = 'X'.

write:/ <p_out>-region, <p_out>-area.

endloop.

leave to list-processing.

regards,darek

Read only

Former Member
0 Likes
2,101

HI,

In the Exporting parameter of the FM too you need to set the folowing


      i_callback_pf_status_set = 'ZPF' 
      i_callback_user_command  = 'ALV_USER_COMMAND'

Hope it helps.

Regards,

Mansi

Read only

Former Member
0 Likes
2,101

Hi,

try like this..



FORM alv_user_command
  USING ucomm               TYPE syucomm
        selfield            TYPE slis_selfield.                          "#EC_CALLED
 
  FIELD-SYMBOLS:
    <p>                     type t_out.

  CHECK NOT selfield-value IS INITIAL.  "Add this Line 

  IF ucomm = '&DATA_SAVE'.
 
    loop at it_out ASSIGNING <p_out> where sel = 'X'.
      write:/ <p_out>-region, <p_out>-area.
    endloop.
 
    selfield-refresh    = 'X'.
    selfield-row_stable = 'X'.
    selfield-col_stable = 'X'.
 
  ENDIF.
 
ENDFORM.  

Regards,

Prabhudas

Read only

Former Member
0 Likes
2,101

check that sy-ucom = compare value is not comming correct. that why its not printing.

Read only

Former Member
0 Likes
2,101

hi,

prepare your status gui ZSTATS for list with ok_code BACK/ENDE/CANC..

and change code:

loop at it_out ASSIGNING <p_out> where sel = 'X'.

write:/ <p_out>-region, <p_out>-area.

endloop.

set pf-status 'ZSTATS'.

leave to list-processing.

regards,darek

Read only

rainer_hbenthal
Active Contributor
0 Likes
2,101

I tried out every suggestion, having now my own gui status, but still when i entered the list processing i'm not able to leave it any more. The only way i have is to enter a transaction code.

Read only

rainer_hbenthal
Active Contributor
0 Likes
2,101

At least i coded a second ALV scenerio which is called in the user command of the first one.

Unforunatetly, none of the suggested solution worked.