cancel
Showing results for 
Search instead for 
Did you mean: 

BSP Code

Former Member
0 Kudos

Hi,

I have a 'Z' BSP application which uses the standard class CL_BSP_HAP_DOCUMENT_UI and method DOCUMENT_GET_LIST_R_OPEN2. In this I'm trying to display a table which has structure "HAP_S_DOCUMENTS " from this method. Need to show one more column in the application, but this standard structure doesnot have this column.

I can think only one way, need create one more sturcture that includes my new column and HAP_S_DOCUMENTS and need to fill the internal table and display this in BSP.

How can we can add column dynamically . What is the best and easiset way of doing this.

In the LAYOUT coding -

<htmlb:tableView id              = "<%= cl_bsp_hap_document_cs=>c_bsp_documents_todo %>"
                       visibleRowCount = "12"
                       fillUpEmptyRows = "<%= cl_bsp_hap_document_cs=>c_false %>"
                       width           = "100%"
                       onHeaderClick   = "SORTING"
                       sort            = "APPLICATION"
                       headerVisible   = "<%= cl_bsp_hap_document_cs=>c_true %>"
                       headerText      = "<%= otr(PAOC_HAP_DOCUMENT_UI/TITLE_LIST_TODO) %>"
                       selectionMode   = "MULTISELECT"
                       table           = "<%= APPLICATION->T_DOCUMENTS_R_OPEN %>" >
        <htmlb:tableViewColumns>

Highly appreciate your help!!!

Regards,

Lekha.

Accepted Solutions (0)

Answers (2)

Answers (2)

Former Member
0 Kudos

Hi,

> I can think only one way, need create one more sturcture that includes my new column and HAP_S_DOCUMENTS and need to fill the internal table and display this in BSP.

as you said, you need a Z structure, which includes HAP_S_DOCUMENTS and the new column. The problem will be that you have to make changes in the class, which I find difficult since you modify SAP objects.

> How can we can add column dynamically . What is the best and easiset way of doing this.

Another option could be to work like this:

1) read your current structure´s information with function DDIF_FIELDINFO_GET. This delivers the whole information about the structure.

2) feed tag <htmlb:tableView> as you do so far

3) work with tag <htmlb:tableViewColumn> in a loop to pass the fields that shall be displayed on the screen

4) after the loop pass your new column also with <htmlb:tableViewColumn>

<htmlb:tableView id    = "<%= cl_bsp_hap_document_cs=>c_bsp_documents_todo %>"
                  visibleRowCount = "12"
                   etc. etc.>
   <% loop at table_dfies. %>
    <htmlb:tableViewColumn ID = "some ID"
                            value = "<%=table_dfies-value%>"
                            title = "<% table_dfies-screentxt_short%>"
                            width = "<%= table_dfies-width%>"/>
   <% endloop %>
    <htmlb:tableViewColumn ID = "new ID"
                             value = "<%=your value%>"
                             title = "<% your title %>"
                             width = "<%= your width%>"/>
<htmlb:tableView></htmlb:tableView>

I am not sure if the attributes are correct; I am far from SAP.

krishnendu_laha
Active Contributor
0 Kudos

I think you are in the right track to make a new structure including the standard one...

Because technically it should be possible to pass dynamic table to 'tableView' elenemt.

but there could be a problem handling in interactive way of working / syntax check error in OOPS scenario...

Thanks