‎2014 Jun 18 2:18 PM
Hi all,
I have a slight issue in my table control with checkbox. My requirement is that in the basic list the user can checkbox a few sales orders and in the selected sales orders will be displayed in the secondary list. However, the problem is that in spite of the sales orders that are selected, the secondary list is displaying all the sales orders from the basic list and not the ones that are selected. So, it seems that the internal table in the basic list is not getting modified accordingly. I have attached the screenshots for your reference. Please help me identify the error.
These are the variables I declared:
For the basic list:
Screenshot for the layout. Here I have inserted a function code for the checkbox as CBOX.
Code for user command:
The basic list is fine as shown. Here 4970 and 4972 are selected:
However, the secondary list is displaying all the values from the basic list, not the selected values. Why?
‎2014 Jul 03 3:35 PM
Hi,
Just check your code for
WHEN 'CBOX'.
LOO AT IT_VBAK INTO WA_VBAK WHERE CHECK = 'X'.
MODIFY IT_VBAK FROM WA_VBAK INDEX SY-TABIX TRANSPORTING CHECK.
ENDLOOP.
In this loop why IT_VBAK is modified? You are transporting CHECK field, but this field contents
will be same like as they are existing in IT_VBAK. If you really want to modify IT_VBAK then set
WA_VBAK-CHECK = <<Some Value>>.
Without using the statement WA_VBAK-CHECK = <<Some Value>>. no need modify IT_VBAK.
I hope you understood.
Regards,
Rafi
‎2014 Jun 18 2:42 PM
Hi Manish,
While CBOX action the selected records to be maintain in another internal table.
loop at it_vBAK into wa_vbak where check = 'X'.
APPEND WA_VBAK TO IT_VBAK1.
MODFIY IT_VBAK FROM WA_VBAK INDEX SY-TABIX TRANSPORTING CHECK.
ENDLOOP.
Use IT_VBAK1 internal table in for all entries select statement.
Thanks,
Ashok.
‎2014 Jun 18 7:22 PM
Hi Ashok,
I tried your approach. This is wat you told me to do:
However it's giving problems. The secondary list is not displaying the output correctly.
On selecting the sales orders:
The secondary list produces the incorrect output as shown. Sales order 4974 is not displayed at all.
‎2014 Jun 18 8:27 PM
Hi Manish,
Did the Sales order 4974 having entries in VBAP....? Please check once. Try to check different orders in screen 9000 and perform NEXT action.
Thanks,
Ashok.
‎2014 Jun 19 9:04 AM
Yes Ashok, there are entries for sales order 4974. In fact all the sales orders from 4969 to 4974 have records in the VBAP table.
Just to add a minor detail, I modified internal table IT_VBAK1 instead of IT_VBAK as u specified in your post. The reason being that IT_VBAK is not needed in the FOR ALL ENTRIES part. Even when I modified IT_VBAK (as per your suggestion), the output did not come correctly.
‎2014 Jun 19 2:25 PM
Hi Manish,
Can you please share you declaration part of IT_VBAK structures both internal table and work areas.
Thanks,
Ashok.
‎2014 Jun 19 3:21 PM
Hi Manish,
Can you please check IT_VBAK1 and IT_VBAP internal table entries in debugging mode after for all entries select statement while NEXT action. How many entries does IT_VBAP exits when you select
4974 and 4975 ?
Thanks,
Ashok.
‎2014 Jun 20 2:39 PM
Hi Ashok,
In my post, I have already attached the screenshot of all the variables which I had declared. Nevertheless, I am pasting the screenshot again. (Please not that IT_VBAK1 is not shown in the screenshot, but I have declared it as well ,which is of type TY_VBAK).
When I debugged, I found out that after selecting 4974 and 4975, IT_VBAP consists of all the entries starting from 4969 to 4975 from the select-options. This means that the selection part in the basic list (checkbox) is not working properly. I saw while debugging that when I am using the for all entries statement based on IT_VBAK1, the selected records are not coming up, but all the records from 4969 to 4975. So the part WA_VBAK-CHECK = 'X' is not functioning properly.
Hope this answers your question.
Regards.
Manish
‎2014 Jun 20 3:18 PM
Hi Manish,
Can you please refer this program.
DEMO_DYNPRO_TABCONT_LOOP_AT
Remove check box column, the standard SAP provides us check box option, Please see the attachment, you can assign wa_vbak-check(check w/Selcolumn) field on highlighted spot. And mean while CBOX action not required i think.
Use below code under NEXT action, place this code before for all entries statement.
refresh it_vbak1[ ].
loop at it_VBAK into wa_vbak where check = 'X'.
APPEND WA_VBAK TO IT_VBAK1.
ENDLOOP.
if IT_VBAK1 is not initial.
for all entries.
endif.
Hopes this helps you.
Thnaks,
Ashok.
‎2014 Jun 22 2:58 PM
Hi Ashok,
Firstly I would like to tell you that I found the program DEMO_DYNPRO_TABCONT_LOOP_AT confusing in some areas. It used the global structure as a work area and I am not quite aware of that . I did try the same approach in my program, but I did not get any value in the secondary list.
Below are the screenshots of how I approached the program after taking some reference from DEMO_DYNPRO_TABCONT_LOOP_AT.
I created 2 global structures for VBAK and VBAP:
These are the variables declared:
I did the layout and inserted the global structure name in selcol as per DEMO_DYNPRO_TABCONT_LOOP_AT :
This is what I typed for user command:
Now in the secondary list, no values from VBAP table are displayed; this means that the marked records from the basic list are not being selected, as a result not a single value is displayed in the secondary list as IT_VBAK1 is initial. So IT_VBAK1 is not holding the selected records which I found out while debugging. Why is this so and how can it be corrected?
Regards.
Manish.
‎2014 Jun 23 1:49 PM
Hi Manish,
At table control screen field you should assign w/SelCcolumn as WA_VBAK-MARK field instead of ZVBAKSTR.
I think this time it should be working fine, please check.
Thanks,
Ashok.
‎2014 Jul 03 3:35 PM
Hi,
Just check your code for
WHEN 'CBOX'.
LOO AT IT_VBAK INTO WA_VBAK WHERE CHECK = 'X'.
MODIFY IT_VBAK FROM WA_VBAK INDEX SY-TABIX TRANSPORTING CHECK.
ENDLOOP.
In this loop why IT_VBAK is modified? You are transporting CHECK field, but this field contents
will be same like as they are existing in IT_VBAK. If you really want to modify IT_VBAK then set
WA_VBAK-CHECK = <<Some Value>>.
Without using the statement WA_VBAK-CHECK = <<Some Value>>. no need modify IT_VBAK.
I hope you understood.
Regards,
Rafi
‎2014 Jul 05 9:11 AM
‎2023 Jul 23 12:39 PM
Hi Manish
I also stuck with the same point ,Can u please provide the modified code.
‎2023 Jul 23 12:40 PM