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.


34 comments:

Unknown 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.

biciclo said...

Thanks!!

Unknown 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.

a::. 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.

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.

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

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!

Unknown said...

Wow great information about toolbar development. Hire toolbar developer exhaustive analysis is capable of reshaping toolbar solutions with accuracy and precision.For more information please visit our website.

Oracle Fusion Training Institute

Quickbooks Support Phone Number said...

To get more and more answers on your QuickBooks , Dialing the
QuickBooks Customer Service Phone Number +18556753194 will connect you with a QuickBooks specialist who will help you in any case.

Quickbooks Customer Service said...

QuickBooks has been a trusted accounting used for running business .If you are Suffering QuickBooks issue then You can also call
QuickBooks Customer Support Phone Number +17735165910 nd talk to someone about your Software

QuickBooks Support Phone Number said...

If you're having QuickBooks Problems like QuickBooks error 15106 , simply dial
QuickBooks Support Phone Number +1 757-751-0347 and get answers to all your questions.

Quickbooks Customer Service said...

By dialing QuickBooks Customer Support Phone Number +1 773-516-5910 and you need to dial that number for your queries and errors issues.

Quickbooks customer service said...

If you want to Quick help about your Software or contact their customer care service at QuickBooks Customer Support +1 866-306-2642 related to their product

Quickbooks Customer Service said...

Nice & Informative Blog ! If you want to Fix QuickBooks issue and want to help then you can dial on QuickBooks customer Service +17735165910

Ken Lee said...
This comment has been removed by the author.
Ken Lee said...
This comment has been removed by the author.
Ken Lee said...

very informative blog !! if you are looking help regarding QuickBooks issue then you should connect our expert at
QuickBooks Customer Service +1 855-624-1268 to get immediate Solutions

QuickBooks Support Phone Number said...

If you want to Fix QuickBooks issue and want to help Contact at QuickBooks Customer Service (877) 606-0004

Simmyjessure said...

very technical information get from your blog if you also looking any help regarding about your QuickBooks software then you can just one ring
quickbooks customer support New Orleans, LA 70130

أشعة الدوبلر said...

أشعة الدوبلر