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: 

Select All Button in Table Control Wizard

NooruBohra
Participant
0 Kudos

Hi All,

I have created a table control using wizard and then checked the option for selecting multiple rows using selection column.

As screenshot contains the table control. The highlighted button is the button to select all the rows of the table control. But when I click save button I am unable to find out whether the select all button was clicked or not. On clicking select all button PAI is not getting triggered. Kindly help.

Regards,

Nooru

19 REPLIES 19

Former Member
0 Kudos

Hi Nooruddin,

Try using the below code:

IF ok_code = 'SELALL'.

LOOP AT [Int_table] --> populated in table control

    table-mark = 'X'.

    MODIFY TABLE.

ENDLOOP.

ENDIF.

Then use this table in the PBO.

Hope it helps!

Cheers!

0 Kudos

Hi,

This code will not be executed as I stated earlier PAI is not triggered on clicking on the select all button.

Thanks & Regards,

Nooru

kabil_g
Active Participant
0 Kudos

Hi Nooruddin,

In the table control have you checked the multiple selection............if not check your table control ...........

0 Kudos

Yes I have checked the multiple selection checkbox. I am able to select multiple lines but the functionality of default select all button is not proper.

Thanks & Regards,

Nooru

kabil_g
Active Participant
0 Kudos

does your table control maintained as below

0 Kudos

Hi Kabil,

Yes exactly.

Thanks & Regards,

Nooru

NooruBohra
Participant
0 Kudos

Hi All,

Kinldy look at the Image attached.

The highlighted Button is not working properly. I need help on it.

Thanks & Regards,

Nooru

kabil_g
Active Participant
0 Kudos

Have you modified your internal table in pai event  and describe tables statement in pbo................................

0 Kudos

Hi Kabil,

Yes I have done that. If I manually selects one or more than one rows then I am getting MARK = 'X'
But if I use select all button then I am not getting  MARK = 'X'.

Thanks & Regards,

Nooru

0 Kudos

Have you created an "user_command" INPUT in PAI?


PROCESS AFTER INPUT.
MODULE USER_COMMAND_0100.



MODULE USER_COMMAND_0100 INPUT.

...

ENDMODULE.                             " USER_COMMAND_0100

0 Kudos

Hi Rodolfo,

let me clear my requirement.

I have a excel contains details of business partners.

Once I upload the data in SAP I use table control to display the data and when user selects a row and presses the save button the selected Business Partner is getting created in SAP using BDC for transaction BP.

Well till this point I don't have any issues. if user selects multiple lines "Manually" then also the program works fine and selected Business Partners are getting created in SAP.

But as I stated earlier if I use select all button that and press the SAVE button then all records are getting highlighted as if they all are selected but the MARK field is having value SPACE.

I hope it will help you to understand the probelm.

Thanks,

Nooru Bohra

Former Member
0 Kudos

Hi Noor,

Looks like your you have to put a /h on the select all button and catch your sy-ucomm value.

Once done follow the same instructions of Rodolfo.

IF ok_code = <>.


Any user action will definitely trigger PAI event.


Regards,

Kannan

0 Kudos

Hi Kannan,

As I said earlier no PAI Event is getting Triggered. I have also tried /H and then pressed the select all button, no code execution takes place. It worked just like Radio Button without Function code won't trigger any event.

How can I assign Function Code to the Button that I highlighted in the image.

Regards,

Nooru

Former Member
0 Kudos

Hi Noor,

I figured out a way to solve your issue!

Try doing the following steps:

In your TOP INCLUDE, create the following type for your internal table and structure.

After that, create a TC using Wizard Tool as shown below

*** DO NOT SELECT MARK FIELD ***

Here you will put your [mark] field declared in your internal table

This will create the following output, with a default "Select All" button (that will have a ok_code related to it and will trigger the PAI event).

After using "Select All" and choosing "Save" button, we get the following values in Internal Table used for Table Control

Hope it solves your issue! 

Cheers!

0 Kudos

Hi Rodolfo,

This would be an additional button. Kinldy look into the image that I have shared in Question. The highlighted button is not working but it is displaying all records as selected. Either Tell me a way to remove it or a way to make it work.

also I would like to inform you about the option of Line selection checkbox under line selectability, I am getting that option disabled.

Thanks,

Nooruddin

0 Kudos

Hi Noor,

Creating the way I posted above (I know, it's an "extra button" to select all fields but it works) you will have the other "Select All" button at the top left disabled.

Still could not find another better way...

Cheers!

0 Kudos

Hi Rodolfo,

The process you have described earlier will not be the same if I chose Dictionary Table.

Kindly try to create Table control for Dictionary Structure. I am having trouble with Table Control which was created with the reference of Dictionary Structure.

Thanks,

Nooru Bohra

0 Kudos

Hi Nooruddin

Did you find any solution to this problem?

Reagrds

Sagar

0 Kudos

hi,

you will be needing an internal table to hold the data even if you make Table control using dictionary reference.

you can declare structure like this in global declaration and declare an internal table of declared structure like this :

types: begin of tc_tab.

include structure <dictionary structure>.

data: mark  type xfled.

types: end of tc_tab.

data: it_tctab type table of tc_tab.

then follow the guidelines of Mr. Rodolfo.

thanks!!