‎2010 Feb 23 5:13 AM
Hi,
I am working with type statement first time , find belo wmy code but with this code after excuting data is not coming in the table IT_BSAK, what is the problem with this code.
******************
REPORT ZMS_TDS_DETAILS.
TABLES : BSAK,BKPF,LFA1,LFB1.
TYPES :
BEGIN OF TP_BSAK,
bukrs TYPE bsak-bukrs,
lifnr TYPE bsak-lifnr,
augdt TYPE bsak-augdt,
augbl TYPE bsak-augbl,
zuonr TYPE bsak-zuonr,
gjahr TYPE bsak-gjahr,
belnr TYPE bsak-belnr,
buzei TYPE bsak-buzei,
budat TYPE bsak-budat,
bldat TYPE bsak-bldat,
cpudt TYPE bsak-cpudt,
waers TYPE bsak-waers,
xblnr TYPE bsak-xblnr,
blart TYPE bsak-blart,
monat TYPE bsak-monat,
dmbtr TYPE bsak-dmbtr,
wrbtr TYPE bsak-wrbtr,
sgtxt TYPE bsak-sgtxt,
rebzg TYPE bsak-rebzg,
qsskz TYPE bsak-qsskz,
END OF TP_BSAK.
DATA : IT_BSAK TYPE STANDARD TABLE OF TP_BSAK.
DATA : WA_BSAK TYPE TP_BSAK.
SELECTION-SCREEN : BEGIN OF BLOCK B1 WITH FRAME TITLE TEXT-001.
SELECT-OPTIONS : S_LIFNR FOR BSAK-LIFNR,
S_BUDAT FOR BSAK-BUDAT OBLIGATORY,
S_GJAHR FOR BSAK-GJAHR NO INTERVALS NO-EXTENSION OBLIGATORY,
S_BUKRS FOR BSAK-BUKRS NO INTERVALS NO-EXTENSION OBLIGATORY.
SELECTION-SCREEN END OF BLOCK B1.
SELECT bukrs lifnr augdt augbl zuonr gjahr belnr buzei budat bldat cpudt waers xblnr blart monat dmbtr wrbtr sgtxt rebzg qsskz
from BSAK INTO TABLE IT_BSAK where LIFNR IN S_LIFNR
AND BUDAT IN S_BUDAT
AND GJAHR EQ S_GJAHR
AND BUKRS EQ S_BUKRS.
BREAK-POINT.
****************************************
regards,
zafar
‎2010 Feb 23 5:30 AM
SELECT bukrs lifnr augdt augbl zuonr gjahr belnr buzei budat bldat cpudt waers xblnr blart monat dmbtr wrbtr sgtxt rebzg qsskz
from BSAK INTO TABLE IT_BSAK where LIFNR IN S_LIFNR
AND BUDAT IN S_BUDAT
AND GJAHR IN S_GJAHR
AND BUKRS IN S_BUKRS.
Use IN not EQ for select options.
Ganga
‎2010 Feb 23 5:21 AM
Hi,
I think there is no problem with your code.
Please check in the table whether the data exists for your selection criteria.
Thanks,
Sudheer
‎2010 Feb 23 5:22 AM
hi,
you give the condition in the select query
>
> SELECT bukrs lifnr augdt augbl zuonr gjahr belnr buzei budat bldat cpudt waers xblnr blart monat dmbtr wrbtr sgtxt rebzg qsskz
> from BSAK INTO TABLE IT_BSAK where LIFNR IN S_LIFNR
> AND BUDAT IN S_BUDAT
> AND GJAHR EQ S_GJAHR
> AND BUKRS EQ S_BUKRS.
>
>
> zafar
give the same value in the table BSAK and see value is coming or not i think what the value you are passing is not match with the table values.
Hope this helps
Regards
Ritesh
‎2010 Feb 23 5:30 AM
SELECT bukrs lifnr augdt augbl zuonr gjahr belnr buzei budat bldat cpudt waers xblnr blart monat dmbtr wrbtr sgtxt rebzg qsskz
from BSAK INTO TABLE IT_BSAK where LIFNR IN S_LIFNR
AND BUDAT IN S_BUDAT
AND GJAHR IN S_GJAHR
AND BUKRS IN S_BUKRS.
Use IN not EQ for select options.
Ganga
‎2010 Feb 23 5:31 AM
Hi,
You are using select-options in where condition, so always use 'IN' to compare.
SELECT bukrs lifnr augdt augbl zuonr gjahr belnr buzei budat bldat cpudt waers xblnr blart monat dmbtr wrbtr sgtxt rebzg qsskz
from BSAK INTO TABLE IT_BSAK where LIFNR IN S_LIFNR
AND BUDAT IN S_BUDAT
AND GJAHR IN S_GJAHR
AND BUKRS IN S_BUKRS.Thanks,
Archana
‎2010 Feb 23 5:33 AM
Dear Zafar,
Your internal table declaration is correct. the only change which you need to make in select query is
SELECT bukrs lifnr augdt augbl zuonr gjahr belnr buzei budat bldat cpudt waers xblnr blart monat dmbtr wrbtr sgtxt rebzg qsskz
from BSAK INTO TABLE IT_BSAK where LIFNR IN S_LIFNR
AND BUDAT IN S_BUDAT
AND GJAHR IN S_GJAHR (Use IN operator rather than EQ)
AND BUKRS IN S_BUKRS. (Use IN operator rather than EQ)*
Hope this will solve your problem.
‎2010 Feb 23 5:59 AM
Hi,
I am also very new with types, so i tried executing ur code. For me it showed an error that the internal table doesnot contain a header. i tried giving WITH HEADER LINE in the declaration
(data: it_bsak type standard table of tp_bsak with header line).
this is working for me. I tried without the where condition.
hope it works for u