Application Development and Automation 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: 
Read only

Sapscript Question

Former Member
0 Likes
439

Once we upload the company logo in sap that is .bmp or .tif file wheather can we retrieve or download the logo file from sap . it is possible or not if yes then how

please reply me

2 REPLIES 2
Read only

Former Member
0 Likes
413

Yeah...The logo can be downloaded....Just check this report -;)


REPORT Z_DUMMY_ATG_3.

DATA : L_BYTECOUNT TYPE I,
       L_TDBTYPE   LIKE STXBITMAPS-TDBTYPE,
       L_CONTENT   TYPE STANDARD TABLE OF BAPICONTEN INITIAL SIZE 0.

DATA: GRAPHIC_SIZE TYPE I.

DATA: BEGIN OF GRAPHIC_TABLE OCCURS 0,
LINE(255) TYPE X,
END OF GRAPHIC_TABLE.

CALL FUNCTION 'SAPSCRIPT_GET_GRAPHIC_BDS'
  EXPORTING
    I_OBJECT       = 'GRAPHICS'
    I_NAME         = 'ZPRUEBA'  "Name of you image
    I_ID           = 'BMAP'
    I_BTYPE        = 'BCOL'
  IMPORTING
    E_BYTECOUNT    = L_BYTECOUNT
  TABLES
    CONTENT        = L_CONTENT
  EXCEPTIONS
    NOT_FOUND      = 1
    BDS_GET_FAILED = 2
    BDS_NO_CONTENT = 3
    OTHERS         = 4.

CALL FUNCTION 'SAPSCRIPT_CONVERT_BITMAP'
  EXPORTING
    OLD_FORMAT               = 'BDS'
    NEW_FORMAT               = 'BMP'
    BITMAP_FILE_BYTECOUNT_IN = L_BYTECOUNT
  IMPORTING
    BITMAP_FILE_BYTECOUNT    = GRAPHIC_SIZE
  TABLES
    BDS_BITMAP_FILE          = L_CONTENT
    BITMAP_FILE              = GRAPHIC_TABLE
  EXCEPTIONS
    OTHERS                   = 1.

CALL FUNCTION 'WS_DOWNLOAD'
  EXPORTING
    BIN_FILESIZE            = GRAPHIC_SIZE
    FILENAME                = 'C:FirmaAsociado.bmp'
    FILETYPE                = 'BIN'
  TABLES
    DATA_TAB                = GRAPHIC_TABLE
  EXCEPTIONS
    INVALID_FILESIZE        = 1
    INVALID_TABLE_WIDTH     = 2
    INVALID_TYPE            = 3
    NO_BATCH                = 4
    UNKNOWN_ERROR           = 5
    GUI_REFUSE_FILETRANSFER = 6.

IF SY-SUBRC <> 0.
  MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
          WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.

Greetings,

Blag.

Read only

Former Member
0 Likes
413

You can read this weblog also -:D

<a href="/people/alvaro.tejadagalindo/blog/2007/04/15/tasting-the-mix-of-php-and-sap--volume-12 the mix of PHP and SAP - Volume 12 (SE78 Emulator)</a>

Greetings,

Blag.