AbapGit
A source-verified project description is not available yet. Open the detail page or wait for a manual refresh.
Source facts need a manual refresh
Data import made easy
Data import made easy
Via https://github.com/abapGit/abapGit. Requires https://github.com/Kaszub09/abapEasyALV. Written in ABAP 7.50.
Getting data from user made easy!
Whenever you need to user to supply data, be it table or file - usually you have some target structure, which the file must match. But unless there is some documentation or example file (usually there isn't), you have to read code to see what kind of structure should file have. Instead, you could just use this framework to declare desired structure, and let it take care of parsing and mapping whatever data user (or you via internal table) supplies. Now documentation is optional since you know explicitly what columns are expected (and code doesn't lie).
For example, when you run this report:
"Sample target structure
TYPES:
BEGIN OF t_target,
date_field TYPE d,
some_name TYPE fieldname,
int_field TYPE i,
packed_field TYPE p LENGTH 10 DECIMALS 2,
another_column TYPE string,
END OF t_target,
tt_target TYPE STANDARD TABLE OF t_target WITH EMPTY KEY.
DATA:
target_tab TYPE tt_target.
DATA(target) = zcl_dtti_target_factory=>create_from_ref( REF #( target_tab ) ).
"Set in code or create (or use existing) data elements if needed
target->set_field_description( field = 'ANOTHER_COLUMN' description = |Another column| ).
target->set_field_description( field = 'INT_FIELD' description = |Some int column| ).
"Data source from file
DATA(source) = zcl_dtti_source_factory=>create_from_file( ).
IF source IS NOT BOUND.
MESSAGE TEXT-001 TYPE 'E'.
ENDIF.
"Get mapping
DATA(dtti) = NEW zcl_data_to_table_import( ).
DATA(result) = dtti->run_mapping( source = source target = target ).
"Display mapping result
DATA(alv) = NEW zcl_ea_salv_table( ).
alv->set_data( target->get_target_table( ) ).
alv->display_data( ).
It will ask user for file, parse it, and allow user to map columns from file to the ones needed by program.
https://github.com/user-attachments/assets/ea282c18-54ae-404e-93ae-7c7c1ffdbeac