‎2009 Feb 05 7:17 AM
Hi experts..................
The below is the scenario, it will be helpful if u can help
me out to solve the problem which iam facing...
My Sel Screen has
ccode ---> bkpf
date -
>bkpf
channeid ---> from ztable
===============================
values stored in table as ,
channel_id --->5801 (ztable)
xblnr -
>5801-3605IL (bkpf)
==============================
so i have used range table and given as xblnr in i_rangetable.
Select bldat xblnr from bkpf into corresponding fields of table it_bkpf
where bukrs = pr_bukrs and bldat in so_bldat
and blart = 'AR'
and xblnr in i_rangetable.
while i execute values are not populating and
while debuging no values are displayed in internal table (it_bkpf) too...
wat cud be the reason ???
If entire coding is required i can send...
Thanx in advance
Rachel.
‎2009 Feb 05 7:19 AM
‎2009 Feb 05 7:22 AM
*
----
Tables *
----
TABLES : Bseg , bkpf, kna1.
Tables : zft_oa_brand, zft_oa_channel.
----
Types Begin with TY_ *
----
TYPES : Begin of ty_sh, " Search Help (f4)
CHANNEL_ID type zft_oa_channel-CHANNEL_ID,
CHANNEL_DESC type zft_oa_channel-CHANNEL_DESC, " Brand / Product Name
End of ty_sh.
types: begin of ty_agency,
kunnr like bseg-kunnr, " Customer Number
name1 like kna1-name1, " Customer Name /Agency Name
ktokd type kna1-ktokd , " customer Account Group
end of ty_agency.
types: begin of ty_adv,
xref1 type zft_oa_advtr-xref1,
advt_name type zft_oa_advtr-advt_name, " Advertiser Name
end of ty_adv.
types: begin of ty_brand,
xref2 type zft_oa_brand-xref2,
brand_name type zft_oa_brand-brand_name, " Brand/Product Name
end of ty_brand.
types: Begin of ty_bkpf,
bldat type bkpf-bldat,
bukrs type bkpf-bukrs,
xblnr type bkpf-xblnr,
end of ty_bkpf.
types: begin of ty_on_acc,
konto like rfposxext-konto,
dmshb like rfposxext-dmshb,
end of ty_on_acc.
types: begin of ty_bseg,
bukrs type bseg-bukrs,
kunnr type bseg-kunnr,
xref1 type bseg-xref1,
xref2 type bseg-xref2,
end of ty_bseg.
types: begin of ty_bsid,
bukrs type bsid-bukrs ,
kunnr type bsid-kunnr ,
gjahr type bsid-gjahr ,
belnr type bsid-belnr ,
dmbtr type bsid-dmbtr ,
rebzg type bsid-rebzg ,
augbl type bsid-augbl ,
augdt type bsid-augdt ,
hkont type bsid-hkont,
end of ty_bsid.
TYPES : begin of ty_Final,
bukrs type bseg-bukrs,
kunnr type bseg-kunnr,
xref1 type bseg-xref1,
xref2 type bseg-xref2,
bldat type bkpf-bldat,
bukrs1 type bkpf-bukrs,
xblnr type bkpf-xblnr,
End of ty_final.
type-pools: slis.
----
Constants Begin with C_ *
----
*CONSTANTS: *
----
Data Begin with W_ *
----
DATA : w_repid like sy-repid.
----
Infotypes ( HR Module Specific) *
----
*INFOTYPES : *
----
Internal tables Begin with IT_ *
----
Data : it_sh type table of ty_sh,
wa_sh type ty_sh.
Data: ret_tab like ddshretval occurs 0 with header line.
data: it_adv type table of ty_adv,
wa_adv type ty_adv.
data: it_brand type table of ty_brand,
wa_brand type ty_brand.
data : it_bkpf type table of ty_bkpf,
wa_bkpf type ty_bkpf.
data: it_bseg type table of ty_bseg,
wa_bseg type ty_bseg.
data: it_final type table of ty_final,
wa_final type ty_final.
data: it_on_acc type table of ty_on_acc with header line,
wa_on_acc type ty_on_acc.
data : channel_id type zft_oa_channel-CHANNEL_ID.
data : it_fieldcat type slis_t_fieldcat_alv with header line.
Data: it_agency type table of ty_agency,
wa_agency type ty_agency.
Data i_rangetable type range of zft_oa_channel-CHANNEL_ID.
data wa_range like line of i_rangetable .
wa_range-sign = 'I'.
wa_range-option = 'CP'.
wa_range-low = channel_id.
append wa_range to i_rangetable.
----
Field Symbols Begin with FS_ *
----
*FIELD-SYMBOLS: *
----
Insert *
----
*INSERT : *
----
Select Options Begin with SO_ *
----
Selection-screen : Begin of block b1 with frame title text-001.
Parameters: pr_bukrs type bkpf-bukrs obligatory, " Company Code
pr_chaid type ZFT_OA_CHANNEL-CHANNEL_ID. " Station
SELECT-OPTIONS : so_bldat for bkpf-bldat obligatory. " Date
selection-screen : End of block b1.
----
Parameters Begin with PR_ *
----
*PARAMETERS : *
----
Initialisation *
----
*INITIALISATION :
----
At selection-screen *
----
AT SELECTION-SCREEN on value-request for pr_chaid.
Select CHANNEL_ID CHANNEL_DESC from ZFT_OA_CHANNEL into corresponding fields of table it_sh.
CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'
EXPORTING
DDIC_STRUCTURE = ' '
retfield = ' CHANNEL_ID'
PVALKEY = ' '
DYNPPROG = ' '
DYNPNR = ' '
DYNPROFIELD = ' '
STEPL = 0
WINDOW_TITLE =
VALUE = '*'
VALUE_ORG = 'S'
MULTIPLE_CHOICE = ' '
DISPLAY = ' '
CALLBACK_PROGRAM = ' '
CALLBACK_FORM = ' '
MARK_TAB =
IMPORTING
USER_RESET =
tables
value_tab = it_sh
FIELD_TAB =
RETURN_TAB = ret_tab
DYNPFLD_MAPPING =
EXCEPTIONS
PARAMETER_ERROR = 1
NO_VALUES_FOUND = 2
OTHERS = 3
.
IF sy-subrc <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
pr_chaid = ret_tab-fieldval.
***********************************************************************
S T A R T O F S E L E C T I O N *
***********************************************************************
START-OF-SELECTION.
w_repid = sy-repid.
Select bldat xblnr from bkpf into corresponding fields of table it_bkpf
where bukrs = pr_bukrs and bldat in so_bldat
and blart = 'AR'
and xblnr = channel_id+0(4) .
and xblnr in i_rangetable.
If it_bseg[] is not initial.
select kunnr xref1 xref2 from bseg into corresponding fields of table it_bseg
for all entries in it_bkpf
where bukrs = it_bkpf-bukrs.
endif.
loop at it_bkpf into wa_bkpf.
wa_final-xblnr = wa_bkpf-xblnr.
wa_final-bldat = wa_bkpf-bldat.
read table it_bseg into wa_bseg with key bukrs = wa_bkpf-bukrs.
if sy-subrc = 0.
wa_final-kunnr = wa_bseg-kunnr.
wa_final-xref1 = wa_bseg-xref1.
wa_final-xref2 = wa_bseg-xref2.
Endif.
append wa_final to it_final.
Endloop.
perform fieldcat.
*GET XX.
END-OF-SELECTION.
***********************************************************************
E N D O F S E L E C T I O N *
***********************************************************************
At line selection *
----
*AT LINE-SELECTION.
----
User Command Processing *
----
*AT USER-COMMAND.
----
Top Of Page *
----
*TOP-OF-PAGE.
----
End Of Page *
----
*END-OF-PAGE.
&----
*& Form FIELDCAT
&----
text
----
--> p1 text
<-- p2 text
----
form FIELDCAT .
it_fieldcat-fieldname = 'XBLNR'.
it_fieldcat-seltext_m = 'Bill No ' .
it_fieldcat-col_pos = 1.
it_fieldcat-outputlen = 10.
append it_fieldcat.
clear it_fieldcat.
it_fieldcat-fieldname = 'BLDAT'.
it_fieldcat-seltext_m = 'Bill Date' .
it_fieldcat-col_pos = 1.
it_fieldcat-outputlen = 10.
append it_fieldcat.
clear it_fieldcat.
it_fieldcat-fieldname = 'NAME1' .
it_fieldcat-seltext_m = 'Agency Name' .
it_fieldcat-col_pos = 1.
it_fieldcat-outputlen = 10.
append it_fieldcat.
clear it_fieldcat.
it_fieldcat-fieldname = 'XREF1' .
it_fieldcat-seltext_m = 'Advertiser Name' .
it_fieldcat-col_pos = 1.
it_fieldcat-outputlen = 10.
append it_fieldcat.
clear it_fieldcat.
it_fieldcat-fieldname = 'XREF2' .
it_fieldcat-seltext_m = 'Brand_name' .
it_fieldcat-col_pos = 1.
it_fieldcat-outputlen = 15.
append it_fieldcat.
clear it_fieldcat.
*
it_fieldcat-fieldname = '' .
it_fieldcat-seltext_m = 'Gross
it_fieldcat-col_pos = 1.
it_fieldcat-outputlen = 10.
*
append it_fieldcat.
clear it_fieldcat.
*
endform. " FIELDCAT
‎2009 Feb 05 7:22 AM
Hi,
Can you check if the values in the range table for document number exists in BKPF for that date which is taken as input & for the corresponding company code.
If that exists do send the elaborated code.
Regards,
Kritesh Shah
‎2009 Feb 05 7:26 AM
Hi
thanx for the reply....
I checked in the table.....
if i give the input with
doc no
ccode
date
i am getting the o/p , where as if i give
xblnr as 5801
it say no values found , cos its stored as 5801-3605IL
‎2009 Feb 05 7:23 AM
Hi,
Did u checked for the values( IN SE11) for the condittion .. ie. blart = 'AR'
thanks\
Mahesh
‎2009 Feb 05 7:23 AM
hi
Are you getting values into this table "i_rangetable".
send the code how are you populating this internal table so that i can solve the problem.
‎2009 Feb 05 7:42 AM
Hi,
Correct me if i am wrong.
First u might be getting data from ur ztable
select channel id xblnr from ztable into table lv_channel id where channel id = s_channelid.
Lv_xblnr1 = lv_channel id-xblnr(ist record)
lv_xblnr2 = lv_channel id-xblnr(last record)
now u get the XBLNr u might be preparing the rannge table
r_xblnr-sign = 'I'
r_xblnr-option = 'BT'
r_xblnr-low = Lv_xblnr1
r_xblnr-high = Lv_xblnr2.
append r_xblnr.
now u tried u r below code...
Select bldat xblnr from bkpf into corresponding fields of table it_bkpf
where bukrs = pr_bukrs and bldat in so_bldat
and blart = 'AR'
and xblnr in i_rangetable.
also check the table entries in BKPF.
Regards,
Nagaraj
‎2009 Feb 05 8:58 AM
Hi......
Thanx for your effort.......
I tried cahnging the code as you have said .....
but dont wat u have mentioned below................. and also i have already given the range table...do you wanna change as below?????
Thanx
Rachel
===============================
Lv_xblnr1 = lv_channel id-xblnr(ist record)
lv_xblnr2 = lv_channel id-xblnr(last record)
now u get the XBLNr u might be preparing the rannge table
r_xblnr-sign = 'I'
r_xblnr-option = 'BT'
r_xblnr-low = Lv_xblnr1
r_xblnr-high = Lv_xblnr2.
append r_xblnr.
now u tried u r below code...
Select bldat xblnr from bkpf into corresponding fields of table it_bkpf
where bukrs = pr_bukrs and bldat in so_bldat
and blart = 'AR'
and xblnr in i_rangetable.
also check the table entries in BKPF.
‎2009 Feb 05 9:05 AM
Hi,
can u paste ur code so that i can have a look at it..
it will be easy for me to understand if i see ur code.
Regards,
Nagaraj
‎2009 Feb 05 9:16 AM
hi
ihave confusely written the correct, pls do correct me....
thanx alot for your help...
***************
select channel_id from zft_oa_channel into corresponding fields of table it_zchannel where channel_id = pr_chaid.
xblnr1 = bkpf-xblnr.
xblnr2 = bkpf-xblnr.
xblnr-sign = 'I'.
xblnr-option = 'BT'.
xblnr-low = xblnr1.
xblnr-high = xblnr2.
append xblnr.
***********************
if it_Zchannel[] is not initial.
Select bldat xblnr from bkpf into corresponding fields of table it_bkpf
where bukrs = pr_bukrs and bldat in so_bldat
and blart = 'AR'
and xblnr in i_rangetable.
endif.
If it_bseg[] is not initial.
select kunnr xref1 xref2 from bseg into corresponding fields of table it_bseg
for all entries in it_bkpf
where bukrs = it_bkpf-bukrs.
endif.
loop at it_bkpf into wa_bkpf.
wa_final-xblnr = wa_bkpf-xblnr.
wa_final-bldat = wa_bkpf-bldat.
read table it_bseg into wa_bseg with key bukrs = wa_bkpf-bukrs.
if sy-subrc = 0.
wa_final-kunnr = wa_bseg-kunnr.
wa_final-xref1 = wa_bseg-xref1.
wa_final-xref2 = wa_bseg-xref2.
Endif.
append wa_final to it_final.
Endloop.
‎2009 Feb 05 9:47 AM
i mean to say i have confusely written the coding .....pls do correst me.....
‎2009 Feb 05 9:48 AM
Hi,
change this and let me know if ur getting records.
xblnr-sign = 'I'.
xblnr-option = 'EQ'.
xblnr-low = xblnr1.
xblnr-high = xblnr2.
append xblnr.
Regards,
Nagaraj
‎2009 Feb 05 10:01 AM
Hi ......
i am really sorry for troubling u alot...but iam new to this....and in a hurry to finish thats y.......
it gives me a error saying...................
The data object "XBLNR" has no structure and therefore no component called "SIGN".
thanx
‎2009 Feb 05 10:15 AM
try this way
ranges : r_xblnr for bkpf-xblnr.
select channel_id xblnr from zft_oa_channel into corresponding fields of table it_zchannel where channel_id = pr_chaid.
describe table it_zchannel lines v_lines.
sort it_zchannel.
read table it_zchannel index 1.
xblnr1 = it_zchannel -xblnr.
read table it_zchannel index v_lines.
xblnr2 = it_zchannel -xblnr.
r_xblnr-sign = 'I'.
r_xblnr-option = 'EQ'.
r_xblnr-low = xblnr1.
r_xblnr-high = xblnr2.
append r_xblnr.
***********************
if it_Zchannel[] is not initial.
Select bldat xblnr from bkpf into corresponding fields of table it_bkpf
where bukrs = pr_bukrs and bldat in so_bldat
and blart = 'AR'
and xblnr in r_xblnr.
endif.
If it_bseg[] is not initial.
select kunnr xref1 xref2 from bseg into corresponding fields of table it_bseg
for all entries in it_bkpf
where bukrs = it_bkpf-bukrs.
endif.
loop at it_bkpf into wa_bkpf.
wa_final-xblnr = wa_bkpf-xblnr.
wa_final-bldat = wa_bkpf-bldat.
read table it_bseg into wa_bseg with key bukrs = wa_bkpf-bukrs.
if sy-subrc = 0.
wa_final-kunnr = wa_bseg-kunnr.
wa_final-xref1 = wa_bseg-xref1.
wa_final-xref2 = wa_bseg-xref2.
Endif.
append wa_final to it_final.
Endloop.
I am assuming the XBLNR field is in the ztable zft_oa_channel
Reagrds,
Nagaraj
‎2009 Feb 05 10:29 AM
xlbnr is in bkpf and
channel_id is in zft_oa_channe <ztable >
‎2009 Feb 05 10:33 AM
Hi,
if that is the case then initially when u raised the question
channel_id --->5801 (ztable)
xblnr -
>5801-3605IL (bkpf)->
u told u have prepared a range table..On which basis u have prepared that and how u preapared it.
what is the significane of having the channel id at the selection screen.
Regards,
Nagaraj
‎2009 Feb 05 10:36 AM
hi nagaraj....
i think u didnt get my coding or i shud have written somewhere wrong.....
you have specified channel_id and xblnr from same table....
but both are in different tables
also my problem is i have used the zft_oa_channel for f4 in sele screen( for eg 5801) where as that channel no is stored in bkpf table as 5801- 3605l so i have used the range..... and specified in where
now got strucked up!!!
‎2009 Feb 05 10:44 AM
Hi,
if the XBLNR is stored in BKPF as 5801- 3605l then if u use the range table it won't work because (5801- 3605l ) is a single value . So u cannot use ranges.
so in the select query u shouldn't put the where condition for XBLNR.
revert back
Regards,
Nagaraj
‎2009 Feb 05 10:53 AM
yes nagaraj your r rite.....it works for single value,.......
i have used the range table since i have specified as Parameter in Selection screen Parameters: pr_chaid type ZFT_OA_CHANNEL-CHANNEL_ID. " Station
‎2009 Feb 05 10:58 AM
Hi,
U should only use range when u want to check the multiple values..
are u able to get the record or still u r facing problem.
Regards,
Nagaraj
‎2009 Feb 05 11:13 AM
iam still facing the problem........
with out using range table how to specify in where condition such that it will fetch values matching
befor hypehn (5801- 1109l)
if someother option is there it will be helpful such that i can solve easily with a where condition itself....
previously i started this way............................ and xblnr = channel_id+0(4) .*
if can help me out....thou i know i am troubling u alont....if it sounds bit confusing .do let me know ...its ok ....i will try to manage myself.......
=================
select channel_id from zft_oa_channel into corresponding fields of table it_zchannel where channel_id = pr_chaid.
if it_Zchannel[] is not initial.
Select bldat xblnr from bkpf into corresponding fields of table it_bkpf
where bukrs = pr_bukrs and bldat in so_bldat
and blart = 'AR'
and xblnr = channel_id+0(4) .
‎2009 Feb 05 11:26 AM
Hi,
Try like this then
Is channel_id is parameter in selection screen ??if yes then do this way ..if not then inteasd of cahnnel_id use p_channel_id where p_channel_id is ur paramter on se;ection screen
concatenate channel_id '%' into channel_id.
Select bldat xblnr from bkpf into corresponding fields of table it_bkpf
where bukrs = pr_bukrs and bldat in so_bldat
and blart = 'AR'
and xblnr like channel_id .
Nagaraj
‎2009 Feb 05 11:29 AM
Hello Rachel,
Try this code:
select channel_id from zft_oa_channel
into corresponding fields of table it_zchannel
where channel_id = pr_chaid.
if it_Zchannel[] is not initial.
conactenate pr_chaid+0(4) '%' into l_v_chaid.
Select bldat xblnr from bkpf
into corresponding fields of table it_bkpf
where bukrs = pr_bukrs
and bldat in so_bldat
and blart = 'AR'
and xblnr LIKE l_v_chaid.
endif.
Hope this helps.
BR,
Suhas
‎2009 Feb 05 12:52 PM
Hi nagaraj ....
sorry was not able to reply immdly since had a network issue....
its working perfectly....but in next select its not fetching values ....
iam trying to debug and let u know if the issue is solved ....
thank you so much
‎2009 Feb 05 12:53 PM
hi saha...............
its working perfectly....but in next select
If it_bkpf[] is not initial.
select kunnr xref1 xref2 from bseg into corresponding fields of table it_bseg
for all entries in it_bkpf
where bukrs = it_bkpf-bukrs.
endif.
its not fetching values ....
iam trying to debug and let u know if the issue is solved ....
thnx
‎2009 Feb 05 1:06 PM
hi,
i am afraid is ur it_bkpf table has BUKRS...
because in the code which u have pasted initially, in the first select u r not selecting that field...
Rgds.,
subash
‎2009 Feb 06 7:19 AM
Hi,
U should have bukrs field in ur first select query
if it_Zchannel[] is not initial.
Select bukrs bldat xblnr from bkpf into corresponding fields of table it_bkpf
where bukrs = pr_bukrs and bldat in so_bldat
and blart = 'AR'
and xblnr in i_rangetable.
endif.
If it_bseg[] is not initial.
select kunnr xref1 xref2 from bseg into corresponding fields of table it_bseg
for all entries in it_bkpf
where bukrs = it_bkpf-bukrs.
endif.
Now it should work..
Regards,
Nagaraj
‎2009 Feb 05 1:53 PM
wa_range-sign = 'I'.
wa_range-option= 'CP'. *change to wa_range-option = 'EQ'.*
wa_range-low = channel_id.
append wa_range to i_rangetable.Cheers
Edited by: Mukundan Ramanathan on Feb 5, 2009 2:53 PM