cancel
Showing results for 
Search instead for 
Did you mean: 

f4 help : how to select all fields of a row

former_member206377
Active Contributor
0 Kudos

Hi All,

I am implementing f4 help in my bsp page. in teh help page i have 3 fields for each row. i get the value of key row in the input field once i select a particular row, bt I also want to access other 2 fields of the row that is selected, How can i do this?

in the in put field i wnat only the key field tyo be displayed, but in the BSP application i want to access the otehr two fields that are in teh selected row, how can i do this?

Thanks,

Vasuki

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi Vasuki,

As you have already transferred a single value to the parent window, the solution should be simple.

But the important thing is, you have to decide whether this should be performed using the javascript function or using backend ABAP code.

Assuming that you have formed the f4 page with the htmlb:tableview

Soltuion 1:

On click of the row, the backend event is raised, since you already have a tableview for this, you can retrieve the information from the tableview based on the row number that is selected. Then this work area can be stored as part of the model data or applicaiton class data or controller class data.

After the above said request is processed, the response comes back to the same popup, where you can transfer all your work area values into javascript variables, like...


var key_field = '<%= wa-key %>';
var column1_value = '<%= wa-column1_value %>';
var column2_value = '<%= wa-column2_value %>';

Now these three variable values can be passed to the parent, by using the similar logic that you used to transfer the selected value to the parent page. (This can be done using the Javascript DOM objects)

After this is done you could close the popup window using window.close();

Assuming that you have formed te f4 page with the html table,

Solution 2:

On selection of the row, you could be able to traverse the tags on the selected row and you should be able to get the second and thrid column values and then store them in javascript variable as discribed in the solution 1 and transfer them to the parent window and close the window.

Solution 3:

This solution if you want to use this information just during an antoher event, all you need to do is, have some hidden <input tags> and when the row is selected you could transfer the selected row values to this hidden input elements.

Then these become a part of your form_fields array which you could use it during the event handling.

Hope it helps!

Regards,

Maheswaran

Edited by: Maheswaran B on Oct 30, 2009 10:56 PM

former_member206377
Active Contributor
0 Kudos

Hi Maheswaran,

Thanks a lot for your reply .

I have used htmlb:tableview for the F4 page.

I am not able to post my code here. I have used the procedure mentioned in this link

f4 help + bsp + sap technical (google search) ( I am not able to post thsi link either)

Thanks in advance

former_member206377
Active Contributor
0 Kudos

Hi Maheswaran,

Here s my code: please ignore spaces between few keywords in HTML.

Layout page of selection.htm :


function transf (fval)
{
    document.getElementById("overlay").value = fval;
}
function getkml()
{
document.open('help.htm', 'list', "height=350 width=250 left=320 top=200 status=no")
}

          <ht mlb:textView text   = "Select Overlay"
                          design = "EMPHASIZED" />
          <htm lb:inputField id     = "overlay"
                 showHelp          = "X"
                 onValueHelp = "getkml()"   />

                           <ht mlb:button id      = "add"
                        tooltip = "Add Overlay to the Map" />


Layout page of help.htm



function getdata()
{
opener.transf("<%=FORCELEMENT%>");
window.close();
return true;
}

    <ht ml b:tableView id="inputhelp" table="<%=it_kml%>"
                     selectionMode="SINGLESELECT"
                     onRowSelection="rowSelection"
                     keyColumn="FORCELEMENT" >
      <htm lb:tableViewColumn columnName="FORCELEMENT"></ht mlb:tableViewColumn>
      <htm lb:tableViewColumn columnName="BEGINDATE"></htm lb:tableViewColumn>
      <ht ml b:tableViewColumn columnName="TIME"></ht mlb:tableViewColumn>
      </ht mlb:tableView>
      <htm lb:button  text          = "Submit"
                     onClientClick = "getdata()" />

OnInputprocessing (help.htm)


data : tv type ref to cl_htmlb_tableview,
       tv_data type ref to cl_htmlb_event_tableview,
       event type ref to cl_htmlb_event.

tv ?= cl_htmlb_manager=>get_data(
             request = runtime->server->request
             name = 'tableView'
             id = 'inputhelp' ).
tv_data = tv->data.
forcelement = tv_data->row_key.

As you can see in the code , i have the field 'forcelement' that is returned back to the input field on the selection page. Though I want only the foecelement passed back to the input field, but i also want to access the other 2 fields 'begindate' and 'time' , but the input field should however be populated only with forcelement'.

Thanks in advance

Answers (1)

Answers (1)

former_member206377
Active Contributor
0 Kudos

Solved