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

GUI Status - Report program

Former Member
0 Likes
3,248

Hi Experts

How to create toolbar in the Report program.

ie how to add gui status and how to code for it.

Pls suggest me.

Thanks in advance.

Regards

rajaram

15 REPLIES 15
Read only

Former Member
0 Likes
1,978

Go to SE80 -> right-click on your program name -> create GUI status

Add your item in Application Toolbar and give it a function code (eg. 'SAVE')

Add the following code in your report:

FORM user_command USING p_l_ucomm LIKE sy-ucomm

p_l_selfl TYPE slis_selfield.

CASE p_l_ucomm.

WHEN 'SAVE'.

PERFORM save_data.

WHEN OTHERS.

ENDCASE.

ENDFORM. " USER_COMMAND

Read only

0 Likes
1,978

Hi

This is my coding part inwhich i want to add a button in toolbar, Can you change this coding that where exactly changes needed and what.

Pls help me.

Regards

Rajaram

REPORT ZSAB_POLY_INVOICE.

tables : vbrp, vbrk, vbap.

DATA : BEGIN OF it_final OCCURS 0.

INCLUDE STRUCTURE ZINV_ORG.

DATA : END OF it_final.

data : wa like line of it_final.

data : mode type string.

data : flag type i,

flag1 type i.

DATA : fm_name TYPE rs38l_fnam.

DATA : w_formname TYPE tdsfname. "form name

w_formname = 'Z_POLY_ORGINAL'.

DATA: LX_OUTPUT TYPE SSFCOMPOP,

LX_CNTL TYPE SSFCTRLOP.

LX_CNTL-NO_DIALOG = 'X'.

LX_OUTPUT-TDDEST = 'LP01'.

SELECTION-SCREEN BEGIN OF BLOCK bk1 WITH FRAME TITLE text-001.

PARAMETERS vbeln TYPE vbrk-vbeln matchcode object ZINVOICE.

PARAMETERS rtim TYPE vbrk-ERZET.

SELECTION-SCREEN END OF BLOCK bk1.

SELECTION-SCREEN BEGIN OF BLOCK b2 WITH FRAME TITLE text-002.

parameter : p_org as checkbox,

p_dup as checkbox,

p_tri as checkbox,

p_qua as checkbox.

SELECTION-SCREEN END OF BLOCK b2.

select a~vbeln

a~bukrs

b~posnr

b~werks

a~stceg

a~FKDAT

a~INCO1

a~INCO2

b~MATNR

b~ARKTX

b~FKIMG

b~UEPOS

from vbrk as a

inner join vbrp as b on avbeln = bvbeln

into corresponding fields of table it_final

where a~vbeln = vbeln.

break pro01.

if p_org is not initial and p_dup is not initial

and p_tri is not initial and p_qua is not initial.

mode = 'Original for Buyer'.

perform original.

mode = 'Duplicate'.

perform original.

mode = 'Triplicate'.

perform original.

mode = 'Quadruplicate'.

perform original.

elseif p_org is not initial and p_dup is not initial

and p_tri is not initial.

mode = 'Original for Buyer'.

perform original.

mode = 'Duplicate'.

perform original.

mode = 'Triplicate'.

perform original.

elseif p_dup is not initial and p_tri is not initial

and p_qua is not initial.

mode = 'Duplicate'.

perform original.

mode = 'Triplicate'.

perform original.

mode = 'Quadruplicate'.

perform original.

elseif p_org is not initial and p_dup is not initial.

mode = 'Original for Buyer'.

perform original.

mode = 'Duplicate'.

perform original.

elseif p_tri is not initial and p_qua is not initial.

mode = 'Triplicate'.

perform original.

mode = 'Quadruplicate'.

perform original.

elseif p_org is not initial and p_tri is not initial.

mode = 'Original for Buyer'.

perform original.

mode = 'Triplicate'.

perform original.

elseif p_dup is not initial and p_tri is not initial

and p_qua is not initial.

mode = 'Original for Buyer'.

perform original.

mode = 'Duplicate'.

perform original.

mode = 'Triplicate'.

perform original.

elseif p_org is not initial.

mode = 'Original for Buyer'.

perform original.

endif.

&----


*& Form original

&----


  • text

----


  • --> p1 text

  • <-- p2 text

----


FORM original .

CALL FUNCTION 'SSF_FUNCTION_MODULE_NAME'

EXPORTING

formname = w_formname

  • VARIANT = ' '

  • DIRECT_CALL = ' '

IMPORTING

FM_NAME = fm_name

EXCEPTIONS

NO_FORM = 1

NO_FUNCTION_MODULE = 2

OTHERS = 3

.

IF sy-subrc <> 0.

MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO

WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.

ENDIF.

CALL FUNCTION '/1BCDWB/SF00000447'

EXPORTING

RTIM = RTIM

MODE = MODE

*ARCHIVE_INDEX =

*ARCHIVE_INDEX_TAB =

*ARCHIVE_PARAMETERS =

CONTROL_PARAMETERS = LX_CNTL

*MAIL_APPL_OBJ =

*MAIL_RECIPIENT =

*MAIL_SENDER =

OUTPUT_OPTIONS = LX_OUTPUT

*USER_SETTINGS = 'X'

*BOL_NUM =

*CARRIER_NAME =

*SHIP_FROM_ADR =

*SHIP_TO_ADR =

*THIRD_PARTY_ADR =

*IMPORTING

*DOCUMENT_OUTPUT_INFO =

*JOB_OUTPUT_INFO =

TABLES

it_final = it_final

.

IF sy-subrc = 0.

*MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO

*WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.

ENDIF.

ENDFORM.

Read only

kesavadas_thekkillath
Active Contributor
0 Likes
1,978

Its just simple.

Just type SET PF-STATUS 'TEST'. in ur program and double click in on that.

Then It will ask for creation of GUI STATUS. press enter.

Give short description for that GUI STATUS.

Then one screen will appear where you can find

Menu bar

Application toolbar

Function keys

-


You can create buttons in Application toolbar...

Click on arrow which will appear next to Application toolbar. There is a provision to create ur own buttons. Type ur button name ( This is function code ) in the field and click just bellow, where u can find the HOT SPOT ( Hand Symbol ).

Choose text type as Static and press enter...

Then u need to fill

Function text

Icon name ( optional )

Info. text

after filling the above things... press enter... then it will ask for shortcut key... choose the key and fill

Function text

Icon name

Icon text

Info. text

Fastpath

and press enter..... Then ACTIVATE(Ctrl+F3) the GUI STATUS. then go to your program on pressing Esc.

Then in user-command function in program give the function code also in the case statement...

ex...

case sy-ucomm.

....

when '<ur Function code>',

.....

......

.....

endcase.

reward If Helpful

****************sample code***************

SET PF-STATUS 'Z_EJO_PENDING'.

AT USER-COMMAND .

CASE SY-UCOMM.

WHEN 'LEFT'.

SCROLL LIST TO COLUMN 0.

WHEN 'MAT'.

SCROLL LIST TO COLUMN 70.

WHEN 'HEW'.

SCROLL LIST RIGHT BY 5 PLACES .

WHEN 'SORT1'. <-----functon code

PERFORM SORT_BY_EJO_NUMBER .

PERFORM WRITE_REPORT .

WHEN 'SORT2'.

PERFORM SORT_BY_EJO_DATE.

PERFORM WRITE_REPORT .

WHEN 'SORT3'.

PERFORM SORT_BY_EJO_MATERIAL .

PERFORM WRITE_REPORT .

WHEN 'SORT4'.

PERFORM SORT_BY_EJO_DEPARTMENT .

PERFORM WRITE_REPORT .

WHEN 'SORT5'.

PERFORM SORT_BY_EJO_REASON .

PERFORM WRITE_REPORT .

WHEN 'SORT6'.

PERFORM SORT_BY_EJO_PENDING_DAYS .

PERFORM WRITE_REPORT .

ENDCASE.

Read only

0 Likes
1,978

Hi

I have created the GUI Status, but the button is not displayed on the report.

what could be the reason actuallly.

Regards

Rajaram

Read only

0 Likes
1,978

Have u given set-pf status <name>.

Read only

0 Likes
1,978

AT SELECTION-SCREEN OUTPUT.

SET PF-STATUS 'POLY'.

END-OF-SELECTION.

AT USER-COMMAND.

CASE SY-UCOMM.

WHEN 'EXEC'.

PERFORM PRINT.

WHEN 'PREV1'.

ENDCASE.

i have used the above code, inwhich the AT USER-COMMAND part is not working.

what could be the reason, can anyone help me.

Regards

Rajaram

Read only

0 Likes
1,978

give ur pf ststus before start-of-selection.

Read only

0 Likes
1,978

try like this

SET PF-STATUS 'POLY'.

AT SELECTION-SCREEN OUTPUT.

AT USER-COMMAND.

CASE SY-UCOMM.

WHEN 'EXEC'.

PERFORM PRINT.

WHEN 'PREV1'.

ENDCASE.

start-of-selection.

END-OF-SELECTION.

Read only

0 Likes
1,978

Yes i have given set pf status also,but still am not able to get the sy-ucomm value.

AT SELECTION-SCREEN OUTPUT.

SET PF-STATUS 'POLY'.

AT USER-COMMAND.

CASE SY-UCOMM.

WHEN 'EXEC'.

PERFORM PRINT.

WHEN 'PREV1'.

ENDCASE.

END-OF-SELECTION.

Read only

0 Likes
1,978

check my last post.....

Read only

0 Likes
1,978

You mean as follows

SET PF-STATUS 'POLY'.

AT SELECTION-SCREEN OUTPUT.

AT USER-COMMAND.

CASE SY-UCOMM.

WHEN 'EXEC'.

PERFORM PRINT.

WHEN 'PREV1'.

ENDCASE.

start-of-selection.

SELECTION-SCREEN BEGIN OF BLOCK bk1 WITH FRAME TITLE text-001.

PARAMETERS vbeln TYPE vbrk-vbeln matchcode object ZINVOICE.

PARAMETERS rtim TYPE vbrk-ERZET.

SELECTION-SCREEN END OF BLOCK bk1.

SELECTION-SCREEN BEGIN OF BLOCK b2 WITH FRAME TITLE text-002.

parameter : p_org as checkbox,

p_dup as checkbox,

p_tri as checkbox,

p_qua as checkbox.

SELECTION-SCREEN END OF BLOCK b2.

its also not working yar, pls correct this code in the sequence.

Regards

Rajaram

Read only

0 Likes
1,978

no its like this...

SELECTION-SCREEN BEGIN OF BLOCK bk1 WITH FRAME TITLE text-001.

PARAMETERS vbeln TYPE vbrk-vbeln matchcode object ZINVOICE.

PARAMETERS rtim TYPE vbrk-ERZET.

SELECTION-SCREEN END OF BLOCK bk1.

SELECTION-SCREEN BEGIN OF BLOCK b2 WITH FRAME TITLE text-002.

parameter : p_org as checkbox,

p_dup as checkbox,

p_tri as checkbox,

p_qua as checkbox.

SELECTION-SCREEN END OF BLOCK b2.

SET PF-STATUS 'POLY'.

AT SELECTION-SCREEN OUTPUT.

AT USER-COMMAND.

CASE SY-UCOMM.

WHEN 'EXEC'.

PERFORM PRINT.

WHEN 'PREV1'.

ENDCASE.

start-of-selection.

end-of-selection.

Read only

0 Likes
1,978

When i try this, GUI Status is not working yar,

so button is not displayed.

Please coorecl me.

Regards

Rajaram

Read only

0 Likes
1,978

Hi,

Did you make sure you activated your GUI status?

Thanks,

Arul

Read only

Former Member
0 Likes
1,978

Hi,

in u r program at initialization or at at-selection-screen output event use the SET PF-STATUS <name >.

Here the <name> is the pf-status which is created using SE41 TCODE.

There u can give program name then select status checkbox and then create.

there it have menubar, Application toolbar and function keys.

For application tool bar give some function codes and then save it and activate it.

at u r progarm depending on TCODE or user name u can change PF-STATUS by

SET PF-STATUS <name> EXCLUDING RSEXCLUDEinternaltable.

Here RSEXCLUDEinternaltable can generated before above statement by appending function codes of pushbuttons which u dont want to display.

ie

waRSEXCLUDEinternaltable = 'SAVE'.

append waRSEXCLUDEinternaltable to RSEXCLUDEinternaltable.

Regards,

Vijay Mekala