例
以下の例は、データ圧縮の使用方法を示しています。
DATA: html_body TYPE string. … IF compress NE space. CALL METHOD server->response->set_header_field( name = 'Content-Type' value = 'text/html' ). * * is compression supported and does client support gzip * compression technique * CALL METHOD server->set_compression EXPORTING options = if_http_server=>co_compress_in_all_cases EXCEPTIONS compression_not_possible = 1 OTHERS = 2. IF sy-subrc <> 0. CONCATENATE '<html>' '<body>' 'Compress nicht möglich '(001) '</br>' '</body>' '</html>' INTO html_body. ELSE. CONCATENATE '<html>' '<body>' 'Compress erfolgreich '(001) '</br>' '</body>' '</html>' INTO html_body. ENDIF. * * if compression could be activated the body will be transferred * as gzip compressed body * CALL METHOD server->response->set_cdata( data = html_body ). ENDIF. |
詳しくは
この例は、トランザクションSICFのExample_1のパスdefault_host / sap / bc / icf /demo/で実行できます。