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: 

Dynamic Selection Screen

Former Member
0 Kudos

Hello

i want create a dynamic selections screen.

here for example

select-options:   sl_matnr for mara-matnr obligatory,
                  sl_vkorg for a602-vkorg obligatory no intervals no-extension,
                  sl_kunnr for a602-kunnr,
                  sl_vtweg for a950-vtweg,
                  sl_datab for a602-datab no intervals no-extension.

when i write in sl_kunnr field, it should invisiable sl_vtweg.

i try to this way.

at selection-screen on sl_kunnr.
  loop at screen.
    if screen-name = '%_SL_VTWEG_%_APP_%-TEXT'.
      %_sl_vtweg_%_app_%-invisible = 'X'.
    endif.
  endloop.

but it show error, that the filed "invisible" not exist.

ths for help

kostonstyle

1 ACCEPTED SOLUTION

Former Member
0 Kudos

Try it this way:

select-options:   sl_matnr for mara-matnr obligatory,
                  sl_vkorg for a950-vkorg," obligatory no intervals no-extension,
                  sl_kunnr for a950-kunnr,
                  sl_vtweg for a950-vtweg,
                  sl_datab for a950-datab no intervals no-extension.



at selection-screen output.

 if sl_matnr[] is not initial.
  loop at screen.
    if screen-name CS 'SL_VKORG'.
       SCREEN-ACTIVE = 0.

       MODIFY SCREEN.

    endif.
  endloop.
endif.

With luck,

Pritam.

16 REPLIES 16

KK07
Contributor
0 Kudos

hi,

use the screen table for selection-screen validations.

u can write as screen-invisible = 'X' .

Former Member
0 Kudos

Hi,

Try this.

LOOP AT SCREEN.

IF screen-name = 'SL_VTWEG-LOW' OR screen-name = 'SL_VTWEG-HIGH'.

IF SL_KUNNR IS NOT INITAIL.

SCREEN-INPUT = 1.

ELSE.

SCREEN-INPUT=0.

ENDIF.

ENDIF.

MODIFY SCREEN,

ENDLOOP.

JozsefSzikszai
Active Contributor
0 Kudos

hi,

SELECT-OPTIONS :   sl_matnr FOR mara-matnr OBLIGATORY,
                  sl_vkorg FOR a602-vkorg OBLIGATORY NO INTERVAL NO-EXTENSIONS,
                  sl_kunnr FOR a602-kunnr,
                  sl_vtweg FOR a950-vtweg MODIF ID 001, "modif id
                  sl_datab FOR a602-datab NO INTERVAL NO-EXTENSIONS.

AT SELECTION-SCREEN OUTPUT sl_kunnr. "selection screen PBO
LOOP AT screen.
CHECK screen-group EQ '001'.
IF sl_kunnr IS INITIAL.
screen-invisible EQ '0'.
ELSE.
screen-invisible EQ '1'.
ENDIF.
MODIFY screen.
ENDLOOP.

hoep this helps

ec

Former Member
0 Kudos

Give "sl_vtweg for a950-vtweg" a MODIF ID

Eg. sl_vtweg for a950-vtweg MODIF ID B1.

Then you can do:

loop at screen.
  if screen-group1 eq 'B1'.
    screen-invisible = 1.
  endif.
 modify screen.
endloop.

Edited by: Maen Anachronos on Sep 22, 2008 3:00 PM

0 Kudos

Hello kostonstyle,

Rewrite your code as below to avoid syntax error.

loop at screen.

if screen-name = '%_SL_VTWEG_%_APP_%-TEXT'.

screen-visible = 0.

modify screen.

endif.

endloop.

Writing this statement in the event at selection screen on sl_kunnr will not meet your requirement as this event is triggered only when you execute the report.

You need to assign a user-command to sl_kunnr. See F1 for help.

Then write the above code in at selection-screen output event.

Regards

Farzan

Former Member
0 Kudos

when i write into sl_kunnr field, then it should invisible sl_vtweg, otherwise not.

0 Kudos

/spoonfeed

AT SELECTION_SCREEN OUTPUT.

IF NOT sl_kunnr[] is initial.

* Do your stuff

ENDIF.

I'm sure there are other ways, but honestly i cba to look them up.

Former Member
0 Kudos

Try it this way:

select-options:   sl_matnr for mara-matnr obligatory,
                  sl_vkorg for a950-vkorg," obligatory no intervals no-extension,
                  sl_kunnr for a950-kunnr,
                  sl_vtweg for a950-vtweg,
                  sl_datab for a950-datab no intervals no-extension.



at selection-screen output.

 if sl_matnr[] is not initial.
  loop at screen.
    if screen-name CS 'SL_VKORG'.
       SCREEN-ACTIVE = 0.

       MODIFY SCREEN.

    endif.
  endloop.
endif.

With luck,

Pritam.

Former Member
0 Kudos

@Pritam Ghosh

you are my good. super, it's functional.

thx all people for try help me.

regards kostonstyle

Former Member
0 Kudos

You cannot change the screen in the AT SELECTION-SCREEN ON.. event. You have to do it in AT SELECTION-SCREEN OUTPUT. Also, to trigger AT SELECTION-SCREEN OUTPUT, the user has to press enter after a value is entered in the selection screen. You can try something like this.



DATA: kunnr_entered TYPE c.

select-options:   sl_matnr for mara-matnr obligatory,
                  sl_vkorg for a602-vkorg obligatory no intervals no-extension,
                  sl_kunnr for a602-kunnr,
                  sl_vtweg for a950-vtweg,
                  sl_datab for a602-datab no intervals no-extension.

AT SELECTION-SCREEN ON sl_kunnr.
  IF sl_kunnr IS NOT INITIAL.
    kunnr_entered = 'X'.
  ELSE.
    CLEAR kunnr_entered.
  ENDIF.

AT SELECTION-SCREEN OUTPUT.
  IF kunnr_entered = 'X'.
    LOOP AT SCREEN.
      CHECK screen-group1 = 'KUN'.
      screen-active = 0.
      MODIFY SCREEN.
*-- even if the value is entered, clear it
      CLEAR sl_vtweg[].
    ENDLOOP.
  ELSE.
    LOOP AT SCREEN.
      CHECK screen-group1 = 'KUN'.
      screen-active = 1.
      MODIFY SCREEN.
    ENDLOOP.
  ENDIF.

0 Kudos
CHECK screen-group1 = 'KUN'.

You forgot to add the MODIF ID KUN.

0 Kudos

>

>

CHECK screen-group1 = 'KUN'.

>

> You forgot to add the MODIF ID KUN.

and this code

AT SELECTION-SCREEN ON sl_kunnr.
  IF sl_kunnr IS NOT INITIAL.
    kunnr_entered = 'X'.
  ELSE.
    CLEAR kunnr_entered.
  ENDIF.

is just waste of time, because the content of sl_kunnr can be checked in the PBO directly. Anyway, it was worth 6 points...

0 Kudos

It's a selection screen. Given the requirements, how do you want to check the contents of the select-option in the PBO and act upon them?

But i agree, it's a bit silly to set an indicator that the select-option is filled.

edit: on second thought, perhaps you meant the SELECTION_SCREEN OUTPUT when you wrote PBO.

Edited by: Maen Anachronos on Sep 22, 2008 4:22 PM

0 Kudos

>

> It's a selection screen. Given the requirements, how do you want to check the contents of the select-option in the PBO and act upon them?

>

> But i agree, it's a bit silly to set an indicator that the select-option is filled.

there are no tricks needed, it is possible to do it directly, just have a look at my solution above and give it a try! (of course the PBO has to be triggered through a USER-COMMAND, but it is necessary in any case)

0 Kudos

Aahh that post!

While i was posting my first reply, you already hit submit. Hence my reply was a minute later.

And trust me, with 13 years of experience i don't think i need to try it out.

0 Kudos

>

edit: on second thought, perhaps you meant the SELECTION_SCREEN OUTPUT when you wrote PBO.

yes!

by simple report programming:

AT SELECT-SCREEN OUTPUT - this is PBO for the (automatically generated) selection screen

AT SELECTION-SCREEN ON ... - these are PAIs for the (automatically generated) selection screen

but I believe this is clear-cut for you with 13 years of experience