SAP R/3 форум ABAP консультантов
Russian ABAP Developer's Club

Home - FAQ - Search - Memberlist - Usergroups - Profile - Log in to check your private messages - Register - Log in - English
Blogs - Weblogs News

Exporting Graphics from SAP



 
Post new topic   Reply to topic    Russian ABAP Developer's Club Forum Index -> Dialog Programming -> Graphics
View previous topic :: View next topic  
Author Message
admin
Администратор
Администратор



Joined: 01 Sep 2007
Posts: 1636

PostPosted: Sat Jan 31, 2009 6:57 pm    Post subject: Exporting Graphics from SAP Reply with quote

Code:
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'
    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.


Replace I_NAME = 'ZPRUEBA' with you graphic name and
FILENAME = 'C:\FirmaAsociado.bmp' with a parameter and that's it -Wink

You can check this weblog as well SE78 PHP/SAP
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    Russian ABAP Developer's Club Forum Index -> Dialog Programming -> Graphics All times are GMT + 4 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


All product names are trademarks of their respective companies. SAPNET.RU websites are in no way affiliated with SAP AG.
SAP, SAP R/3, R/3 software, mySAP, ABAP, BAPI, xApps, SAP NetWeaver and any other are registered trademarks of SAP AG.
Every effort is made to ensure content integrity. Use information on this site at your own risk.