01-03-2006 3:45 PM
Hello,
I am trying to use SAPSCRIPT_IMPORT_GRAPHIC_BDS function module to upload graphics. The problem is that I am always getting dump. Could some one help me with sample code.
Regards,
Vimal
01-03-2006 3:48 PM
Yes, here is a sample program. This program actually uses the subroutine in SE78 to upload the graphics. Works pretty good. Also, doing it this way, there is no user interaction required after giving the name and filename.
report zrich_0004 .
parameters: p_file type localfile default 'C:file.bmp'.
parameters: p_image type stxbitmaps-tdname.
data: imagename type stxbitmaps-tdname.
at selection-screen on value-request for p_file.
call function 'KD_GET_FILENAME_ON_F4'
exporting
static = 'X'
changing
file_name = p_file.
start-of-selection.
imagename = p_image.
perform show_status using 'Importing Image from Front End'.
perform import_bitmap using p_file
imagename
'Test Image'.
************************************************************************
* FORM import_Bitmap *
************************************************************************
form import_bitmap using filename
name
title.
data: l_resolution type stxbitmaps-resolution.
data: l_docid type stxbitmaps-docid.
perform import_bitmap_bds
in program saplstxbitmaps
using filename
name
'GRAPHICS' "Object
'BMAP' "ID
'BMON' "B/W
'BMP' "Extension
title
space
'X'
changing l_docid
l_resolution.
endform.
Regards,
Rich Heilman
01-03-2006 3:48 PM
Yes, here is a sample program. This program actually uses the subroutine in SE78 to upload the graphics. Works pretty good. Also, doing it this way, there is no user interaction required after giving the name and filename.
report zrich_0004 .
parameters: p_file type localfile default 'C:file.bmp'.
parameters: p_image type stxbitmaps-tdname.
data: imagename type stxbitmaps-tdname.
at selection-screen on value-request for p_file.
call function 'KD_GET_FILENAME_ON_F4'
exporting
static = 'X'
changing
file_name = p_file.
start-of-selection.
imagename = p_image.
perform show_status using 'Importing Image from Front End'.
perform import_bitmap using p_file
imagename
'Test Image'.
************************************************************************
* FORM import_Bitmap *
************************************************************************
form import_bitmap using filename
name
title.
data: l_resolution type stxbitmaps-resolution.
data: l_docid type stxbitmaps-docid.
perform import_bitmap_bds
in program saplstxbitmaps
using filename
name
'GRAPHICS' "Object
'BMAP' "ID
'BMON' "B/W
'BMP' "Extension
title
space
'X'
changing l_docid
l_resolution.
endform.
Regards,
Rich Heilman
01-03-2006 3:50 PM
What does the dump say? Have you checked the where-used list of this function module? It gives two programs where it is used. May be you can find some clues there. Why are uploading graphics yourself? Don't you have standard transaction SE78 to do that?
Srinivas
01-03-2006 4:40 PM