‎2008 Aug 22 2:26 AM
I have input file where the u2018upc_eanu2019 fields contains values like
054871020964
054871020971
054871020988 u2026.
How ever the same values when I read from data base table like vbep, vbak, vbap vbpa as
IF NOT gt_vbpa[] IS INITIAL.
SELECT vbeln
wmeng
j_3aean11
j_3aabgru
INTO TABLE gt_vbep
FROM vbep
FOR ALL ENTRIES IN gt_vbpa
WHERE vbeln = gt_vbpa-vbeln.
ENDIF. To get good performance.
the values are coming into internal table gt_vbep-j_3aean11 as
54871020964
54871020971
54871020988
I want to have values into my internal tableu2019s gt_vbep-j_3aean11 as
054871020964
054871020971
054871020988 u2026.
How can I achieve the above ?
The values are coming as "INTO TABLE itab" like in one glimp.
PLEASE HELP ME.
THANKS IN ADVANCE,
=============================================If you want to have a look at my code...PLEASE BELOW IS MY CODE:
So my logic to select is not working at below 3rd point .
1). Declares table for input file capture :
TYPES : BEGIN OF ty_869_input_rec,
rec_type(2) TYPE c,
cntrl_no(50) TYPE c,
upc_ean TYPE ean11,
vend_style(18) TYPE c,
no_line_itm(6) TYPE c,
time_stamp(16) TYPE c,
END OF ty_869_input_rec.
DATA : gt_869_input_rec TYPE TABLE OF ty_869_input_rec,
DATA : wa_869_input_rec TYPE ty_869_input_rec,
CALL FUNCTION 'GUI_UPLOAD'
EXPORTING
filename = p_lfile
filetype = 'DAT'
has_field_separator = ';'
HEADER_LENGTH = 0
READ_BY_LINE = 'X'
DAT_MODE = ' '
CODEPAGE = ' '
IGNORE_CERR = ABAP_TRUE
REPLACEMENT = '#'
CHECK_BOM = ' '
VIRUS_SCAN_PROFILE =
NO_AUTH_CHECK = ' '
IMPORTING
FILELENGTH =
HEADER =
TABLES
data_tab = gt_lfile " gt_869_input_rec
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.
ENDIF.
2). In the same program I am seleting the values from database table and keeping in the internal tables :
I am selecting the data from database tables LIKE :
GET vbpa required fields
IF NOT gt_vbak[] IS INITIAL.
SELECT vbeln
kunnr
parvw
INTO TABLE gt_vbpa
FROM vbpa
FOR ALL ENTRIES IN gt_vbak
WHERE vbeln = gt_vbak-vbeln
AND kunnr = gt_vbak-kunnr
AND parvw = 'WE'.
ENDIF.
Get vbep required fields
IF NOT gt_vbpa[] IS INITIAL.
SELECT vbeln
wmeng
j_3aean11
j_3aabgru
INTO TABLE gt_vbep
FROM vbep
FOR ALL ENTRIES IN gt_vbpa
WHERE vbeln = gt_vbpa-vbeln.
ENDIF.
3). Here My logic is failing because the value in the wa_869_input_rec-upc_ean is 054871020964
Where as vbep-j_3aean11 contains the values as 54871020964
Order Qty.
LOOP AT gt_vbep INTO wa_vbep
WHERE vbeln IN r3_vbeln
AND j_3aean11 = wa_869_input_rec-upc_ean.
lv_order_qty = lv_order_qty + wa_vbep-wmeng.
ENDLOOP.
Cancelled_1 Qty.
LOOP AT gt_vbep INTO wa_vbep
WHERE vbeln IN r3_vbeln
AND j_3aabgru IN r4_j_3aabgru
AND j_3aean11 = wa_869_input_rec-upc_ean.
lv_cancelled1 = lv_cancelled1 + wa_vbep-wmeng.
ENDLOOP.
Cancelled_2Qty :
LOOP AT gt_vbep INTO wa_vbep
WHERE vbeln IN r3_vbeln
AND j_3aabgru IN r5_j_3aabgru
AND j_3aean11 = wa_869_input_rec-upc_ean.
lv_cancelled2 = lv_cancelled2 + wa_vbep-wmeng.
ENDLOOP.
‎2008 Aug 22 3:48 AM
or can i remove preceding '0's ( in wa_869_input_rec-upc_ean) after reding into input internal table and
use to capture values
LOOP AT gt_vbep INTO wa_vbep
WHERE vbeln IN r3_vbeln
AND j_3aean11 = wa_869_input_rec-upc_ean.
lv_order_qty = lv_order_qty + wa_vbep-wmeng.
ENDLOOP.
Cancelled_1 Qty.
LOOP AT gt_vbep INTO wa_vbep
WHERE vbeln IN r3_vbeln
AND j_3aabgru IN r4_j_3aabgru
AND j_3aean11 = wa_869_input_rec-upc_ean.
lv_cancelled1 = lv_cancelled1 + wa_vbep-wmeng.
ENDLOOP.
AND FINALLY WHILE WRITING INTO OUTPUT INTERNAL TABLE Can I again use converson exit alpha FM for the field wa_869_input_rec-upc_ean in internal table ?
It is always in loop . May I know how the performance effects ?
‎2008 Aug 22 2:35 AM
Hi Sam ,
in this u can do one thing ,
option 1 --> make that column as a Text column in ur excel file , then it wont miss the 0's.
option2 --> by using conversion exit u need to convert into internal Format.
Regards
prabhu
‎2008 Aug 22 3:41 AM
Prabhu,
I didnot get you.
The text file is uploaded in other server.
I am getting preceding '0's when I down load input file data into my internal table.
In SELECT stmt,
SELECT vbeln
wmeng
j_3aean11
j_3aabgru
INTO TABLE gt_vbep
FROM vbep
FOR ALL ENTRIES IN gt_vbpa
WHERE vbeln = gt_vbpa-vbeln.
ENDIF. To get good performance.
the values are coming into internal table gt_vbep-j_3aean11 as
54871020964
54871020971
54871020988
I want to have values into my internal tableu2019s gt_vbep-j_3aean11 as
054871020964
054871020971
054871020988 u2026.
Could you please tell me how to do this?
‎2008 Aug 22 3:45 AM
if you want 0 in front you have to make corresponding field as string
‎2008 Aug 22 3:48 AM
or can i remove preceding '0's ( in wa_869_input_rec-upc_ean) after reding into input internal table and
use to capture values
LOOP AT gt_vbep INTO wa_vbep
WHERE vbeln IN r3_vbeln
AND j_3aean11 = wa_869_input_rec-upc_ean.
lv_order_qty = lv_order_qty + wa_vbep-wmeng.
ENDLOOP.
Cancelled_1 Qty.
LOOP AT gt_vbep INTO wa_vbep
WHERE vbeln IN r3_vbeln
AND j_3aabgru IN r4_j_3aabgru
AND j_3aean11 = wa_869_input_rec-upc_ean.
lv_cancelled1 = lv_cancelled1 + wa_vbep-wmeng.
ENDLOOP.
AND FINALLY WHILE WRITING INTO OUTPUT INTERNAL TABLE Can I again use converson exit alpha FM for the field wa_869_input_rec-upc_ean in internal table ?
It is always in loop . May I know how the performance effects ?
‎2008 Aug 22 3:49 AM