‎2005 Jul 18 5:45 AM
Hello All,
I am using the GET statements (using LDBs)
Start code
GET BKPF.
check : select-options.
move-corresponding bkpf to i_bkpf.
append i_bkpf.
clear i_bkpf.
GET BSEG.
check : select-options.
move-corresponding bseg to i_bseg.
append i_bseg.
clear i_bseg.
GET BKPF late.
Code end
At the BKPF it retrieves 1 Header record.
At the BSEG it should retrieve 3 records but, it picks up only the 3 record (BUZEI =3)(the first two records are omitted).
Please point out the issue in the above code (seems to me Loop at BSEG is missing and when using GET statements LOOP does not exist, so how should i overcome that).
Regards,
- PSK
‎2005 Jul 18 6:16 AM
HI Sravan,
You have not mentioned what are your selection options and the values you are checking under the get bseg. May be some conditions are not met for the first 2 records.
Ravi
‎2005 Jul 18 6:41 AM
Hi,
GET will act as a loop.
First it will take first record and then for that particular record it will retrieve from BSEG.
It will retrieve properly.
I will give u some code sample.
Retrieve data
GET bkpf.
CHECK bkpf-bukrs IN sd_bukrs.(logical dbase selecion)
CHECK bkpf-gjahr IN s_gjahr.(sel screen)
CHECK bkpf-monat IN s_monat.
GET bseg LATE.
CHECK bseg-hkont IN sd_saknr.
*Populating the output table
PERFORM f1000_get_data.
FORM f1000_get_data.
MOVE-CORRESPONDING bkpf TO w_output.
MOVE-CORRESPONDING bseg TO w_output.
IF w_output-blart = 'WL'.
CLEAR w_mara.
SELECT SINGLE
matnr
prdha
INTO w_mara
FROM mara
WHERE matnr = w_output-matnr.
IF sy-subrc = 0.
w_output-prodh = w_mara-prdha.
ENDIF.
ENDIF.
APPEND w_output TO i_output.
CLEAR w_output.
ENDFORM. " f1000_get_data
Get back to me if u need any more help.
Thanks & Regards,
Judith.
Message was edited by: Judith Jessie Selvi