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

PAI

Former Member
0 Likes
566

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.

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
539

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

4 REPLIES 4
Read only

narin_nandivada3
Active Contributor
0 Likes
539

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

Read only

0 Likes
539

boss,

do u really think ur code will work in process after input.no way

Read only

Former Member
0 Likes
540

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

Read only

0 Likes
539

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.