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

validating 'Initial Values' checkbox in the table

Former Member
0 Likes
953

hi all

i have a requirement

i need to put a condition based on the 'Initial values' checkbox of the table.

eg: let us say I have a table KNA1

and i have fields KUNNR, LAND1 and NAME1 in my table

if 'Initial values' checkbox for KUNNR is checked i need to put my condition

and if 'Initial values' checkbox for LAND1 is checked i need to put another condition

and if 'Initial values' checkbox of NAME1 field is checked i need to put some other condition.

in the similar way as per my requirement i need to put conditions for almost all the fields available in the table.

can any one tell me how to write the above logic.

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
707

Hi vamsi,

1. one way is

2. First take all records with all field values, in one ITAB.

3. Then.

4.

data : tabix like sy-tabix.

data : delflag type c.

LOOP AT ITAB.

<b> tabix = sy-tabix.

clear delflag.</b>

if not condit1.

delflag = 'X'.

endif.

if not condit2.

delflag = 'X'.

endif.

..... other if conditions.

<b> if delflag = 'X'.

delete itab index tabix.

endif.</b>

ENDLOOP.

4

regards,

amit m.

5 REPLIES 5
Read only

Former Member
0 Likes
707

Hi vamshi,

ch1 - check box for kunnr

ch2 - check box for Land1

ch3 - check box for name1

if ch1 = 'X' .

put u r condition.

endif.

if ch2 = 'X'.

put u r condition.

endif.

if ch3 = 'X'.

put u r condition.

endif.

Read only

Former Member
0 Likes
708

Hi vamsi,

1. one way is

2. First take all records with all field values, in one ITAB.

3. Then.

4.

data : tabix like sy-tabix.

data : delflag type c.

LOOP AT ITAB.

<b> tabix = sy-tabix.

clear delflag.</b>

if not condit1.

delflag = 'X'.

endif.

if not condit2.

delflag = 'X'.

endif.

..... other if conditions.

<b> if delflag = 'X'.

delete itab index tabix.

endif.</b>

ENDLOOP.

4

regards,

amit m.

Read only

Former Member
0 Likes
707

Hi Vamsi,

Use the table DD03L and give the TABNAME as KNA1 and FIELDNAME as KUNNR, LAND1, etc..

Now for teh record that you get from DD03L for teh above selection, check the value of column NOTNULL. It determines if teh table field is initial or not. Based on that, you can give your conditions for all the fields.

Reward points please..!

Cheers

Abhishek

Read only

Former Member
0 Likes
707
PARAMETERS: cb_kunnr AS Checkbox,
                         cb_land1 AS Checkbox,
                         cb_name1 AS Checkbox.


IF cb_kunnr = 'X'.
 perform...
ELSEIF cb_land1 = 'X'.
 perform....
ELSE.
 perform...
ENDIF.

If this not fine please let me know what you want exactly.

Read only

Former Member
0 Likes
707

Abhishek

a very big thanks for ur answer