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

Defining Selection-Screen Depending on Client

Former Member
0 Likes
796

Good Morning,

I need to hide one parameter from my selection-screen depending on sy-mandt.

Is it possible? If yes, can anyone show an example?

Regards,

Pedro Gaspar

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
643

Hi.

Try something like this in initialization

initialization.

loop at screen.

if screen-name = ... and sy-mandt = ....

screen-input = 0.

screen-invisible = 1.

modify screen.

endif.

endloop.

5 REPLIES 5
Read only

Former Member
0 Likes
643

Hi

Check this sample programs to hide some fields on selection-screen.

SELECTION-SCREEN BEGIN OF BLOCK b1 WITH FRAME TITLE text-001.

PARAMETERS: pa_file TYPE rlgrap-filename MODIF ID abc,

pa_lifnr TYPE lfa1-lifnr MODIF ID abc,

pa_vkorg TYPE vbak-vkorg MODIF ID abc.

SELECTION-SCREEN END OF BLOCK b1.

SELECTION-SCREEN BEGIN OF BLOCK b2 WITH FRAME TITLE text-002.

PARAMETERS: pa_kunnr TYPE vbak-kunnr MODIF ID def.

SELECT-OPTIONS: s_lifnr FOR gs_lfa1-lifnr MODIF ID def,

s_date FOR gs_lfa1-erdat MODIF ID def,

s_augru FOR gs_vbak-augru MODIF ID def,

s_vbeln FOR gs_vbak-vbeln MODIF ID def.

SELECTION-SCREEN END OF BLOCK b2.

SELECTION-SCREEN BEGIN OF BLOCK b3 WITH FRAME TITLE text-003.

SELECTION-SCREEN BEGIN OF LINE.

PARAMETERS: pa_upd RADIOBUTTON GROUP g1 USER-COMMAND uc01 DEFAULT 'X'."#EC *

SELECTION-SCREEN COMMENT 3(60) text-004 FOR FIELD pa_upd.

SELECTION-SCREEN END OF LINE.

SELECTION-SCREEN BEGIN OF LINE.

PARAMETERS: pa_rep RADIOBUTTON GROUP g1 ."#EC *

SELECTION-SCREEN COMMENT 3(60) text-005 FOR FIELD pa_rep.

SELECTION-SCREEN END OF LINE.

SELECTION-SCREEN END OF BLOCK b3.

IF pa_rep EQ gc_x. ---write here IF sy-mandt = '200'...

LOOP AT SCREEN.

IF screen-group1 = gc_abc.

screen-input = gc_zero_num.

ELSEIF screen-group1 = gc_def.

screen-active = gc_one_num.

ENDIF.

MODIFY SCREEN.

ENDLOOP.

ELSEIF pa_upd EQ gc_x.

*For Reprocessing

LOOP AT SCREEN.

IF screen-group1 = gc_def.

screen-input = gc_zero_num.

ELSEIF screen-group1 = gc_abc.

screen-active = gc_one_num.

ENDIF.

MODIFY SCREEN.

CLEAR pa_upd.

ENDLOOP.

ENDIF.

Reward points for useful Answers

Regards

Anji

Read only

Former Member
0 Likes
643

Hi.

Use the folowing code.

Loop at screen.

If sy-mandt = '111'.

if screen-name = 'field name'

screen-invisible = 1.

endif.

modify screen.

endif.

endloop.

reward if helpful.

Read only

Former Member
0 Likes
644

Hi.

Try something like this in initialization

initialization.

loop at screen.

if screen-name = ... and sy-mandt = ....

screen-input = 0.

screen-invisible = 1.

modify screen.

endif.

endloop.

Read only

seshatalpasai_madala
Product and Topic Expert
Product and Topic Expert
0 Likes
643

Hi,

In the event block AT SELECTION-SCREEN OUTPUT

put the below code.

if sy-mandt = 'Your need'.

LOOP AT SCREEN.

CHECK SCREEN-NAME = 'FIELD1'.

SCREEN-ACTIVE = 0.

MODIFY SCREEN.

ENDLOOP.

endif.

Similar IF's for differnet clients.

Regards,

Sesh

Read only

Former Member
0 Likes
643

hi

u can put ur fields in a block sepicific for a particular client.

u check the mandt and display the corresponding block while hiding the others.

check this sample code:

TABLES: eban,

SSCRFIELDS.

SELECTION-SCREEN BEGIN OF SCREEN 100 TITLE title.

SELECTION-SCREEN BEGIN OF BLOCK b1 WITH FRAME TITLE text-t01.

PARAMETER:rad1 RADIOBUTTON GROUP rad USER-COMMAND frad1 DEFAULT 'X',

rad2 RADIOBUTTON GROUP rad .

SELECTION-SCREEN END OF BLOCK b1.

SELECTION-SCREEN BEGIN OF BLOCK b2 WITH FRAME TITLE text-t02.

PARAMETER: mtr AS CHECKBOX MODIF ID g3 USER-COMMAND chk1,

p_matnr TYPE eban-matnr MODIF ID g1,

sloc AS CHECKBOX MODIF ID g3 USER-COMMAND chk2,

str_loc TYPE eban-lgort MODIF ID g4.

SELECTION-SCREEN END OF BLOCK b2.

SELECTION-SCREEN BEGIN OF BLOCK b3 WITH FRAME TITLE text-t03.

SELECT-OPTIONS: matnr1 FOR eban-matnr MODIF ID g2.

SELECTION-SCREEN END OF BLOCK b3.

SELECTION-SCREEN PUSHBUTTON /20(10) name USER-COMMAND UCOM.

SELECTION-SCREEN END OF SCREEN 100.

name = 'FETCH'.

title = 'Test Report'.

CALL SELECTION-SCREEN '100'.

TYPE-POOLS slis.

  • declaration of internal tables and work areas to be used

DATA: BEGIN OF it_pr OCCURS 0,

banfn TYPE eban-banfn,

bnfpo TYPE eban-bnfpo,

loekz TYPE eban-loekz,

statu TYPE eban-statu,

ekgrp TYPE eban-ekgrp,

matnr TYPE eban-matnr,

werks TYPE eban-werks,

lgort TYPE eban-lgort,

preis TYPE eban-preis,

peinh TYPE eban-peinh,

END OF it_pr.

DATA: BEGIN OF it_mat OCCURS 0,

matnr TYPE eban-matnr,

END OF it_mat.

*DATA:BEGIN OF ITAB1 OCCURS 0,

DATA: l_answer.

DATA: it_fieldcat TYPE slis_t_fieldcat_alv,

wa_fieldcat LIKE LINE OF it_fieldcat,

it_event TYPE slis_t_event,

wa_event TYPE slis_alv_event.

  • declaration of variables to be used

DATA: r_ucomm TYPE sy-ucomm,

mat_no TYPE eban-matnr,

len TYPE i VALUE 1,

count TYPE i VALUE IS INITIAL,

iflag TYPE i VALUE IS INITIAL,

iflag1 TYPE i VALUE 0.

DATA :pr_id TYPE sy-repid,

rt_extab TYPE slis_t_extab.

INITIALIZATION.

pr_id = sy-repid.

AT SELECTION-SCREEN OUTPUT.

<b> IF rad1 = 'X' AND SY-MANDT = <client 1></b>

LOOP AT SCREEN.

IF screen-group1 = 'G1' OR screen-group1 = 'G4'.

screen-active = '1'.

screen-input = 0.

ELSEIF screen-group1 = 'G2'.

screen-active = '0'.

ENDIF.

MODIFY SCREEN.

ENDLOOP.

<b>ELSEIF rad2 = 'X' and sy-mandt = <client 1></b>

LOOP AT SCREEN.

IF screen-group1 = 'G1' OR screen-group1 = 'G4' OR screen-group1 = 'G3' OR screen-group1 = 'G5'.

screen-active = '0'.

ELSEIF screen-group1 = 'G2'.

screen-active = '1'.

ENDIF.

MODIFY SCREEN.

ENDLOOP.

ENDIF.

IF mtr = 'X'.

LOOP AT SCREEN.

IF screen-group1 = 'G1'.

screen-input = 1 .

ENDIF.

MODIFY SCREEN.

ENDLOOP.

ENDIF.

IF sloc = 'X'.

LOOP AT SCREEN.

IF screen-group1 = 'G4'.

screen-input = 1 .

ENDIF.

MODIFY SCREEN.

ENDLOOP.

ENDIF.

clear sy-ucomm.

  • iflag = 1.

  • endif.

regards

ravish

<b>plz dont forget to reward points if helpful</b>