cancel
Showing results for 
Search instead for 
Did you mean: 

BSP checkboxes to display table records.

Former Member
0 Kudos
181

Hi All,

I am trying to display the database table record field as checkbox in the BSP page.

I have used the code

data itab type ZPRODUCTS.

select single * from ZPRODUCTS into itab where PRODUCTS = SAPProduct.

%>

<td Valign="top">

<htmlb:checkbox id = "<%=itab-PRODUCTS%>"

checked ="<%=itab-PRODUCTS%>"

text = "<%=SAPProduct%>"

/>

</td>

But its not diplaying anything. can any one help me out.

Can i give the check boxes to display in the loop like no of records in the database table and to that many no of times the loop for the checkboxes should be displayed.

Please help me out.

Thank you very much in advance.

Saripalli S

Accepted Solutions (0)

Answers (1)

Answers (1)

guillaume-hrc
Active Contributor
0 Kudos

Hi,

Of course you can.

Use some ABAP scripting.

I don't know the structure of your Z-table, but here is the principle

<% LOOP AT itab. %>
<htmlb:checkbox id      = "<%= itab-SAPProduct %>"
                checked = "<%= itab-PRODUCTS %>"
                text    = "<%= itab-SAPProduct %>" />
<% ENDLOOP. %>

Best regards,

Guillaume

Former Member
0 Kudos

Hi

Thank you very much for your answer.

my table structure is with Productid ,productname.

I am using itab to get the record for the table to display in the checkbox.

<%

data itab type ZPRODUCTS.

select single * from ZPRODUCTS into itab where PRODUCTS = SAPProduct.

%>

this is the statement i am using. But when I am using to display the itab content in the check box its not displaying.

but i am not getting any errors. Is there any logical error where i have to check.

guillaume-hrc
Active Contributor
0 Kudos

Hi,

Which field do you use to store the checkbox status (checked, unchecked) ?

Best regards,

Guillaume

Former Member
0 Kudos

Hi

I used checked

<td Valign="top">

<htmlb:checkbox id = "<%=itab-PRODUCTS%>"

checked ="<%=itab-PRODUCTS%>"

text = "<%=itab-PRODUCTS%>"

/>

Regards,

suneetha saripalli

guillaume-hrc
Active Contributor
0 Kudos

You can't

Checked is a "boolean" : true or false, or ' ' or 'X'.

You cannot use it for both the text and the status, it doesn't make sense.

Best regards,

Guillaume

Former Member
0 Kudos

Hi,

Thank you so what can be the other possibility to implement i have read it. We cant use this checkboxes other than true or false.

can you suggest me for another way.

With best regards,

Suneetha

guillaume-hrc
Active Contributor
0 Kudos

OK, I think I got it right now.

What is the purpose of the checkbox ?

To select some of the products and perform an action ?

DATA: BEGIN OF tab_products,
             check TYPE xfeld,
             INCLUDE TYPE ZPRODUCTS.
DATA: END OF tab_products.

Here it is.

Best regards,

Guillaume

Former Member
0 Kudos

Hi,

Is it that the checkboxes syntax correct. Its giving message like only oo objects are allowed. So please tell me is it I can give in BSP the above code for checkboxes?

Suneetha

raja_thangamani
Active Contributor
0 Kudos

I also test the above code..i dont see any issue..

Or otherway around is, put the below code in TYPE DEfinitions:

  TYPES: BEGIN OF tab_products,
             check TYPE xfeld,
             INCLUDE TYPE ZPRODUCT.
TYPES: END OF tab_products.

Then in your Event, you can use like

<b>Structure:-</b>

Data: itab type tab_products.

<b>Internal Table:-</b>

Data: itab type table of tab_products.

<i>* Reward each useful answer</i>

Raja T

guillaume-hrc
Active Contributor
0 Kudos

Hi,

Do you have remaining issues ?

If not, please assign points and close the thread.

Best regards,

Guillaume