Application Development 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: 

Help in Select Statement

Former Member
0 Kudos

Hi friends,

In a module pool program iam working on a select statement as shown below.

SELECT SINGLE * FROM zekko_94176 INTO zekko_94176 WHERE ebeln EQ zekko_94176-ebeln.

Here zekko_94176 is screen workarea . Though the value is present in the database table zekko_94176

select statement is not retrieving it.So, its giving a sy-subrc value of 4.

Please help me regarding this.......

<removed_by_moderator>

Thanks in advance...

Venu.

Edited by: Julius Bussche on Oct 21, 2008 12:15 PM

1 ACCEPTED SOLUTION

Former Member
0 Kudos

Hi,

What value is present in "zekko_94176-ebeln.", go and check the table whether any record exists for the given condition.

Thanks & Regards,

Navneeth K.

11 REPLIES 11

Former Member
0 Kudos

Hi,

What value is present in "zekko_94176-ebeln.", go and check the table whether any record exists for the given condition.

Thanks & Regards,

Navneeth K.

former_member598013
Active Contributor
0 Kudos

Hi Venu,

Did you check in the debug mode what the value is coming in the output.

zekko_94176-ebeln

Check the value in the output.

Thanks,

Chidanand

Former Member
0 Kudos

Hi,

At run time in debugging mode check whether zekko_94176-ebeln holds value or not.. other than that everything seems to be fine..

Rgds.,

subash

Former Member
0 Kudos

Hi Venu,

I think the below code will surely help you.

No need of declaring any workarea.

You can directly name the screen fields with the name of the table fields.

Write this kind of code in PBO.

Here the screen fields are named as Z101754SBOOKHDR-bookid,

Z101754SBOOKHDR-custid... etc.

module STATUS_2000 output.

CASE OK_CODE1.

WHEN 'DISPLAY'.

LOOP AT SCREEN.

IF SCREEN-NAME NE 'PROCEED'.

SCREEN-INPUT = 0.

MODIFY SCREEN.

ENDIF.

ENDLOOP.

SELECT BOOKID CARRID CONNID FLDATE CUSTNAME TELEPHONE

FROM Z101754SBOOKHDR INTO

CORRESPONDING FIELDS OF Z101754SBOOKHDR WHERE

BOOKID = Z101754SBOOKHDR-BOOKID.

ENDSELECT.

WHEN 'CHANGE'.

SELECT BOOKID CARRID CONNID FLDATE CUSTNAME TELEPHONE

FROM Z101754SBOOKHDR INTO

CORRESPONDING FIELDS OF Z101754SBOOKHDR WHERE

BOOKID = Z101754SBOOKHDR-BOOKID.

ENDSELECT.

ENDCASE.

endmodule. " STATUS_2000 OUTPUT

Regards,

Amit.

Former Member
0 Kudos

hi,

check two things:

=> whether there is any record corresponding to the ebeln u r entering in table zekko_94176 .

=>.is there any conversion routine for ebeln in zekko_94176 table,if so then first convert ebeln into internal format and then pass it ur select query..

Former Member
0 Kudos

HI,

Are you referred standard EBELN data element with domain EBELN. if that is the case for this field there will be ALPHA conversion routine will exists please check that. May be because of that while selecting using select statement it will consider leading zeros also but those zeros were not taking into consideration while entered that value so please do handle this leading zeros by taking another intermediate variable with length 10 and type of numc and then push that ebeln value into this before select statement and use that in select statement.

Hope this will give you some idea,

Regards,

Aswini.

Former Member
0 Kudos

Hi try this

SELECT SINGLE * FROM zekko_94176 INTO

(zekko_94176-<field name>, zekko_94176-<field name>)

WHERE ebeln = zekko_94176-ebeln.

This condition will work.

Cheers!!

Balu

.

Former Member
0 Kudos

Hi,

check with value of ebeln weather it ezists in data base table or not.

Or try like this..

SELECT SINGLE * FROM zekko_94176 INTO corresponding fielids of table zekko_94176 WHERE ebeln EQ zekko_94176-ebeln.

Run the program in debug mode.

thanks

rajesh kumar

Former Member
0 Kudos

Where are you writing your query, I hope it is in the PAI of the screen you are processing. Also make sure that the zekko_94176-ebeln is populated with some value. Put a break point on this statment and run your program and see.

regards,

Advait

Edited by: Advait Gode on Oct 21, 2008 12:21 PM

Former Member
0 Kudos

Hi Venu,

Is your problem solved. ?

Thanks & Regards,

Navneeth K.

Former Member
0 Kudos

Hi ,

thanks to all ur suggestions....

my problem is solved....

Regards,

Venu..............