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

Help in Select Statement

Former Member
0 Likes
1,069

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
Read only

Former Member
0 Likes
1,042

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
Read only

Former Member
0 Likes
1,043

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.

Read only

Former Member
0 Likes
1,042

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

Read only

Former Member
0 Likes
1,042

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

Read only

Former Member
0 Likes
1,042

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.

Read only

Former Member
0 Likes
1,042

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..

Read only

Former Member
0 Likes
1,042

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.

Read only

Former Member
0 Likes
1,042

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

.

Read only

Former Member
0 Likes
1,042

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

Read only

Former Member
0 Likes
1,042

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

Read only

Former Member
0 Likes
1,042

Hi Venu,

Is your problem solved. ?

Thanks & Regards,

Navneeth K.

Read only

Former Member
0 Likes
1,042

Hi ,

thanks to all ur suggestions....

my problem is solved....

Regards,

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