Application Development and Automation 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: 
Read only

Hide a field on selection screen based on parameter transaction

Former Member
0 Likes
10,312

My program has a initial selection screen 20 with a parameter p_obj and runs from a transaction zabc.

If i run this transaction from a parameter transaction with p_obj filled in default values of transaction,

I want to hide this field on the selection screen.

But when i tried the parameter transaction default values are filled after the selection screen output is processed.

Is there any other way get this.

Thanks

My program has a initial selection screen 20 with a parameter p_obj and runs from a transaction zabc.

If i run this transaction from a parameter transaction with p_obj filled in default values of transaction,

I want to hide this field on the selection screen.

But when i tried the parameter transaction default values are filled after the selection screen output is processed.

Is there any other way get this.

Thanks

12 REPLIES 12
Read only

Former Member
0 Likes
3,619

Hi Harsh,

Maybe you can try invisible it in 'AT SELECTION-SCREEN.' event.

AT SELECTION-SCREEN.

If p_obj is not intial.

loop screen.

   screen-invisible = '1'.

   modify screen.

endloop.

endif.

You see, if call it from transaction, p_obj have value, then it will be invisible. Just try.

regards,

Archer

Read only

0 Likes
3,619

Can we modify the screen in AT SELECTION-SCREEN event ??

Read only

0 Likes
3,619

Hi,

different from Archer's post you have to do that at PBO of the selection screen, which is in event

AT SELECTION-SCREEN OUTPUT.

Additionally you have to check SCREEN-NAME within the loop, otherwise all fields would be set to invisible.

Also don't check a selection screen parameter like P_OBJ directly, otherwise your field will become invisible in normal transaction too after input and ENTER. Check for the tcode. If it's the normal one, don't modify screen.

Regards,

Klaus

Read only

0 Likes
3,619

The value from the parameter transaction gets filled in screen field after AT SELECTION-SCREEN OUTPUT.


Thanks

Read only

0 Likes
3,619

INITIALIZATION.

   LOOP AT SCREEN.

     IF screen-name = 'P_WERKS' OR screen-name '%_P_WERKS_%_APP_%-TEXT'.

       IF sy-tcode IS NOT INITIAL.

         screen-output = '0'.

         screen-active = '0'.

         MODIFY SCREEN.

       ENDIF.

     ENDIF.

   ENDLOOP.

Read only

Former Member
0 Likes
3,619

Hi Harsh,

parameters: p_obj like "-----" default 'abc...' no-display.

is this your requirement?

Thanks.

Read only

0 Likes
3,619

In my case the same zabc transaction can be called from different parameter transactions with different default values. So the values come from transaction i cannot put that as default in code.

Thanks

Read only

RaymondGiuseppi
Active Contributor
0 Likes
3,619

In the PBO : AT SELECTION-SCREEN OUTPUT, execute a LOOP AT SCREEN and hide/deactivate the field if parameter is not empty.

NB: Is there any event that the parameter must be accessible, in this case set a variable in the INITIALIZATION event not to hide the field if it was not initially populated.

Ref: The parameters are received by the report after end of INITIALIZATION event, just before the AT SELECTION-SCREEN OUTPUT event. (Calling Executable Programs / Flow of an Executable Program)

Regards,

Raymond

Read only

0 Likes
3,619

Oops , I tested with a transaction "dialog transaction" with a variant and tbe value was available IN AT SELECTION-SCREEN OUTPUT, BUT with a "parameter transaction" the value is not yet available (same behavior as if a small BDC was executed, so no event to "intercept" program flow is available)

You CANNOT use those transactions for your requirement, the LOOP AT SCREEN only make sense in PBO, or you would have to check sy-tcode in AT SELECTION-SCREEN OUTPUT event.

So

  • Create some system variants (name CUS&xxx) so user won't be allowed to modify those) and create "dialog transaction" with those variant to fulfil your requirement.
  • Or check value of sy-tcode in SELECTION-SCREEN OUTPUT

Regards,

Raymond

Read only

kabil_g
Active Participant
0 Likes
3,619

Hi Harsh,,

Please try these.............

PARAMETERS :  p_dummy  type mara-matnr.

LOOP AT SCREEN.

       IF screen-name CS 'P_DUMMY' OR " Hide dummy paramater

          screen-group1 = 'ONE' OR

          screen-group1 = 'TWO' OR

          screen-group1 = 'TRI' OR

          screen-group1 = 'FR' OR

          screen-group1 = 'FIV' .

         screen-input = 0.

         screen-active = 1.

         screen-active = 0.

         MODIFY SCREEN.

       ENDIF.

     ENDLOOP.



Regards,

Kabil

Read only

VenkatRamesh_V
Active Contributor
0 Likes
3,619

Hi Harsh,

Hope it helpful

DATA FLAG(01).

Declare one variable use export and import  memory id.

AT SELECTION-SCREEN OUTPUT.

IF FLAG  IS NOT INITIAL.

LOOP AT SCREEN.

IF SCREEN-NAME = 'WERKS'.

SCREEN_INPUT = 0.

MODIFY SCREEN.

ENDIF.

ENDLOOP.

ENDIF.


Regards,

Venkat.

Read only

Former Member
0 Likes
3,619

Hi,

Try with this,

PARAMETERS : P_KUNNR TYPE KNA1-KUNNR MODIF ID AAA .

PARAMETERS : P_CNAME TYPE KNA1-NAME1 MODIF ID AAA .

PARAMETERS : P_LIFNR TYPE LFA1-LIFNR MODIF ID BBB .

PARAMETERS : P_VNAME TYPE LFA1-NAME1 MODIF ID BBB .

PARAMETERS : RB_CUST  RADIOBUTTON GROUP  ABC DEFAULT 'X' USER-COMMAND UCOMM,

             RB_VEND RADIOBUTTON GROUP ABC .

AT SELECTION-SCREEN OUTPUT .

  IF RB_CUST = 'X' .

    LOOP AT SCREEN.

      IF SCREEN-GROUP1 =  'AAA' .

        SCREEN-INPUT = '1' .

        MODIFY SCREEN .

      ELSEIF SCREEN-GROUP1 =  'BBB' .

        SCREEN-INPUT = '0' .

        MODIFY SCREEN .

      ENDIF .

    ENDLOOP .

  ELSEIF RB_VEND = 'X' .

    LOOP AT SCREEN.

      IF SCREEN-GROUP1 =  'AAA' .

        SCREEN-INPUT = '0' .

        MODIFY SCREEN .

      ELSEIF SCREEN-GROUP1 =  'BBB' .

        SCREEN-INPUT = '1' .

        MODIFY SCREEN .

Regards,

Darshan MS