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

Problwm while selecting the data from table

Former Member
0 Likes
1,942

Hi,

As per below code I want to pick the data into table gi_qmma from qmma where PSTER is not equal to blank foe that i have writen the below code but still the data is coming in GI_QMMA when the PSTER is blank.

what changes required in below code i dont want to pick data is PSTER is blank.

                                              • CODE ****************

select QMNUM MANUM MNGRP MNCOD MATXT PSTER FROM QMMA INTO TABLE GI_QMMA for all entries in GI_QMEL

WHERE QMNUM = GI_QMEL-QMNUM

AND MNGRP EQ 'VISIT'

AND MNCOD EQ 'ENVI'

AND PSTER NE ' '.

IF SY-SUBRC EQ 0.

SORT GI_QMMA ASCENDING BY PSTER.

******************************END OF BLOCK********

REGARDS,

ZAFAR

13 REPLIES 13
Read only

Former Member
0 Likes
1,881

hi

Try the Possible Ways:

select QMNUM MANUM MNGRP MNCOD MATXT PSTER FROM QMMA INTO TABLE GI_QMMA for all entries in GI_QMEL

WHERE QMNUM = GI_QMEL-QMNUM

AND MNGRP EQ 'VISIT'

AND MNCOD EQ 'ENVI'

AND PSTER NE SPACE.

AND PSTER (Use Not Qual symbol here) SPACE.

Please check it in table PSTER is a date field

Edited by: dharma raj on Mar 17, 2010 4:54 PM

Read only

SuhaSaha
Product and Topic Expert
Product and Topic Expert
0 Likes
1,881

Try with:

SELECT ... WHERE AND PSTER NE space

BR,

Suhas

Read only

Former Member
0 Likes
1,881

Hi,

I have check according to given code PSTER NE SPACE but still it is picking the data from the table.

regards,

zafar

Read only

Former Member
0 Likes
1,881

Hi,

I am not very familiar with this field PSTER. What data type is it? And are you sure the table contents for that field is space and there is nothing else present at the end of the field??

Regards,

Mani

Read only

Former Member
0 Likes
1,881

Hi,

The data type of PSTER is PSTERMA and it is in table QMMA.

regards,

zafar

Read only

Former Member
0 Likes
1,881

hi

Check this internal table data in debug mode GI_QMEL

AND PSTER (Use Not Qual symbol here) SPACE.

Check your table (QMMA)entry.

Read only

Former Member
0 Likes
1,881

Zafar,

My instance of SAP is SCM APO and not ECC, so it does not contain the table you mentioned. My question was to ascertain if it is a character type of or a quantity type like numbers.

Regards,

Mani

Read only

Former Member
0 Likes
1,881

Hi

Hope below change could solve your problem.

                                              • CODE ****************

select QMNUM MANUM MNGRP MNCOD MATXT PSTER FROM QMMA INTO TABLE GI_QMMA for all entries in GI_QMEL

WHERE QMNUM = GI_QMEL-QMNUM

AND MNGRP EQ 'VISIT'

AND MNCOD EQ 'ENVI'

AND PSTER NE SPACE.

IF SY-SUBRC EQ 0.

SORT GI_QMMA ASCENDING BY PSTER.

******************************END OF BLOCK********

Read only

ThomasZloch
Active Contributor
0 Likes
1,881

PSTER is of type DATS. I'll leave it to you to find out the initial value for date fields (It's not space).

Thomas

Read only

0 Likes
1,881

Thomas,

Thanks for the input.

Zafar,

This is where i was getting to, you are looking for a incorrect condition that is causing the problem. Once you replace space with the right condition, your query will work as required. I think you can figure out that initial value.

Thanks

Mani

Read only

0 Likes
1,881

Dear Mani,

I have try with 1: PSTER NE ' '.

and 2: PSTER NE SPACE.

but both are not working in my case.

regards,

zafar

Read only

0 Likes
1,881

Zafar,

Pls try 01/01/1900 instead of space.

Thanks

Mani

Read only

0 Likes
1,881

Not solve hence close