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

IF NOT SO_PRDHA initial

Former Member
0 Likes
438

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

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
402

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.

1 REPLY 1
Read only

Former Member
0 Likes
403

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.