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: 

dowload open and cleared invoices to Users PC

Former Member
0 Kudos

Hi Friends..

Can someone suggest how to download the open and cleared invoices in an excel format to users PC either in foreground or bakground based on customer account (KNA1-kunnr) and company code..

your help is greatly appreciateld and rightly rewarded...

Thanks again..

7 REPLIES 7

Former Member
0 Kudos

Hi kanthi,

1. use FM

GUI_DOWNLOAD

GUI_UPLOAD

2. they will work only in fore-ground.

regards,

amit m.

former_member188685
Active Contributor
0 Kudos

hi,

in foreground you can use gui_download down load it pc(if it is foreground). if it is background then down load it to application server. and later you can download it your pc using gui_download.

regards

vijay

0 Kudos

Thanks for your suggestions..

My requirement is to design a program similar to FBL5N program..

But this would be a custom program where we need to add two radio buttons..

The first radio button is used to download the invoices to Users PC both in foreground and in background..

can you suggest how to select open invoices and cleared invoices..

The second radio button is used to call an existing excel template where some fields are already filled and some fields are blank and we need to fill those blank fields based on the download option so that the same filled template is used for upload purpose by another program..

Also i need to know how to filter down the invoices based on normal items, Special G/L transactions, noted items, parked items and vendor items..

Iam doing some research on FBL5N but your comments are most welcome..

Also can someone suggest how to create the Dynamic Selection just as the one present in FBL5N and search Help ID.. (For serch help id - i need to add sales related fields ) to the existing ones in FBL5n..

Sorry for the long list of questions..

But your commensts along with my research would progress the things much faster..

Thanks agan for your valuable comments...

vinod_gunaware2
Active Contributor
0 Kudos

U can use WS_DOWNLOAD and GUI_DOWNLOAD function for

download.

Use <b>VA05</b> it will show u all open sale order u can

directly download from utility.

Regards

vinod

Former Member
0 Kudos

hi Kranthi,

here is the sample code for GUI_DOWNLOAD AND GUI_UPLOAD

hope this might help you

GUI_DOWNLOAD

DATA: W_WSD_FILENAME01 TYPE STRING,

W_WSD_FILETYPE01 TYPE CHAR10.

W_WSD_FILENAME01 = P_OUT1.

W_WSD_FILETYPE01 = 'DAT'.

CALL FUNCTION 'GUI_DOWNLOAD'

EXPORTING

  • BIN_FILESIZE =

FILENAME = W_WSD_FILENAME01

FILETYPE = W_WSD_FILETYPE01

  • APPEND = ' '

  • WRITE_FIELD_SEPARATOR = ' '

  • HEADER = '00'

  • TRUNC_TRAILING_BLANKS = ' '

  • WRITE_LF = 'X'

  • COL_SELECT = ' '

  • COL_SELECT_MASK = ' '

  • DAT_MODE = ' '

  • CONFIRM_OVERWRITE = ' '

  • NO_AUTH_CHECK = ' '

  • CODEPAGE = ' '

  • IGNORE_CERR = ABAP_TRUE

  • REPLACEMENT = '#'

  • WRITE_BOM = ' '

  • TRUNC_TRAILING_BLANKS_EOL = 'X'

  • WK1_N_FORMAT = ' '

  • WK1_N_SIZE = ' '

  • WK1_T_FORMAT = ' '

  • WK1_T_SIZE = ' '

  • IMPORTING

  • FILELENGTH =

TABLES

DATA_TAB = ITAB_VBAK

  • FIELDNAMES =

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.

  • MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO

  • WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.

ENDIF.

GUI_UPLOAD

DATA W_WSU_FILENAME02 TYPE STRING.

DATA W_WSU_FILETYPE02 TYPE CHAR10.

W_WSU_FILETYPE02 = 'ASC'.

CALL FUNCTION 'GUI_UPLOAD'

EXPORTING

FILENAME = W_WSU_FILENAME02

FILETYPE = W_WSU_FILETYPE02

TABLES

DATA_TAB = ITAB_INFILE

EXCEPTIONS

FILE_OPEN_ERROR = 1

FILE_READ_ERROR = 2

NO_BATCH = 3

GUI_REFUSE_FILETRANSFER = 4

INVALID_TYPE = 5

NO_AUTHORITY = 6

UNKNOWN_ERROR = 7

BAD_DATA_FORMAT = 8

HEADER_NOT_ALLOWED = 9

SEPARATOR_NOT_ALLOWED = 10

HEADER_TOO_LONG = 11

UNKNOWN_DP_ERROR = 12

ACCESS_DENIED = 13

DP_OUT_OF_MEMORY = 14

DISK_FULL = 15

DP_TIMEOUT = 16

OTHERS = 17

.

IF SY-SUBRC <> 0.

  • MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO

  • WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.

ENDIF.

Regards,

Santosh

Former Member
0 Kudos

Hi,

Invoices are stored in VBRk and VBRP tables.

If you specifically want to download to excel,

use function module MS_EXCEL_OLE_STANDARD_DAT.

Hope this helps..

Regards,

Shashank

0 Kudos

HI..

Thanks for the information...

Does anybody have any good links on how to create dynamic selection and search help IDs just like the one that are present in the program FBL5N..

Thanks for your help...