on 01-13-2015 8:38 AM
hello Tech Experts,
I'm developing a simple application in wd for uploading text file into ztable. I've found some sources to implement, I had a doubt in the following code
CALL FUNCTION 'HR_KR_XSTRING_TO_STRING'
EXPORTING
in_xstring = l_xstring
IMPORTING
out_string = l_string.
SPLIT l_string AT cl_abap_char_utilities=>newline INTO TABLE i_data.
* Bind With table Element.
LOOP AT i_data INTO l_string.
SPLIT l_string AT cl_abap_char_utilities=>horizontal_tab INTO TABLE fields.
READ TABLE fields INTO lv_field INDEX 1.
fs_table-name = lv_field.
READ TABLE fields INTO lv_field INDEX 2.
fs_table-age = lv_field.
APPEND fs_table TO t_table1.
ENDLOOP.
lo_nd_sflight = wd_context->get_child_node( 'DATA_TAB' ).
lo_nd_sflight->bind_table( t_table1 ).
this code works fine, But inside the loop we are reading the value field by field using index in this case it has just 2 records, what if they are n number of records. Do I have to use those read statements for 'n' times.
please help me if there is any alternative solution for this.
thank you,
Regards,
Nagendra
Hi,
Alternative can be this for N-Fields.
SPLIT l_string AT cl_abap_char_utilities=>newline INTO TABLE i_data.
LOOP AT i_data INTO l_string.
SPLIT l_string AT cl_abap_char_utilities=>horizontal_tab INTO
<workarea>-field1
<workarea>-field2
<workarea>-field3
<workarea>-field4
<workarea>-field5
<workarea>-field6
:
:
append <workarea> to <itab>.
clear <workarea>.
ENDLOOP.
Note : <itab> is an internal table where your required fields are declared.
Hope this helps you.
Thanks
KH
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
hello KH,
I copied this code from standard one
data:
lr_pdf_node type ref to if_wd_context_node,
pdf type xstring.
lr_pdf_node = wd_context->get_child_node( wd_this->wdctx_UPLOAD_EXCEL ).
lr_pdf_node->get_attribute( exporting name = 'FILE_DATA' importing value = pdf ).
cl_wd_runtime_services=>attach_file_to_response(
i_filename = 'DemoAdobeOffline.pdf'
i_content = pdf
i_mime_type = 'application/pdf'
i_in_new_window = ABAP_FALSE
i_inplace = ABAP_false ).
I would like to download the pdf in local system. but they didn't specify any location to download in that method. can you please help me.
Thank you,
Regards,
Nagendra
Hi KH,
I did that too.
cl_wd_runtime_services=>attach_file_to_response(
i_filename = 'C:\DemoAdobeOffline.pdf'
i_content = pdf
i_mime_type = 'application/pdf'
i_in_new_window = ABAP_FALSE
i_inplace = ABAP_false ).
It didn't work. Actually my requirement is to download an internal table to pdf format.
please help.
Regards
nagendra
User | Count |
---|---|
93 | |
11 | |
10 | |
9 | |
9 | |
7 | |
6 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.