Thursday, November 26, 2009

Selection Screen

I have found good tutorial on SAP selection Screen, below code is taken from this site


In this example I will show you below selection screen properties

* Adding button on selection screen
* Define radiobuttons
* Define checkboxes
* Add more than one object in per line of selection screen
* Disable an object
* Hide/Show an object
* Display blue colored parameters

REPORT ZMAVSARTEST.

Tables : Pgmi, Sscrfields.

Data : Begin Of IPgmi Occurs 0,
Werks Type Pgmi-Werks,
Prgrp Type Pgmi-Prgrp,
Nrmit Type Pgmi-Nrmit,
End Of IPgmi.
Data : WPgmi Like Line Of IPgmi.

Selection-Screen Begin of Block b1 With Frame Title TEXT-T01.
Select-Options : Prgrp For Pgmi-Prgrp Default ‘183X366_BTE’ Modif Id OB.
Parameters : Werks Like Marc-Werks Default ‘2000′,
S1 RadioButton Group G1,
S2 RadioButton Group G1,
S3 RadioButton Group G1,
PSay(3).
Selection-Screen End of Block b1.

Selection-Screen Begin of Block b2 With Frame Title TEXT-T02.
Parameters : S4 RadioButton Group G2,
S5 RadioButton Group G2.
Selection-Screen End of Block b2.

Selection-Screen Begin of Block b3 With Frame Title TEXT-T03.
Parameters : S6 RadioButton Group G3 User-Command Radyo,
S7 RadioButton Group G3.
Selection-Screen begin of line.
Parameters p_ch1 AS checkbox Modif ID SL.
Selection-Screen comment 3(20) text-001 Modif ID SL.
Parameters p_ch2 AS checkbox Modif ID SL.
Selection-Screen comment 27(20) text-002 Modif ID SL.
Parameters p_ch3 AS checkbox Modif ID SL.
Selection-Screen comment 51(20) text-003 Modif ID SL.
Selection-Screen end of line.
Selection-Screen begin of line.
Parameters p_ch4 AS checkbox Modif ID SL.
Selection-Screen comment 3(20) text-004 Modif ID SL.
Parameters p_ch5 AS checkbox Modif ID SL.
Selection-Screen comment 27(20) text-005 Modif ID SL.
Parameters p_ch6 AS checkbox Modif ID SL.
Selection-Screen comment 51(20) text-006 Modif ID SL.
Selection-Screen end of line.
Selection-Screen begin of line.
Parameters p_ch7 AS checkbox Modif ID SL.
Selection-Screen comment 3(20) text-007 Modif ID SL.
Parameters p_ch8 AS checkbox Modif ID SL.
Selection-Screen comment 27(20) text-008 Modif ID SL.
Parameters p_ch9 AS checkbox Modif ID SL.
Selection-Screen comment 51(20) text-009 Modif ID SL.
Selection-Screen end of line.
Selection-Screen begin of line.
Parameters p_ch10 AS checkbox Modif ID SL.
Selection-Screen comment 3(20) text-010 Modif ID SL.
Parameters p_ch11 AS checkbox Modif ID SL.
Selection-Screen comment 27(20) text-011 Modif ID SL.
Parameters p_ch12 AS checkbox Modif ID SL.
Selection-Screen comment 51(20) text-012 Modif ID SL.
Selection-Screen end of line.
Selection-Screen End of Block b3.

TYPE-POOLS icon.
Data : Functxt TYPE Smp_Dyntxt.

Selection-Screen: Function Key 1,
Function Key 2.
Initialization.
S7 = ‘X’.
Functxt-icon_id = ICON_ALARM.
Functxt-quickinfo = ‘Uç’.
Functxt-icon_text = ‘Uç’.
Sscrfields-functxt_01 = functxt.
Sscrfields-Functxt_02 = ‘Button2′.

At Selection-Screen.
Case Sscrfields-Ucomm.
When ‘FC01′.
Message ‘Uçakla mı uçacaksın?’ Type ‘I’.
When ‘FC02′.
Message ‘Button2′ Type ‘I’.
When Others.
Endcase.

At Selection-Screen Output.
Perform CheckRadio.

FORM CheckRadio.
Loop At Screen.
If S6 = ‘X’.
If Screen-Group1 = ‘SL’.
Screen-Active = 0.
Endif.
Elseif S7 = ‘X’.
If Screen-Group1 = ‘SL’.
Screen-Active = 1.
Endif.
Endif.
If Screen-Group1 = ‘OB’.
Screen-Intensified = ‘1′.
Endif.
If Screen-Name = ‘S5′.
Screen-Input = 0.
Endif.
Modify Screen.
Endloop.
ENDFORM.” CheckRadio

Start-Of-Selection.
Perform GetData.
End-Of-Selection.

Form GetData.
* Get your data in this subroutine
EndForm. ” GetData

Input History not avalaible

Recently i try to figure out why my auto fill or input history not displayed after i had installed new SAP Gui Lagon, after few doing some Google research , below is the result

1) change the sap gui logon setting
2) Reinstall MADC

Solution for number two is working for me and my system using windows XP sp3.

Below is the guide taken from this site

I had a customer that just couldn’t get MDAC to work under XP. Reinstalling XP SP3 didn’t work. Microsoft doesn’t make anything available to reinstall MDAC individually. So it’s a complete nightmare to fix it. Luckily, I was able to solve the issue with these steps:

1. Click Start > Run and type %windir%\inf and click OK.

2. Right-click mdac.inf and select Install.

This is where the nightmare started for me. I didn’t have any of the files below. I had to copy the OLE DB, msadc, Ole DB and Binaries folders from another computer and place them in the C:\Program Files\Common Files\System\ folder. If you are missing the servicepackfiles folder, you will have it after you reinstall XP Service Pack 3. You can also just extract the files from the SP3 file by using the windowsxp-kb936929-sp3-x86-enu.exe –x command.

3. When prompted for each of the following files, try to browse and locate them in the directories specified.

  • adcjavas.inc – C:\Windows\servicepackfiles\i386
  • handler.reg – C:\Program Files\Common Files\System\msadc
  • MDACRdMe.htm – C:\Program Files\Common Files\System\Ado. I had to rename MDACReadme.htm to MDACRdMe.htm first.
  • oledbjvs.inc – C:\Program Files\Common Files\System\Ole DB
  • mssoap1.dll – C:\Program Files\Common Files\MSSoap\Binaries
  • mssoapr.dll – C:\Program Files\Common Files\MSSoap\Binaries

After all these steps, MDAC was working again.