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

Regarding Fetching the data when Enter

former_member242166
Participant
0 Likes
935

HI experts,

i have a selection-screen having 10 parameter value. first value is primary key field. When i give already existing value in first field and enter it will fetch the data from table to selection-screen how can i do this.  I know fetching the data using pushbutton but i dont know using enter action.  How can i do this please help me..

Thanks and Regards,

Linganathan

Moderator message - please search before asking.

Locked

Message was edited by: Rob Burbank

Use AT SELECTION-SCREEN. Try this:

DATA: g_kunnr TYPE kna1-kunnr,
       g_name1 TYPE kna1-name1.

PARAMETERS: p_kunnr LIKE g_kunnr,
             p_name1 LIKE g_name1.

AT SELECTION-SCREEN.

   " Select Customer Name
   IF p_kunnr IS NOT INITIAL.
     SELECT SINGLE name1
       FROM kna1
       INTO g_name1
      WHERE kunnr EQ p_kunnr.

     IF sy-subrc EQ 0.
       " pass the value to parameter
       p_name1 = g_name1.
     ENDIF.
   ENDIF.

AT SELECTION-SCREEN OUTPUT.
   " make the parameter P_NAME1 inactive.
   LOOP AT SCREEN.
     IF screen-name EQ 'P_NAME1'.
       screen-input = 0.
       MODIFY SCREEN.
     ENDIF.
   ENDLOOP.

Regards,

Jake

5 REPLIES 5
Read only

former_member282968
Contributor
0 Likes
849

Hi,

" AT selection-screen "  is the event which gets triggered for any action in the selection-screen. For a particular field it will be "at selection screen on <field-name>".

You can write the code or select query based on the event and the function code which comes during the actions.

With regards,

Read only

0 Likes
849

Hi Naveen i cant get you .. Can you please explain somewat briefly.

Read only

0 Likes
849

Hi,

Please refer some of the examples given in the T-code ABAPDOCU in the node "Processing selection screen" under ABAP user dialogs->Selection-screen.

With regards,

Read only

Former Member
0 Likes
849

Hi,

You can make use of AT-SELECTION-SCREEN for the same.

Refer to the below link:

http://scn.sap.com/thread/2027004

Hope it solves your problem.

Read only

Former Member
0 Likes
849

Use AT SELECTION-SCREEN. Try this:

DATA: g_kunnr TYPE kna1-kunnr,
       g_name1 TYPE kna1-name1.

PARAMETERS: p_kunnr LIKE g_kunnr,
             p_name1 LIKE g_name1.

AT SELECTION-SCREEN.

   " Select Customer Name
   IF p_kunnr IS NOT INITIAL.
     SELECT SINGLE name1
       FROM kna1
       INTO g_name1
      WHERE kunnr EQ p_kunnr.

     IF sy-subrc EQ 0.
       " pass the value to parameter
       p_name1 = g_name1.
     ENDIF.
   ENDIF.

AT SELECTION-SCREEN OUTPUT.
   " make the parameter P_NAME1 inactive.
   LOOP AT SCREEN.
     IF screen-name EQ 'P_NAME1'.
       screen-input = 0.
       MODIFY SCREEN.
     ENDIF.
   ENDLOOP.

Regards,

Jake