Application Development and Automation 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: 
Read only

help for checkbox display

asif_ali2
Explorer
0 Likes
696

Hi good souls,

I have 8 check boxes and when i want to insert the record in my table and check any of checkboxes the required field gets updated. but the problem is coming when i want to display the values.

the check boxes are not marked when i display the result. please help me by code and by your ideas on how to display the check mark when i press display.

data: mac1 type c,

mac2 type c,

mac3 type c,

mac4 type c,

mac5 type c,

mac6 type c,

mac7 type c.

WHEN 'INSERT'.

if mac1 = 'X'.

zaa_st-mc1 = 'CORRUGATOR'.

endif.

if mac2 = 'X'.

zaa_st-mc2 = 'INLINE'.

endif.

if mac3 = 'X'.

zaa_st-mc3 = 'LANGSTON'.

endif.

if mac4 = 'X'.

zaa_st-mc4 = 'DRO'.

endif.

if mac5 = 'X'.

zaa_st-mc5 = 'BOBST'.

endif.

if mac6 = 'X'.

zaa_st-mc6 = 'EMBA PRINTER'.

endif.

if mac7 = 'X'.

zaa_st-mc7 = 'EMBA GLUER'.

endif.

INSERT ZAA_ST.

IF SY-SUBRC = 0.

MESSAGE I000(0) WITH 'RECORD INSERTED'.

ELSE.

MESSAGE E001(0) WITH 'RECORD NOT INSERTED'.

ENDIF.

6 REPLIES 6
Read only

Former Member
0 Likes
649

Hi friend,

How is your zaa_st table? Is it contains any field for check box (i.e: check_box). If yes, transfer 'X' to check_box field.

ex:


data: mac1 type c,
mac2 type c,
mac3 type c,
mac4 type c,
mac5 type c,
mac6 type c,
mac7 type c.

WHEN 'INSERT'.
if mac1 = 'X'.
zaa_st-mc1 = 'CORRUGATOR'.
endif.

if mac2 = 'X'.
zaa_st-mc2 = 'INLINE'.
endif.

if mac3 = 'X'.
zaa_st-mc3 = 'LANGSTON'.
endif.

if mac4 = 'X'.
zaa_st-mc4 = 'DRO'.
endif.

if mac5 = 'X'.
zaa_st-mc5 = 'BOBST'.
endif.

if mac6 = 'X'.
zaa_st-mc6 = 'EMBA PRINTER'.
endif.

if mac7 = 'X'.
zaa_st-mc7 = 'EMBA GLUER'.
endif.

* check box
zaa_st-check_box = 'X'.

INSERT ZAA_ST.

IF SY-SUBRC = 0.
MESSAGE I000(0) WITH 'RECORD INSERTED'.
ELSE.
MESSAGE E001(0) WITH 'RECORD NOT INSERTED'.
ENDIF.

please check and reply

regards,

Read only

0 Likes
649

my z table do not contain checkbox field

Read only

Former Member
0 Likes
649

Hi,

For the fields you want to display as check box, set the dataelement to XFELD in the table. Hope it helps.

Cheers,

Sujay

Read only

Former Member
0 Likes
649

asif,

where is your code for display!!!.. is that a separate radio button or what?

Read only

Former Member
0 Likes
649

hii

try this..

where you write display code there you write all your checkbox names with = 'X'...so when you click on display your check boxes wil be clicked or checked always it will not get cleared.

hope this will help you..

regards

kavita

Read only

former_member201275
Active Contributor
0 Likes
649

If you have a checkbox on your selection screen and you output it as is then it will have an 'x'. Are you outputting in ALV format or what? Maybe you are moving the value to another field incorrectly.

Please provide the section of code which contains your checkbox definition.