Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Double quote issue #6

Closed
pacroy opened this issue Apr 7, 2017 · 4 comments
Closed

Double quote issue #6

pacroy opened this issue Apr 7, 2017 · 4 comments

Comments

@pacroy
Copy link

pacroy commented Apr 7, 2017

Method parse_line fails when the field value is double-quoted (e.g. "1,234.56").
Suggested to fix by adding this code at line 1006 in zcl_mockup_loader.abap

* Remove double quotes "..."
data: lv_tmp type string,
lv_regex type string.
lv_regex = '(["]).+\1'. "#ec notext
lv_tmp = ls_field.
find all occurrences of regex lv_regex in lv_tmp match count sy-tabix.
if sy-tabix = 1.
shift ls_field left deleting leading '"'.
shift ls_field right deleting trailing '"'.
endif.
clear sy-subrc.

@sbcgua
Copy link
Owner

sbcgua commented Apr 8, 2017

Thanks for the issue. :)
Do you mean any field can be quoted or number only ?

sbcgua added a commit that referenced this issue Apr 8, 2017
@sbcgua
Copy link
Owner

sbcgua commented Apr 8, 2017

Have a look at PARSE_FIELD method. Should work now.

P.S. I finally did what I planned for some time already - migrated to abapGit tool. So the folder structure has changed a bit. The code now in /src/zcl_mockup_loader.clas.abap

@pacroy
Copy link
Author

pacroy commented Apr 8, 2017

Thank you for fixing. As I observed, double quotes are added to the field containing comma both numeric and character fields. Save as tab limitted txt with Excel 2013.

PS: abapGit sounds interesting. I'm finding a tool to help syncing ABAP with Git.

@sbcgua
Copy link
Owner

sbcgua commented Apr 8, 2017

No prob :) OK, I'll close the issue for now. If any other issue, pls open a new one.

P.S. Yeah, have a look at it, it is a great tool - https://github.com/larshp/abapGit/

@sbcgua sbcgua closed this as completed Apr 8, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants