‎2007 Jan 23 8:46 AM
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.
‎2007 Jan 23 8:55 AM
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.
‎2007 Jan 23 8:54 AM
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.
‎2007 Jan 23 8:55 AM
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.
‎2007 Jan 23 9:08 AM
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
‎2007 Jan 23 9:13 AM
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.
‎2007 Jan 23 10:04 AM