on 2016 Aug 12 1:26 PM
Hi Seniors,
I have written a query on RSEG table but fields SPGRP and SPGRM are not populating in structure not even in variables for the invoice which have both the values for SPGRP and SPGRM as 'X'. Means for invoice which are blocked by both price and quantity. this query in written in a method of Bussiness Object ZBUS2081 and is release.
Please guide me to solve this puzzle.
Thanks in advance.
Request clarification before answering.
More information required?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
SELECT SINGLE EBELN SPGRP SPGRM
INTO (lv_ebeln,lv_spgrp,lv_spgrm) FROM RSEG
WHERE BELNR = BELNR AND GJAHR = GJAHR.
IF SY-SUBRC = 0.
SELECT SINGLE EKORG EKGRP INTO (LV_EKORG,LV_EKGRP)
FROM EKKO WHERE EBELN = lv_EBELN.
IF SY-SUBRC = 0.
* pblock = ls_rseg-spgrp.
* qblock = ls_rseg-spgrm.
IF lv_SPGRP IS NOT INITIAL.
LV_BLOCKTYP = 'P'.
Select single * from ZDT_EMAIL_INV
into ZDT_EMAIL_INV_P where ZZ_PURCH_ORG = LV_EKORG
and ZZ_PURCH_GROUP = LV_EKGRP
and ZZ_BLOCK_TYP = LV_BLOCKTYP.
endif.
IF Lv_SPGRM IS NOT INITIAL.
LV_BLOCKTYP = 'Q'.
Select single * from ZDT_EMAIL_INV
into ZDT_EMAIL_INV_Q where ZZ_PURCH_ORG = LV_EKORG
and ZZ_PURCH_GROUP = LV_EKGRP
and ZZ_BLOCK_TYP = LV_BLOCKTYP.
ENDIF.
ENDIF.
ENDIF.
Above is the code for fetching recipients based on Flag Fields but flag fields SPGRP and SPGRM are not populating from RSEG.
You forgot BUZEI field, so only one item is randomly read from invoice, if you look for records in error (e.g. from RBKP_BLOCKED) and don't already know item number add some criteria like in following sample:
SELECT ebeln ebelp spgrp spgrm ...
INTO (lv_ebeln, lv_ebelp, lv_spgrp, lv_spgrm, ...)
FROM rseg
WHERE belnr = rbkp-belnr
AND gjahr = rbkp-gjahr
AND ( spgrg NE space
OR spgrm NE space
OR spgrp NE space
OR spgrc NE space
OR spgrs NE space
OR spgrt NE space
OR spgrq NE space
OR spgrext NE space ).
" ...
ENDSELECT.
Regards,
Raymond
User | Count |
---|---|
76 | |
30 | |
10 | |
8 | |
8 | |
7 | |
7 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.