2008 Jun 10 7:40 PM
Hi Experts,
some more basic doubts,
here I hv statements,
A) IF my_itab_mara-prdha(2) in so_prdha[].
delete my_itab_mara index sy-tabix.
endif.
case: the user did not put any input in so_prdha in selection screen
so, the IF condition is false and record wuld not b deleted
but, i hv observed in debugging that, IF bcoming true and record is deleting??
1) pls.let me know why?
2) guess, If I adds one more IF like
IF NOT SO_PRDHA initial.
logic....
endif.
Is works out?
B) my_itab-menge_quyntity like vbap-kwmeng
IF my_itab-menge_quyntity IS INITIAL.
DELETE my_itab index sy-tabix.
endif.
In the above, How its working, bcoz, QUANTITY field is comapring with INITIAL? guess, it should like
IF my_itab-menge_quyntity = 00000000000000000.
right?
thanq
2008 Jun 10 7:45 PM
Hello,
About the first question:
... [operand [NOT] IN] seltab ...
For the structure of a selection table, refer to section SELECT-OPTIONS. The evaluation of a selection table requires the table to contain the valid values specified in that section in the columns sign and option. If the selection table contains invalid values, an untreatable exception occurs. If the selection table is initial, the logical expression is always true.
And the second.
... operand IS [NOT] INITIAL ...
Effect
The logical expression checks if the operand operand is initial. The expression is true, if the operand contains its type-specific initial value. For operand, you can specify data objects, built-in functions (since Release 6.10) and functional methods. The latter use the return value as operand.
With the addition NOT, the expression is true if the operand contains a different value than its type-specific initial value
Example
The logical expression in the IF statement is true if the internal table in the SELECT statement was filled with rows.
DATA spfli_tab TYPE TABLE OF spfli.
...
CLEAR spfli_tab.
SELECT *
FROM spfli
INTO TABLE spfli_tab
WHERE ...
IF spfli_tab IS NOT INITIAL.
...
ENDIF.
Regards.
Hello,
About the first question:
... [operand [NOT] IN] seltab ...
For the structure of a selection table, refer to section SELECT-OPTIONS. The evaluation of a selection table requires the table to contain the valid values specified in that section in the columns sign and option. If the selection table contains invalid values, an untreatable exception occurs. If the selection table is initial, the logical expression is always true.
And the second.
... operand IS [NOT] INITIAL ...
Effect
The logical expression checks if the operand operand is initial. The expression is true, if the operand contains its type-specific initial value. For operand, you can specify data objects, built-in functions (since Release 6.10) and functional methods. The latter use the return value as operand.
With the addition NOT, the expression is true if the operand contains a different value than its type-specific initial value
Example
The logical expression in the IF statement is true if the internal table in the SELECT statement was filled with rows.
DATA spfli_tab TYPE TABLE OF spfli.
...
CLEAR spfli_tab.
SELECT *
FROM spfli
INTO TABLE spfli_tab
WHERE ...
IF spfli_tab IS NOT INITIAL.
...
ENDIF.
Regards.
2008 Jun 10 7:45 PM
Hello,
About the first question:
... [operand [NOT] IN] seltab ...
For the structure of a selection table, refer to section SELECT-OPTIONS. The evaluation of a selection table requires the table to contain the valid values specified in that section in the columns sign and option. If the selection table contains invalid values, an untreatable exception occurs. If the selection table is initial, the logical expression is always true.
And the second.
... operand IS [NOT] INITIAL ...
Effect
The logical expression checks if the operand operand is initial. The expression is true, if the operand contains its type-specific initial value. For operand, you can specify data objects, built-in functions (since Release 6.10) and functional methods. The latter use the return value as operand.
With the addition NOT, the expression is true if the operand contains a different value than its type-specific initial value
Example
The logical expression in the IF statement is true if the internal table in the SELECT statement was filled with rows.
DATA spfli_tab TYPE TABLE OF spfli.
...
CLEAR spfli_tab.
SELECT *
FROM spfli
INTO TABLE spfli_tab
WHERE ...
IF spfli_tab IS NOT INITIAL.
...
ENDIF.
Regards.
| User | Count |
|---|---|
| 4 | |
| 2 | |
| 2 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |