Tuesday, July 24, 2007

Add toolbar button on selection screen


We can add new toolbar (maximal 5) in ABAP report to make program more interactive to user on selection screen.

Do following step.

1. Declare work area sscrfields.

TABLES: sscrfields.

2. Define text displayed in button in initialization event.

INITIALIZATION.
MOVE 'This is button 1' TO sscrfields-functxt_0n." n = 1 up to 5

3. Activate toolbar in selection screen.

SELECTION-SCREEN FUNCTION KEY n.

4. Check user command in AT selection screen

AT SELECTION-SCREEN.
IF sy-ucomm = 'FC0n'." n = 1 up to 5
....
ENDIF.

This is complete sample:

REPORT ZAALGAL0005 .

TABLES: sscrfields.

DATA: d_butt1(4).

PARAMETERS: p_grpa1(10) MODIF ID A,
p_grpa2(10) MODIF ID A,
p_grpb1(10) MODIF ID B.

SELECTION-SCREEN FUNCTION KEY 1.
SELECTION-SCREEN FUNCTION KEY 2.

INITIALIZATION.
MOVE 'This is button 1' TO sscrfields-functxt_01.
MOVE 'Toggle 1' TO sscrfields-functxt_02.
d_butt1 = 'NO'.

AT SELECTION-SCREEN.
IF sy-ucomm = 'FC01'.
d_butt1 = 'YES'.
sscrfields-ucomm = 'ONLI'.
ELSEIF sy-ucomm = 'FC02'.
IF sscrfields-functxt_02 = 'Toggle 1'.
sscrfields-functxt_02 = 'Toggle 2'.
ELSE.
sscrfields-functxt_02 = 'Toggle 1'.
ENDIF.
ENDIF.

START-OF-SELECTION.
WRITE d_butt1.


25 comments:

Indrachapa said...

I post this comment to say
Thanks!!
really that code was helpful to me and i learn how to use it to customize looking at your coding.
so again thanks.

regards,
rada.

Anonymous said...

Thx a lot ;o)

Alessandro

Em said...

Thanks, this is really useful and clearly explained - really helpful.

Andele said...

Thanks!!

prakash said...

That was good. Thanks

Anonymous said...

thank you!!!

Anonymous said...

Hey...Thannks a lot. Really helpful. great work dude.

Anonymous said...

good article thanks a lot

AdrianoBH said...

Very Good!!!! Tks.

aL::. said...

Thanks a lot man.

You can also use an icon:

MOVE '@0S@Text' TO sscrfields-functxt_01.

Where @0S@ is icon id.

Cheers.

Anonymous said...

I have small problem. The tool bar came but it is so small. Button don't get displayed. How to increase the length. PLs.

Thx.

seventyros said...

For a Excellent Online Resource for SAP EP and SAP Web Dynpro ABAP, Visit Learn SAP Online

seventyros said...

Excellent Online Resource for SAP EP and SAP Web Dynpro ABAP. Visit Learn SAP

Online for Free


Sap Netweaver-an Ambitious

vision

Sap Netweaver Portal

Implementation

Delta Links and Chained Objects
Knowledge Management
System Administration
Delegated Administration
SAP EP Content Administration
How to Develop Portal

Applications

SAP EP-Developing portal

content and assigning permissions

SAP EP-Role maintenance
SAP EP-How to make Enterprise

Portal highly available


And Many More Topics...

Abap Community Forums said...

Really some good informative posts by you.Learn more about ABAP at
Abap Community Forums

bOOm said...

Hi,

'm new to adap development but i have been a .net developer for almost 10 years now. In our we've a SAP and a document manage system..

just want to ask, is there a way to retrieve information in mysql to display the image in sap..?

Hope to hear from you soon..

thanks,

Nestea

Unknown said...

hi man
thanks a lot for giving this info and this solved my problem.
it's very helpful.

Ghanshyam ABAPer said...

hi man
thanks a lot for giving this information and it was a very helpfull.

GHANSHYAM said...

hi man
I have create a report of user and password.But when i show to sir he told do it by validate at selection screen event.
please give some example of that.

Ghanshyam ABAPer said...

hi man
I have create a report of user and password.But when i show to sir he told do it by validate at selection screen event.
please give some example of that.

google said...

Excellent Online Resource for SAP EP and SAP Web Dynpro ABAP. Visit Learn SAP Online for Free

How to make WDJ Component available on SAP EP
SAP Enterprise Portal Application in NWDS
SAP and Their Produstcs - SMB Customer - SAP Business One
What is SAP ?
Architecture of SAP Business One Application
Navigation in SAP Business One
SMB Portal and its Functionality
Netweaver Administrator Day to Day Work
SAP Business Intelligence
Business Partners in SAP Business One
Continuous Stock System in SAP business one

And Many Morte Topics

sagarsap said...

i want to access application tool bar button in the program through another abap program.. Please help me...

sagarsap said...

my requirement is......
i have to call another program in the current program, in the calling program having material field as select-option and save button on application tool bar....... how can i call that program by sending the data..i can do for select-options but i dont know for the application tool bar button... pls help me its an urgent requirment

Debra Mccurley said...

Wow great information about toolbar development. Hire toolbar developer exhaustive analysis is capable of reshaping toolbar solutions with accuracy and precision. Here, cutting-edge technology in collaboration with cost-efficient methods is the stand-out corner for toolbar developer.

Giorgio said...

Hi your code for toggle is not working. Modify the IF block like this:

IF sy-ucomm = 'FC01'.
d_butt1 = 'YES'.
sscrfields-ucomm = 'ONLI'.
ELSEIF sy-ucomm = 'FC02'.
IF sscrfields-functxt_02 = 'Toggle 1'.
sscrfields-functxt_02 = 'Toggle 2'.
ELSE.
sscrfields-functxt_02 = 'Toggle 1'.
ENDIF.
ENDIF.

Anonymous said...

Thanks!