..3 Программа печати
Создайте отчет Z_SHIPPING_LABELS и поместите в него следующий код:
REPORT z_shipping_labels.
* declare the context
DATA:
gs_line TYPE zcontext_shipping_label ,
gt_context TYPE zcontext_shipping_labels .
* fill the context
gs_line-to_name = 'Dan Tedford' .
gs_line-to_street = '811 Alworth Avenue' .
gs_line-to_town = 'Middlefield' .
gs_line-to_state = 'CA' .
gs_line-to_zip = '98567' .
APPEND gs_line TO gt_context .
gs_line-to_name = 'Shane Hamby' .
gs_line-to_street = '852 Ocean View Rd.' .
gs_line-to_town = 'Bayshore' .
gs_line-to_state = 'CA' .
gs_line-to_zip = '94123' .
APPEND gs_line TO gt_context .
gs_line-to_name = 'Dr.Henry Albrecht' .
gs_line-to_street = '522 Ravenswood' .
gs_line-to_town = 'East Bayshore' .
gs_line-to_state = 'CA' .
gs_line-to_zip = '93327' .
APPEND gs_line TO gt_context .
gs_line-to_name = 'Hugh Molotsi' .
gs_line-to_street = '1980 N.Stonecrest Rd.' .
gs_line-to_town = 'West Middlefield' .
gs_line-to_state = 'CA' .
gs_line-to_zip = '12384' .
APPEND gs_line TO gt_context .
* call the form
CALL FUNCTION 'ZXLWB_CALLFORM'
EXPORTING
iv_formname = 'SHIPPING_LABELS'
iv_context_ref = gt_context[]
EXCEPTIONS
OTHERS = 2 .
IF sy-subrc NE 0 .
MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4 .
ENDIF .