{"id":272892,"date":"2016-01-26T11:47:02","date_gmt":"2016-01-26T08:47:02","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=272892"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-29T21:00:00","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=272892","title":{"rendered":"ABAP: \u041a\u0440\u0430\u0441\u0438\u0432\u044b\u0439 #2"},"content":{"rendered":"<p>       <b>\u042d\u0442\u0430 \u043f\u0443\u0431\u043b\u0438\u043a\u0430\u0446\u0438\u044f \u043f\u0440\u0435\u0434\u043d\u0430\u0437\u043d\u0430\u0447\u0435\u043d\u0430 ABAP-\u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u0430\u043c \u0432 SAP ERP \u0438 \u0432\u0441\u0435\u043c \u0438\u043c \u0441\u043e\u0447\u0443\u0432\u0441\u0442\u0432\u0443\u044e\u0449\u0438\u043c.<\/b><br \/>  <a href=\"https:\/\/habrahabr.ru\/post\/275677\/\">\u0427\u0430\u0441\u0442\u044c1<\/a><\/p>\n<p>  \u041d\u0435 \u0432\u0441\u0435 \u0437\u043d\u0430\u044e\u0442, \u0447\u0442\u043e \u0432 ALV-\u043e\u0442\u0447\u0435\u0442 \u043c\u043e\u0436\u043d\u043e \u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u043a\u0440\u0430\u0441\u0438\u0432\u044b\u0439 \u0437\u0430\u0433\u043e\u043b\u043e\u0432\u043e\u043a \u043d\u0430 HTML.<br \/>  \u0420\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442 \u0431\u0443\u0434\u0435\u0442 \u043f\u043e\u0445\u043e\u0436 \u043d\u0430 \u044d\u0442\u043e:<br \/>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/files\/cf5\/ead\/ec1\/cf5eadec1c92495d802de66051cef275.png\"\/><\/p>\n<p>  \u0410 \u0447\u0442\u043e \u0435\u0441\u043b\u0438 \u0431\u044b \u0445\u043e\u0442\u0438\u043c \u043d\u0430\u0440\u0438\u0441\u043e\u0432\u0430\u0442\u044c \u043d\u0435\u0447\u0442\u043e \u0441\u0432\u043e\u0435?<br \/>  \u041d\u0430\u043f\u0440\u0438\u043c\u0435\u0440:<br \/>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/files\/069\/513\/965\/069513965fa6427c9c9e1b61ae7b3a99.png\"\/><\/p>\n<p>  \u0414\u043e\u0431\u0440\u043e \u043f\u043e\u0436\u0430\u043b\u043e\u0432\u0430\u0442\u044c \u043f\u043e\u0434 \u043a\u0430\u0442.<br \/>  <a name=\"habracut\"><\/a><br \/>  \u041f\u043e\u0435\u0445\u0430\u043b\u0438! <\/p>\n<p>  \u042f \u043d\u0435 \u043d\u0430\u0448\u0435\u043b \u0432 \u0438\u043d\u0435\u0442\u0435, \u043a\u0430\u043a\u043e\u0439-\u043b\u0438\u0431\u043e \u0438\u043d\u0444\u044b, \u0438 \u0440\u0435\u0448\u0438\u043b \u043f\u0440\u0438\u0434\u0443\u043c\u0430\u0442\u044c \u043d\u0435\u0447\u0442\u043e \u0441\u0432\u043e\u0435.<br \/>  \u0421\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u043d\u044b\u0439 \u0437\u0430\u0433\u043e\u043b\u043e\u0432\u043e\u043a \u0440\u0438\u0441\u0443\u0435\u0442\u0441\u044f \u043f\u0440\u0438\u043c\u0435\u0440\u043d\u043e \u0442\u0430\u043a:  <\/p>\n<pre><code class=\"html\">FORM do_html_top_of_page USING p_do TYPE REF TO cl_dd_document.  *----------------------------------------------------------------------* * .DATA *----------------------------------------------------------------------*   DATA: ta      TYPE REF TO cl_dd_table_element,               col1  TYPE REF TO cl_dd_area,               col2  TYPE REF TO cl_dd_area,               col3  TYPE REF TO cl_dd_area,               text   TYPE sdydo_text_element,               str     TYPE string,               rows TYPE int4.    DEFINE add_column.     call method ta-&gt;add_column       exporting         heading = text       importing         column  = &1.     clear text.   END-OF-DEFINITION.    DEFINE add_text.     call method &1-&gt;add_text       exporting         text = text.     clear text.   END-OF-DEFINITION.    str = '\u041f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u044b \u043e\u0442\u0447\u0435\u0442\u0430:'.   CALL METHOD p_do-&gt;add_table     EXPORTING       with_heading    = 'X'       no_of_columns   = 2       width           = '30%'       with_a11y_marks = 'X'       a11y_label      = str     IMPORTING       table           = ta.    text = '\u041f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u044b \u043e\u0442\u0447\u0435\u0442\u0430:'.   add_column: col1.    text = '\u0417\u043d\u0430\u0447\u0435\u043d\u0438\u044f'.   add_column: col2.    text = '\u0417\u0430\u043a\u0430\u0437'.   add_text: col1.   text = gv_aufnr.   add_text: col2.    CALL METHOD ta-&gt;new_row.   ADD 1 TO rows.    ENDFORM.                    &quot;do_html_top_of_page   <\/code><\/pre>\n<p>  \u0427\u0442\u043e-\u0431\u044b \u0441\u0432\u043e\u0435 \u0431\u044b\u043b\u043e \u0443\u043d\u0438\u0432\u0435\u0440\u0441\u0430\u043b\u044c\u043d\u043e \u0438 \u043b\u0435\u0433\u043a\u043e \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0430\u043b\u043e\u0441\u044c, <br \/>  \u0432 \u043b\u044e\u0431\u043e\u0439 \u043e\u0442\u0447\u0435\u0442, \u0432 \u043a\u043e\u0442\u043e\u0440\u043e\u043c \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u044b HTML-\u0437\u0430\u0433\u043e\u043b\u043e\u0432\u043a\u0438,<br \/>  \u043e\u0431\u0435\u0440\u043d\u0435\u043c \u044d\u0442\u043e \u0434\u0435\u043b\u043e \u0432 \u0444\u0443\u043d\u043a\u0446\u0438\u043e\u043d\u0430\u043b\u044c\u043d\u044b\u0439 \u043c\u043e\u0434\u0443\u043b\u044c:<\/p>\n<pre><code class=\"html\"> FORM do_html_top_of_page *&---------------------------------------------------------------------*                   USING p_do TYPE REF TO cl_dd_document. *&---------------------------------------------------------------------*    DATA lt_html TYPE TABLE OF zparam WITH HEADER LINE.    lt_html-param = '\u0412\u0430\u0436\u043d\u043e\u0441\u0442\u044c'.   lt_html-value = '\u0412\u044b\u0441\u043e\u043a\u0430\u044f'.   APPEND lt_html.    lt_html-param = '\u041c\u0430\u0442\u0435\u0440\u0438\u0430\u043b'.   lt_html-value = '\u0412\u0441\u0435'.   APPEND lt_html.    lt_html-param = '\u041f\u0435\u0440\u0438\u043e\u0434'.   lt_html-value = '01.01.2015 - 01.03.2016'.   APPEND lt_html.    CALL FUNCTION 'Z_FM_FORM_HTML_TAB'     EXPORTING       it_param    = lt_html[]       iv_type      = 'DARK'     CHANGING       dd_document = p_do.  ENDFORM.  <\/code><\/pre>\n<p>  \u0421\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0430 zparam \u043f\u0440\u043e\u0441\u0442\u0430:<br \/>  PARAM CHAR100<br \/>  VALUE CHAR100<\/p>\n<p>  \u0412 \u0424\u041c: <br \/>  \u0441\u043d\u0430\u0447\u0430\u043b\u0430 \u0437\u0430\u043f\u043e\u043b\u043d\u044f\u0435\u043c CSS \u0447\u0430\u0441\u0442\u044c, <br \/>  \u043f\u043e\u0442\u043e\u043c \u0441\u043e\u0437\u0434\u0430\u0435\u043c \u0442\u0430\u0431\u043b\u0438\u0446\u0443 \u043d\u0430 HTML,<br \/>  \u0432 \u043a\u043e\u043d\u0446\u0435 \u0434\u043e\u0431\u0430\u0432\u043b\u044f\u0435\u043c \u0432 dd_document \u0438\u043b\u0438 \u0435\u0433\u043e \u043e\u0431\u043b\u0430\u0441\u0442\u044c, \u0435\u0441\u043b\u0438 \u043e\u043d\u0430 \u0435\u0441\u0442\u044c \u043d\u0430 \u0432\u0445\u043e\u0434\u0435<\/p>\n<p>  \u0424\u0443\u043d\u043a\u0446\u0438\u043e\u043d\u0430\u043b\u044c\u043d\u044b\u0439 \u043c\u043e\u0434\u0443\u043b\u044c:  <\/p>\n<pre><code class=\"html\">FUNCTION z_fm_form_html_tab. *&quot;---------------------------------------------------------------------- *&quot;*&quot;\u041b\u043e\u043a\u0430\u043b\u044c\u043d\u044b\u0439 \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441: *&quot;  IMPORTING *&quot;     REFERENCE(IT_PARAM) TYPE  ZTPARAM *&quot;     REFERENCE(IV_TYPE) TYPE  CHAR10 *&quot;  CHANGING *&quot;     REFERENCE(DD_DOCUMENT) TYPE REF TO  CL_DD_DOCUMENT *&quot;     REFERENCE(DD_AREA) TYPE REF TO  CL_DD_AREA OPTIONAL *&quot;----------------------------------------------------------------------    DATA lt_html TYPE TABLE OF sdydo_html_line WITH HEADER LINE.    DEFINE add_tag.     lt_html = &1.     append lt_html.   END-OF-DEFINITION.    DEFINE conc_tag_line.     concatenate '&lt;td&gt;' &1 '&lt;\/td&gt;' into lt_html.     append lt_html.   END-OF-DEFINITION.  *&quot;---------------------------------------------------------------------- * \u0414\u043e\u0431\u0430\u0432\u0438\u043c CSS *&quot;----------------------------------------------------------------------    add_tag '&lt;html&gt;'.    add_tag '&lt;style type=&quot;text\/css&quot;&gt;'.    CASE iv_type.      WHEN 'DARK'.        add_tag 'table {'.       add_tag 'font-family: &quot;Lucida Sans Unicode&quot;, &quot;Lucida Grande&quot;, Sans-Serif;'.       add_tag 'font-size: 12px;'.       add_tag 'border-collapse: collapse;'.       add_tag 'text-align: center;}'.       add_tag 'th, td:first-child {'.       add_tag 'background: #252F48;'.       add_tag 'color: white;'.       add_tag 'padding: 1px 1px;}'.       add_tag 'th, td {'.       add_tag 'border-style: solid;'.       add_tag 'border-width: 0 1px 1px 0;'.       add_tag 'border-color: white;}'.       add_tag 'td { background: #CAD4D6;}'.       add_tag 'th:first-child, td:first-child {'.       add_tag 'text-align: left;}'.      WHEN 'ZEBRA'.        add_tag 'table {'.       add_tag 'border-spacing: 0;'.       add_tag 'empty-cells: hide;}'.       add_tag 'td {'.       add_tag 'padding: 3px 3px;'. &quot;5       add_tag 'text-align: center;'.       add_tag 'border-bottom: 1px solid #F4EEE8;'.       add_tag 'transition: all 0.5s linear;}'.       add_tag 'td:first-child {'.       add_tag 'text-align: left;'.       add_tag 'color: #3D3511;'.       add_tag 'font-weight: bold;}'.       add_tag 'th {'.       add_tag 'padding: 3px 3px;'. &quot;5       add_tag 'color: #3D3511;'.       add_tag 'border-bottom: 1px solid #F4EEE8;'.       add_tag 'border-top-left-radius: 10px;'.       add_tag 'border-top-right-radius: 10px;}'.       add_tag 'td:nth-child(even)'.       add_tag ' {background: #F6D27E;}'.       add_tag 'td:nth-child(odd)'.       add_tag ' {background: #D1C7BF;}'.       add_tag 'th:nth-child(even)  {'.       add_tag 'background: #F6D27E;}'.       add_tag 'th:nth-child(odd)'.       add_tag '  {background: #D1C7BF;}'.       add_tag '.round-top {'.       add_tag 'border-top-left-radius: 10px;}'.       add_tag '.round-bottom {'.       add_tag 'border-bottom-left-radius: 10px;}'.       add_tag 'tr:hover td{'.       add_tag 'background: #D1C7BF;'.       add_tag 'font-weight: bold;}'.     ENDCASE.    add_tag '&lt;\/style&gt;'.  *&quot;---------------------------------------------------------------------- * \u0414\u043e\u0431\u0430\u0432\u0438\u043c HTML *&quot;----------------------------------------------------------------------    add_tag '&lt;table&gt;'.    add_tag '&lt;tr&gt;'.   add_tag '&lt;th&gt;\u041f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u044b \u043e\u0442\u0447\u0435\u0442\u0430: &lt;\/th&gt;'.   add_tag '&lt;th&gt;\u0417\u043d\u0430\u0447\u0435\u043d\u0438\u0435: &lt;\/th&gt;'.   add_tag '&lt;\/tr&gt;'.    DATA ls_param LIKE LINE OF it_param.   LOOP AT it_param INTO ls_param.      add_tag '&lt;tr&gt;'.     conc_tag_line: ls_param-param.     conc_tag_line: ls_param-value.     add_tag '&lt;\/tr&gt;'.    ENDLOOP.    add_tag '&lt;\/table&gt;'.    add_tag '&lt;\/html&gt;'.  *&quot;---------------------------------------------------------------------- * \u0414\u043e\u0431\u0430\u0432\u0438\u043c HTML \u0432 \u043e\u0431\u043b\u0430\u0441\u0442\u044c \u0438\u043b\u0438 \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442 *&quot;----------------------------------------------------------------------    IF dd_area IS NOT INITIAL.     dd_area-&gt;add_static_html( table_with_html = lt_html[] ).   ELSE.     dd_document-&gt;add_static_html( table_with_html = lt_html[] ).   ENDIF.   ENDFUNCTION.  <\/code><\/pre>\n<p>  \u041d\u0430\u043f\u043e\u043c\u043d\u044e \u043f\u043e\u043b\u0443\u0447\u0438\u043c:<br \/>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/files\/069\/513\/965\/069513965fa6427c9c9e1b61ae7b3a99.png\"\/><\/p>\n<p>  \u041c\u0438\u043d\u0443\u0441 \u0440\u0435\u0448\u0435\u043d\u0438\u044f, \u0435\u0441\u043b\u0438 \u0443 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f \u043f\u043e\u0432\u044b\u0448\u0435\u043d\u043d\u044b\u0435 \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0438 \u0431\u0435\u0437\u043e\u043f\u0430\u0441\u043d\u043e\u0441\u0442\u0438 \u0432 IE, CSS \u043e\u0444\u043e\u0440\u043c\u043b\u0435\u043d\u0438\u0435 \u0432\u044b\u0432\u043e\u0434\u0438\u0442\u0441\u044f \u043d\u0435 \u0431\u0443\u0434\u0435\u0442. \u0412\u0441\u0435\u043c \u0441\u043f\u0430\u0441\u0438\u0431\u043e.               <\/p>\n<div class=\"clear\"><\/div>\n<p> \u0441\u0441\u044b\u043b\u043a\u0430 \u043d\u0430 \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b \u0441\u0442\u0430\u0442\u044c\u0438 <a href=\"https:\/\/habrahabr.ru\/post\/275899\/\"> https:\/\/habrahabr.ru\/post\/275899\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>       <b>\u042d\u0442\u0430 \u043f\u0443\u0431\u043b\u0438\u043a\u0430\u0446\u0438\u044f \u043f\u0440\u0435\u0434\u043d\u0430\u0437\u043d\u0430\u0447\u0435\u043d\u0430 ABAP-\u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u0430\u043c \u0432 SAP ERP \u0438 \u0432\u0441\u0435\u043c \u0438\u043c \u0441\u043e\u0447\u0443\u0432\u0441\u0442\u0432\u0443\u044e\u0449\u0438\u043c.<\/b><br \/>  <a href=\"https:\/\/habrahabr.ru\/post\/275677\/\">\u0427\u0430\u0441\u0442\u044c1<\/a><\/p>\n<p>  \u041d\u0435 \u0432\u0441\u0435 \u0437\u043d\u0430\u044e\u0442, \u0447\u0442\u043e \u0432 ALV-\u043e\u0442\u0447\u0435\u0442 \u043c\u043e\u0436\u043d\u043e \u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u043a\u0440\u0430\u0441\u0438\u0432\u044b\u0439 \u0437\u0430\u0433\u043e\u043b\u043e\u0432\u043e\u043a \u043d\u0430 HTML.<br \/>  \u0420\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442 \u0431\u0443\u0434\u0435\u0442 \u043f\u043e\u0445\u043e\u0436 \u043d\u0430 \u044d\u0442\u043e:<br \/>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/files\/cf5\/ead\/ec1\/cf5eadec1c92495d802de66051cef275.png\"\/><\/p>\n<p>  \u0410 \u0447\u0442\u043e \u0435\u0441\u043b\u0438 \u0431\u044b \u0445\u043e\u0442\u0438\u043c \u043d\u0430\u0440\u0438\u0441\u043e\u0432\u0430\u0442\u044c \u043d\u0435\u0447\u0442\u043e \u0441\u0432\u043e\u0435?<br \/>  \u041d\u0430\u043f\u0440\u0438\u043c\u0435\u0440:<br \/>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/files\/069\/513\/965\/069513965fa6427c9c9e1b61ae7b3a99.png\"\/><\/p>\n<p>  \u0414\u043e\u0431\u0440\u043e \u043f\u043e\u0436\u0430\u043b\u043e\u0432\u0430\u0442\u044c \u043f\u043e\u0434 \u043a\u0430\u0442.  <\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[],"tags":[],"class_list":["post-272892","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/272892","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=272892"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/272892\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=272892"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=272892"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=272892"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}