Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

Problem with select options.

pritam_baboo
Participant
0 Kudos

Hi All,

I have a custom report with two inputs: Vendor and plant. In selection screen i have given select-option for vendor and parameters for plant. when i pass some values to vendor then getting correct records but when I keep the vendor fields blank, i.e. to fetch all vendors the some line items for some vendors are missing. I am not able to understand why it is happenning and how to resolve this.

Need your kind support and help on this.

1 ACCEPTED SOLUTION

pritam_baboo
Participant
0 Kudos

Hi All,

Thanks for the replay and concern.

I debug the program and corrected it. All records and line items are populating correctly to my internal tables. One small mistake in read table statement for which some line items were missing.

6 REPLIES 6

DominikTylczyn
Active Contributor

Why don't you share the code? It is all but impossible to help you without that.

raymond_giuseppi
Active Contributor

Post the actual selection-screen definition and the select statement where you use it, where clause?

pritam_baboo
Participant
0 Kudos
DATA: vendor TYPE lfa1-lifnr.
SELECTION-SCREEN BEGIN OF BLOCK blk.
SELECT-OPTIONS: s_vendor FOR vendor.
PARAMETERS : p_werks TYPE ekpo-werks.
SELECTION-SCREEN END OF BLOCK blk.
SELECT lifnr
name1
ktokk
FROM lfa1 INTO CORRESPONDING FIELDS OF TABLE it_lfa1
WHERE lifnr IN s_vendor.
IF it_lfa1 IS NOT INITIAL.
SELECT *
FROM t077y INTO TABLE it_t077y FOR ALL ENTRIES IN it_lfa1
WHERE ktokk = it_lfa1-ktokk.
SELECT ebeln
lifnr
zterm
FROM ekko INTO TABLE it_ekko FOR ALL ENTRIES IN it_lfa1
WHERE lifnr = it_lfa1-lifnr.
ENDIF.
IF it_ekko IS NOT INITIAL.
SELECT ebeln
ebelp
FROM ekpo INTO TABLE it_ekpo
FOR ALL ENTRIES IN it_ekko
WHERE ebeln = it_ekko-ebeln AND werks = p_werks.
ENDIF.
IF it_ekpo IS NOT INITIAL.
SELECT ebeln
ebelp
belnr
budat
werks
xblnr
bldat
bewtp
wrbtr
gjahr
lfbnr
hswae
dmbtr
FROM ekbe INTO CORRESPONDING FIELDS OF TABLE it_ekbe
FOR ALL ENTRIES IN it_ekpo
WHERE ebeln = it_ekpo-ebeln
AND ebelp = it_ekpo-ebelp
AND werks = p_werks.
ENDIF.
IF it_ekbe IS NOT INITIAL.
SELECT *
FROM rbkp INTO CORRESPONDING FIELDS OF TABLE it_rbkp
FOR ALL ENTRIES IN it_ekbe
WHERE belnr = it_ekbe-belnr
AND gjahr = it_ekbe-gjahr.
ENDIF.
IF it_rbkp IS NOT INITIAL.
SELECT *
FROM bsik INTO CORRESPONDING FIELDS OF TABLE it_bsik
FOR ALL ENTRIES IN it_rbkp
WHERE lifnr = it_rbkp-lifnr
AND gjahr = it_rbkp-gjahr.
ENDIF.
IF it_bsik IS NOT INITIAL.
SELECT * FROM bseg INTO TABLE it_bseg
FOR ALL ENTRIES IN it_bsik
WHERE gjahr = it_bsik-gjahr
AND belnr = it_bsik-belnr
AND augbl = ''
AND koart = 'S'.
SELECT lifnr
augbl
gjahr
belnr
xblnr
blart
FROM bsak INTO CORRESPONDING FIELDS OF TABLE it_bsak
FOR ALL ENTRIES IN it_bsik
WHERE lifnr = it_bsik-lifnr
AND belnr = it_bsik-belnr.
SELECT *
FROM with_item INTO TABLE it_with_item
FOR ALL ENTRIES IN it_bsik
WHERE belnr = it_bsik-belnr
AND gjahr = it_bsik-gjahr.
ENDIF.
IF it_ekko IS NOT INITIAL.
SELECT * FROM t052u INTO TABLE it_t052
FOR ALL ENTRIES IN it_ekko
WHERE zterm = it_ekko-zterm.
ENDIF.
IF it_bsak IS NOT INITIAL.
SELECT chect
lifnr
vblnr
gjahr
FROM payr INTO CORRESPONDING FIELDS OF TABLE it_payr
FOR ALL ENTRIES IN it_bsak
WHERE lifnr = it_bsak-lifnr
AND vblnr = it_bsak-augbl.
ENDIF.

xiswanto
Active Participant
0 Kudos

some line items are missing -> which line item table? from ekko table select query or where?

pritam_baboo
Participant
0 Kudos

Hi All,

Thanks for the replay and concern.

I debug the program and corrected it. All records and line items are populating correctly to my internal tables. One small mistake in read table statement for which some line items were missing.

That was a question without minimum details needed to answer, and now we have the answer that it was a "small mistake of missing stuff" (?) which is now fixed. Happy for you but I don't think the existence of this question/answer will help future visitors 😉