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: 

How to retrive the VBELN Value based on EBELN

Former Member
0 Kudos

Dear Friends,

I think so everybody is doing Goood,

This is my small doubt but I am not getting it.

Here i want to get VBKD-VBELN value Where VBKD-BSTKD = EKKO-EBELN.

But i know BSTKD length is 35 and EBELN Length is 10 only how to fetch this VBELN??

Thanks in advance

Sridhar.

5 REPLIES 5

former_member181962
Active Contributor
0 Kudos

HI Reddy,

YOu can pass the EKKO-EBELN value to v_ebeln which is of length 35 chars or of type VBKD-BSTKD

and then use it in where condition.

Regards,

Ravi

Former Member
0 Kudos

Hi

Try this

TABLES: VBKD, EKKO.

DATA: BSTKD TYPE BSTKD.

MOVE EKKO-EBELN TO BSTKD.

SELECT * FROM VBKD WHERE BSTKD = BSTKD.

ENDSELECT.

Max

Former Member
0 Kudos

Hi Sridhar,

U can compare EKKO-EBELN directly with VBKD-BSTKD.

or else pass this EKKO-EBELN to a 35 char variable

and compare that variable with VBKD-BSTKD

Regards,

GSR.

Former Member
0 Kudos

Try this:


TABLES: vbkd, ekko.

DATA: BEGIN OF itab OCCURS 0,
        doc LIKE vbkd-vbeln,
      END   OF itab.

SELECT vbeln FROM vbkd
  INTO TABLE itab
  WHERE bstkd = ekko-ebeln.

Rob

Former Member
0 Kudos

Are you sure that your PO number is the customer PO number on the sales order? BSTDK is the customer PO number. This is used to store the number your customer uses to refer to the sales order. The EBELN is your PO number to your vendor.

Unless you have the business process confirming that these two are the same, you will not be able to combine the two.

What exactly are you trying to get using a PO?