Technology Blogs by Members
Explore a vibrant mix of technical expertise, industry insights, and tech buzz in member blogs covering SAP products, technology, and events. Get in the mix!
cancel
Showing results for 
Search instead for 
Did you mean: 
Former Member

Hi All,

I saw so many threads about how to hide fields dynamically,how to change titles dynamcially on SAP community Network.

I decided to have a document on this so it will help us .

How Views get displayed?

Normally Views will get displayed with the help of .HTM page and the Configuration done via UI config tab.

How conifguration data can be read?

When we do configuration and in .HTM page two lines of code will be generated to read your configuration field lable's postions etc ,See below two lines of code which read configuration

<%

data: lv_xml    type string.

lv_xml    = controller->CONFIGURATION_DESCR->GET_CONFIG_DATA( ).

%>

<chtmlb:config xml     = "<%= lv_xml %>"

                mode    = "RUNTIME"  />

If you observe above two lines It will read the data in XML format ad pas it to frame work in run time which will display accordingly.

How XML file looks like in Runtime?


If you observe ,It clearly have Row number,column number and the lable for,Input field details.

How to hide  the field in tun time?

So just put your condition and then write a statement like below:

For example i want to hide a filed mc_name2 then i write like

" replace all occurances of "//MEMBERBASICSEARCH//STRUCT>MC_NAME2 " with ' ' in lv_xml.

and then pass our modifed XML to Config tab as show below

<chtmlb:config xml     = "<%= lv_xml %>"

                mode    = "RUNTIME"  />

so the field mc_name will be hidden with this logic

Final code would be like below:

<%

data: lv_xml    type string.

lv_xml    = controller->CONFIGURATION_DESCR->GET_CONFIG_DATA( ).

%>

" replace all occurances of "//MEMBERBASICSEARCH//STRUCT>MC_NAME2 " with ' ' in lv_xml.

<chtmlb:config xml     = "<%= lv_xml %>"

                mode    = "RUNTIME"  />

.

Thanks for reading it and please let me know if i need to improve anything as it is my first document on SDN.



1 Comment
Labels in this area