Skip to Content
author's profile photo Former Member
Former Member

select single

hi all,

i do not why sy-subrc returns 4. in debug, data in wa_inputrec is ok. even in table vbrp i can get record with the same value in wa_inputrec.

what has gone wrong?

thx

SELECT SINGLE * FROM vbrp WHERE vbeln = wa_inputrec-vbeln AND

vgbel = wa_inputrec-vgbel.

IF sy-subrc <> 0.

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

8 Answers

  • author's profile photo Former Member
    Former Member
    Posted on Feb 27, 2007 at 02:45 AM

    hi,

    due to check in vbrp table for the combination of wa_inputrec-vbeln and wa_inputrec-vgbel. it may be like there may be no entries with this combinations.

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Feb 27, 2007 at 02:50 AM

    Hi El,

    Check VBRP in SE16/SE11 by passing the values.

    Rgds,

    Jothi.P

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Feb 27, 2007 at 02:56 AM

    Hi EL,

    due you check the contents of the table vbrp according to the entries in the work ares

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Feb 27, 2007 at 03:10 AM

    hi all,

    as i said in my post, both data found in vbrp table. also the working area is having the same data.

    that is baffled me why the select statement returns 4.

    Add a comment
    10|10000 characters needed characters exceeded

    • Former Member

      It's the probelm with the leading or trailing zeros...

      
      DAta: i_vbrp type standard table of vbrp .
      SELECT * FROM vbrp into corresponding fields of table i_vbrp
      WHERE vbeln = 0090000000  and
      VGBEL = 0080000001.
      
      
      IF sy-subrc <> 0.
      write 'No sucess'.
      else.
      write ' sucess'.
      endif.
      
      

      It's working after i add the <b>00</b> leading zeroes before <b>00</b>90000000 and <b>00</b>80000001

      Rgds,

      Jothi.P

      *Ps close the thread once u got the answer.

  • author's profile photo Former Member
    Former Member
    Posted on Feb 27, 2007 at 03:15 AM

    nothing wrong with your select query just check in vbrp table is there any data for your where condition or not? and in some cases leading zeros make some problem just check if any leading zeros are present which can mismatch your where condition.

    regards

    shiba dutta

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Feb 27, 2007 at 03:25 AM

    hi,

    Select statement is right, but try to change sy-subrc <> 0 (give another sign

    like EQ and try it.

    and also check wa_inputrec-vbeln and wa_inputrec-vgbel.

    sri

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Feb 27, 2007 at 03:41 AM

    Hi,

    Check the entries in table VBRK where vbeln = wa_inputrec-vbeln and

    vgbel = wa_inputrec-vgbel. Both the condition needs to be satisfied. May be you will not have entries with the required values of both vbeln and vgbel.

    Regards,

    Sharmila

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Feb 27, 2007 at 04:36 AM

    Hi,

    Make sure taht the <b>wa_inputrec-vbeln</b> and vgbel is of teh <b>same type of vbrp-vbeln</b> and vgbel. If not define with the same type so taht it wont fail, if teh record exists.

    DATA: wa_inputrec-vbeln LIKE vbrp-vbeln,
              wa_inputrec-vgbel LIKE vbrp-vgbel.

    Hope this will solve ur problem.

    U have not rewarded any points?

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.