on 05-01-2006 6:28 PM
12. Local file
Name Card name number
- master -
- visa -
- visa -
- master -
- master -
- master -
Write a code for how many master and visa records present in the table.
Hi Sagarika,
Try this code.
types: begin of st_carddetails,
cardname(20),
cardnum type i,
end of st_carddetails.
data: gf_fpath type string,
gf_card type st_carddetails-cardname,
gf_total type i .
data: gt_carddetails type table of st_carddetails,
wa_carddetails type st_carddetails.
parameters: p_fpath(30) .
start-of-selection.
gf_fpath = p_fpath.
call function 'GUI_UPLOAD'
exporting
filename = gf_fpath
tables
data_tab = gt_carddetails
exceptions
file_open_error = 1
file_read_error = 2
no_batch = 3
gui_refuse_filetransfer = 4
invalid_type = 5
no_authority = 6
unknown_error = 7
bad_data_format = 8
header_not_allowed = 9
separator_not_allowed = 10
header_too_long = 11
unknown_dp_error = 12
access_denied = 13
dp_out_of_memory = 14
disk_full = 15
dp_timeout = 16
others = 17.
if sy-subrc <> 0.
message id sy-msgid type sy-msgty number sy-msgno
with sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
else.
loop at gt_carddetails into wa_carddetails.
if gf_card <> wa_carddetails-cardname.
if not gf_card is initial.
write:/ gf_card,
gf_total.
endif.
gf_total = 1.
gf_card = wa_carddetails-cardname.
else.
gf_total = gf_total + 1.
endif.
endloop.
endif.
****Don't forget to reward useful replies***
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
DATA : W_MCOUNT TYPE I, W_COUNT TYPE I.
LOOP AT ITAB.
IF CARDNAME = 'MASTER'.
W_MCOUNT = W_MCOUNT + 1
ELSECARDNAME = 'VISA'.
W_VCOUNT = W_VCOUNT + 1
ENDIF.
ENDLOOP.
WRITE 😕 W_MCOUNT, W_VCOUNT.
Regards,
Ravi
Note : Please mark the helpful answers
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
87 | |
10 | |
10 | |
10 | |
7 | |
6 | |
6 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.