2006 Aug 31 10:09 AM
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.
2006 Aug 31 10:41 AM
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'.
2006 Aug 31 7:31 PM
2006 Aug 31 7:50 PM
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
| User | Count |
|---|---|
| 4 | |
| 2 | |
| 2 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |