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 ISSUE

Former Member
0 Kudos

Dear Experts,

I have gone through some existing code and found some doubtful line.I have gone through the internet for some document but not able to clear the doubt.

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

PARAMETERS: r_local RADIOBUTTON GROUP rad1 USER-COMMAND flg, "Local
  r_server RADIOBUTTON GROUP rad1 DEFAULT 'X'. "Server
* Begin - Block 2
SELECTION-SCREEN BEGIN OF BLOCK b2 WITH FRAME TITLE text-002.
PARAMETER: p_local LIKE rlgrap-filename DEFAULT 'C:\' OBLIGATORY.
PARAMETER: p_server LIKE rlgrap-filename DEFAULT '/default' OBLIGATORY.
* End - Block 2
SELECTION-SCREEN END OF BLOCK b2.
* Begin - Block 3
SELECTION-SCREEN BEGIN OF BLOCK b3 WITH FRAME TITLE text-003.
SELECT-OPTIONS: s_kunnr FOR kna1-kunnr, "Customer Number 1
  s_land1 FOR kna1-land1. "Country Key
* End - Block 3
SELECTION-SCREEN END OF BLOCK b3.
* End - Block 1
SELECTION-SCREEN END OF BLOCK b1.
************************************************************************
* At Selection Screen OUTPUT *
************************************************************************
AT SELECTION-SCREEN OUTPUT.
* Check what radiobutton is selected
* Local
  IF r_local = 'X'.
  LOOP AT SCREEN.
  IF "screen-name = 'P_LOCAL'. " OR
  screen-name = '%_P_LOCAL_%_APP_%-TEXT'.
  screen-invisible = '0'.
  screen-input = '1'.
  MODIFY SCREEN.
  ELSEIF screen-name = 'P_SERVER'. " OR
  screen-name = '%_P_SERVER_%_APP_%-TEXT'.
  screen-invisible = '1'.
  screen-input = '0'.
  MODIFY SCREEN.
  ENDIF.
  ENDLOOP.
* Server
  ELSE.
  LOOP AT SCREEN.
  IF screen-name = 'P_SERVER' OR
  screen-name = '%_P_SERVER_%_APP_%-TEXT'.
  screen-invisible = '0'.
  screen-input = '0'.
  MODIFY SCREEN.
  ELSEIF screen-name = 'P_LOCAL' OR
  screen-name = '%_P_LOCAL_%_APP_%-TEXT' OR
  screen-name = '%_S_KUNNR_%_APP_%-TEXT' OR
  screen-name = '%_S_KUNNR_%_APP_%-OPTI_PUSH' OR
  screen-name = 'S_KUNNR-LOW' OR
  screen-name = '%_S_KUNNR_%_APP_%-TO_TEXT' OR
  screen-name = 'S_KUNNR-HIGH' OR
  screen-name = '%_S_KUNNR_%_APP_%-VALU_PUSH'. .
  screen-invisible = '1'.
  screen-input = '0'.
  MODIFY SCREEN.
  ENDIF.
  ENDLOOP.
  ENDIF.

My doubt is why use use the below statement ? means what is the exact use of the statement and in which case we generally use this statement ?

'%_P_LOCAL_%_APP_%-TEXT'

'%_S_KUNNR_%_APP_%-TEXT'


how the system comes to know about the statement ?


Please clear my doubt and if posible then send me some document.


Kind Regards,


Ajit

1 ACCEPTED SOLUTION

Former Member
0 Kudos

Hello Ajit,

    Juz follow the process below then u understood the logic of this...

'%_P_LOCAL_%_APP_%-TEXT'

'%_S_KUNNR_%_APP_%-TEXT'


Whenever in report if we use parameters or selection-screen, Automatically system generates a screen with the screen number 1000.


Juz press f1 in the selection screen parameter and go for technical information.. inthat double click the screen number  it will go the screen painter and go for the layout .In that layout double click all the fileds and see the name of each button and text u will come to know that why they used like this...


i hope u understand , any doubts please feel free to ask ...


Thanks,

Vijay SR



13 REPLIES 13

Former Member
0 Kudos

Dear Experts,

Why the user use the user-command statement ? no where he use the user-command FLG .

Please clarify the same .

Kind regards,

Ajit

0 Kudos

For rest you need to search

nabheetscn
Active Contributor
0 Kudos

Ajit

These are nothing but label text. When you create a parameters/select option selection screen you see the label also. Those label text are defined in this form. You can open any executable report check what are element created on selction screen 1000 created by SAP

Nabheet

Former Member
0 Kudos

Hello Ajit,

    Juz follow the process below then u understood the logic of this...

'%_P_LOCAL_%_APP_%-TEXT'

'%_S_KUNNR_%_APP_%-TEXT'


Whenever in report if we use parameters or selection-screen, Automatically system generates a screen with the screen number 1000.


Juz press f1 in the selection screen parameter and go for technical information.. inthat double click the screen number  it will go the screen painter and go for the layout .In that layout double click all the fileds and see the name of each button and text u will come to know that why they used like this...


i hope u understand , any doubts please feel free to ask ...


Thanks,

Vijay SR



Former Member
0 Kudos

Dear vijay,

As you said, I have gone through the layout and double click on each field and I found the name but in text nothing is mentaioned , So how i ll find that '%_P_LOCAL_%_APP_%' ?

Please clarify ..

kind regards,

Ajit

Former Member
0 Kudos

Dear vijay,

Thank you very much for your clear clarifications..

now I got all the field names and that '%_P_LOCAL_%_APP_% name also.

Thanks

Ajit

0 Kudos

Hi Ajit,

      Once if u found the answer is correct please mark it as right answer , so that i will useful for other sdn searchers to solve the same kind of issue...

Thanks

Vijay SR

0 Kudos

Dear,

Could anyone expalin why the user use user-command FLG ? what is use of this statement ?

Regards,

Ajit

0 Kudos

Hi Ajit,

The User-command statement is used to perform some action when the user makes changes to the screen. For example, if I have 2 radio buttons and for the 1st button i have to show 2 fields as selection fields and for the 2nd button I have to show 3 fields then based on the user command selected by the user (either 1st rbadio button or 2nd radio button) logic can be written.

With Regards,

Giriesh M

0 Kudos

Dear Girish,

But he has not use user command FLG anywhere in the  program. So I confuged.

Thanks

Ajit

0 Kudos

Hi Ajit,

The User command FLG will not be used in the program but it triggers the At-Selection Screen Output event when you select any of the radio button mentioned within a group. In this above code, R_local and r_server are radio buttons with the group rad1. So whenever user selects any radiobutoon the User command triggers the at selection screen event.

With Regards,

Giriesh M

0 Kudos

Thank you very much girish. Now I am clear

Former Member
0 Kudos

Dear Nabheet,

Thank you for your valueable answer. Now I am clear my doubt.

Tnaks

Ajit