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

Abap Table Control Dependent Field

Former Member
0 Likes
733

I have table Control , In which There are two Check box Fields, The first one is Dependent on second one. when I click on 2nd one the first one should be checked automatically its corresponding 1st CheckBox only.


MODULE ZSET_DEP INPUT.
  loop at itab_dep.
if sy-ucomm = 'ZPH' and ITAB_DEP-ZPHYC1 = 'X'.
ITAB_DEP-DEPDT1 = 'X'.
Modify ITAB_DEP INDEX sy-tabix."<TABCNTRL>-CURRENT_LINE.
ENDIF.
ENDLOOP.
ENDMODULE.

Here itab_dep is the name of internal table, The 2nd CheckBox Field's FactCode is 'ZPH'.

Now it is working.

Problem is When i remove the 2nd field ie.itab_dep-zphyc1 checkbox then the corresponding Checkbox of 1st'field should should be removed. But it is Removing All.

Please suggest. <removed by moderator>

For Requirement Help You Can follow this Link. <removed by moderator>

[https://picasaweb.google.com/106952500585093627368/SapScreenShot?authuser=0&feat=directlink]

Edited by: Thomas Zloch on Nov 9, 2011 1:20 PM

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
682

Hi,

Please change the code as below.

MODULE ZSET_DEP INPUT.

loop at itab_dep.

if ITAB_DEP-ZPHYC1 = 'X'.

ITAB_DEP- ZPHYC2= 'X'.

else.

ITAB_DEP- ZPHYC2= ' '.

Modify ITAB_DEP INDEX sy-tabix."<TABCNTRL>-CURRENT_LINE.

ENDIF.

ENDLOOP.

ENDMODULE.

Regards

Chitra

I have table Control , In which There are two Check box Fields, The first one is Dependent on second one. when I click on 2nd one the first one should be checked automatically its corresponding 1st CheckBox only.


MODULE ZSET_DEP INPUT.
  loop at itab_dep.
if sy-ucomm = 'ZPH' and ITAB_DEP-ZPHYC1 = 'X'.
ITAB_DEP-DEPDT1 = 'X'.
Modify ITAB_DEP INDEX sy-tabix."<TABCNTRL>-CURRENT_LINE.
ENDIF.
ENDLOOP.
ENDMODULE.

Here itab_dep is the name of internal table, The 2nd CheckBox Field's FactCode is 'ZPH'.

Now it is working.

Problem is When i remove the 2nd field ie.itab_dep-zphyc1 checkbox then the corresponding Checkbox of 1st'field should should be removed. But it is Removing All.

Please suggest. <removed by moderator>

For Requirement Help You Can follow this Link. <removed by moderator>

[https://picasaweb.google.com/106952500585093627368/SapScreenShot?authuser=0&feat=directlink]

Edited by: Thomas Zloch on Nov 9, 2011 1:20 PM

4 REPLIES 4
Read only

Former Member
0 Likes
683

Hi,

Please change the code as below.

MODULE ZSET_DEP INPUT.

loop at itab_dep.

if ITAB_DEP-ZPHYC1 = 'X'.

ITAB_DEP- ZPHYC2= 'X'.

else.

ITAB_DEP- ZPHYC2= ' '.

Modify ITAB_DEP INDEX sy-tabix."<TABCNTRL>-CURRENT_LINE.

ENDIF.

ENDLOOP.

ENDMODULE.

Regards

Chitra

Read only

0 Likes
682

Hi Chitra Thank you.

But Problem is When m unchecking from One Row it is making uncheck for all rows from its dependent field.

Read only

Former Member
0 Likes
682

Hi Jithender,

Please use the below code still if it is not soved means send me all the column names of the internal table.

MODULE ZSET_DEP INPUT.

loop at itab_dep.

if ITAB_DEP-ZPHYC1 = 'X'.

ITAB_DEP- ZPHYC2= 'X'.

else.

ITAB_DEP- ZPHYC2= ' '.

Modify ITAB_DEP INDEX sy-tabix TRANSPORTING ZPHYC2.

ENDIF.

ENDLOOP.

ENDMODULE.

Regards

chitra

Read only

0 Likes
682

HI Chitra the internal table is refreshing b4 it enter into the Module.

Here is a link Which will make you understand the problem clearly.

https://picasaweb.google.com/106952500585093627368/SapScreenShot?authuser=0&feat=directlink

Thanks With Regards.

Jitendra Nayak