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

NOT EMPTY

Former Member
0 Likes
704

Hello Experts,

how can I say not empty. I have to assure that this field is filled

READ TABLE et_item WITH KEY PARTNER_PROD NOT EMPTY TRANSPORTING NO FIELDS.

IF sy-subrc <> 0.

RAISE error.

ENDIF.

Regards

ertas

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
664

Hi,

Code as follows:-

READ TABLE et_item WITH KEY PARTNER_PROD = SPACE  TRANSPORTING NO FIELDS.

IF sy-subrc eq 0.
  RAISE error.
ENDIF.

Regards,

Ankur Parab

Edited by: Ankur Parab on Jun 9, 2009 7:17 PM

4 REPLIES 4
Read only

Former Member
0 Likes
664

Try if this works....


READ TABLE et_item WITH KEY PARTNER_PROD NE SPACE TRANSPORTING NO FIELDS.

IF sy-subrc 0.
RAISE error.
ENDIF.

Read only

former_member229729
Active Participant
0 Likes
664

Hi Iihan,

It is simple.

The READ command accepts only the Equal SIgn.

Hence, Try this below given logic

Loop at et_item where partner_prod ne SPACE.
  Exit.
Endloop.
If sy-subrc eq 0.
*  Capture the Success Message

Else.
*  Failiure Message
Endif.

Rgds,

Ramani N

Edited by: Ramani Nagarajan on Jun 9, 2009 3:48 PM

Read only

Former Member
0 Likes
665

Hi,

Code as follows:-

READ TABLE et_item WITH KEY PARTNER_PROD = SPACE  TRANSPORTING NO FIELDS.

IF sy-subrc eq 0.
  RAISE error.
ENDIF.

Regards,

Ankur Parab

Edited by: Ankur Parab on Jun 9, 2009 7:17 PM

Read only

SuhaSaha
Product and Topic Expert
Product and Topic Expert
0 Likes
664

Hello,

A easier way of coding this will be:

L_IT_TEMP = ET_ITEM.

V_LINES = LINES( L_IT_TEMP ).

DELETE L_IT_TEMP WHERE PARTNER_PROD = SPACE.

V_LINES1 = LINES( L_IT_TEMP ).

IF V_LINES NE V_LINES1.
"  RAISE error.
ENDIF.

Hope this helps.

BR,

Suhas