{"id":1206,"date":"2014-11-07T11:42:06","date_gmt":"2014-11-07T10:42:06","guid":{"rendered":"http:\/\/oprsteny.cz\/?p=1206"},"modified":"2014-11-07T11:42:06","modified_gmt":"2014-11-07T10:42:06","slug":"abap-list-of-all-colors-available-in-webdynpro","status":"publish","type":"post","link":"https:\/\/oprsteny.cz\/?p=1206","title":{"rendered":"ABAP &#8211; List of all colors available in WebDynpro"},"content":{"rendered":"<p><img loading=\"lazy\" decoding=\"async\" data-attachment-id=\"358\" data-permalink=\"https:\/\/oprsteny.cz\/?attachment_id=358\" data-orig-file=\"https:\/\/oprsteny.cz\/wp-content\/uploads\/SAP.jpg\" data-orig-size=\"44,50\" data-comments-opened=\"1\" data-image-meta=\"{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;Picasa&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;1365690880&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;}\" data-image-title=\"SAP\" data-image-description=\"\" data-image-caption=\"\" data-large-file=\"https:\/\/oprsteny.cz\/wp-content\/uploads\/SAP.jpg\" class=\"size-full wp-image-358 alignleft\" src=\"http:\/\/oprsteny.cz\/wp-content\/uploads\/SAP.jpg\" alt=\"SAP\" width=\"44\" height=\"50\" \/>This is a demo webdynpro application to show you a list of all available colors you can use in your WebDynpros.<\/p>\n<p><!--more--><\/p>\n<ol>\n<li>In SE80 Create new WebDynpro component<\/li>\n<li>In ComponentController create the following Context<br \/>\n<a href=\"http:\/\/oprsteny.cz\/wp-content\/uploads\/WEBDYNPRO_ALV_COLORS_01.png\"><img loading=\"lazy\" decoding=\"async\" data-attachment-id=\"1207\" data-permalink=\"https:\/\/oprsteny.cz\/?attachment_id=1207\" data-orig-file=\"https:\/\/oprsteny.cz\/wp-content\/uploads\/WEBDYNPRO_ALV_COLORS_01.png\" data-orig-size=\"613,195\" data-comments-opened=\"1\" data-image-meta=\"{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;0&quot;}\" data-image-title=\"Colors in WebDynpro &amp;#8211; ComponentController Context\" data-image-description=\"\" data-image-caption=\"\" data-large-file=\"https:\/\/oprsteny.cz\/wp-content\/uploads\/WEBDYNPRO_ALV_COLORS_01.png\" class=\"alignnone size-medium wp-image-1207\" src=\"http:\/\/oprsteny.cz\/wp-content\/uploads\/WEBDYNPRO_ALV_COLORS_01-300x95.png\" alt=\"Colors in WebDynpro - ComponentController Context\" width=\"300\" height=\"95\" srcset=\"https:\/\/oprsteny.cz\/wp-content\/uploads\/WEBDYNPRO_ALV_COLORS_01-300x95.png 300w, https:\/\/oprsteny.cz\/wp-content\/uploads\/WEBDYNPRO_ALV_COLORS_01-500x159.png 500w, https:\/\/oprsteny.cz\/wp-content\/uploads\/WEBDYNPRO_ALV_COLORS_01.png 613w\" sizes=\"auto, (max-width: 300px) 100vw, 300px\" \/><\/a><br \/>\nNode ALV_COLORS with cardinality 0..n and selection 0..1<br \/>\nElement NAME with type CHAR30<br \/>\nElement COLOR with type WDY_UIE_LIBRARY_ENUM_TYPE<\/li>\n<li>In View MAIN, tab Properties &#8211; add new Component use:<br \/>\nALV_COLORS with type SALV_WD_TABLE<br \/>\n<a href=\"http:\/\/oprsteny.cz\/wp-content\/uploads\/WEBDYNPRO_ALV_COLORS_02.png\"><img loading=\"lazy\" decoding=\"async\" data-attachment-id=\"1208\" data-permalink=\"https:\/\/oprsteny.cz\/?attachment_id=1208\" data-orig-file=\"https:\/\/oprsteny.cz\/wp-content\/uploads\/WEBDYNPRO_ALV_COLORS_02.png\" data-orig-size=\"712,319\" data-comments-opened=\"1\" data-image-meta=\"{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;0&quot;}\" data-image-title=\"Colors in WebDynpro &amp;#8211; View Component Uses\" data-image-description=\"\" data-image-caption=\"\" data-large-file=\"https:\/\/oprsteny.cz\/wp-content\/uploads\/WEBDYNPRO_ALV_COLORS_02.png\" class=\"alignnone size-medium wp-image-1208\" src=\"http:\/\/oprsteny.cz\/wp-content\/uploads\/WEBDYNPRO_ALV_COLORS_02-300x134.png\" alt=\"Colors in WebDynpro - View Component Uses\" width=\"300\" height=\"134\" srcset=\"https:\/\/oprsteny.cz\/wp-content\/uploads\/WEBDYNPRO_ALV_COLORS_02-300x134.png 300w, https:\/\/oprsteny.cz\/wp-content\/uploads\/WEBDYNPRO_ALV_COLORS_02-500x224.png 500w, https:\/\/oprsteny.cz\/wp-content\/uploads\/WEBDYNPRO_ALV_COLORS_02.png 712w\" sizes=\"auto, (max-width: 300px) 100vw, 300px\" \/><\/a><\/li>\n<li>In View MAIN, tab Layout &#8211; add ViewContainerUIElement VIC_ALV_COLORS<br \/>\n<a href=\"http:\/\/oprsteny.cz\/wp-content\/uploads\/WEBDYNPRO_ALV_COLORS_03.png\"><img loading=\"lazy\" decoding=\"async\" data-attachment-id=\"1209\" data-permalink=\"https:\/\/oprsteny.cz\/?attachment_id=1209\" data-orig-file=\"https:\/\/oprsteny.cz\/wp-content\/uploads\/WEBDYNPRO_ALV_COLORS_03.png\" data-orig-size=\"715,129\" data-comments-opened=\"1\" data-image-meta=\"{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;0&quot;}\" data-image-title=\"Colors in WebDynpro &amp;#8211; View Layout\" data-image-description=\"\" data-image-caption=\"\" data-large-file=\"https:\/\/oprsteny.cz\/wp-content\/uploads\/WEBDYNPRO_ALV_COLORS_03.png\" class=\"alignnone size-medium wp-image-1209\" src=\"http:\/\/oprsteny.cz\/wp-content\/uploads\/WEBDYNPRO_ALV_COLORS_03-300x54.png\" alt=\"Colors in WebDynpro - View Layout\" width=\"300\" height=\"54\" srcset=\"https:\/\/oprsteny.cz\/wp-content\/uploads\/WEBDYNPRO_ALV_COLORS_03-300x54.png 300w, https:\/\/oprsteny.cz\/wp-content\/uploads\/WEBDYNPRO_ALV_COLORS_03-500x90.png 500w, https:\/\/oprsteny.cz\/wp-content\/uploads\/WEBDYNPRO_ALV_COLORS_03.png 715w\" sizes=\"auto, (max-width: 300px) 100vw, 300px\" \/><\/a><\/li>\n<li>In View MAIN, tab Context &#8211; copy node ALV_COLORS from ComponentController Context<br \/>\n<a href=\"http:\/\/oprsteny.cz\/wp-content\/uploads\/WEBDYNPRO_ALV_COLORS_04.png\"><img loading=\"lazy\" decoding=\"async\" data-attachment-id=\"1210\" data-permalink=\"https:\/\/oprsteny.cz\/?attachment_id=1210\" data-orig-file=\"https:\/\/oprsteny.cz\/wp-content\/uploads\/WEBDYNPRO_ALV_COLORS_04.png\" data-orig-size=\"950,205\" data-comments-opened=\"1\" data-image-meta=\"{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;0&quot;}\" data-image-title=\"Colors in WebDynpro &amp;#8211; View Context\" data-image-description=\"\" data-image-caption=\"\" data-large-file=\"https:\/\/oprsteny.cz\/wp-content\/uploads\/WEBDYNPRO_ALV_COLORS_04.png\" class=\"alignnone size-medium wp-image-1210\" src=\"http:\/\/oprsteny.cz\/wp-content\/uploads\/WEBDYNPRO_ALV_COLORS_04-300x64.png\" alt=\"Colors in WebDynpro - View Context\" width=\"300\" height=\"64\" srcset=\"https:\/\/oprsteny.cz\/wp-content\/uploads\/WEBDYNPRO_ALV_COLORS_04-300x64.png 300w, https:\/\/oprsteny.cz\/wp-content\/uploads\/WEBDYNPRO_ALV_COLORS_04-500x107.png 500w, https:\/\/oprsteny.cz\/wp-content\/uploads\/WEBDYNPRO_ALV_COLORS_04.png 950w\" sizes=\"auto, (max-width: 300px) 100vw, 300px\" \/><\/a><\/li>\n<li>In View MAIN, tab Methods, impement method WDDOINIT with code attached below<\/li>\n<li>Create new WebDynpro Application for your component and execute it &#8211; You should see the following result<br \/>\n<a href=\"http:\/\/oprsteny.cz\/wp-content\/uploads\/WEBDYNPRO_ALV_COLORS_05.png\"><img loading=\"lazy\" decoding=\"async\" data-attachment-id=\"1211\" data-permalink=\"https:\/\/oprsteny.cz\/?attachment_id=1211\" data-orig-file=\"https:\/\/oprsteny.cz\/wp-content\/uploads\/WEBDYNPRO_ALV_COLORS_05.png\" data-orig-size=\"357,799\" data-comments-opened=\"1\" data-image-meta=\"{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;0&quot;}\" data-image-title=\"Colors in WebDynpro &amp;#8211; WebDynpro colors\" data-image-description=\"\" data-image-caption=\"\" data-large-file=\"https:\/\/oprsteny.cz\/wp-content\/uploads\/WEBDYNPRO_ALV_COLORS_05.png\" class=\"alignnone size-medium wp-image-1211\" src=\"http:\/\/oprsteny.cz\/wp-content\/uploads\/WEBDYNPRO_ALV_COLORS_05-134x300.png\" alt=\"Colors in WebDynpro - WebDynpro colors\" width=\"134\" height=\"300\" srcset=\"https:\/\/oprsteny.cz\/wp-content\/uploads\/WEBDYNPRO_ALV_COLORS_05-134x300.png 134w, https:\/\/oprsteny.cz\/wp-content\/uploads\/WEBDYNPRO_ALV_COLORS_05.png 357w\" sizes=\"auto, (max-width: 134px) 100vw, 134px\" \/><\/a><\/li>\n<\/ol>\n<pre lang=\"abap\">METHOD wddoinit.\r\n  \"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\r\n  \" data declarations                             \"\r\n  \"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\r\n  DATA: ls_stru                TYPE REF TO cl_abap_structdescr,\r\n        lt_comp                TYPE STANDARD TABLE OF abap_componentdescr,\r\n        lo_nd_alv_colors       TYPE REF TO if_wd_context_node,\r\n        lt_alv_colors          TYPE wd_this-&gt;elements_alv_colors,\r\n        ls_alv_colors          LIKE LINE OF lt_alv_colors,\r\n        lo_input_field         TYPE REF TO cl_salv_wd_uie_input_field,\r\n        lo_value               TYPE REF TO cl_salv_wd_config_table,\r\n        lo_interfacecontroller TYPE REF TO iwci_salv_wd_table,\r\n        lo_table_settings      TYPE REF TO if_salv_wd_table_settings,\r\n        lo_std_settings        TYPE REF TO if_salv_wd_config_table.\r\n\r\n  FIELD-SYMBOLS: &lt;lv_value&gt; TYPE any.\r\n  \"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\r\n  \" component usage                               \"\r\n  \"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\r\n  DATA(lo_cmp_usage_alv) = wd_this-&gt;wd_cpuse_alv_colors( ).\r\n  IF lo_cmp_usage_alv-&gt;has_active_component( ) IS INITIAL.\r\n    lo_cmp_usage_alv-&gt;create_component( ).\r\n  ENDIF.\r\n  \"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\r\n  \" get structure                                 \"\r\n  \"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\r\n  ls_stru ?= cl_abap_typedescr=&gt;describe_by_data( \r\n    cl_wd_table_column=&gt;e_cell_design \r\n  ).\r\n  lt_comp = ls_stru-&gt;get_components( ).\r\n  \"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\r\n  \" create table                                  \"\r\n  \"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\r\n  LOOP AT lt_comp INTO DATA(ls_comp).\r\n    ASSIGN COMPONENT ls_comp-name \r\n      OF STRUCTURE cl_wd_table_column=&gt;e_cell_design \r\n      TO &lt;lv_value&gt;.\r\n    IF &lt;lv_value&gt; IS ASSIGNED.\r\n      ls_alv_colors-name = ls_comp-name.\r\n      ls_alv_colors-color = &lt;lv_value&gt;.\r\n      APPEND ls_alv_colors TO lt_alv_colors.\r\n    ENDIF.\r\n  ENDLOOP.\r\n  \"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\r\n  \" set context                                   \"\r\n  \"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\r\n  lo_nd_alv_colors = wd_context-&gt;get_child_node( \r\n    name = wd_this-&gt;wdctx_alv_colors \r\n  ).\r\n  lo_nd_alv_colors-&gt;bind_table( lt_alv_colors ).\r\n  \"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\r\n  \" set cell color                                \"\r\n  \"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\r\n  lo_interfacecontroller =   wd_this-&gt;wd_cpifc_alv_colors( ).\r\n  lo_value = lo_interfacecontroller-&gt;get_model( ).\r\n  DATA(lo_column) = lo_value-&gt;if_salv_wd_column_settings~get_column(\r\n    id = 'COLOR' \r\n  ).\r\n  lo_column-&gt;set_cell_design_fieldname( 'COLOR' ).\r\n  \"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\r\n  \" table settings                                \"\r\n  \"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\r\n  lo_table_settings ?= lo_value.\r\n  lo_table_settings-&gt;set_visible_row_count( '100' ).\r\n  lo_std_settings ?= lo_value.\r\n  lo_std_settings-&gt;get_toolbar_settings(\r\n    )-&gt;set_visible( \r\n      value = '00' \r\n  ).\r\nENDMETHOD.<\/pre>\n","protected":false},"excerpt":{"rendered":"<p>This is a demo webdynpro application to show you a list of all available colors you can use in your WebDynpros.<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"jetpack_post_was_ever_published":false,"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_jetpack_memberships_contains_paid_content":false,"footnotes":"","jetpack_publicize_message":"ABAP - List of all colors available in WebDynpro","jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":true,"jetpack_social_options":{"image_generator_settings":{"template":"highway","default_image_id":0,"font":"","enabled":false},"version":2}},"categories":[16,86,9,222,359],"tags":[446,447,360,309],"class_list":["post-1206","post","type-post","status-publish","format-standard","hentry","category-abap","category-alv","category-development","category-dynpro","category-webdynpro-abap","tag-abap","tag-alv","tag-colors","tag-webdynpro"],"jetpack_publicize_connections":[],"jetpack_featured_media_url":"","jetpack_sharing_enabled":true,"jetpack_shortlink":"https:\/\/wp.me\/p3nYbe-js","jetpack-related-posts":[],"_links":{"self":[{"href":"https:\/\/oprsteny.cz\/index.php?rest_route=\/wp\/v2\/posts\/1206","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/oprsteny.cz\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/oprsteny.cz\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/oprsteny.cz\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/oprsteny.cz\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=1206"}],"version-history":[{"count":1,"href":"https:\/\/oprsteny.cz\/index.php?rest_route=\/wp\/v2\/posts\/1206\/revisions"}],"predecessor-version":[{"id":1212,"href":"https:\/\/oprsteny.cz\/index.php?rest_route=\/wp\/v2\/posts\/1206\/revisions\/1212"}],"wp:attachment":[{"href":"https:\/\/oprsteny.cz\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=1206"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/oprsteny.cz\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=1206"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/oprsteny.cz\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=1206"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}