‎2008 Aug 04 5:17 PM
hi im using material number and description in my screen,
if the user changes the material number , then it has to validate and show the appropriate description.
how to code it in Process After Input.
PROCESS BEFORE OUTPUT.
MODULE STATUS_0200.
PROCESS AFTER INPUT.
***************
???????????????
*******************
MODULE USER_COMMAND_0200.
‎2008 Aug 04 5:58 PM
Write following code in PAI of your screen
FIELD p_material
MODULE get_desc ON REQUEST.code for module......
*&---------------------------------------------------------------------*
*& Module get_desc INPUT
*&---------------------------------------------------------------------*
* text
*----------------------------------------------------------------------*
MODULE get_desc INPUT.
IF p_material IS NOT INITIAL.
SELECT SINGLE maktx FROM makt INTO p_desc WHERE matnr = p_material AND spras = 'EN'.
IF sy-subrc NE 0.
MESSAGE 'Incorrect Material ' TYPE 'E'.
ENDIF.
ENDIF.
ENDMODULE. " get_desc INPUT
‎2008 Aug 04 5:43 PM
Hi Murali,
Please check the below code...
In PAI...
Data:
W_maktx type makt-maktx.
Select single
maktx
into w_maktx
from makt
where matnr eq p_matnr
and spras eq 'E'. " Language
if sy-subrc eq 0.
message w_maktx type 'S'.
else.
Message 'Material not found' Type 'E'.
endif.
Hope this would help you.
Good luck.
Narin
‎2008 Aug 04 5:50 PM
boss,
do u really think ur code will work in process after input.no way
‎2008 Aug 04 5:58 PM
Write following code in PAI of your screen
FIELD p_material
MODULE get_desc ON REQUEST.code for module......
*&---------------------------------------------------------------------*
*& Module get_desc INPUT
*&---------------------------------------------------------------------*
* text
*----------------------------------------------------------------------*
MODULE get_desc INPUT.
IF p_material IS NOT INITIAL.
SELECT SINGLE maktx FROM makt INTO p_desc WHERE matnr = p_material AND spras = 'EN'.
IF sy-subrc NE 0.
MESSAGE 'Incorrect Material ' TYPE 'E'.
ENDIF.
ENDIF.
ENDMODULE. " get_desc INPUT
‎2008 Aug 04 6:16 PM
thank u for ur reply,
but i have used the coding in se38,
can u guide me , how to use this in module....
START-OF-SELECTION.
SELECT * FROM mara UP TO 10 ROWS
INTO CORRESPONDING FIELDS OF TABLE itab
WHERE matnr IN s_matnr AND ersda IN s_date.
read table itab index 1 .
if sy-subrc eq 0 .
select single * from makt where matnr eq itab-matnr .
endif .
CALL SCREEN 200.