{"id":1593,"date":"2017-01-16T15:06:39","date_gmt":"2017-01-16T14:06:39","guid":{"rendered":"http:\/\/oprsteny.cz\/?p=1593"},"modified":"2017-01-16T15:07:01","modified_gmt":"2017-01-16T14:07:01","slug":"abap-popup_to_confirm-with-dynamic-text","status":"publish","type":"post","link":"https:\/\/oprsteny.cz\/?p=1593","title":{"rendered":"ABAP &#8211; POPUP_TO_CONFIRM with dynamic text"},"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=\"alignleft size-full wp-image-358\" src=\"http:\/\/oprsteny.cz\/wp-content\/uploads\/SAP.jpg\" alt=\"\" width=\"44\" height=\"50\" \/>If you need to display dynamic text in an e.g. confirmation dialog, in which you need to place several variables (different for each popup) you can use function module <em>POPUP_TO_CONFIRM<\/em> and the\u00a0<em>parameter<\/em> table.<!--more--><\/p>\n<p>The only thing you need to do is to prepare an internal table filled with parameters and their values. This table is then passed to the function module which will use it to replace the variable place-holdes in the text.<\/p>\n<p>To create\/edit text for parameter <em>DIAGNOSE_OBJECT<\/em> of the function module <em>POPUP_TO_CONFIRM<\/em>, use transaction SE61 and select DT (Dialog texts)<\/p>\n<p><a href=\"http:\/\/oprsteny.cz\/wp-content\/uploads\/POPUP_TO_CONFIRM_WITH_PARAMETERS_01.png\"><img loading=\"lazy\" decoding=\"async\" data-attachment-id=\"1594\" data-permalink=\"https:\/\/oprsteny.cz\/?attachment_id=1594\" data-orig-file=\"https:\/\/oprsteny.cz\/wp-content\/uploads\/POPUP_TO_CONFIRM_WITH_PARAMETERS_01.png\" data-orig-size=\"610,269\" 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=\"Create text with placeholders for variables in SE61\" data-image-description=\"\" data-image-caption=\"\" data-large-file=\"https:\/\/oprsteny.cz\/wp-content\/uploads\/POPUP_TO_CONFIRM_WITH_PARAMETERS_01.png\" class=\"size-medium wp-image-1594 alignnone\" src=\"http:\/\/oprsteny.cz\/wp-content\/uploads\/POPUP_TO_CONFIRM_WITH_PARAMETERS_01-300x132.png\" alt=\"\" width=\"300\" height=\"132\" srcset=\"https:\/\/oprsteny.cz\/wp-content\/uploads\/POPUP_TO_CONFIRM_WITH_PARAMETERS_01-300x132.png 300w, https:\/\/oprsteny.cz\/wp-content\/uploads\/POPUP_TO_CONFIRM_WITH_PARAMETERS_01-500x220.png 500w, https:\/\/oprsteny.cz\/wp-content\/uploads\/POPUP_TO_CONFIRM_WITH_PARAMETERS_01.png 610w\" sizes=\"auto, (max-width: 300px) 100vw, 300px\" \/><\/a><\/p>\n<p>In the text, enter the placeholders for variables like in the following picture<a href=\"http:\/\/oprsteny.cz\/wp-content\/uploads\/POPUP_TO_CONFIRM_WITH_PARAMETERS_02.png\"><img loading=\"lazy\" decoding=\"async\" data-attachment-id=\"1595\" data-permalink=\"https:\/\/oprsteny.cz\/?attachment_id=1595\" data-orig-file=\"https:\/\/oprsteny.cz\/wp-content\/uploads\/POPUP_TO_CONFIRM_WITH_PARAMETERS_02.png\" data-orig-size=\"606,192\" 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=\"Placeholders for variables\" data-image-description=\"\" data-image-caption=\"\" data-large-file=\"https:\/\/oprsteny.cz\/wp-content\/uploads\/POPUP_TO_CONFIRM_WITH_PARAMETERS_02.png\" class=\"size-medium wp-image-1595 alignnone\" src=\"http:\/\/oprsteny.cz\/wp-content\/uploads\/POPUP_TO_CONFIRM_WITH_PARAMETERS_02-300x95.png\" alt=\"\" width=\"300\" height=\"95\" srcset=\"https:\/\/oprsteny.cz\/wp-content\/uploads\/POPUP_TO_CONFIRM_WITH_PARAMETERS_02-300x95.png 300w, https:\/\/oprsteny.cz\/wp-content\/uploads\/POPUP_TO_CONFIRM_WITH_PARAMETERS_02-500x158.png 500w, https:\/\/oprsteny.cz\/wp-content\/uploads\/POPUP_TO_CONFIRM_WITH_PARAMETERS_02.png 606w\" sizes=\"auto, (max-width: 300px) 100vw, 300px\" \/><\/a><\/p>\n<p>Now you can use this text with your variable&#8217;s value like this:<\/p>\n<pre lang=\"abap\">DATA:\r\n  lt_popup_params TYPE STANDARD TABLE OF spar,\r\n  lv_popup_answer TYPE c.\r\n\r\nCONSTANTS:\r\n  co_matnr           TYPE matnr VALUE '123456789'.\r\n\r\nAPPEND INITIAL LINE TO lt_popup_params \r\n  ASSIGNING FIELD-SYMBOL(&lt;ls_popup_param&gt;).\r\n&lt;ls_popup_param&gt;-param = 'MATNR'.\r\n&lt;ls_popup_param&gt;-value = co_matnr.\r\n\r\nCALL FUNCTION 'POPUP_TO_CONFIRM'\r\n  EXPORTING\r\n    titlebar              = 'Select Approver'(001)\r\n    diagnose_object       = 'YVVA_YCL_IM_COND_SAVE_WFL'\r\n    text_question         = ' '\r\n    display_cancel_button = ' '\r\n    start_column          = 30\r\n    start_row             = 10\r\n  IMPORTING\r\n    answer                = lv_popup_answer\r\n  TABLES\r\n    parameter             = lt_popup_params.\r\nIF lv_popup_answer = 1.\r\n  WRITE 'APPROVED'.\r\nELSE.\r\n  WRITE 'CANCELLED'.\r\nENDIF.<\/pre>\n<p>The resulting popup will look like this:<\/p>\n<p><a href=\"http:\/\/oprsteny.cz\/wp-content\/uploads\/POPUP_TO_CONFIRM_WITH_PARAMETERS_03.png\"><img loading=\"lazy\" decoding=\"async\" data-attachment-id=\"1596\" data-permalink=\"https:\/\/oprsteny.cz\/?attachment_id=1596\" data-orig-file=\"https:\/\/oprsteny.cz\/wp-content\/uploads\/POPUP_TO_CONFIRM_WITH_PARAMETERS_03.png\" data-orig-size=\"467,285\" 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=\"Popup text with variables\" data-image-description=\"\" data-image-caption=\"\" data-large-file=\"https:\/\/oprsteny.cz\/wp-content\/uploads\/POPUP_TO_CONFIRM_WITH_PARAMETERS_03.png\" class=\"size-medium wp-image-1596\" src=\"http:\/\/oprsteny.cz\/wp-content\/uploads\/POPUP_TO_CONFIRM_WITH_PARAMETERS_03-300x183.png\" alt=\"\" width=\"300\" height=\"183\" srcset=\"https:\/\/oprsteny.cz\/wp-content\/uploads\/POPUP_TO_CONFIRM_WITH_PARAMETERS_03-300x183.png 300w, https:\/\/oprsteny.cz\/wp-content\/uploads\/POPUP_TO_CONFIRM_WITH_PARAMETERS_03.png 467w\" sizes=\"auto, (max-width: 300px) 100vw, 300px\" \/><\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>If you need to display dynamic text in an e.g. confirmation dialog, in which you need to place several variables (different for each popup) you can use function module POPUP_TO_CONFIRM and the\u00a0parameter table.<\/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":true,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_jetpack_memberships_contains_paid_content":false,"footnotes":"","jetpack_publicize_message":"ABAP - POPUP_TO_CONFIRM with dynamic text","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],"tags":[500],"class_list":["post-1593","post","type-post","status-publish","format-standard","hentry","category-abap","category-alv","category-development","category-dynpro","tag-popup_to_confirm"],"jetpack_publicize_connections":[],"jetpack_featured_media_url":"","jetpack_sharing_enabled":true,"jetpack_shortlink":"https:\/\/wp.me\/p3nYbe-pH","jetpack-related-posts":[],"_links":{"self":[{"href":"https:\/\/oprsteny.cz\/index.php?rest_route=\/wp\/v2\/posts\/1593","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=1593"}],"version-history":[{"count":3,"href":"https:\/\/oprsteny.cz\/index.php?rest_route=\/wp\/v2\/posts\/1593\/revisions"}],"predecessor-version":[{"id":1599,"href":"https:\/\/oprsteny.cz\/index.php?rest_route=\/wp\/v2\/posts\/1593\/revisions\/1599"}],"wp:attachment":[{"href":"https:\/\/oprsteny.cz\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=1593"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/oprsteny.cz\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=1593"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/oprsteny.cz\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=1593"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}