10-20-2008 8:51 AM
hi
i have an issue in the report, the problem is
in the selection screen i have an WBS ELEMENT as an select option(there is no belnr in selection scrren)
for eg- if i enter
COMP CODE = 0010
WBS ELEMNT = 23456
YEAR = 2008.
For the above details there are 2 line items in table for that particular belnr as
BUKRS BELNR YEAR BUZEI WBSELT SHKZG
0010 40000050 2008 001 23456 S
0010 40000050 2008 002 00000 H
there is only one line item for WBS ELEMENT IN BSEG TABLE(I.E, FOR LINE ITEM 2 THERE IS NO WBS ELEMENT).
So i am getting debit(SHKZG-S) value but i am not getting credit value (SHKZG-H)if i write the select query as below.
SELECT bukrs
belnr
gjahr
buzei
sgtxt
kostl
aufnr
lifnr
ebeln
projk
FROM bseg
into table gt_bseg
for all entries in i_get
where bukrs eq i_get-bukrs
and belnr eq i_get-belnr
and gjahr eq i_get-ryear
and buzei eq i_get-buzei
and projk in s_projk.
please help how to get both values.help with code
DO I NEED TO REMOVE PROJK IN S_PROJK IN SELECT QUERY.
thanks in advance,
Edited by: Julius Bussche on Oct 20, 2008 10:24 AM
10-20-2008 8:58 AM
Hi,
If you remove the PROJK field then all the WBS element will be selected.
Instead i suggest following steps:
1)Fetch the belnr from the BSEG table based on the WBS element.
2)ANd then put the condition in the selection query and remove the condition of PROJK field.
So by doing this, only the WBS element ' ' will be selected and then you can select both the records based on belnr.
Regards
Pooja
10-20-2008 9:05 AM
hi pooja,,
i did not get you could you please tell me clearly.
if possible with code.
please help me.
thanks in advance
10-20-2008 9:21 AM
Hi,
Can you tell me what do you contain in the i_get internal table?
Regards,
Pooja
10-20-2008 9:37 AM
Hi,
I have pasted the code below:
SELECT-OPTIONS: s_bukrs FOR bkpf-bukrs,
s_projk FOR bseg-projk,
s_gjahr FOR bseg-gjahr.
SELECT belnr FROM bseg
INTO TABLE i_bseg
WHERE bukrs IN s_bukrs
AND gjahr IN s_gjhar
AND projk IN s_projk .
SELECT bukrs
belnr
gjahr
buzei
sgtxt
kostl
aufnr
lifnr
ebeln
projk
FROM bseg
INTO TABLE i_bseg_all
FOR ALL ENTRIES IN i_bseg
WHERE bukrs EQ i_bseg-bukrs
AND belnr EQ i_bseg-belnr
AND gjahr EQ i_bseg-ryear.
Regards,
Pooja