Application Development 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: 

GUI Status

Former Member
0 Kudos

Hi All,

How to specify GUI status in a report program based on some condition.

OR

Change the GUI status of a report during run time.

Any suggestions?

Thanks

1 ACCEPTED SOLUTION

Former Member
0 Kudos

Hi,

Use this stmt.

SET PF-STATUS <stat> [EXCLUDING <f>|<itab>]

[OF PROGRAM <prog>]

[IMMEDIATELY].

http://help.sap.com/saphelp_nw04/helpdata/en/9f/dba3ae35c111d1829f0000e829fbfe/frameset.htm

Svetlin

6 REPLIES 6

Former Member
0 Kudos

Hi,

Use this stmt.

SET PF-STATUS <stat> [EXCLUDING <f>|<itab>]

[OF PROGRAM <prog>]

[IMMEDIATELY].

http://help.sap.com/saphelp_nw04/helpdata/en/9f/dba3ae35c111d1829f0000e829fbfe/frameset.htm

Svetlin

Former Member
0 Kudos

If you are trying to set a gui status in selection screen you can specify SET PF-STATUS <NNN> in the event "AT SELECTION-SCREEN OUTPUT".

If you are trying to set a gui status in list screen you can specify SET PF-STATUS <NNN> in the event "TOP OF PAGE". <NNN> can be a variable to which you can pass value at run time based on your IF ELSEIF conditions .

( The GUI status should be created in the program prior to use i.e. those GUI status should exit.)

You can use

IF COND1.

PFSTAT = '001'.

ELSE.

PFSTAT = '002'.

ENDIF.

SET PF-STATUS PFSTAT.

Dont forget to reward if answers helped.

Cheers

0 Kudos

Hi Sanjay,

Thanks for your reply.

My code is as follows

IF Equip NE ''.

SET PF-STATUS 'MAIN' of Program 'RCS11001'.

CALL FUNCTION 'CONVERSION_EXIT_ALPHA_INPUT'

EXPORTING

input = Equip

IMPORTING

output = Equip.

SELECT stlnr INTO eqst-stlnr FROM eqst WHERE equnr IN Equip.

SELECT SINGLE idnrk INTO stpo-idnrk FROM stpo

WHERE stlnr EQ eqst-stlnr.

CALL FUNCTION 'RFC_DISPLAY_BILL_OF_MATERIAL'

EXPORTING

bom_action = '1'

bom_application = ' '

material = stpo-idnrk

plant = '2001'

bom_alternative = ' '

change_number = ' '

valid_from = ' '

revision_level = ' '

bom_type = ' '

skip_first_screen = 'x'

IMPORTING

function_code = l_test

TABLES

sap_field_data = sap_field_data

dms_class_data = dms_class_data.

ENDSELECT.

IF l_test EQ 'BACK' "Back

OR l_test EQ 'ENDE' "Exit

OR l_test EQ 'ABBR'. "Cancel

submit ZPM_RIMARA20 via selection-screen.

ENDIF.

When I run the program system displays the output but when I click back icon it takes me to a blank screen, which I want to avoid.

How can I do this.

Thanks

Former Member
0 Kudos

Instead of trying GUI STATUS why dont your try

submit ZPM_RIMARA20 via selection-screen <b>and return</b>.

I hope this will fix the issue of "BACK" button.

If at you want to set the GUI status you will have to do it in the program ZPM_RIMARA20 and write code for handling "BACK" button in this program only. Just by setting GUI status will not help.

Also check what is coded for "BACK" in program ZPM_RIMARA20 .

Cheers

0 Kudos

Hi Sanjay.

Thanks a lot for your reply.

Problem fixed.

I found that function code returned is F03 for back icon.

So I have changed my code to

IF fn_code EQ 'F03' "Back

OR fn_code EQ 'F15'

OR fn_code EQ 'F12'.

SUBMIT zpm_rimara20 VIA SELECTION-SCREEN.

ENDIF.

Former Member
0 Kudos

Hi Pratibha,

Can you close this thread if problem solved .

Dont forget to reward if answers helped.

Cheers