Display text in dynamic in module pool Programming



 dialog programming we cannot change the labels on the screen dynamically. Labels act as constants and their value cannot be changed at runtime. This article will show you trick to change such label text at runtime.
a simple program to display text in dynamic 


PROGRAM  sapmzrk_mpp8.

DATAok_code TYPE sy-ucomm,
      t1      
TYPE char40,
      t2      
TYPE char40,
      t3      
TYPE char40,
      t4      
TYPE char40,
      t5      
TYPE char40,
      t6      
TYPE char40,
      textdisplay 
TYPE char40,
      textdisplay1 
TYPE char40,
      textdisplay2 
TYPE char40,
      textdisplay3 
TYPE char40,
      textdisplay4 
TYPE char40,
      textdisplay5 
TYPE char40,
      textdisplay6 
TYPE char40.

MODULE status_9001 OUTPUT.
  
SET PF-STATUS 'ZSTATUS'.
  
SET TITLEBAR 'ZTITLE'.

ENDMODULE.   


MODULE user_command_9001 INPUT.
  
CASE ok_code.
    
WHEN  'BACK' OR 'EXIT' OR 'CANCEL'.
      
LEAVE PROGRAM.
    
WHEN  'DISPLAY'.
      
PERFORM f_output.
  
ENDCASE.
ENDMODULE.                 " USER_COMMAND_9001  INPUT
*&---------------------------------------------------------------------*
*&      Form  F_OUTPUT
*&---------------------------------------------------------------------*
*       text
*----------------------------------------------------------------------*
*  -->  p1        text
*  <--  p2        text
*----------------------------------------------------------------------*
FORM f_output .
  
IF t1 IS INITIAL.
    textdisplay1 
'Pleas Enter First Name'.
  
ELSEIF t1 IS NOT INITIAL.
    
CLEARtextdisplay1.
  
ENDIF.
  
IF t2 IS INITIAL AND t1 IS NOT INITIAL.
    textdisplay2 
'Pleas Enter Second Name'.
  
ELSEIF t2 IS NOT INITIAL.
    
CLEAR:  textdisplay2.
  
ENDIF.
  
IF t3 IS INITIAL  AND t2 IS NOT INITIAL..
    textdisplay3 
'Pleas Enter Email Address'.
  
ELSEIF t3 IS NOT INITIAL.
    
CLEAR:  textdisplay3.
  
ENDIF.
  
IF t4 IS INITIAL  AND t3 IS NOT INITIAL..
    textdisplay4 
'Pleas Enter Mobile Number'.
  
ELSEIF t4 IS NOT INITIAL.
    
CLEAR:  textdisplay4.
  
ENDIF.
  
IF t5 IS INITIAL  AND t4 IS NOT INITIAL..
    textdisplay5 
'Pleas Enter Address'.
  
ELSEIF t5 IS NOT INITIAL.
    
CLEAR:  textdisplay5.
  
ENDIF.
  
IF t6 IS INITIAL  AND t5 IS NOT INITIAL..
    textdisplay6 
'Pleas Enter City Name'.
  
ELSEIF t6 IS NOT INITIAL.
    
CLEAR:  textdisplay6.
  
ENDIF.


ENDFORM.  

Comments

Popular posts from this blog

all user exit mv45afzz (implicit user exit )

Long Text in input and output field in module pool

MB_MIGO_BADI THIS BADI USED TO POSTING DATA IN MIGO