Application Development 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: 

Modifying the selection screen dynamically

Former Member
0 Kudos
140

Hey folks,

I have posted this question previously but no one understood the real problem.

I have 4 fields

Company Code

material Number

plant

storage Location

Unit

when I select the company code AA01 from the F4 help I want to disable material number and Plant ..Like this i have 4 scenarios where based upon the input given in the selection screen other fields have to be enabled or disabled.

I have already used at selection screen on output but that doesn't help me as its a PBO event I tried to search for a proper event but cudn't find it. Is there any way i can achieve this. A sample code wud be easy for me to understand .

Thanks in advance

Rock

5 REPLIES 5

naimesh_patel
Active Contributor
0 Kudos
99

Set different groups in your fieds on the screen.

Set the screen group for the Material and Plant as the GR1

Set the screen gorup for the Storage location as the GR2.

You need to modify your screen fields on the PBO event.

Like:


IF P_BUKRS = 'AA01'.
 loop at screen.
   if screen-group1 = 'GP1'.
     screen-input = 0.
     modify screen.
   elseif screen-group2 = 'GP2'.  
     screen-input = 1.
     modify screen.
   endif.
 endloop.  
else.
 loop at screen.
   if screen-group1 = 'GP2'.
     screen-active = 0.
     modify screen.
   elseif screen-group2 = 'GP1'.  
     screen-input = 1.
     modify screen.
   endif.
 endloop.  
endif. 

Regards,

Naimesh Patel

0 Kudos
99

Hey Naimesh,

Its working only when i hit enter. is there any possibility that when i select the values from the F4 help it modifies the screen without hitting enter.

Thanks in advance

Rock

0 Kudos
99

hi Rock,

Try the following logic in your POV.



 data:    record_tab like seahlpres occurs 0 with header line.
...
...
    call function 'F4IF_INT_TABLE_VALUE_REQUEST'
....
....
.         exceptions
              parameter_error = 1
              no_values_found = 2
              others          = 3.

import record_tab from memory id 'mcx_record_tab'.

    if not record_tab[] is initial.

     loop at screen.

        if screen-group1 = ...

           modify screen....
     
       endif.
....
....
     endloop.
   endif.

Thanks & Regards,

Abhishek Jolly

former_member194669
Active Contributor
0 Kudos
99

Try this way with MODIF ID


SELECT-OPTIONS NAME FOR SY-REPID MODIF ID XYZ.
...
AT SELECTION-SCREEN OUTPUT.
LOOP AT SCREEN.
CHECK SCREEN-GROUP1 = 'XYZ'.
SCREEN-INTENSIFIED = '1'.
MODIFY SCREEN.
ENDLOOP.

Former Member
0 Kudos
99

First, define the modify ID for the fields you want to disable.

Second, loop at screen to find out the fields and set the attributes for them.