Application Development 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: 

Change field on screen

Former Member
0 Kudos

Hi,

I have a module pool requirement wherein i need to display one field as input field from user Lets say MATNR

and based on material number selected by user , there is one additional field on module pool lets say material description

which is purely display field. Now the requirement is that when user enter material number on screen then its corresponding

material description should automatically get displayed on screen.

Thanks

Parga

3 REPLIES 3

former_member1245113
Active Contributor
0 Kudos

Hi

Check the below Code Snippet

DATA : from_f4.
" Just copy this and Execute this is Tested Code
PARAMETERS : matnr TYPE matnr,
             maktx TYPE maktx.

DATA : BEGIN OF itab OCCURS 0,
       matnr type matnr,
       maktx type maktx,
   END OF itab.
DATA : fmap TYPE TABLE OF dselc WITH HEADER LINE.

AT SELECTION-SCREEN OUTPUT.
  LOOP AT SCREEN.
    IF screen-name = 'MAKTX'.
      screen-input = 0.
      MODIFY SCREEN.
    ENDIF.
  ENDLOOP.

AT SELECTION-SCREEN ON VALUE-REQUEST FOR MATNR." If it is a selection
*Screen
*else in PROCESS ON VALUE REQUEST

  SELECT A~MATNR B~MAKTX FROM MARA AS A INNER JOIN MAKT AS B
    ON A~MATNR = B~MATNR
    INTO TABLE ITAB UP TO 200 ROWS.

  fmap-fldname = 'MATNR'.
  fmap-dyfldname = 'MATNR'.
  APPEND fmap.
  fmap-fldname = 'MAKTX'.
  fmap-dyfldname = 'MAKTX'.
  APPEND fmap.

  CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'
    EXPORTING
      ddic_structure         = 'ZMATNR11' " Create your Own Structure in SE11
" with only 2 fields (MATNR and MAKTX)
" We can use MAKT(so that we can avoid structure 
"creation in SE11)
" table but for unkonw reasons it is returning Junk 
"Chars at the end of Material description
      retfield               = 'MATNR' 
     dynpprog               = sy-repid
     dynpnr                 = sy-dynnr
     dynprofield            = 'MATNR'
     value_org              = 'S'
     display                = 'F' " This forces the F4 help for
    TABLES
      value_tab              = itab
     dynpfld_mapping        = fmap.

Cheerz

Ram

Edited by: Rob Burbank on May 25, 2010 11:05 AM

Former Member
0 Kudos

Write a PBO Module:


IF g_matnr IS NOT INITIAL.
 SELECT SINGLE maktx 
      FROM makt
      INTO g_maktx
    WHERE matnr EQ g_matnr
      AND spras EQ syst-langu.        
ENDIF.

Regards,

John.

Former Member
0 Kudos

Moderator message - Please do not ask or answer basic questions - thread locked Rob