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

AT SELECTION-SCREEN ON VALUE-REQUEST FOR

Former Member
0 Likes
7,035

Experts,

I have two selection parameters on Selection_Screen as subscreen, as below:

  • Custom Selection Screen 1010

selection-screen begin of screen 1010 as subscreen.

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

SELECT-OPTIONS :

s_matnr FOR mara-matnr MODIF ID sc1, "Material

s_grid FOR mara-J_3APGNR MODIF ID sc6, "Grid values "pkb001

SELECTION-SCREEN END OF BLOCK b2.

selection-screen end of screen 1010.

Now i want to populate s_grid (Grid value) based on the values enterd for s_matnr (material ).

but when i want use:

AT SELECTION-SCREEN ON VALUE-REQUEST FOR s_grid,

I'm not getting the values eneterd in s_matnr..

is the problem beacuse of subcreen?

Answers are highly appriciated.

Thanks.

1 ACCEPTED SOLUTION
Read only

amit_khare
Active Contributor
4,371

I think you are manually providing the value for s_matnr, ifso, then SAP will not able to recognize that value unless an event is trigger. So, press enter after inputting the value, it will take it in s_grid request. Otherwise, just allow user to choose value from F4 for matnr, this will help in suppressing the pressing of enter key.

Experts,

I have two selection parameters on Selection_Screen as subscreen, as below:

  • Custom Selection Screen 1010

selection-screen begin of screen 1010 as subscreen.

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

SELECT-OPTIONS :

s_matnr FOR mara-matnr MODIF ID sc1, "Material

s_grid FOR mara-J_3APGNR MODIF ID sc6, "Grid values "pkb001

SELECTION-SCREEN END OF BLOCK b2.

selection-screen end of screen 1010.

Now i want to populate s_grid (Grid value) based on the values enterd for s_matnr (material ).

but when i want use:

AT SELECTION-SCREEN ON VALUE-REQUEST FOR s_grid,

I'm not getting the values eneterd in s_matnr..

is the problem beacuse of subcreen?

Answers are highly appriciated.

Thanks.

14 REPLIES 14
Read only

amit_khare
Active Contributor
4,372

I think you are manually providing the value for s_matnr, ifso, then SAP will not able to recognize that value unless an event is trigger. So, press enter after inputting the value, it will take it in s_grid request. Otherwise, just allow user to choose value from F4 for matnr, this will help in suppressing the pressing of enter key.

Read only

0 Likes
4,371

Amit,

what did you meant by saying "Otherwise, just allow user to choose value from F4 for matnr, this will help in suppressing the pressing of enter key" ?

s_matnr, s_grid both uses F4 to get the values.

but when i press F4 for s_matnr then the values are coming from MARA table.

when i press F4 for s_grid, then the above code i provided should execute...

thanks!

Read only

Former Member
0 Likes
4,371

Hi,

Because the value manully input, so it should use an event to trigger otherwise the value you can not get it. An easy way, after you input the value, press 'Enter' ,then you can get it.

Try it.

Hope it helps.

Regards,

Chris Gu

Read only

Former Member
0 Likes
4,371

Hi ,

use 1000 screen in place of 1010screen.

Regards

Sreeni

Read only

0 Likes
4,371

Sreeni,

i cant use 1000 as subscreen, beacuse that is default screen number..

in my case; 1010 is subscreen on screen 100. i had other elements to include using screen painter.

Read only

Former Member
0 Likes
4,371

Hi,

the code have an error!

*AT SELECTION-SCREEN ON VALUE-REQUEST FOR s_grid, *

Error Description: "ON VALUE-REQUEST FOR" should be followed by <parameter> or <select-option>-LOW / <select-option>-HIGH.

And in AT SELECTION-SCREEN, the s_matnr is not getting the values eneterd. Because the value isn't write the s_matnr. Solution means: After you input the s_matnr, you need enter give system read the value.

Best Regards,

Wind lin

Read only

0 Likes
4,371

Wind lin,

in my code I'm using..

AT SELECTION-SCREEN ON VALUE-REQUEST FOR s_grid-LOW

thanks.

Read only

Former Member
0 Likes
4,371

Hi,

Use this FM 'DYNP_VALUES_READ' to get the values from the screen.

Example

AT SELECTION-SCREEN ON VALUE-REQUEST FOR s_lgort-low.

IF r_werks[] IS INITIAL.

populate lt_dynpread with S_WERKS-LOW and S_WERKS-HIGH

CALL FM 'DYNP_VALUES_READ'

ENDIF.

Read only

Former Member
0 Likes
4,371

Hi Prema,

As you are not hitting enter after you enter the MATNR value there is no PAI triggering so use DYNP_VALUES_READ to get the entered MATNR read by the program and used further in the Program where you can use in the F4 help for grid

call function DYNP_VALUES_READ

Regards

Ramchander Rao.K

Read only

Former Member
0 Likes
4,371

Yes that is correct, Once I hit enter key, then only the value for s_matnr populates, but it is not a good Idea to expect the user to hit the enter key. is there any way i can imitate/simulate "enter" key in the program?

also I'm using the FM:'DYNP_VALUES_READ' but that is also not getting me any value..

below is the code I'm using,



FORM sub_get_grid .

  Refresh: t_mara.
  data: lin type i.

  data: l_dyname type standard table of dynpread,
  w_dynpread type dynpread.

  clear w_dynpread.
  w_dynpread-fieldname = 'S_MATNR'.
  append w_dynpread to l_dyname.
  clear w_dynpread.


  CALL FUNCTION 'DYNP_VALUES_READ'
    EXPORTING
      dyname     = sy-repid
      dynumb     = sy-dynnr
    TABLES
      dynpfields = l_dyname.


*Do not allow to select more than 1 material at a time.
  SELECT
    MARA~MATNR
    INTO TABLE t_mara
    FROM MARA
    WHERE MARA~MATNR IN s_matnr.

  describe table t_mara LINES lin.

  If lin > 1.
    Refresh: s_matnr.
    MESSAGE i000 WITH text-033.
    LEAVE LIST-PROCESSING.
*    LEAVE TO SCREEN 100.
  endif.

ENDFORM.    

Read only

Former Member
0 Likes
4,371

Dear Prema,

This link will help you. https://www.sdn.sap.com/irj/scn/advancedsearch?query=atSELECTION-SCREENONVALUE-REQUESTFOR+&cat=sdn_all

Regards,

Flavya

Read only

Former Member
0 Likes
4,371
Read only

0 Likes
4,371

sabyasachi,

even this URL is not helping me..

Thanks.

Read only

Former Member
0 Likes
4,371

thanks all for your help and time.

i got it resolved by using: MATCHCODE OBJECT (which is Elementary srch hlp)



*     s_grid FOR mara-J_3APGNR MODIF ID sc6,    "Grid values   "pkb001           (before)
     s_grid for mara-J_3APGNR MATCHCODE OBJECT /AFS/MTX_SIZE_SHLP MODIF ID sc6,   (now)

I could reolve it by using thread:

by Girish Kumar Loganathan.

URL: http://www.sapdevelopment.co.uk/dictionary/shelp/shelp_basic.htm