2014 Sep 26 7:39 AM
hi ,
FORM GET_DATA .
select vbeln kunnr audat waerk bstnk bstdk from vbak into TABLE it_vbak where vbeln in P_sale.
select * from vbap into table it_vbap for all ENTRIES IN it_vbak where vbeln = it_vbak-vbeln.
select vbeln inco1 zterm from vbkd into TABLE it_vbkd for ALL ENTRIES IN it_vbak where vbeln = it_vbak-vbeln.
select kunnr name1 ort01 from kna1 into TABLE IT_KNA1 for ALL ENTRIES IN it_vbak where kunnr = it_vbak-kunnr.
loop at it_vbap into wa_vbap.
read table it_vbak into wa_vbak with key vbeln = wa_vbap-vbeln.
if sy-subrc = 0.
wa_final-vbeln = wa_vbak-vbeln.
wa_final-audat = wa_vbak-audat.
wa_final-waerk = wa_vbak-waerk.
wa_final-bstnk = wa_vbak-bstnk.
wa_final-bstdk = wa_vbak-bstdk.
select single edatu into wa_final-edatu from vbep where vbeln = wa_vbap-vbeln."delivery date
read table it_vbkd into wa_vbkd with key vbeln = wa_vbap-vbeln.
if sy-subrc = 0.
select single bezei into wa_final-bezei from tinct where inco1 = wa_vbkd-inco1 and spras = 'EN'."terms of delivery
select single vtext into wa_final-vtext from tvzbt where zterm = wa_vbkd-zterm and spras = 'EN'."terms of payment
endif.
read table it_kna1 into wa_kna1 with key kunnr = wa_vbak-kunnr.
if sy-subrc = 0.
wa_final-kunnr = wa_vbak-kunnr.
wa_final-name1 = wa_kna1-name1.
wa_final-ort01 = wa_kna1-ort01.
endif.
endif.
wa_final-posnr = wa_vbap-posnr.
wa_final-matnr = wa_vbap-matnr.
wa_final-arktx = wa_vbap-arktx.
wa_final-netpr = wa_vbap-netpr.
wa_final-netwr = wa_vbap-netwr.
wa_final-kpein = wa_vbap-kpein.
wa_final-kmein = wa_vbap-kmein.
wa_final-ZMENG = wa_vbap-zmeng.
APPEND wa_final to it_final.
endloop.
ENDFORM. " GET_DATA
am getting all the values except that terms of payment and terms of delivery am not getting i dont know what mistake i did (bezei fld and vtext fld )
please help me
2014 Sep 26 7:47 AM
Hi Mahalakshmi ;
Did you check the 'TINCT' table from se16n or with debugging; may be space the description of the text
field.
Regards.
Özgün.
2014 Sep 26 7:55 AM
2014 Sep 26 8:04 AM
Check you other thread
http://scn.sap.com/thread/3626811
You are reading your tables with SPRAS = 'EN' instead of SPRAS = 'E'
2014 Sep 26 8:06 AM
Hi,
The Language Key in the tables in 1 digit, though the selection screen allows us to enter EN. Did you try replacing EN with E and check.
Regards,
Shashi Thakur
2014 Sep 26 8:17 AM
Hi i have replaced the en with 'e' but its not showing its text in debugging part i have checked
2014 Sep 26 8:24 AM
Please, put a screenshot with the debugging and the content of the table
2014 Sep 26 8:39 AM
2014 Sep 26 8:44 AM
2014 Sep 26 8:32 AM
Hi Mahalakshmi,
Check the conditions , which you are using to extract the desired text.
Thanks & Regards,
Swati
2014 Sep 26 8:40 AM
Hi,
Please check it for internal table is initial or not.
select vbeln kunnr audat waerk bstnk bstdk from vbak into TABLE it_vbak where vbeln in P_sale.
if it_vbak is not initial.
select * from vbap into table it_vbap for all ENTRIES IN it_vbak where vbeln = it_vbak-vbeln.
endif.
if it_vbap is not initial.
select vbeln inco1 zterm from vbkd into TABLE it_vbkd for ALL ENTRIES IN it_vbak where vbeln = it_vbak-vbeln.
endif.
if it_vbkd is not initial.
select kunnr name1 ort01 from kna1 into TABLE IT_KNA1 for ALL ENTRIES IN it_vbak where kunnr = it_vbak-kunnr.
endif.
2014 Sep 26 8:49 AM
2014 Sep 26 8:50 AM
2014 Sep 26 9:00 AM
Then replace the not optimized
SELECT vbeln kunnr audat waerk bstnk bstdk FROM vbak
INTO TABLE it_vbak WHERE vbeln IN p_sale.
SELECT * FROM vbap
INTO TABLE it_vbap FOR ALL ENTRIES IN it_vbak WHERE vbeln = it_vbak-vbeln.
SELECT vbeln inco1 zterm FROM vbkd
INTO TABLE it_vbkd FOR ALL ENTRIES IN it_vbak WHERE vbeln = it_vbak-vbeln.with
SELECT vbeln kunnr audat waerk bstnk bstdk FROM vbak
INTO TABLE it_vbak WHERE vbeln IN p_sale.
SELECT * FROM vbap
INTO TABLE it_vbap WHERE vbeln IN p_sale.
SELECT vbeln inco1 zterm FROM vbkd
INTO TABLE it_vbkd WHERE vbeln IN p_sale.
Here FOR ALL ENTRIES is not required and will hamper performance
Questions
Regard,
Raymond
2014 Sep 26 9:35 AM
Hi
The VBKD table has Key fields as VBELN and POSNR. So try changing your query to
select vbeln posnr inco1 zterm from vbkd into TABLE it_vbkd for ALL ENTRIES IN it_vbak wherevbeln = it_vbak-vbeln.
read table it_vbkd into wa_vbkd with key vbeln = wa_vbap-vbeln posnr = wa_vbap-posnr.
Regards,
Shashi Thakur
2014 Sep 26 9:56 AM
s
tables:vbak,vbpa,vbap,vbkd,vbep.
types:begin of ty_vbak,
vbeln type vbeln_va,"sales order
kunnr type kunag,"customer no
audat type audat,"doc date
waerk type waerk,"currency
bstnk type bstnk,"Po number
bstdk type bstdk,"po date
end of ty_vbak.
types:begin of ty_vbkd,
vbeln type vbeln,
inco1 type inco1,
zterm type dzterm,
end of ty_vbkd.
TYPES:BEGIN OF TY_KNA1,
KUNNR TYPE KUNAG, " Customer No.
NAME1 TYPE NAME1_GP," name
ORT01 type ORT01_GP,
END OF TY_KNA1.
types:begin of ty_final,
vbeln type vbeln_va,"
kunnr type kunag,
audat type audat,
waerk type waerk,
bstnk type bstnk,
bstdk type bstdk,"Po date
NAME1 TYPE NAME1_GP," name
ORT01 type ORT01_GP,
edatu type edatu,
inco1 type inco1,
bezei type bezei30,
vtext type dzterm_bez,
posnr type posnr_va,
matnr type matnr,
arktx type arktx,
kpein type kpein,
netpr type netpr,
netwr type netwr_ap,
kmein type kmein,
zmeng type dzmeng,
end of ty_final.
data:it_vbak type STANDARD TABLE OF ty_vbak,
wa_vbak type ty_vbak,
it_vbap type STANDARD TABLE OF vbap,
wa_vbap type vbap,
it_vbkd type STANDARD TABLE OF ty_vbkd,
wa_vbkd type vbkd,
it_final type STANDARD TABLE OF ty_final,
wa_final type ty_final,
it_kna1 type STANDARD TABLE OF ty_kna1,
wa_kna1 type ty_kna1.
2014 Sep 26 1:49 PM
Ok,
Regards,
Raymond
2014 Sep 26 6:00 PM
Hi,
I am working on sales order the number usually same really thanks for all the replies I will resolve that issue even I have not noticed that Wa_vbkd type vbkd in declaration kd
Thanks
Maha