09-23-2008 7:44 PM
hi
i have created a ztable with 3 fields.and the three data elements are yktopl,saknr and zsaknr.
yktopl is a copy of ktopl
zsaknr is a copy of saknr.
i am using excel file to upload data to this table.
one the data loaded sucessfully ,
when i execute se-ztable then i am able to see all the records.
if i want view data for a perticular A/C is is saying no data found.
but if i put zfield or zfield or zfield then i am ablt to see data for zfield
if i just enter zfield then it is saying no data found.
any inputs..
09-23-2008 7:50 PM
09-23-2008 7:51 PM
here is the program
&----
*& Report ZWPRGL_FS_ITEM_UPLOAD *
*& *
&----
*& *
*& *
&----
REPORT ZWPRGL_FS_ITEM_UPLOAD .
TABLES: ZFSMAP.
DATA: t_ZFSMAP TYPE TABLE OF ZFSMAP.
SELECTION-SCREEN BEGIN OF BLOCK a1 WITH frame title text-001.
PARAMETERS: r_read radiobutton group gr1,
p_file TYPE rlgrap-filename,
p_endrow TYPE I DEFAULT 65000,
p_modf AS CHECKBOX ,
r_del radiobutton group gr1.
SELECT-OPTIONS: s_saknr FOR ZFSMAP-zwpr_glacct.
SELECTION-SCREEN END OF BLOCK a1.
AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_file.
CALL FUNCTION 'F4_FILENAME'
EXPORTING
PROGRAM_NAME = SYST-CPROG
DYNPRO_NUMBER = SYST-DYNNR
FIELD_NAME = 'P_'
IMPORTING
FILE_NAME = p_file.
START-OF-SELECTION.
If r_read = 'X'.
IF p_file IS INITIAL.
write 'Please enter file name'.
exit.
ENDIF.
PERFORM read_file.
PERFORM update_database.
endif.
IF r_del = 'X'.
DELETE FROM ZFSMAP WHERE ZWPR_GLACCT IN s_saknr.
COMMIT WORK.
WRITE 'Successfully deleted data'.
ENDIF.
&----
*& Form READ_FILE
&----
form READ_FILE .
DATA: tl_data TYPE TABLE OF alsmex_tabline,
wal_ZFSMAP TYPE ZFSMAP.
FIELD-SYMBOLS: <l_data> TYPE alsmex_tabline.
CLEAR t_ZFSMAP.
REFRESH t_ZFSMAP.
IF p_endrow IS INITIAL.
p_endrow = 65000.
ENDIF.
CALL FUNCTION 'ALSM_EXCEL_TO_INTERNAL_TABLE'
EXPORTING
filename = p_file
i_begin_col = 1
i_begin_row = 1
i_end_col = 3
i_end_row = p_endrow
TABLES
intern = tl_data
EXCEPTIONS
inconsistent_parameters = 1
upload_ole = 2
OTHERS = 3.
IF sy-subrc <> 0.
MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
ENDIF.
LOOP AT tl_data ASSIGNING <l_data>.
IF sy-tabix > X
CASE <l_data>-col.
WHEN 1.
wal_ZFSMAP-ZWPR_CHARACCT = <l_data>-value.
WHEN 2.
wal_ZFSMAP-zwPR_GLACCT = <l_data>-value.
CALL FUNCTION 'CONVERSION_EXIT_ALPHA_INPUT'
EXPORTING
input = <l_data>-value
IMPORTING
OUTPUT = <l_data>-value.
WHEN 3.
wal_ZFSMAP-ZFS_ITM = <l_data>-value.
CALL FUNCTION 'CONVERSION_EXIT_ALPHA_INPUT'
EXPORTING
input = <l_data>-value
IMPORTING
OUTPUT = <l_data>-value.
APPEND wal_ZFSMAP to t_ZFSMAP.
ENDCASE.
ENDIF.
ENDLOOP.
endform. " READ_FILE
&----
*& Form UPDATE_DATABASE
&----
form UPDATE_DATABASE .
if t_ZFSMAP[] IS NOT INITIAL.
if p_modf IS INITIAL.
INSERT ZFSMAP FROM TABLE t_ZFSMAP.
ELSEIF p_modf IS NOT INITIAL.
MODIFY ZFSMAP FROM TABLE t_ZFSMAP.
ENDIF.
COMMIT WORK.
WRITE 'Successfully updated data'.
ENDIF.
endform.
09-23-2008 8:18 PM
09-23-2008 8:22 PM
09-23-2008 8:30 PM
09-23-2008 8:34 PM
09-23-2008 8:50 PM
For a start, try putting in the leading zeroes when selecting individual records.
Rob
09-23-2008 9:35 PM
if i add 000 for the accounting doc number its working fine..
can you plz tell me what is coping conversion exits in table and how do we doi that.
thanks,
srinivas
09-23-2008 9:42 PM
You said that you have three fields in the table. I don't see the document number there.
Rob
09-23-2008 9:47 PM
saknr is the data element for gl account number..
sorry for the confusion
09-23-2008 9:52 PM
09-23-2008 10:11 PM
09-23-2008 10:19 PM
Then it should be OK (so long as you enter individual accounts or ranges). If you use '*', then you will have to add the leading zeroes.
Rob
09-23-2008 10:23 PM
thanks for your time and suggestion..
i have used the conversion exits in the program to add leading zeros
itss wroking fine now..
points assigned.
srinivas
09-23-2008 10:29 PM
Please close this thread (and your others as well). You may find that you cannot post new ones with so many open.
Rob