2009 Mar 06 4:22 AM
Hi,
i need net amount totals by vendor based.
for ex:
Vendor 10146.
Document No Net Amount
6000003 1,250.0
6260003 63,143.00
-
total
-
Vendor 11312
Document No Net Amount
6000001 4,000.00
6260000 465,874.00
-
total
-
Regards ,
K.Karthikeyan.
2009 Mar 06 4:32 AM
HI,
You can use statement:
AT END OF Vendor number.
SUM (by your required fields name)
ENDAT.
Hope it helps
Regrds
Mansi
Hi,
i need net amount totals by vendor based.
for ex:
Vendor 10146.
Document No Net Amount
6000003 1,250.0
6260003 63,143.00
-
total
-
Vendor 11312
Document No Net Amount
6000001 4,000.00
6260000 465,874.00
-
total
-
Regards ,
K.Karthikeyan.
2009 Mar 06 4:24 AM
Hi,
I think that you already have all data in 1 internal table. So, why don't you just add up all values being printed in a variable above the total...
2009 Mar 06 4:25 AM
Use control break statements.
sort ur internal table by vendor number befour loop stmt....
wit in loop endloop use control break stmt..
AT END of <vendor>.
sum.
ENDAT>
2009 Mar 06 4:32 AM
HI,
You can use statement:
AT END OF Vendor number.
SUM (by your required fields name)
ENDAT.
Hope it helps
Regrds
Mansi
2009 Mar 06 4:36 AM
Hi,
try this.
sort itab by vendor.
loop at itab into fs.
at new vendor.
write 😕 fs-vendor.
sum.
endat.
at end of vendor.
write : fs-amount.
endat.
endloop.
2009 Mar 06 6:29 AM
Hi Karthikeyan,
Use this code :
Sort int_table By vendor.
LOOP AT int_table INTO wa_table.
AT NEW vendor.
Write : 'Vendor' , wa_table-vendor.
SKIP.
Write : / 1(20) 'Document No', 22(20) 'Net Amount'.
ENDAT.
Write : / 1(20) wa_table-document , 22(20) wa_table-netamt.
AT END OF vendor.
SUM.
ULINE.
Write : / 'Total', wa_table-netamt UNDER wa_table-netamt.
ULINE.
ENDAT.
ENDLOOP.
Hope this helps.
Regards,
Qamar.
2009 Mar 06 6:45 AM
Use Control Break Statement.
AT END OF Vendor No.
SUM.
END AT.
Regards,
Joan
2009 Mar 06 6:59 AM
hI ,
You can use
at end of vendor.
sum.........
endat.
at end of vendor
write sum.
endat.
2009 Mar 06 7:05 AM
Hi Karthick,
Here is a sample code to display subtotals on alv grid control,
U hv to create a screen & set pf-status
data:
begin of t_itab occurs 0.
include structure sflight.
data end of t_itab.
**declaring the container & grid for output table display**
data:
r_container type ref to cl_gui_custom_container,
r_grid type ref to cl_gui_alv_grid.
**structure of layout**
data:
fs_lay type lvc_s_layo.
**Field Catalog**
data:
t_fcat type lvc_t_fcat,
fs_fcat type lvc_s_fcat.
**Sort table**
data: t_sort type lvc_t_sort,
fs_sort type lvc_s_sort.
select * from sflight into corresponding fields of table t_itab.
fs_fcat-fieldname = 'PRICE'.
fs_fcat-do_sum = 'X'.
append fs_fcat to t_fcat.
fs_sort-spos = 1.
fs_sort-fieldname = 'CONNID'. " here give fieldname as VENDOR, it gives u total amt based on vendor
fs_sort-up = 'X'.
fs_sort-subtot = 'X'.
append fs_sort to t_sort.
*--------------------------------------------------------------------------------
call screen 100.
*&---------------------------------------------------------------------*
*& Module STATUS_0100 OUTPUT
*&---------------------------------------------------------------------*
* text
*----------------------------------------------------------------------*
module status_0100 output.
set pf-status 'SCREEN1'.
endmodule. " STATUS_0100 OUTPUT
*&---------------------------------------------------------------------*
*& Module USER_COMMAND_0100 INPUT
*&---------------------------------------------------------------------*
* text
*----------------------------------------------------------------------*
module user_command_0100 input.
case sy-ucomm.
when 'BACK'.
leave to screen 0.
when 'EXIT'.
leave program.
endcase.
endmodule. " USER_COMMAND_0100 INPUT
*&---------------------------------------------------------------------*
*& Module LIST OUTPUT
*&---------------------------------------------------------------------*
* text
*----------------------------------------------------------------------*
module list output.
create object r_container
exporting
container_name = 'CCONTAINER2'.
create object r_grid
exporting
i_parent = r_container.
*passing the layout structure, fieldcatalog and output table for display*
call method r_grid->set_table_for_first_display
exporting
i_structure_name = 'SFLIGHT'
IS_LAYOUT = fs_lay
changing
it_fieldcatalog = t_fcat
it_sort = t_sort
it_outtab = t_itab[].
endmodule. " LIST OUT
Regards,
Mdi.Deeba
| User | Count |
|---|---|
| 4 | |
| 2 | |
| 2 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |