Download as pdf or txt
Download as pdf or txt
You are on page 1of 2

Sharath Chandra Panuganti, Consultant - SAP YASH Technologies Pvt. Ltd.

Programmers Challenge:
Write a program which would accept a Material as a Parameter on the selection screen. When the user enters a material number on the selection-screen and presses ENTER, the shortdescription of that particular Material should appear beside the Parameter. Solution: Please find the below code snippet for the same.
REPORT ZMATNR_DESC.

SELECTION-SCREEN BEGIN OF LINE. *&Text element to Maintain Parameter text similar to Selection Texts SELECTION-SCREEN COMMENT 1(9) text-001. *&Input field for MATNR PARAMETERS: p_matnr TYPE mara-matnr VISIBLE LENGTH 18. *&Comment where the Material description gets populated on ENTER. SELECTION-SCREEN COMMENT 40(25) maktx. SELECTION-SCREEN END OF LINE. *&This could be done using both the events AT SELECTION-SCREEN OUTPUT as well *&as AT SELECTION-SCREEN. In either of the cases the description is *&populated beside the input field AT SELECTION-SCREEN." OUTPUT. IF p_matnr IS NOT INITIAL. SELECT SINGLE maktx FROM makt INTO maktx WHERE matnr = p_matnr AND spras = sy-langu. ENDIF.

Please find the below screen-shots for the program flow of the same

On F4 for Input help

The third entry has been chosen and ENTER.

You might also like