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

back button is not working-urgent

Former Member
0 Likes
3,989

hi ,

i created my own pf status by using following function modue. it is showing pf status correct. in my pf status i keep back and exit buttons only. when i execute the following report it is showing back and exit buttons only. when i click back button action is not performing . any body can tell why the action is not working . i activated my pf status also. if possible send me the sample code.

iam sending my code below....

selection-screen: begin of block b1.

parameters : p_appln type mara-matnr.

parameters : p_user type marc-werks.

selection-screen: end of block b1.

data: begin of exclude occurs 0,

func(10) type c,

end of exclude.

At selection-screen output.

  • set pf-status 'SELK'. <-- Comment this line

if sy-dynnr eq '1000'.

call function 'RS_SET_SELSCREEN_STATUS'

exporting

p_status = 'SELK'

tables

p_exclude = exclude

exceptions

others = 1.

endif.

thanks,

maheedhar.t

1 ACCEPTED SOLUTION
Read only

RichHeilman
Developer Advocate
Developer Advocate
0 Likes
2,529

In your pf-status, do the back and exit icons have the appropriate fcodes assigned to them?

Regards,

Rich Heilman

8 REPLIES 8
Read only

RichHeilman
Developer Advocate
Developer Advocate
0 Likes
2,530

In your pf-status, do the back and exit icons have the appropriate fcodes assigned to them?

Regards,

Rich Heilman

Read only

0 Likes
2,529

It appears that you will need to add this code in order for the buttons to work.



AT selection-screen.
  CASE sy-ucomm.
    WHEN 'BACK' OR 'EXIT'.
      LEAVE PROGRAM.
  ENDCASE.

REgards,

Rich Heilman

Read only

0 Likes
2,529

if you see in debugging sy-ucomm becomes blank. enthough it wont work. i already tried with this statement.

thanks,

maheedhar.t

Read only

0 Likes
2,529

Did you set the FCODEs for this icons in your status?

Regards,

RIch heilman

Read only

Former Member
0 Likes
2,529

Are you setting the status for your selection screen and want the BACK button to work in the selection screen? Since it is your own pf-status, you will have to write the code for it in AT SELECTION-SCREEN.


TABLES: sscrfields.

AT SELECTION-SCREEN.

  CASE sscrfields-ucomm.
    WHEN 'BACK'.
      SET SCREEN 0.
      LEAVE SCREEN.
    WHEN OTHERS.
  ENDCASE.

Read only

Former Member
2,529

Please assign the function codes to the back button and use the function code in your program for a particulat action.

Check this piece of code might help you.

----


  • call the ABAP list viewer *

----


FORM list_display TABLES a_output.

pgm = disvariant-report = sy-repid.

disvariant-variant = variant.

  • call list viewer

CALL FUNCTION 'REUSE_ALV_LIST_DISPLAY'

EXPORTING

i_callback_program = pgm

i_callback_pf_status_set = 'SET_PF_STATUS'

it_fieldcat = fieldcat

is_layout = layout

is_print = print

i_save = 'A'

it_events = eventcat

it_sort = sortcat

i_callback_user_command = '<b>USER_COMMAND'</b>

TABLES

t_outtab = a_output

EXCEPTIONS

program_error = 1

OTHERS = 2.

ENDFORM. "LIST_DISPLAY

*----


    • FORM SET_PF_STATUS *

*----


FORM set_pf_status USING extab TYPE slis_t_extab.

SET PF-STATUS 'STATUS1'.

ENDFORM. "set_pf_status

*----


    • FORM USER_COMMAND *

*----


FORM user_command USING ucomm LIKE sy-ucomm

selfield TYPE slis_selfield.

DATA t_difference TYPE i.

CASE ucomm.

WHEN 'ENT1'. <--The function code.

Shreekant

Read only

Former Member
0 Likes
2,529

Hi mahender,

Here is the you need to add at AT SELECTION SCREEN event

TABLES: sscrfields.

AT SELECTION-SCREEN.

CASE SY-UCOMM.

WHEN 'BACK'.

SET SCREEN 0.

LEAVE SCREEN.

WHEN 'EXIT'.

LEAVE PROGRAM.

ENDCASE.

Regards

Sudheer

Read only

Former Member
0 Likes
2,529

Hi,

when you are not excluding any std buttons functionality.Try to use the set pf-status and set the function for the back button as "BACK" and clear the sy-ucomm after list display.