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

get order number

Former Member
0 Likes
622

Hi friends,

can u plz suggest me the code for the following given description.

Order_Number:

1. If billing document type (VBFA-VBTYP_N) = ‘M,’ then select from VBFA the preceding document (VBFA-VBELV) where the billing document (VBRK-VBELN) is equal to the follow on document (VBFA-VBELN).

a. Select from VBFA the preceding document (VBFA-VBELV) where the preceding document (VBFA-VBELV) in step 1 is equal to the follow on document (VBFA-VBELN)

2. If billing document type (VBFA-VBTYP_N) = ‘H’ or ‘O’ or ‘P,’ then select from VBFA the preceding document (VBFA-VBELV) where the billing document (VBRK-VBELN) is equal to the follow on document (VBFA-VBELN).

regards,

siri.

Hi friends,

can u plz suggest me the code for the following given description.

Order_Number:

1. If billing document type (VBFA-VBTYP_N) = ‘M,’ then select from VBFA the preceding document (VBFA-VBELV) where the billing document (VBRK-VBELN) is equal to the follow on document (VBFA-VBELN).

a. Select from VBFA the preceding document (VBFA-VBELV) where the preceding document (VBFA-VBELV) in step 1 is equal to the follow on document (VBFA-VBELN)

2. If billing document type (VBFA-VBTYP_N) = ‘H’ or ‘O’ or ‘P,’ then select from VBFA the preceding document (VBFA-VBELV) where the billing document (VBRK-VBELN) is equal to the follow on document (VBFA-VBELN).

regards,

siri.

3 REPLIES 3
Read only

Former Member
0 Likes
577

1..Assuming that you are reading vbrk before the below.

select vbelv into ldoc1

from vbfa

where vbeln = vbrk-vbeln

and vbtyp_n = 'M'.

1a.

select vbelv into ldoc2

from vbfa

where vbeln = ldoc1.

2.

select vbelv into table itab

from vbfa

where vbeln = vbrk-vbeln

and vbtyp_n CA 'HOP'.

Read only

0 Likes
577

can someone give one select quirie for this,

siri

Read only

Former Member
0 Likes
577

Hi,

<b>1 Select is:</b>

IF VBFA-VBTYP_N = 'M'.

Select VBELV into G_VBELV from VBFA

where VBELN = VBRK-VBELN.

Endif.

<b>2nd Select is:</b>

Select VBELN into G_VBELN from VBFA

where VBELV = G_VBELV.

<b>3rd Select:-</b>

If VBFA-VBTYP_N = 'H' or VBFA-VBTYP_N = 'O' or

VBFA-VBTYP_N = 'P'.

Select VBELV into L_VBELV from VBFA

where VBELN = VBRK-VBELN.

Endif.

Regards

Sudheer