Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

Checkbox:

Former Member
0 Kudos

Hi frnd's

I had created 6 checkboxs and textboxs with the loop statement.

If the values contained in the internal table is 3 means it will display only 3 checkboxes and textboxes.

The retrived data is displayed using loop at screen statement and also the chckbox is made invisible.

but if i select any checkbox ie displayed it is not checked

If i select any chkbox it should be selected.

how can i do this.

13 REPLIES 13

Former Member
0 Kudos

Hi Suganya,

Can you clarify your requirement please? I suppose your requirement is depending on the number of items in the internal table, that many checkboxes and textboxes must be displayed.Am I right?

Regards,

Sylendra.

0 Kudos

checkbox1 textbox1

checkbox2 textbox2

checkbox3 textbox3

checkbox4 textbox4

i had created this using a loop.

i am getting values for the textbox from the table.

if i had only 3 values the fourth checkbox and textbox should be made invisible.

i made that using.

lines = sy-loopc.

idx = sy-stepl + line.

IF idx GE fill.

scr-txt = fromtable.

ELSE.

loop at screen.

if screen-name = 'scr-chk'.

screen-invisible = 0.

else.

screen-invisible = 1.

modify screen.

endif.

endloop.

but after that if i select the checkbox it is not selected.

if i click any checkbox it should be checked.

0 Kudos

Hi Suganya,

I don't know how u created checkbox and textboxes using a loop.From what I could understand from your code,you are modifying the screen using MODIFY statement only in the else statement.

So try writing like this:

loop at screen.

if screen-name = 'scr-chk'.

screen-invisible = 0.

else.

screen-invisible = 1.

endif.

modify screen.

endloop.

In the meantime, can you tell me how you created checkbox and textbox using a loop.It will be nice to learn new things.

Regards,

Sylendra.

0 Kudos

... also very unclear to me what you mean, how these checkboxes appear, under what circumstances you want them do disappear and so forth.

But I may have found two bugs in your program section:


loop at screen.
   if screen-name = 'scr-chk'.   " Is never equal. Screen
                                 " fields are upper case
      screen-invisible = 0.
   else.
      screen-invisible = 1.
      modify screen.             " this belongs after
                                 " then endif, because
                                 " otherwise not processed
   endif.
endloop.

Best wishes and may some more clarifications?

Florin

0 Kudos

goto layout .

create one text and checkbox and select that block.

and select loop from menu and mark endline of loop.

try this.

0 Kudos

Hi Sylendra,

I changed,

but i cant able to select the checkbox property.

pls anybody help me.

0 Kudos

hmm... if I had to use a number of checkbox/text-combos that are not predefined at precompile time I would use an ABAP ListViewer object instead, that has two columns where one is a checkbox and the other one is an edit field. With that one you have easily full control of what happends.

I personally have never worked with the LOOP's in the dynpros.

Best wishes,

Florin

Former Member
0 Kudos

Hi,

Can you specify your requirements clearly?

Former Member
0 Kudos

Hi Suganya,

I suppose you are using step loops in your screen for displaying checkboxes and textboxes.

Step loops are rather outdated elements and they have been modified to implement table controls and even ALVs. I suggest you to use either of the two(I would prefer ALV,where you can implement checkboxes as well).

In ALV,all your requirements will be satisfied.

Regards,

Sylendra.

0 Kudos

Hi Suganya,

I have worked with the step loops and same error was coming to me also. It was because I gave Function Code to the check boxes. When I removed the Function Code to the check boxes, it worked fine. Try removing the Function code of the check boxes.It may probably work fine for you also.

Regards,

Sylendra.

0 Kudos

Hi Sylendra.

Thanks.

I removed the function code of chkbox it is working,

but if i select one it should go to the next screen then without function code how i can do it.

0 Kudos

Hi Suganya,

I don't think you can individually select the checkbox because all the checkboxes that you have created are the copies of one set of checkboxes and all of them will be having the same set of properties like Function Code, Checked or Unchecked, visible or invisible etc..

Supposing that you have given the Function code to the check box. The moment u click on one checkbox, the PAI is triggered. But all others are remaining unchecked, so you can't individually check that and so it becomes unchecked.

So I think you should go with ALV, where these requirements can be satisfied.

Regards,

Sylendra.

Former Member
0 Kudos

Hi Suganya,

Thanks for the points. But it hasn't been added to my Total points. please do the needful.

Regards,

Sylendra.