Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

Upload Data from .txt to z-table

Former Member
0 Kudos

Hi All,

<b>text file contains</b>

<i>internal_audit_cd

txn_dt

posting_dt

txn_amt

currency_key

debit_credit

upload_dt</i>

<b>Same filelds are exisitng in z-table</b>

Upload program to upload data from .txt file to z-table

Upload records should not amend the existing data

It should always clear the existing recordsin the table

Before uploading to the table, check to make sure that the data are clean. Make sure that the format of each record is correct. (eg. Not blank space. If capital letter is required for upload, check the data in .txt file to make sure the records for the field are in Caps, Etc.)

Can anybody help me

Advanced Thanks to them

i look forward to ur reply

Regards

Raja Sekhar.T

7 REPLIES 7

Vinod_Chandran
Active Contributor
0 Kudos

Hi,

Please find the answers.

Upload program to upload data from .txt file to z-table

  • Use the function module GUI_UPLOAD to upload from the front end or 'OPEN DATASET, READ DATASET' to read from application server. The uploaded data will go to an internal table.

Upload records should not amend the existing data

  • You can check this using the key fields in the internal table against the database table.

It should always clear the existing recordsin the table

  • Not sure what you mean by clear.

Before uploading to the table, check to make sure that the data are clean. Make sure that the format of each record is correct. (eg. Not blank space. If capital letter is required for upload, check the data in .txt file to make sure the records for the field are in Caps, Etc.)

  • Loop through the internal table and check for each field.

LOOP AT ITAB.

IF ITAB-ID IS INITIAL.

MESSAGE Wxxx.

ENDIF.

....

...

ENDLOOP.

Thanks

Vinod

0 Kudos

Hi Vinod,

Thank you for your reply

Please send any example programs or links

i look forward to your reply

Regards

Raja Sekhar.T

0 Kudos

Hi Raja,

Please find a sample progam here.

http://www.sapdevelopment.co.uk/file/file_uptabpc.htm

Kindly assign points if your question is answered.

Thanks

Vinod

0 Kudos

Thank you vinod,

upload all data from text to internal tab using WS_UPLOAD Function module

Please Reply these Quries

1 -> Upload record should not amend the existing data. It should always clear the existing records in the table

2 -> Before uploading to the table, check to make sure that the data are clean. Make sure that the format of each record is correct. (eg. Not blank space. If capital letter is required for upload, check the data in .txt file to make sure the records for the field are in Caps, Etc.)

Advanced thanks to your reply

i look forward to your reply

Regards

Raja Sekhar.T

0 Kudos

Hi Raja,

Instead of WS_UPLOAD, use GUI_UPLOAD because the first one is obselete.

The first question is not clear. What you mean by CLEAR?

For the second one do as given below.

LOOP AT ITAB.

  • You need to do the checking here.

IF ITAB-NAME IS INITIAL.

MESSAGE Exxx.

ENDIF.

ENDLOOP.

Let me know if you need more clarification on this.

Thanks

Vinod

0 Kudos

Hi Raja,

2. Check data

After you've uploaded your file with WS_UPLOAD you have an internal table in SAP which has the data from the file.

Now what you need to do is to loop it through and check wheter all the data meets your conditions. Can't help you further since I don't know what your requirements are.

Regards,

Ville

Former Member
0 Kudos

Hi,

i have answered a similar question which will upload and download from sap to excel and excel to sap.

even sample code is there here......

hope this helps you.

if you got any helpful answers or solved your query then reward with points and close the thread.

regards,

venu.