2007 Sep 24 3:01 PM
we have to do a billing document::
selection screen should consist of:
1.billing document number
2.billing document date
3.items used for billing
4.tables used for billing
conditions:
1.billing date range should be <=200 days
2.select billing document number and other fields from vbrk table for the basic ewhere the billing documents should not be cancelled
3.material number should be from mara table where the billing documents used as items
4.sales organization details from tvkt table and company codes from t001
we should develop a classical report in the following format
-
comapny name----
biiling doc numorganisation-datecompanynetvalue---currency
total-amount----
date time page number
total amount should be displayed for each page and final amount should be printed on the last page.
remember we hav eto use the tables vbrk,mara,tvkot,t001
and particular elments for the above data are vbrk-vbeln;tvkot-vtext;vbrk-fkdat;t001-butxt;vbrk-waerk.
joins:
vbrk-vkorg = tvkot-vkorg
vbrk-bukrs = t001-bukrs
please solve this and generate the result as early as possible
2007 Sep 24 3:16 PM
Why don't you start coding this yourself and get back to the forum if you have specific problems. It's not the forum's job to do your work for you.
Rob
we have to do a billing document::
selection screen should consist of:
1.billing document number
2.billing document date
3.items used for billing
4.tables used for billing
conditions:
1.billing date range should be <=200 days
2.select billing document number and other fields from vbrk table for the basic ewhere the billing documents should not be cancelled
3.material number should be from mara table where the billing documents used as items
4.sales organization details from tvkt table and company codes from t001
we should develop a classical report in the following format
-
comapny name----
biiling doc numorganisation-datecompanynetvalue---currency
total-amount----
date time page number
total amount should be displayed for each page and final amount should be printed on the last page.
remember we hav eto use the tables vbrk,mara,tvkot,t001
and particular elments for the above data are vbrk-vbeln;tvkot-vtext;vbrk-fkdat;t001-butxt;vbrk-waerk.
joins:
vbrk-vkorg = tvkot-vkorg
vbrk-bukrs = t001-bukrs
please solve this and generate the result as early as possible
2007 Sep 24 3:16 PM
Why don't you start coding this yourself and get back to the forum if you have specific problems. It's not the forum's job to do your work for you.
Rob
2007 Sep 25 4:45 AM
Hello Mr.Rob
I tried alot but the output was not proper thats why i want to take your help.Thanks a lot
for ur support.
2007 Sep 25 2:25 PM
OK - so why don't you post the code you have developed and maybe we can see where the problem lies?
Rob
2007 Sep 25 2:36 PM
Why should they bother to do that when some other fool will happily supply code already developed as long as they get the points?!
2007 Sep 25 3:00 PM
Because this looks like a complex program and if any code is simply cut and pasted from a different program, it won't come close to meeting the requirements.
Rob
2007 Sep 25 3:05 PM
Hmmmm... Maybe there is a lesson to be learnt there somewhere?
2007 Sep 25 3:06 PM
Hi..
Try to follow this link..which gives coding to most part....which is called ALV generator..
<a href="http://www.alvrobot.com.ar/home.php">http://www.alvrobot.com.ar/home.php</a>
Hope this should help your problem.
regards,
chaithanya.
2007 Sep 25 3:27 PM
2007 Sep 25 4:54 AM
see this sample code for billing ..........................i hope this will help u
----
Tables *
----
tables: vbrk,
vbrp,
vbak,
vbap.
----
Constants *
----
constants: gc_fp type vbrk-fkart value 'FP'.
----
Variables *
----
data: a type vbrp-aubel.
----
Structures *
----
types: begin of gt_vbrk,
vbeln type vbrk-vbeln,
fkart type vbrk-fkart,
knumv type vbrk-knumv,
bukrs type vbrk-bukrs,
waerk type vbrk-waerk,
netwr type vbrk-netwr,
end of gt_vbrk,
begin of gt_vbrp,
vbeln type vbrp-vbeln,
posnr type vbrp-posnr,
fkimg type vbrp-fkimg,
meins type vbrp-meins,
gsber type vbrp-gsber,
netwr type vbrp-netwr,
aubel type vbrp-aubel,
aupos type vbrp-aupos,
end of gt_vbrp,
begin of gt_vbak,
vbeln type vbak-vbeln,
augru type vbak-augru,
vkgrp type vbak-vkgrp,
gsber type vbak-gsber,
end of gt_vbak,
begin of gt_vbap,
vbeln type vbap-vbeln,
posnr type vbap-posnr,
matnr type vbap-matnr,
netwr type vbap-netwr,
end of gt_vbap,
begin of gt_fcode,
code(4) type c,
end of gt_fcode.
----
Internal Tables *
----
data : git_vbrk type standard table of gt_vbrk,
git_vbrp type standard table of gt_vbrp,
git_vbak type standard table of gt_vbak,
git_fcode type table of gt_fcode,
git_vbap type table of gt_vbap.
data : wa_vbrk type gt_vbrk,
wa_vbrp type gt_vbrp,
wa_vbak type gt_vbak,
wa_fcode type gt_fcode,
wa_vbap type gt_vbap.
----
Selection Screen *
----
selection-screen begin of block b1 with frame title text-001.
select-options: s_vbeln for vbrk-vbeln.
parameters: p_fkart like vbrk-fkart.
selection-screen end of block b1.
----
Initialization *
----
initialization.
p_fkart = gc_fp.
----
At Selection Screen *
----
at selection-screen.
perform validate_entries.
----
Start Of Selection *
----
start-of-selection.
perform take_data_vbrk.
if not git_vbrk[] is initial.
perform take_data_vbrp.
endif.
perform take_data_vbak.
perform get_sales_items.
set pf-status 'MMM'.
----
End Of Selection *
----
end-of-selection.
perform display_data.
----
Top Of Page *
----
top-of-page.
perform desc_header.
----
Top Of Page DURING LINE-SELECTION *
----
top-of-page during line-selection.
perform sec_list_heading.
----
End Of Page *
----
end-of-page.
----
At Line Selection *
----
at line-selection.
perform view_sec_list.
----
At User Command *
----
at user-command.
perform getcursor_button.
perform getcursor_menu.
&----
*& Form validate_entries
&----
text
----
form validate_entries .
if s_vbeln-low is initial.
set cursor field 's_vbeln-low'.
message e000 with ' enter the data '.
endif.
endform. " validate_entries
&----
*& Form take_data_vbrk
&----
text
----
form take_data_vbrk .
clear git_vbrk[].
select vbeln
fkart
knumv
bukrs
waerk
netwr
from vbrk into table git_vbrk
where vbeln in s_vbeln.
if sy-subrc eq 0.
sort git_vbrk by vbeln.
endif.
endform. " take_data_vbrk
&----
*& Form take_data_vbrp
&----
text
----
form take_data_vbrp .
clear git_vbrp[].
select vbeln
posnr
fkimg
meins
gsber
netwr
aubel
aupos
from vbrp into table git_vbrp
for all entries in git_vbrk
where vbeln = git_vbrk-vbeln.
if sy-subrc eq 0.
sort git_vbrp by vbeln.
endif.
endform. " take_data_vbrp
&----
*& Form display_data
&----
text
----
form display_data .
wa_fcode-code = 'view'.
append wa_fcode to git_fcode.
set pf-status 'MMM' excluding 'VIEW'.
loop at git_vbrk into wa_vbrk.
write: /(10) wa_vbrk-vbeln,
(10) wa_vbrk-fkart,
(10) wa_vbrk-knumv,
(10) wa_vbrk-bukrs,
(10) wa_vbrk-waerk,
(10) wa_vbrk-netwr.
hide wa_vbrk-vbeln.
clear wa_vbrk.
endloop.
endform. " display_data
&----
*& Form view_sec_list
&----
text
----
form view_sec_list .
data: lv_fname type c,
lv_value type vbrp-vbeln.
get cursor field lv_fname value lv_value.
call function 'CONVERSION_EXIT_ALPHA_INPUT'
exporting
input = lv_value
importing
output = lv_value.
loop at git_vbrp into wa_vbrp.
write: /(10) wa_vbrp-vbeln,
(10) wa_vbrp-posnr,
(10) wa_vbrp-fkimg,
(10) wa_vbrp-meins,
(10) wa_vbrp-gsber,
(10) wa_vbrp-netwr,
(10) wa_vbrp-aubel,
(10) wa_vbrp-aupos.
*SET PF-STATUS 'MMM'.
endloop.
endform. " view_sec_list
&----
*& Form desc_header
&----
text
----
form desc_header.
write:/(10) 'billing-doc',
(10) 'bill type',
(10) 'no of doc',
(10) 'comp code',
(10) 'sd doc curr',
(10) 'net value'.
uline.
endform. " desc_header
&----
*& Form sec_list_heading
&----
text
----
form sec_list_heading .
write:/ 'This is my secondary list:'(009), sy-lsind.
endform. " sec_list_heading
&----
*& Form take_data_vbak
&----
text
----
form take_data_vbak .
clear git_vbak[].
select vbeln
augru
vkgrp
gsber
from vbak into table git_vbak
for all entries in git_vbrp
where vbeln = git_vbrp-aubel.
if sy-subrc eq 0.
sort git_vbak by vbeln.
endif.
endform. " take_data_vbak
&----
*& Form getcursor_button
&----
text
----
form getcursor_button .
case sy-ucomm.
when 'SELECT'.
call function 'CONVERSION_EXIT_ALPHA_INPUT'
exporting
input = wa_vbrk-vbeln
importing
output = wa_vbrk-vbeln.
loop at git_vbrp into wa_vbrp where vbeln eq wa_vbrk-vbeln.
a = wa_vbrp-aubel.
endloop.
loop at git_vbak into wa_vbak where vbeln eq a.
write:/(10) wa_vbak-vbeln,
(10) wa_vbak-augru,
(10) wa_vbak-vkgrp,
(10) wa_vbak-gsber.
hide wa_vbak-vbeln.
clear wa_vbak.
set pf-status 'MMM' excluding 'SELECT'.
endloop.
endcase.
endform. " getcursor_button
&----
*& Form getcursor_menu
&----
text
----
form getcursor_menu .
case sy-ucomm.
when 'VIEW'.
set pf-status 'MMM' excluding 'SELECT'.
loop at git_vbap into wa_vbap where vbeln eq wa_vbak-vbeln.
write : / wa_vbap-vbeln ,
wa_vbap-posnr,
wa_vbap-matnr,
wa_vbap-netwr.
endloop.
endcase.
endform. " getcursor_menu
&----
*& Form get_sales_items
&----
text
----
form get_sales_items .
select vbeln
posnr
matnr
netwr
from vbap
into table git_vbap. "FOR ALL ENTRIES IN GIT_VBRP WHERE POSNR EQ GIT_VBRP-AUPOS.
endform. " get_sales_items
reward points if helpful.........
| User | Count |
|---|---|
| 4 | |
| 2 | |
| 2 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |