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: 

Problem with GUI_DOWNLOAD

Former Member
0 Kudos

Hi All,

I am using GUI_DOWNLOAD FM in a BADI... and the BADI is getting triggered by some status change......

The problem is when i use breakpoint id and try to execute..the file is created and i can see it....... in presentation server......

But when i try to remove the breakpoint id and execute.... it doesnt create a file..... but there are no dumps nor any errorsss...

can anyone tell me what wrong hereee????

1 ACCEPTED SOLUTION

Former Member
0 Kudos

Hi,

Use Commit and wait statement in your badi.

BR,

Lokeswari.

10 REPLIES 10

Former Member
0 Kudos

Dear,

After the statement for create file in presentation server, put the below statements.

WAIT UP TO 1 SECONDS.

0 Kudos

Hi i used this statement...after GUI_DOWNLOAD..

Its not working.. still the file is not created....

Former Member
0 Kudos

Hi,

Use Commit and wait statement in your badi.

BR,

Lokeswari.

0 Kudos

how should i use these statment exactly...

comiit what???

and just write wait??

should i write this after GUI_DOWNLOAD or where?

0 Kudos

Hi,

commit work and wait.

BR,

Lokeswari.

0 Kudos

>

> commit work and wait.

Absolutely rubbish!!! You should never use COMMIT inside BAdIs.

0 Kudos

then what is the solution.. Please help me..... in solving..

0 Kudos

Hello,

Without further inputs viz., BAdI name, method implemented, code snippet etc. i'm sure you wont get good responses.

BR,

Suhas

0 Kudos

ok..

Definition : EXEC_METHODCALL_PPF

Method : EXECUTE

inside this execute... i have written the code...

CALL TRANSFORMATION zfocus_ii_transformation

SOURCE

root1 = it_final

root2 = it_final1

root3 = it_final2

RESULT XML xml_string.

Convert the encoding standard to "UTF-8".

SPLIT xml_string AT c_aux INTO TABLE i_result IN BYTE MODE.

  • Convert to ASC

LOOP AT i_result INTO wa_result.

v_xleng = XSTRLEN( wa_result ).

  • Pass each line and convert encoding to UTF-8 format.

v_conv = cl_abap_conv_in_ce=>create(

encoding = c_utf8

endian = c_l

input = wa_result

).

  • Get the converted data.

CALL METHOD v_conv->read(

EXPORTING n = v_xleng

IMPORTING data = wa_output

).

  • Insert the converted data into output table.

INSERT wa_output INTO TABLE i_output.

CLEAR wa_output.

CALL FUNCTION 'GUI_DOWNLOAD'

EXPORTING

filename = gv_fullpath

filetype = 'ASC'

TABLES

data_tab = i_output

EXCEPTIONS

file_write_error = 1

no_batch = 2

gui_refuse_filetransfer = 3

invalid_type = 4

no_authority = 5

unknown_error = 6

header_not_allowed = 7

separator_not_allowed = 8

filesize_not_allowed = 9

header_too_long = 10

dp_error_create = 11

dp_error_send = 12

dp_error_write = 13

unknown_dp_error = 14

access_denied = 15

dp_out_of_memory = 16

disk_full = 17

dp_timeout = 18

file_not_found = 19

dataprovider_exception = 20

control_flush_error = 21

OTHERS = 22.

IF sy-subrc <> 0.

ENDIF.

hope now i will get someinputs...

0 Kudos

If your program is running in background then GUI_DOWNLOAD will never work. That case you have to use datasets and store the file at application server.

If program is running in foreground, please check if you are getting any exception. you can check it by coding a WRITE statement when sy-subrc NE 0 instead break-point.