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

Is not initial

Former Member
0 Likes
4,889

Hi All!

I want to check before if the field is initial or not in a select statement.How can i achieve this.

regards

Pavan

1 ACCEPTED SOLUTION
Read only

venkata_ramisetti
Active Contributor
0 Likes
2,175

Hi ,

yuou can do like below.

if field is a character type field:

SELECT ... FROM TABLE WHERE FIELD NE SPACE.

if field is a numeric type field:

SELECT ... FROM TABLE WHERE FIELD NE 0.

THanks,

ramakrishna

5 REPLIES 5
Read only

Former Member
0 Likes
2,175

if not field-val is initial.

select ................

endif.

2.

check field is not initial.

in both ways u can do.

Read only

Former Member
0 Likes
2,175

Sorry i don't you get your question....But...it shouldn't be like this???


IF NOT MY_FIELD IS INITIAL.
SELECT *
INTO TABLE MY_TABLE
FROM ZTABLE
WHERE FIELD EQ MY_FIELD.
ENDIF.

Greetings,

Blag.

Read only

venkata_ramisetti
Active Contributor
0 Likes
2,176

Hi ,

yuou can do like below.

if field is a character type field:

SELECT ... FROM TABLE WHERE FIELD NE SPACE.

if field is a numeric type field:

SELECT ... FROM TABLE WHERE FIELD NE 0.

THanks,

ramakrishna

Read only

0 Likes
2,175

You can also do this.

<b>report zrich_0004 .

tables: mara.

select single * from mara where not matnr is null.

write:/ mara-matnr.</b>

Regards,

Rich Heilman

Read only

Former Member
0 Likes
2,175

Hi Kunmar

<i>If IT_PA0000 has data then go further</i>

  IF NOT IT_PA0000[] IS INITIAL.
<i>Get Master Record (Personal Data) & (Org. Assignment)</i>

SELECT PERNR

SUBTY

BEGDA

ENDDA

WERKS

BTRTL

PERSK

INTO CORRESPONDING FIELDS OF TABLE IT_PA0001

FROM PA0001

FOR ALL ENTRIES IN IT_PA0000

WHERE PERNR = IT_PA0000-PERNR AND

ENDDA = V_DATE.

*Check Sy-subrc and then sort by PERNR

IF SY-SUBRC = 0.

SORT IT_PA0001 BY PERNR WERKS.

ENDIF.

ENDIF.

Thanks

Khimavath Vikranth