{"id":1438,"date":"2015-06-08T13:49:53","date_gmt":"2015-06-08T12:49:53","guid":{"rendered":"http:\/\/oprsteny.cz\/?p=1438"},"modified":"2015-12-07T14:42:01","modified_gmt":"2015-12-07T13:42:01","slug":"abap-additional-button-in-the-selection-screen-toolbar","status":"publish","type":"post","link":"https:\/\/oprsteny.cz\/?p=1438","title":{"rendered":"ABAP &#8211; Additional button in the selection screen toolbar"},"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\" \/>In this short code snippet you can find out how to add additional buttons to the selection screen and trigger user-defined functions based on what user clicks on.<\/p>\n<p>This specific example shows how to display current report&#8217;s documentation.<\/p>\n<p><em>Note: T<\/em>he INFO button is added to the selection screen automatically once you maintain the report&#8217;s documentation, but the following code should serve as a reference on how a similar thing can be done manually.<!--more--><\/p>\n<pre lang=\"abap\">* this is a must for 'sscrfields' definition\r\nTABLES sscrfields.\r\n\r\n* this is a must in case you want to use icons\r\nTYPE-POOLS icon.\r\n\r\nDATA:\r\n  gs_functxt   TYPE smp_dyntxt.\r\n\r\nSELECTION-SCREEN FUNCTION KEY 1. \" here you can use 1-5\r\nPARAMETERS: p_dummy TYPE matnr.\r\n\r\nINITIALIZATION.\r\n  gs_functxt-icon_id   = icon_information.\r\n  gs_functxt-quickinfo = 'Report Documentation'(s01).\r\n  gs_functxt-icon_text = 'Info'(s02).\r\n\r\n  sscrfields-functxt_01 = gs_functxt.\r\n\r\nAT SELECTION-SCREEN.\r\n  IF sscrfields-ucomm = 'FC01'.\r\n    \" show report documentation\r\n    CALL FUNCTION 'DSYS_SHOW_FOR_F1HELP'\r\n      EXPORTING\r\n        dokclass         = 'RE'\r\n        dokname          = sy-repid\r\n        short_text       = 'X'\r\n      EXCEPTIONS\r\n        class_unknown    = 1\r\n        object_not_found = 2\r\n        OTHERS           = 3.\r\n  ENDIF.\r\n\r\nSTART-OF-SELECTION.<\/pre>\n<p>The result will look like the following picture:<\/p>\n<p><a href=\"http:\/\/oprsteny.cz\/wp-content\/uploads\/SELECTION_SCREEN_ADDITIONAL_TOOLBAR_BUTTON_01.png\"><img loading=\"lazy\" decoding=\"async\" data-attachment-id=\"1439\" data-permalink=\"https:\/\/oprsteny.cz\/?attachment_id=1439\" data-orig-file=\"https:\/\/oprsteny.cz\/wp-content\/uploads\/SELECTION_SCREEN_ADDITIONAL_TOOLBAR_BUTTON_01.png\" data-orig-size=\"411,106\" 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=\"Additional toolbar button\" data-image-description=\"\" data-image-caption=\"\" data-large-file=\"https:\/\/oprsteny.cz\/wp-content\/uploads\/SELECTION_SCREEN_ADDITIONAL_TOOLBAR_BUTTON_01.png\" class=\"alignnone size-medium wp-image-1439\" src=\"http:\/\/oprsteny.cz\/wp-content\/uploads\/SELECTION_SCREEN_ADDITIONAL_TOOLBAR_BUTTON_01-300x77.png\" alt=\"Additional toolbar button\" width=\"300\" height=\"77\" srcset=\"https:\/\/oprsteny.cz\/wp-content\/uploads\/SELECTION_SCREEN_ADDITIONAL_TOOLBAR_BUTTON_01-300x77.png 300w, https:\/\/oprsteny.cz\/wp-content\/uploads\/SELECTION_SCREEN_ADDITIONAL_TOOLBAR_BUTTON_01.png 411w\" sizes=\"auto, (max-width: 300px) 100vw, 300px\" \/><\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>In this short code snippet you can find out how to add additional buttons to the selection screen and trigger user-defined functions based on what user clicks on. This specific example shows how to display current report&#8217;s documentation. Note: The &hellip; <a href=\"https:\/\/oprsteny.cz\/?p=1438\">Continue reading <span class=\"meta-nav\">&rarr;<\/span><\/a><\/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 - Additional button in the selection screen toolbar","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,233,9,222],"tags":[127,436,449,355],"class_list":["post-1438","post","type-post","status-publish","format-standard","hentry","category-abap","category-customizing","category-development","category-dynpro","tag-button","tag-function","tag-report-documentation","tag-selection-screen"],"jetpack_publicize_connections":[],"jetpack_featured_media_url":"","jetpack_sharing_enabled":true,"jetpack_shortlink":"https:\/\/wp.me\/p3nYbe-nc","jetpack-related-posts":[],"_links":{"self":[{"href":"https:\/\/oprsteny.cz\/index.php?rest_route=\/wp\/v2\/posts\/1438","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=1438"}],"version-history":[{"count":1,"href":"https:\/\/oprsteny.cz\/index.php?rest_route=\/wp\/v2\/posts\/1438\/revisions"}],"predecessor-version":[{"id":1440,"href":"https:\/\/oprsteny.cz\/index.php?rest_route=\/wp\/v2\/posts\/1438\/revisions\/1440"}],"wp:attachment":[{"href":"https:\/\/oprsteny.cz\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=1438"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/oprsteny.cz\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=1438"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/oprsteny.cz\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=1438"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}