{"id":1541,"date":"2016-07-19T15:44:04","date_gmt":"2016-07-19T14:44:04","guid":{"rendered":"http:\/\/oprsteny.cz\/?p=1541"},"modified":"2016-07-19T15:45:54","modified_gmt":"2016-07-19T14:45:54","slug":"abap-call-transaction-using-bdc","status":"publish","type":"post","link":"https:\/\/oprsteny.cz\/?p=1541","title":{"rendered":"ABAP &#8211; CALL TRANSACTION USING BDC"},"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 the following code snippet you can find an example on how to trigger a transaction HU03 (display handling unit details) with given HU number via batch input.<!--more--><\/p>\n<p>Because HU number does not have its own PARAMETER ID, we can&#8217;t do it in the simple way, e.g.<\/p>\n<pre lang=\"abap\">SET PARAMETER 'DTB' FIELD 'MARA'.\r\nCALL TRANSACTION 'SE16' AND SKIP FIRST SCREEN.<\/pre>\n<p>Luckily there&#8217;s an alternative way using batch input.<\/p>\n<p>You can record\/simulate the batch sequence in transaction SHDB<a href=\"http:\/\/oprsteny.cz\/wp-content\/uploads\/SHDB.png\"><img loading=\"lazy\" decoding=\"async\" data-attachment-id=\"1542\" data-permalink=\"https:\/\/oprsteny.cz\/?attachment_id=1542\" data-orig-file=\"https:\/\/oprsteny.cz\/wp-content\/uploads\/SHDB.png\" data-orig-size=\"441,204\" 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=\"SHDB recording\" data-image-description=\"\" data-image-caption=\"\" data-large-file=\"https:\/\/oprsteny.cz\/wp-content\/uploads\/SHDB.png\" class=\"size-medium wp-image-1542 alignnone\" src=\"http:\/\/oprsteny.cz\/wp-content\/uploads\/SHDB-300x139.png\" alt=\"SHDB recording\" width=\"300\" height=\"139\" srcset=\"https:\/\/oprsteny.cz\/wp-content\/uploads\/SHDB-300x139.png 300w, https:\/\/oprsteny.cz\/wp-content\/uploads\/SHDB.png 441w\" sizes=\"auto, (max-width: 300px) 100vw, 300px\" \/><\/a><\/p>\n<p>From here you can take all the necessary information to build up your program:<\/p>\n<pre lang=\"abap\">DATA:\r\n      lt_bdc TYPE TABLE OF bdcdata,\r\n      lv_exidv TYPE exidv VALUE '123456789'.\r\n\r\n    FIELD-SYMBOLS:\r\n      &lt;ls_bdc&gt; TYPE bdcdata.\r\n\r\n*   Macro to fill the necessary BDC data\r\n    DEFINE add_bdc.\r\n      APPEND INITIAL LINE TO lt_bdc ASSIGNING &lt;ls_bdc&gt;.\r\n      &lt;ls_bdc&gt;-fnam = &amp;1.\r\n      &lt;ls_bdc&gt;-fval = &amp;2.\r\n\r\n      &lt;ls_bdc&gt;-program  = &amp;3.\r\n      &lt;ls_bdc&gt;-dynpro   = &amp;4.\r\n      &lt;ls_bdc&gt;-dynbegin = &amp;5.\r\n    END-OF-DEFINITION.\r\n\r\n*   Rewrite the commands from SHDB\r\n    add_bdc: ' '              ' '              'RHU_DISPLAY_HANDLING_UNITS' '1000' 'X',\r\n             'BDC_CURSOR'     'VEKP-EXIDV(01)' ' '                          ' '    ' ',\r\n             'BDC_OKCODE'     '=CREATE'        ' '                          ' '    ' ',\r\n             'VEKP-EXIDV(01)' lv_exidv         ' '                          ' '    ' '.\r\n\r\n*   Call transaction with the batch input data\r\n    CALL TRANSACTION 'HU03'                                  \"#EC CI_CALLTA\r\n      USING lt_bdc\r\n      MODE 'E'.<\/pre>\n<p>&nbsp;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>In the following code snippet you can find an example on how to trigger a transaction HU03 (display handling unit details) with given HU number via batch input.<\/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":"","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,9,222,106],"tags":[477,476],"class_list":["post-1541","post","type-post","status-publish","format-standard","hentry","category-abap","category-development","category-dynpro","category-transactions","tag-bdc","tag-shdb"],"jetpack_publicize_connections":[],"jetpack_featured_media_url":"","jetpack_sharing_enabled":true,"jetpack_shortlink":"https:\/\/wp.me\/p3nYbe-oR","jetpack-related-posts":[],"_links":{"self":[{"href":"https:\/\/oprsteny.cz\/index.php?rest_route=\/wp\/v2\/posts\/1541","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=1541"}],"version-history":[{"count":3,"href":"https:\/\/oprsteny.cz\/index.php?rest_route=\/wp\/v2\/posts\/1541\/revisions"}],"predecessor-version":[{"id":1545,"href":"https:\/\/oprsteny.cz\/index.php?rest_route=\/wp\/v2\/posts\/1541\/revisions\/1545"}],"wp:attachment":[{"href":"https:\/\/oprsteny.cz\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=1541"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/oprsteny.cz\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=1541"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/oprsteny.cz\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=1541"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}