Skip to Content
Jul 07, 2011 at 09:12 PM

How to differentiate that code is system generated or developer wrote it?



When i am checking a custom interactive form, i found the below code in the Form Script (FormCalc), (in the same form, Java Script also used for some subforms)

MY_ROOT.PAGE1.companySub.Button1::click - (FormCalc, client)
var Name
var Street
//var CC 
//var CZ 
//var FN 
var Cmsg 
if (HasValue(MY_ROOT.PAGE1.custdetailsSub.Name)) then 
Name = "" 
Name = "- Name\u000a" 
Cmsg = Name
if (HasValue(MY_ROOT.P1.custdetailsSub.Street)) then 
Street = "" 
Street = "- Street\u000a" 
Cmsg = Concat(Cmsg, Street) 
//if (HasValue(form1.#subform[0].Table4.Row3.Client_City)) then 
//CC = "" 
//CC = "Client City\u000a" 
//Cmsg = Concat(Cmsg, CC) 
//if (HasValue(form1.#subform[0].Table4.Row4.Client_Zip)) then 
//CZ = "" 
//CZ = "State/Zip or Province/Postal Code\u000a" 
//Cmsg = Concat(Cmsg, CZ) 
//if (HasValue(form1.#subform[4].For_Name)) then 
//FN = "" 
//FN = "For Client Name" 
//Cmsg = Concat(Cmsg, FN) 
if (Cmsg <> "") then 
Cmsg = Concat("The following field(s) need to be filled before submitting the form.\u000a", Cmsg), "Missing Value", 0, 0) 
MY_ROOT.PAGE1.companySub.Button1.presence = "hidden" 

Pls. let me know

1) Is the above code is created by sysstem (SAP-ADS) itself? or a developer wrote that code manually?

2) How to differentiate a piece of code that its created by system (SAP-ADS) or manullay wrote?

3) Pls. eloborate that wht the above code is doing/validating? bcz am confusing that why code

 (Name = "" & Street = "") 

is okay and why it populating Message variable if

(Name = "- CoName\u000a" & Street = "- CoName\u000a") 

? these fields (Name and Street) should get values from user right? if user did not input any value then Error message. !


 CUSTOMER.P1.companySub.Button1.presence = "hidden" 

the above lin eof code in the snippet is saying that 'Hide' the subform, if Name & Street has some values in it, why it should Hide? its displayable filed right?

5) Is green color represents Comments/documentation part?

Thank you