Get the F4 help of a field based on the value of another field

By Ashesh Thodupunuri, IBM India

Introduction: This article will discuss in detail how to access or update the value of one field in the F4 help event of another field.  

Requirement and scenario: We often come across requirements where in values in the F4 help of one field should be based upon the value in another field.  

For example take a scenario where there are two fields on the selection screen. A value is entered in the first field, now the values in the F4 help of the second field should be based on the value entered in the first field.  

The challenge here is the first field value is not directly accessible (or read) in the F4 help event of the second field. We will see how to tackle this challenge.  

Steps to be followed: 

Step1: Create a program in SE38 with two selection screen fields.  

 Here I have taken two fields: Company code & Sales Organization on selection screen.

If you see the F4 help of the Sales organization field it gives the below values.  


You can see Sales Organizations belonging to different company codes (MAC,TRE etc). Now we want to limit the Sales Org. values based on the company code value entered in the company code field.

In this case I want to have the Sales Org. values as TRE1, TRE2, TRE3 as I have entered company code value equal to TRE.  

Step2:   Now we will create a custom F4 help for the sales organization field using below selection screen event:  


Check table or value table for the Sales organization field is TVKO.  

Step3:  Write the below code in the above mentioned event.  

Click here to continue...

Please send us your feedback/suggestions at webmaster@SAPTechnical.COM 

HomeContribute About Us Privacy Terms Of Use • Disclaimer • SafeCompanies: Advertise on SAPTechnical.COM | Post JobContact Us  

Graphic Design by Round the Bend Wizards

footer image footer image