Import CSV File - in SAP ABAP [english]

  Рет қаралды 9,301

Cust&Code in SAP ABAP

Cust&Code in SAP ABAP

Күн бұрын

In this video I show how to import a CSV file into an SAP system and copy the data into an internal table in a structured way.
The program is divided as follows:
Upload of the CSV file
Copy line by line into a string table
Splitting of the line after a certain separator
Assigning the values column by column into a structure
Add the structure to the new internal CSV table
#import #csv #sap
▬▬ My Hardware ▬▬▬▬▬▬▬▬▬▬▬▬▬
Microphone: amzn.to/3zj2UIz
Headphone: amzn.to/3GUBRFg
*The links are affiliate links. There are no additional costs.
▬▬ My Software (free) ▬▬▬▬▬▬▬▬▬▬▬
Video Recorder: bit.ly/678fgh6
Video Editor: bit.ly/38Rj9lb
▬▬ Further Links ▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬
Become my subscriber: bit.ly/CustAnd...
All videos in English: bit.ly/CustAnd...

Пікірлер: 10
@dipeshkayasth9470
@dipeshkayasth9470 Ай бұрын
Nice :) really helpful video.
@CustAndCode
@CustAndCode Ай бұрын
Thanks! You are very welcome! 🤗
@SYL-h9w
@SYL-h9w 2 жыл бұрын
It's really helped a lot!! Thanks for the great video!!! I like your video so much!
@CustAndCode
@CustAndCode 2 жыл бұрын
Thank you! 😃 Glad to hear that! 🤗
@79rooky
@79rooky 2 жыл бұрын
Great video I'm doing this at the moment but mine needs to accept any csv file so I need to put the code into a dynamic internal table Any ideas on how to do that?
@CustAndCode
@CustAndCode 2 жыл бұрын
Do you select your file from your local computer or from the application server? I am not sure yet what exactly your requirement is. Do you want to upload the CSV without manual confirmation? 🤔
@sk16034
@sk16034 2 ай бұрын
How do we import file from application server and access it in the program? Can you help me on this requirement?
@CustAndCode
@CustAndCode 2 ай бұрын
I already did a video where I fetch some filled from the application server. If you have done this you can access the data in the file 🤗
@vashisthnihit
@vashisthnihit 2 жыл бұрын
could you please copy paste the code in comment section, or share some text file is having this? I want to try similar case
@CustAndCode
@CustAndCode 2 жыл бұрын
Best way is to write it 😉 it is helpful for the understanding! 😊 but here it is: ----- Code Begin ----- " declare variables, types and structures TYPES: BEGIN OF ty_s_csv, mandt TYPE string, carrid TYPE string, connid TYPE string, text TYPE string, text2 TYPE string, END OF ty_s_csv. TYPES: ty_it_csv TYPE STANDARD TABLE OF ty_s_csv WITH DEFAULT KEY. " checkbox has the file a header PARAMETERS: p_header AS CHECKBOX DEFAULT 'X'. TRY. " call file open dialog DATA: lv_rc TYPE i, it_files TYPE filetable, lv_action TYPE i. cl_gui_frontend_services=>file_open_dialog( EXPORTING file_filter = |csv (*.csv)\|*.csv\|{ cl_gui_frontend_services=>filetype_all }| multiselection = abap_false CHANGING file_table = it_files rc = lv_rc user_action = lv_action ). IF lv_action = cl_gui_frontend_services=>action_ok. IF lines( it_files ) = 1. DATA(it_csv_strings) = VALUE string_table( ). " read csv file to internal csv string tab cl_gui_frontend_services=>gui_upload( EXPORTING filename = CONV #( it_files[ 1 ]-filename ) filetype = 'ASC' CHANGING data_tab = it_csv_strings ). cl_demo_output=>write_data( it_csv_strings ). " check if header exists DATA(lv_start_line) = COND i( WHEN p_header = abap_true THEN 2 ELSE 1 ). " check if we have some processable entries IF ( lines( it_csv_strings ) > lv_start_line - 1 ). " create itab csv processing DATA(it_csv) = VALUE ty_it_csv( ). LOOP AT it_csv_strings ASSIGNING FIELD-SYMBOL() FROM lv_start_line. DATA(ls_csv_line) = VALUE ty_s_csv( ). SPLIT AT ';' INTO TABLE DATA(it_columns). IF lines( it_columns ) = 5. ls_csv_line-mandt = it_columns[ 1 ]. ls_csv_line-carrid = it_columns[ 2 ]. ls_csv_line-connid = it_columns[ 3 ]. ls_csv_line-text = it_columns[ 4 ]. ls_csv_line-text2 = it_columns[ 5 ]. ENDIF. APPEND ls_csv_line TO it_csv. ENDLOOP. cl_demo_output=>write_data( it_csv ). DATA(lv_html) = cl_demo_output=>get( ). cl_abap_browser=>show_html( EXPORTING title = 'CSV Data' html_string = lv_html container = cl_gui_container=>default_screen ). WRITE: space. ENDIF. ENDIF. ENDIF. CATCH cx_root INTO DATA(e_text). MESSAGE e_text->get_text( ) TYPE 'I'. ENDTRY.
Export Data From SAP to CSV  / TSV File [english]
6:47
Cust&Code in SAP ABAP
Рет қаралды 7 М.
How to create LSMW in SAP- Mass upload data
16:55
KH Zeeds
Рет қаралды 147 М.
黑天使被操控了#short #angel #clown
00:40
Super Beauty team
Рет қаралды 61 МЛН
1% vs 100% #beatbox #tiktok
01:10
BeatboxJCOP
Рет қаралды 67 МЛН
СИНИЙ ИНЕЙ УЖЕ ВЫШЕЛ!❄️
01:01
DO$HIK
Рет қаралды 3,3 МЛН
Display Data in SAP - Quickly and Easily with CL_SALV_TABLE [english]
19:54
Cust&Code in SAP ABAP
Рет қаралды 7 М.
API Call with ABAP - POST Method and JSON Request [english]
12:15
Cust&Code in SAP ABAP
Рет қаралды 10 М.
Querying 100 Billion Rows using SQL, 7 TB in a single table
9:07
Arpit Agrawal (Elastiq.AI)
Рет қаралды 60 М.
Import Excel *.xlsx to Internal Table - with ABAP [english]
20:44
Cust&Code in SAP ABAP
Рет қаралды 18 М.
CSV Import and Export in Jira
13:17
Atlasstic
Рет қаралды 15 М.
59_1 Application server AL11
40:11
Sathish Reddy
Рет қаралды 19 М.
SAP ABAP COMPLETE TUTORIAL | SAP ABAP TRAINING COURSE - PART 1
10:29:14
Alpha Tutorials - Finance
Рет қаралды 80 М.
Importing a .csv file to R Studio using the read.csv function
5:56
Charlene McCord
Рет қаралды 279 М.
黑天使被操控了#short #angel #clown
00:40
Super Beauty team
Рет қаралды 61 МЛН