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

Call screen

Former Member
0 Likes
1,280

Hi,

i m calling screen from report and and in output where does my pf-status ok_code (for buttons in application toolbar of report) will be set.

when i m clicking button (back, exit ,fagr )in application tool bar they r not working.

so plzz help me out.

my code is....

START-OF-SELECTION.

SET PF-STATUS 'S100'.

WRITE : '//'.

IF sy-ucomm IS INITIAL .

SET USER-COMMAND 'GETSCR' .

ENDIF .

AT USER-COMMAND .

CASE SY-UCOMM.

WHEN 'GETSCR'.

CLEAR SY-UCOMM.

CALL SCREEN '0100'.

WHEN 'FAGR'.

...................................

WHEN 'SAGR' .

WHEN 'BACK'.

SET SCREEN 0.

LEAVE SCREEN.

WHEN 'EXIT'.

LEAVE TO SCREEN 0.

WHEN 'CANC'.

LEAVE TO SCREEN 0.

ENDCASE.

\[removed by moderator\]

Regards,

Devi.

Edited by: Jan Stallkamp on Jul 29, 2008 5:29 PM

7 REPLIES 7
Read only

Former Member
0 Likes
827

hi use this..

START-OF-SELECTION.

SET PF-STATUS 'S100'.

AT USER-COMMAND .

CASE SY-UCOMM.

WHEN 'GETSCR'.

CALL SCREEN '0100'.

WHEN 'FAGR'.

...................................

WHEN 'SAGR' .

WHEN 'BACK'.

SET SCREEN 0.

LEAVE SCREEN.

WHEN 'EXIT'.

LEAVE TO SCREEN 0.

WHEN 'CANC'.

LEAVE TO SCREEN 0.

ENDCASE.

Read only

Former Member
0 Likes
827

this will help u

tables :BUT000 .

type-pools SLIS.

data : IT_ZEFL_BP_LOCATION type standard table of ZEFL_BP_LOCATION

initial size 0,

IT_BUT000 type standard table of BUT000

initial size 0.

data WA_ZEFL_BP_LOCATION type ZEFL_BP_LOCATION.

data : PARTNER_NO type CRMT_PARTNER_NO,

LOCATION type LGORT_D,

PLANT type WERKS_D,

ACTUAL_PLANT type ZWERKS_D.

data : V_RC type SY-SUBRC.

data : WA_ZEFL_BP_LOCN_LOG type ZEFL_BP_LOCN_LOG.

selection-screen begin of block BLK1 with frame title TEXT-001.

parameters:PR_PART type BUT000-PARTNER.

selection-screen end of block BLK1 .

at selection-screen on exit-command.

if SY-UCOMM = 'ECAN' or SY-UCOMM = 'ENDE' or SY-UCOMM = 'E'

or SY-UCOMM = 'CCAN' or SY-UCOMM = 'CEND' or SY-UCOMM = 'CBAC'.

leave program.

endif.

start-of-selection.

    • get ZEFL_BP_LOCATION

perform GET_ZEFL_BP_LOCATION.

if SY-SUBRC = 0.

read table IT_ZEFL_BP_LOCATION into WA_ZEFL_BP_LOCATION

index 1.

call screen 2000 starting at 0 8.

else.

perform GET_BUT000. " Get customer Table

if SY-SUBRC = 0.

  • clear wa_zemplimit.

call screen 2000 starting at 0 8.

else.

message 'Invalid Partner Code' type 'E'.

endif.

endif.

&----


*& Form GET_ZEFL_BP_LOCATION

&----


  • text

----


form GET_ZEFL_BP_LOCATION .

call function 'CONVERSION_EXIT_ALPHA_OUTPUT'

exporting

INPUT = PR_PART

importing

OUTPUT = PR_PART.

.

select * from ZEFL_BP_LOCATION

into table IT_ZEFL_BP_LOCATION

where PARTNER_NO = PR_PART.

endform. " GET_ZEFL_BP_LOCATION

&----


*& Form GET_KNA1

&----


  • text

----


  • --> p1 text

  • <-- p2 text

----


form GET_BUT000 .

select * from BUT000

into table IT_BUT000

where PARTNER = PR_PART.

endform. " GET_KNA1

&----


*& Module USER_COMMAND_2000 INPUT

&----


  • text

----


module USER_COMMAND_2000 input.

case SY-UCOMM.

when 'SAVE'.

perform UPDATE_LOG.

when 'REJECT'.

message 'Not updated' type 'I'.

call selection-screen 1000.

endcase.

endmodule. " USER_COMMAND_2000 INPUT

&----


*& Module STATUS_2000 OUTPUT

&----


  • text

----


module STATUS_2000 output.

  • SET PF-STATUS 'STANDARD'.

  • SET TITLEBAR 'xxx'.

perform GET_ZEFL_BP_LOCATION.

if SY-SUBRC = 0.

read table IT_ZEFL_BP_LOCATION into WA_ZEFL_BP_LOCATION

index 1.

endif.

PARTNER_NO = PR_PART.

if PARTNER_NO ge 80000.

loop at screen .

if SCREEN-NAME = 'LOCATION'.

SCREEN-INPUT = '0'.

SCREEN-OUTPUT = '0'.

modify screen.

endif.

modify screen.

endloop.

endif.

LOCATION = WA_ZEFL_BP_LOCATION-LOCATION.

PLANT = WA_ZEFL_BP_LOCATION-PLANT.

ACTUAL_PLANT = WA_ZEFL_BP_LOCATION-ACTUAL_PLANT.

endmodule. " STATUS_2000 OUTPUT

&----


*& Form UPDATE_LOG

&----


  • text

----


form UPDATE_LOG .

WA_ZEFL_BP_LOCN_LOG-ZDATE = SY-DATUM.

WA_ZEFL_BP_LOCN_LOG-ZTIME = SY-UZEIT.

WA_ZEFL_BP_LOCN_LOG-USER_ID = SY-UNAME.

WA_ZEFL_BP_LOCN_LOG-PARTNER_NO = PARTNER_NO.

WA_ZEFL_BP_LOCN_LOG-LOCATION = LOCATION.

WA_ZEFL_BP_LOCN_LOG-PLANT = PLANT.

WA_ZEFL_BP_LOCN_LOG-ACTUAL_PLANT = ACTUAL_PLANT.

WA_ZEFL_BP_LOCATION-PARTNER_NO = PARTNER_NO.

WA_ZEFL_BP_LOCATION-LOCATION = LOCATION.

WA_ZEFL_BP_LOCATION-PLANT = PLANT.

WA_ZEFL_BP_LOCATION-ACTUAL_PLANT = ACTUAL_PLANT.

update ZEFL_BP_LOCATION from WA_ZEFL_BP_LOCATION.

if SY-SUBRC ne 0.

insert into ZEFL_BP_LOCATION values WA_ZEFL_BP_LOCATION.

V_RC = 1.

endif.

if V_RC = 1.

WA_ZEFL_BP_LOCN_LOG-TYPE = 'N'.

else.

WA_ZEFL_BP_LOCN_LOG-TYPE = 'M'.

endif.

insert into ZEFL_BP_LOCN_LOG values WA_ZEFL_BP_LOCN_LOG.

message 'Entry Updated' type 'I'.

call selection-screen 1000.

call function 'CONVERSION_EXIT_ALPHA_OUTPUT'

exporting

INPUT = PR_PART

importing

OUTPUT = PR_PART.

.

endform. " UPDATE_LOG

Regards

Anbu

Read only

Former Member
0 Likes
827

hi,

If you have created your own PF-STATUS then you will have to define the actions need to performed when a ok_code is triggered. Thats the reason the back, exit, cancel buttons wont work in the called screen.



SAVE_OK = OK_CODE.

CASE SAVE_OK.

    WHEN 'SALL'.

      PERFORM mark_all_checkboxes.

    WHEN 'DALL'.

      PERFORM demark_all_checkboxes.

    WHEN 'F15'.                                                 " Function code for Back button

      LEAVE SCREEN.

    WHEN '&F12'.                                               " Function code for Exit button

      LEAVE PROGRAM.

  ENDCASE.            

Read only

Former Member
0 Likes
827

Hi,

U have to set the code for the buttons in the screen PBO and PAI.

Module PBO_200.

Set pf_status 'STATUS'.

in PAI of 200.

case sy-ucomm.

when 'save'.

ur code.

when 'back'.

leave to screen 0.

endcase.

Hope it helps you.

Read only

Former Member
0 Likes
827

Hi,

After set screen 0, you can leave the screen (100 ) by giving LEAVE SCREEN Statement.

Read only

Former Member
0 Likes
827

Hi Devi Raju,

The report should of this format:

start-of-selection.
call screen 100.

in screen 100 Flow logic:

PBO.
module status_100.

PAI.
module user_command.

in the report:

module status_100.
set pf-status 'STAT'.

module user_command.

CASE SY-UCOMM.
WHEN 'GETSCR'.
CLEAR SY-UCOMM.
CALL SCREEN '0100'.

WHEN 'FAGR'.
...................................

WHEN 'SAGR' .

WHEN 'BACK'.
SET SCREEN 0.
LEAVE SCREEN.
WHEN 'EXIT'.
LEAVE TO SCREEN 0.
WHEN 'CANC'.
LEAVE TO SCREEN 0.

ENDCASE.

So, your Usercommand should be PAI.

Regards,

Shailaja

Read only

Former Member
0 Likes
827

START-OF-SELECTION.

SET PF-STATUS 'STATUS'.

AT USER-COMMAND .

CASE SY-UCOMM.

WHEN 'GETSCR'.

CALL SCREEN '1000'.

WHEN 'BACK' or 'EXIT' or 'CANC'.

LEAVE SCREEN.

ENDCASE.