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: 

Single selection of checkbox

former_member1110335
Participant
0 Kudos
100

Hi.

I have added an editable checkbox to an ALV grid.

The requirement is that only one checkbox should be selected at a time.

could you please help me with it....

I have to do this in SAP4.6C

best regards,

Karen

6 REPLIES 6

Former Member
0 Kudos
52

If that is the case, then why dont you use radio button ?

<REMOVED BY MODERATOR>

Edited by: Alvaro Tejada Galindo on Apr 22, 2008 12:59 PM

former_member1110335
Participant
0 Kudos
52

Can we use radiobuttons in ALV grid ?

If yes.... could you please tell me how to do it..

Former Member
0 Kudos
52

hi

it may help u.

PERFORM FIELDCAT.

i_layout-box_fieldname = 'CHECK'.

PERFORM DISPLAY.

&----


*& Form FIELDCAT

&----


  • text

----


  • --> p1 text

  • <-- p2 text

----


FORM FIELDCAT .

*DATA: W_FIELDCAT TYPE SLIS_FIELDCAT_ALV.

CLEAR W_FIELDCAT.

W_FIELDCAT-FIELDNAME = 'MATNR'.

W_FIELDCAT-TABNAME = 'I_MATNR'.

W_FIELDCAT-SELTEXT_M = 'MATERIAL NUMBER'.

W_FIELDCAT-EDIT = 'X'.

W_FIELDCAT-COL_POS = '2'.

APPEND W_FIELDCAT TO I_FIELDCAT.

CLEAR W_FIELDCAT.

W_FIELDCAT-FIELDNAME = 'BSART'.

W_FIELDCAT-TABNAME = 'I_MATNR'.

W_FIELDCAT-SELTEXT_M = 'document type'.

W_FIELDCAT-EDIT = 'X'.

W_FIELDCAT-COL_POS = '3'.

APPEND W_FIELDCAT TO I_FIELDCAT.

*

CLEAR W_FIELDCAT.

W_FIELDCAT-FIELDNAME = 'WERKS'.

W_FIELDCAT-TABNAME = 'I_MATNR'.

W_FIELDCAT-SELTEXT_M = 'PLANT'.

W_FIELDCAT-EDIT = 'X'.

W_FIELDCAT-COL_POS = '5'.

APPEND W_FIELDCAT TO I_FIELDCAT.

CLEAR W_FIELDCAT.

W_FIELDCAT-FIELDNAME = 'EKGRP'.

W_FIELDCAT-TABNAME = 'I_MATNR'.

W_FIELDCAT-SELTEXT_M = 'Purchasing group'.

W_FIELDCAT-EDIT = 'X'.

W_FIELDCAT-COL_POS = '6'.

APPEND W_FIELDCAT TO I_FIELDCAT.

CLEAR W_FIELDCAT.

W_FIELDCAT-FIELDNAME = 'MENGE'.

W_FIELDCAT-TABNAME = 'I_MATNR'.

W_FIELDCAT-SELTEXT_M = 'QUANTITY'.

W_FIELDCAT-EDIT = 'X'.

W_FIELDCAT-COL_POS = '7'.

APPEND W_FIELDCAT TO I_FIELDCAT.

CLEAR W_FIELDCAT.

W_FIELDCAT-FIELDNAME = 'BNFPO'.

W_FIELDCAT-TABNAME = 'I_MATNR'.

W_FIELDCAT-SELTEXT_M = 'Item number'.

W_FIELDCAT-EDIT = 'X'.

W_FIELDCAT-COL_POS = '8'.

APPEND W_FIELDCAT TO I_FIELDCAT.

ENDFORM. " FIELDCAT

FORM DISPLAY .

CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'

EXPORTING

I_INTERFACE_CHECK = SY-REPID

  • I_BYPASSING_BUFFER = ' '

  • I_BUFFER_ACTIVE = ' '

I_CALLBACK_PROGRAM = SY-REPID

I_CALLBACK_PF_STATUS_SET = 'SET_PF_STATUS'

I_CALLBACK_USER_COMMAND = 'PUR_REQUISITION'

  • I_CALLBACK_TOP_OF_PAGE = ' '

  • I_CALLBACK_HTML_TOP_OF_PAGE = ' '

  • I_CALLBACK_HTML_END_OF_LIST = ' '

  • I_STRUCTURE_NAME =

  • I_BACKGROUND_ID = ' '

  • I_GRID_TITLE =

  • I_GRID_SETTINGS =

IS_LAYOUT = i_layout

IT_FIELDCAT = I_FIELDCAT

  • IT_EXCLUDING =

...

...

FORM set_pf_status USING rt_extab TYPE slis_t_extab.

SET PF-STATUS 'ZDE_PF_STATUS'.

ENDFORM. "set_pf_status

..........

do like this in this it takes one at time.

and create pf status and write code for that after checking what u want to do.

regards,

chandu,

<REMOVED BY MODERATOR>

Edited by: Alvaro Tejada Galindo on Apr 22, 2008 1:00 PM

former_member1110335
Participant
0 Kudos
52

Hi Chandu

Sorry to bother you... but could you please give me the complete program...

thanks for your solution.

<REMOVED BY MODERATOR>

thanks!!

Edited by: Alvaro Tejada Galindo on Apr 22, 2008 1:05 PM

0 Kudos
52

Hi Karen,

Check the following Thread this will give you the complete solution.

You can check the code given in the last reply for reference..

[;

<REMOVED BY MODERATOR>

Regards

Hemant Khemani

Edited by: Alvaro Tejada Galindo on Apr 22, 2008 1:08 PM

former_member1110335
Participant
0 Kudos
52

Still not answered