‎2007 Feb 19 9:46 AM
hi all,
i have data in the internal table which i need to put one Ztable which i created, can any one help me out in giving an example for how to upload the data into the table in background job everyday Using BDC.
I will be very thankful if any one you can help me out with some examples thanks in advance.
‎2007 Feb 19 9:50 AM
Hi,
If you have created any custom screen to Insert data into the custom table, then you can do BDC for it. If there is no Custom Screen, you can 1st validate the data that is uploaded and directly user INSERT statement to create data in table. I dont see any advantage in doing BDC for SM30 and uploading data into table.
regards,
Mahesh
‎2007 Feb 19 9:52 AM
Hi,
Sample code to update the Z db table :
REPORT yupload.
TABLES ybtab.
DATA itab LIKE ybtab OCCURS 0 WITH HEADER LINE.
CALL FUNCTION 'WS_UPLOAD'
EXPORTING
CODEPAGE = ' '
filename = 'C:\data.txt'
filetype = 'DAT'
HEADLEN = ' '
LINE_EXIT = ' '
TRUNCLEN = ' '
USER_FORM = ' '
USER_PROG = ' '
DAT_D_FORMAT = ' '
IMPORTING
FILELENGTH =
TABLES
data_tab = itab
EXCEPTIONS
CONVERSION_ERROR = 1
FILE_OPEN_ERROR = 2
FILE_READ_ERROR = 3
INVALID_TYPE = 4
NO_BATCH = 5
UNKNOWN_ERROR = 6
INVALID_TABLE_WIDTH = 7
GUI_REFUSE_FILETRANSFER = 8
CUSTOMER_ERROR = 9
NO_AUTHORITY = 10
OTHERS = 11
.
IF sy-subrc <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ELSE.
INSERT ybtab FROM TABLE itab.
ENDIF.
Schedule this program as a Background Job with required time paramters .
Regards,
Anji
‎2007 Feb 19 10:37 AM
Anji,
You said 'Schedule this program as a Background Job with required time paramters'.
Do you not know that you cannot schedule this FM in the background.
‎2007 Feb 19 9:53 AM
Hello Madan,
For ur requirement there is no need to use BDC. Instead declare ut itab similar to the ZTABLE anf use the MODIFY statement.
<b>MODIFY ZTABLE FROM ITAB.</b>
Vasanth
‎2007 Feb 19 9:54 AM
Hi
As you will upload the data to the standard tables through the standard transactions we can do the same to upload the data to the ztables.
Regards,
kumar
‎2007 Feb 19 10:35 AM
use insert statement to upload data, but validate ur data before inserting.
‎2007 Feb 19 10:42 AM
Hi,
If you wnat to upload the data from the internal table into the ztable then you have to first create the dialogue program with some screens which updates the table from the data given in the screen.
After that you can record your dialogue program and code a BDC.
However, I suggest you to use the statement.
Insert <Ztablename> from table <internal_table_name>.
with the help of this , you will be able to directly post the value of the internal table to the Ztable.
The internal table should be of the same structure like the Ztable.
Remember to validate the data before inserting.
I hope this might be helpfull
‎2007 Feb 19 10:52 AM
Thanks for your valuable inputs,
so i have the fields in the table the Company Code, Plant, Year, Material No ... , As per the reply you have given i have to create a screen with the Company code Plant and Year and the remaining i will update after validating can you suggest me some example.
Here is my Requirement i have the data in the internal table, my internal table has the fields like Company code, Plant, Year, Inventory Qty, Material num, Inventory Value, ........
So i want to upload the data to the table which have the similar structure of my internal table.