Friday, March 18, 2016

At Selection Screen Output



We can change selection screen dynamically by the event AT-SELECTION SCREEN OUTPUT. Now SCREEN contains the following fields which hold screen information at run time. We can customize the screen information by looping the screen and modify the screen as required. All screen modifications should be done under the event AT-SELECTION SCREEN OUTPUT.

Component
Length
Type
Attribute
Description
name
132
c
Name
Name
group1
3
c
Group1
Modification group
group2
3
c
Group2
Modification group
group3
3
c
Group3
Modification group
group4
3
c
Group4
Modification group
required
1
c
Required-entry field
Mandatory field
input
1
c
Input
input-enabled field
output
1
c
Output
display field
intensified
1
c
Intensified
intensified field
invisible
1
c
Invisible
invisible element
length
1
x
Visible Length
Field length
active
1
c
Input/Output/Invisible
active field
display_3d
1
c
Two-dimensional
Box
value_help
1
c
Input help
Input help key
request
1
c
-
Input exists
values_in_combo
1
c
Dropdown listbox
Value help exists

In the following example we have called a selection screen where two radio buttons (PO & Item) have been mentioned. PO is selected by default. Now the screen contains four parameters (purchase order, company code, item & material). Now for default selection of PO button the purchase order & company fields are appeared. If we select item button then purchase order, item & material input fields will be displayed.

REPORT  zsr_test.

PARAMETERS: po RADIOBUTTON GROUP rad1 DEFAULT 'X' USER-COMMAND test,
            item RADIOBUTTON GROUP rad1,
            p_ebeln TYPE ekko-ebeln,
            p_bukrs TYPE ekko-bukrs,
            p_ebelp TYPE ekpo-ebelp,
            p_matnr TYPE ekpo-matnr.

AT SELECTION-SCREEN OUTPUT.

  LOOP AT SCREEN.

    "If item is selected then Item field appears
    IF screen-name CP '*P_EBELP*'.
      IF item IS NOT INITIAL.
        screen-active = 1.
      ELSE.
        screen-active = 0.
      ENDIF.
      MODIFY SCREEN.
    ENDIF.

    "If item is selected then Material field appears
    IF screen-name CP '*P_MATNR*'.
      IF item IS NOT INITIAL.
        screen-active = 1.
      ELSE.
        screen-active = 0.
      ENDIF.
      MODIFY SCREEN.
    ENDIF.

    "If item is selected then Company field disappears
    IF screen-name CP '*P_BUKRS*'.
      IF item IS NOT INITIAL.
        screen-active = 0.
      ELSE.
        screen-active = 1.
      ENDIF.
      MODIFY SCREEN.
    ENDIF.
  ENDLOOP.



5 comments:

Unknown said...

Sir i need your guidance as i am new in abap. please give your contact details.my mail id bappakunduhere@gmail.com

Anonymous said...

SAP Success Factors Real Time Hands on Training in Chennai...

Don't always Depend on Training Institute Alone and so please aware of Best Trainers too..

http://thecreatingexperts.com/sap-successfactors-training-in-chennai/

If You need a Best Trainer over SAP Success Factors Means??? Please ready for an DEMO From the Trainer MR.Karthick
CONTACT:8122241286

Both Classroom/Online Training is Available!!!!!!

Unknown said...

SAP Success Factors Real Time Hands on Training in Chennai…

Don’t always Depend on Training Institute alone.Please aware of Best Trainers too..

http://thecreatingexperts.com/sap-successfactors-training-in-chennai/

If You need a Best Trainer in SAP Success Factors??? Then be ready for a DEMO From the Trainer MR.Karthick
CONTACT:8122241286
http://thecreatingexperts.com/sap-mm-training-in-chennai/

Both Classroom/Online Training is Available!!!!!!

Unknown said...

Thanks for your info...Here THE CREATING EXPERTS provide hands on training with real time scenarios

http://thecreatingexperts.com/sap-abap-training-in-chennai/

contact +91-08122241286

Anonymous said...

Sir, Really very helpful and very well explained. Thank you. Regards,