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: 

Regarding PF-STATUS in Dialog Programming

Former Member
0 Kudos

Hi All,

I have some issues with PF-STATUS functionality in my Dialog screen.

I have initially one PF-STATUS.

That i have used in screen 100 & 200.

In both Screens i Will have one Button on application tool bar.

so now i have created one PF-STATUS called 300 with one Button initially i named it as PRINT and it's icon text as Print SPI. this should come in 100 screen. Now in screen 200 same PF-STATUS i have used NOw that button also getting displayed in 200 screen APplication tool bar.

Now i want to change the icon text in 200 screen as DELETE instead of Print SPI which was displayed in previous screen how can i do it.

In this case i am not able to use diffrent PF-STATUS's i have to use same PF-STATUS.

If any body knows the solution please post it!

Thanks in advance.

Thanks & Regards,

Prasad.

14 REPLIES 14

RichHeilman
Developer Advocate
Developer Advocate
0 Kudos

Put all buttons in one status and exclude the ones that you don't want to show using the EXCLUDE extension of the SET PF-STATUS statement.

Regards,

Rich Heilman

0 Kudos

Here is an example of using an ITAB to exclude more than one Fcode in a status.





types: begin of tab_type,
        fcode like rsmpe-func,
       end of tab_type.

data: tab type standard table of tab_type with
               non-unique default key initial size 10,
      wa_tab type tab_type.

clear tab.
move 'DELE' to wa_tab-fcode.
append wa_tab to tab.
move 'PRIN' to wa_tab-fcode.
append wa_tab to tab.

set pf-status 'STA3' excluding tab.


You can exlude just one fcode by doing this.

set pf-status 'STA3' excluding 'DELE'.

Regards,

Rich Heilman

0 Kudos

Hi,

That is not my case.

In my application i have only one Button in tool bar its properties are declared as follow:

Function Code - DELE

Function Text - Print SPI

Icon Name - ICON_PRINT

Icon Text - Print SPI

Info Text - Print SPI

This is what i should get in screen 100.

where i have written SET PF-STAUS '300'.

Now in screen 300, I will call same SET PF-STAUS '300'.

But My icon Name[ICON]& Icon Text should change to DELETE[ICON] & DELETE.

How can i do it.

Here why i am using single PF-STATUS is while creating new one DELETE is coming but in standard tool bar is SAVE & all other things are coming as disabled.

Can anybody have the solution.

Thanks,

Prasad.

0 Kudos

Just create two different buttons, one for PRINT and another for DELETE. Use SET PF-STATUS '300' EXCLUDING 'DELETE' in the first screen and SET PF-STATUS '300' EXCLUDING 'PRINT' in the next screen.

0 Kudos

Maybe you were missing my point. I think it will be easiest to have to separate buttons with the separate text, and depending on what screen you are on, only show 1 of the buttons. You can do this by using the EXCLUDING extension that I have described above. Does this make sense?

Regards,

Rich Heilman

0 Kudos

HI,

I am not able to create new Button in APPlication Tool Bar.

One Button Already exist there.

When i give new Button as DELE and hit Enter i am getting a message as

<b>Function code DELE has not been assigned to a function key</b>.

Can anybody tell me what is the issue over here!

Thanks.

0 Kudos

When you create a new button on the application toolbar, it should have asked you to assign a function key(F1, F2 etc). You can also do it under the function keys section in SE41.

> HI,

>

> I am not able to create new Button in APPlication

> Tool Bar.

>

> One Button Already exist there.

>

> When i give new Button as DELE and hit Enter i am

> getting a message as

> <b>Function code DELE has not been assigned to a

> function key</b>.

>

> Can anybody tell me what is the issue over here!

>

> Thanks.

0 Kudos

Also it should have asked you whether you want to have static text or dynamic text.

You cannot have just one button and change the function code, icon, and the text dynamically.

0 Kudos

Hi,

When i am trying to create new button on application tool bar. As soon as i enter text and hit eneter it is displaying following message.

When i give new Button as <b>DELE</b> and hit Enter i am getting a message as

<b>Function code DELE has not been assigned to a function key.</b>

Thanks,

Prasad.

Former Member
0 Kudos

1. Go to the PF-STATUS through SE41.

2. Create a item in applicatio toolbar by assigning a function code to it.

3. Now Double click on it and give a field name to the dynamic function text say ('L_FIELD').

4. Now declare a variable in your programe with same name of type SMP_DYNTXT.

5. in the PBO of the current screen Assign value to SMP_DYNTXT-TEXT depending on what text you want to display.

0 Kudos

Hi,

But in this case ICON on Button is not getting displayed only text is displayed.

Though i have used ICON_ID field of SMP_DYNTXT.

My code is as below:

DATA: L_PRINT TYPE SMP_DYNTXT.

L_PRINT-ICON_ID = 'ICON_PRINT'.

L_PRINT-ICON_TEXT = 'TEXT'.

L_PRINT-TEXT = 'TEXT'.

Can anybody give me solution for the same.

Also Can anybody tell me why i am not able to add 2nd button to Application tool bar of PF-STATUS.

Thanks,

Prasad.

Former Member
0 Kudos

hii

well i am sending u a example of a program wherer u can use the same pf-status by excluding .

START-OF-SELECTION.

SET PF-STATUS 'TEST' EXCLUDING 'EXP'.

PERFORM get_vbak_data.

PERFORM get_vbap_data.

END-OF-SELECTION.

PERFORM display_report.

TOP-OF-PAGE.

WRITE:/1 'Run Date:', 11 sy-datum.

ULINE AT /1(37).

WRITE:/1 '|',2(10) 'Document #', 12 '|', 13(5) 'Ln #',

18 '|',19(18) 'Material #', 37 '|'.

ULINE AT /1(37).

TOP-OF-PAGE DURING LINE-SELECTION.

IF sy-ucomm = 'SUMM'.

WRITE:/1 'Summary Report'.

WRITE:/1 'Run Date:', 11 sy-datum.

ULINE AT /1(18).

WRITE:/1 '|', 2(10) 'Document #', 12'|', 13(05) 'Ln #', 18'|'.

ULINE AT /1(18).

ENDIF.

AT USER-COMMAND.

DATA: BEGIN OF t_code OCCURS 0,

tcode LIKE sy-ucomm,

END OF t_code.

t_code-tcode = 'SUMM'.

APPEND t_code.

t_code-tcode = 'DTL'.

APPEND t_code.

IF sy-ucomm = 'SUMM'.

SET PF-STATUS 'TEST' EXCLUDING t_code.

LOOP AT t_vbap.

WRITE:/1 '|',2(10) t_vbap-vbeln,

12 '|', 13(5) t_vbap-posnr,

18 '|'.

ULINE AT /1(18).

ENDLOOP.

ENDIF.

IF sy-ucomm = 'DTL'.

WRITE:/1 'HAPPY NEW YEAR'.

ENDIF.

&----


*& Form get_vbak_data

&----


  • text

----


  • --> p1 text

  • <-- p2 text

----


FORM get_vbak_data .

SELECT vbeln vkorg INTO TABLE t_vbak FROM vbak

WHERE vkorg IN s_vkorg.

IF sy-subrc <> 0.

MESSAGE i398(00) WITH 'No Data Exists in VBAK'(002).

LEAVE LIST-PROCESSING.

ENDIF.

ENDFORM. " get_vbak_data

&----


*& Form get_vbap_data

&----


  • text

----


  • --> p1 text

  • <-- p2 text

----


FORM get_vbap_data .

SELECT vbeln posnr matnr INTO TABLE t_vbap FROM vbap

FOR ALL ENTRIES IN t_vbak

WHERE vbeln = t_vbak-vbeln.

IF sy-subrc <> 0.

MESSAGE i398(00) WITH 'No Data Exists in VBAP'(003).

LEAVE LIST-PROCESSING.

ENDIF.

ENDFORM. " get_vbap_data

&----


*& Form display_report

&----


  • text

----


  • --> p1 text

  • <-- p2 text

----


FORM display_report .

LOOP AT t_vbap.

WRITE:/1 '|',2(10) t_vbap-vbeln ,

12 '|', 13(5) t_vbap-posnr,

18 '|',19(18) t_vbap-matnr, 37 '|'.

HIDE: t_vbap.

ULINE AT /1(37).

ENDLOOP.

ENDFORM. " display_report

thanks

pradiptakumar_mishra
Participant
0 Kudos

Dear Prasad,

While defining your button, press enter and give text type as dynamic text. Declare a field in your top-include type c.

then as per your condition, give the text in that field.

am sending you a sample code.

DATA : var_txt(10) TYPE c.

when sy-dynnr = 100.

var_txt = 'text1'.

when sy-dynnr = 200.

var_txt = 'text2'.

it'll automatically change the text.

this will solve your issue.

With Regards

Pradipta K Mishra

pradiptakumar_mishra
Participant
0 Kudos

You don't have to create two buttons. Also, mention this in your PBO and no need to give any excluding addition or anything else.

I've forgotten to mention this in the last reply.

With Regards

Pradipta k Mishra