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

How to validate Checkbox

Former Member
0 Likes
1,495

Hi All,

can any one tell the code for this process.

Validate if checkbox is checked or not.

If the checkbox is checked then follow below steps .

Create 713 record by populating u2018Xu2019 in the field ZORIG_DFI_NAME, if user checked the

Checkbox.

Prompt the user whether to create correspondence bank details or not.

When user clicks u201CYesu201D button, then display the new screen u201CCorrespondent Bank informationu201D

to enter 718 record specific data.

Store the above entered records into an internal table u201Cgt_iat_er_datau201D.

When user clicks on icon, we call the function module u201CZIAT_DATA_EDITu201D by

passing the internal table gt_iat_er_data as input as shown below:

Function module u201CZIAT_DATA_EDITu201D will validate the u201Cgt_iat_er_datau201D data and return an

exception if an error occurs.

If an exception is returned then

Display a message : u201CCorrespondence Bank information is incomplete

End.

After clicking on button, control should go to Step 5, so that the user can re-edit 718

records.

4 REPLIES 4
Read only

Former Member
0 Likes
700

Hi,

Check my code snippets in bold below:

Validate if checkbox is checked or not.

Paramters: CX_BOX as CHECKBOX " Check box declaration

For validation: IF CX_BOX is initial. " Not checked

-----Validation/Error messages

If the checkbox is checked then follow below steps .

IF CX_BOX is not initial.

Create 713 record by populating u2018Xu2019 in the field ZORIG_DFI_NAME, if user checked the

Checkbox.

To update the table; use command UPDATE

Prompt the user whether to create correspondence bank details or not.

Use the FM : POPUP_TO_CONFIRM - Pop-up dialog confirm an action before it is carried out. .

When user clicks u201CYesu201D button, then display the new screen u201CCorrespondent Bank informationu201D

to enter 718 record specific data.

Store the above entered records into an internal table u201Cgt_iat_er_datau201D.

When user clicks on icon, we call the function module u201CZIAT_DATA_EDITu201D by

passing the internal table gt_iat_er_data as input as shown below:

Function module u201CZIAT_DATA_EDITu201D will validate the u201Cgt_iat_er_datau201D data and return an

exception if an error occurs.

If an exception is returned then

Display a message : u201CCorrespondence Bank information is incomplete

End.

After clicking on button, control should go to Step 5, so that the user can re-edit 718

records.

Regards

Shiva

Read only

Former Member
0 Likes
700

Few more additions:

Validate if checkbox is checked or not.

If the checkbox is checked then follow below steps .

Create 713 record by populating u2018Xu2019 in the field ZORIG_DFI_NAME, if user checked the

Checkbox.

Prompt the user whether to create correspondence bank details or not.

When user clicks u201CYesu201D button, then display the new screen u201CCorrespondent Bank informationu201D

to enter 718 record specific data.

Store the above entered records into an internal table u201Cgt_iat_er_datau201D.

When user clicks on icon, we call the function module u201CZIAT_DATA_EDITu201D by

passing the internal table gt_iat_er_data as input as shown below:

Function module u201CZIAT_DATA_EDITu201D will validate the u201Cgt_iat_er_datau201D data and return an

exception if an error occurs.

CALL FUNCTION "ZIAT_DATA_EDIT"

---Pass the relevant paramters

If an exception is returned then

Display a message : u201CCorrespondence Bank information is incomplete

End.

IF SY-SUBRC NE 0.

message e000 with "Correspondence Bank information is incomplete".

ELSE.

CONTINUE

After clicking on button, control should go to Step 5, so that the user can re-edit 718

records

ENDIF.

Read only

Former Member
0 Likes
700

Lets say CB_BOX is ur check box ..You have to code something like this...

IF CB_BOX eq 'X'.

//Create 713 record by populating u2018Xu2019 in the field ZORIG_DFI_NAME, if user checked the

Checkbox.

ITAB-ZORIG_DFI_NAME = 'X'.

Prompt the user whether to create correspondence bank details or not.

CALL 'POPUP_TO_CONFIRM'.

...

//When user clicks u201CYesu201D button, then display the new screen

IF RETURN = 'Y'.

MESSAGE I000(XX) WITH u201CCorrespondent Bank informationu201D

to enter 718 record specific data.

ELSE.

....

ENDIF.

ENDIF.

Read only

Former Member
0 Likes
700

hii all,|

please help me.

How to have a check on checkbox whixh when checkbox='x' it allows vlaue 0 in a parameter period.

when period is from 0- 8, it calculate the sum??