Wednesday, September 28, 2016

Change Labels on screen at Run Time (Dialog programming)

Introduction
In dialog programming we cannot change the labels on screen dynamically. Labels act as constants and its value cannot be changed at run time. This article will show you trick to change such label text at runtime.

Requirement
Change label text on screen based on input selection. In this demo, we have Test as checkbox on selection screen. We will be displaying two ALVs on screen. So we have two container added on screen. We want to display text line which will show whether it is ‘TEST’ mode or not.  Text of this label will be chosen based on value of checkbox on selection screen.

Steps to Do
On required Screen add input/output field .
Set the properties of DYN_TEXT as below. Set Field as ‘Output only’.  
Now go to PBO section of Screen. Write down code on Module Status_1001.
  
Output
Run program without test mode.
Output





Run the program with Test mode.
Output



No comments:

Post a Comment

SAP giới thiệu mã hỗ trợ AI trong ngôn ngữ ABAP riêng của mình

SAP đã ra mắt một loạt tính năng mã hỗ trợ AI trong môi trường phát triển ứng dụng dựa trên đám mây của mình, đồng thời tham gia vào danh sá...