{"id":1563,"date":"2016-12-01T10:38:18","date_gmt":"2016-12-01T09:38:18","guid":{"rendered":"http:\/\/oprsteny.cz\/?p=1563"},"modified":"2016-12-01T10:38:18","modified_gmt":"2016-12-01T09:38:18","slug":"abap-how-to-identify-invoice-text-id","status":"publish","type":"post","link":"https:\/\/oprsteny.cz\/?p=1563","title":{"rendered":"ABAP &#8211; How to identify invoice text ID"},"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\" \/>If you need to read a text out of an invoice, you use standard function module READ_TEXT.\u00a0But it might be a challenge to identify the correct input parameters for this FM as invoice can contain quite a lot of texts.<!--more--><\/p>\n<p>The parameters necessary to read text out of an invoice are the following:<\/p>\n<ul>\n<li><strong>ID<\/strong> &#8211; ID of the text on invoice (will be explained further)<\/li>\n<li><strong>NAME<\/strong> &#8211; number of the invoice (converted to a variable of type TDOBNAME)<\/li>\n<li><strong>LANGUAGE<\/strong> &#8211; language in which the text is maintained<\/li>\n<li><strong>OBJECT<\/strong> &#8211; &#8216;VBBK&#8217; for invoices<\/li>\n<\/ul>\n<p>The tricky part is the parameter <em>ID. How to identify the correct text ID?<br \/>\n<\/em>One possible way is to open the invoice in VF03 and go to header texts<\/p>\n<p><a href=\"http:\/\/oprsteny.cz\/wp-content\/uploads\/READ_TEXT_INVOICE_01.png\"><img loading=\"lazy\" decoding=\"async\" data-attachment-id=\"1564\" data-permalink=\"https:\/\/oprsteny.cz\/?attachment_id=1564\" data-orig-file=\"https:\/\/oprsteny.cz\/wp-content\/uploads\/READ_TEXT_INVOICE_01.png\" data-orig-size=\"941,250\" 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=\"Invoice &amp;#8211; Go to header texts\" data-image-description=\"\" data-image-caption=\"\" data-large-file=\"https:\/\/oprsteny.cz\/wp-content\/uploads\/READ_TEXT_INVOICE_01.png\" class=\"wp-image-1564 size-medium alignnone\" src=\"http:\/\/oprsteny.cz\/wp-content\/uploads\/READ_TEXT_INVOICE_01-300x80.png\" alt=\"Invoice - Go to header texts\" width=\"300\" height=\"80\" srcset=\"https:\/\/oprsteny.cz\/wp-content\/uploads\/READ_TEXT_INVOICE_01-300x80.png 300w, https:\/\/oprsteny.cz\/wp-content\/uploads\/READ_TEXT_INVOICE_01-768x204.png 768w, https:\/\/oprsteny.cz\/wp-content\/uploads\/READ_TEXT_INVOICE_01-500x133.png 500w, https:\/\/oprsteny.cz\/wp-content\/uploads\/READ_TEXT_INVOICE_01.png 941w\" sizes=\"auto, (max-width: 300px) 100vw, 300px\" \/><\/a><\/p>\n<p>Select the text you want to read to view its contents<\/p>\n<p><a href=\"http:\/\/oprsteny.cz\/wp-content\/uploads\/READ_TEXT_INVOICE_02.png\"><img loading=\"lazy\" decoding=\"async\" data-attachment-id=\"1565\" data-permalink=\"https:\/\/oprsteny.cz\/?attachment_id=1565\" data-orig-file=\"https:\/\/oprsteny.cz\/wp-content\/uploads\/READ_TEXT_INVOICE_02.png\" data-orig-size=\"721,225\" 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=\"Invoice header texts\" data-image-description=\"\" data-image-caption=\"\" data-large-file=\"https:\/\/oprsteny.cz\/wp-content\/uploads\/READ_TEXT_INVOICE_02.png\" class=\"size-medium wp-image-1565 alignnone\" src=\"http:\/\/oprsteny.cz\/wp-content\/uploads\/READ_TEXT_INVOICE_02-300x94.png\" alt=\"Invoice header texts\" width=\"300\" height=\"94\" srcset=\"https:\/\/oprsteny.cz\/wp-content\/uploads\/READ_TEXT_INVOICE_02-300x94.png 300w, https:\/\/oprsteny.cz\/wp-content\/uploads\/READ_TEXT_INVOICE_02-500x156.png 500w, https:\/\/oprsteny.cz\/wp-content\/uploads\/READ_TEXT_INVOICE_02.png 721w\" sizes=\"auto, (max-width: 300px) 100vw, 300px\" \/><\/a><\/p>\n<p>To display the ID corresponding to their respective texts, press the &#8220;Display log&#8221; icon.<\/p>\n<p><a href=\"http:\/\/oprsteny.cz\/wp-content\/uploads\/READ_TEXT_INVOICE_03.png\"><img loading=\"lazy\" decoding=\"async\" data-attachment-id=\"1566\" data-permalink=\"https:\/\/oprsteny.cz\/?attachment_id=1566\" data-orig-file=\"https:\/\/oprsteny.cz\/wp-content\/uploads\/READ_TEXT_INVOICE_03.png\" data-orig-size=\"628,277\" 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=\"Invoice texts ID&amp;#8217;s\" data-image-description=\"\" data-image-caption=\"\" data-large-file=\"https:\/\/oprsteny.cz\/wp-content\/uploads\/READ_TEXT_INVOICE_03.png\" class=\"size-medium wp-image-1566 alignnone\" src=\"http:\/\/oprsteny.cz\/wp-content\/uploads\/READ_TEXT_INVOICE_03-300x132.png\" alt=\"Invoice texts ID's\" width=\"300\" height=\"132\" srcset=\"https:\/\/oprsteny.cz\/wp-content\/uploads\/READ_TEXT_INVOICE_03-300x132.png 300w, https:\/\/oprsteny.cz\/wp-content\/uploads\/READ_TEXT_INVOICE_03-500x221.png 500w, https:\/\/oprsteny.cz\/wp-content\/uploads\/READ_TEXT_INVOICE_03.png 628w\" sizes=\"auto, (max-width: 300px) 100vw, 300px\" \/><\/a><\/p>\n<p>Here you can see all the avaiable text ID&#8217;s in the invoice. Pick the ID you need (in our case <em>0014<\/em>) to read and use it in the READ_TEXT function module call.<\/p>\n<pre lang=\"abap\">  DATA: \r\n    lv_lang  TYPE sy-langu   VALUE 'D',   \" german texts\r\n    lv_vbeln TYPE vbrk-vbeln VALUE '70000419',\r\n    lt_lines TYPE tline_t,\r\n    lv_header_text TYPE char255.\r\n\r\n  CALL FUNCTION 'READ_TEXT'\r\n    EXPORTING\r\n*     CLIENT                  = SY-MANDT\r\n      id                      = '0014'\r\n      language                = lv_langu\r\n      name                    = CONV tdobname( lv_vbeln )\r\n      object                  = 'VBBK'\r\n    TABLES\r\n      lines                   = lt_lines\r\n    EXCEPTIONS\r\n      id                      = 1\r\n      language                = 2\r\n      name                    = 3\r\n      not_found               = 4\r\n      object                  = 5\r\n      reference_check         = 6\r\n      wrong_access_to_archive = 7\r\n      OTHERS                  = 8.\r\n  IF sy-subrc = 0.\r\n    LOOP AT lt_lines ASSIGNING FIELD-SYMBOL(&lt;ls_line&gt;).\r\n      AT FIRST.\r\n        lv_header_text = |{ &lt;ls_line&gt;-tdline }|.\r\n        CONTINUE.\r\n      ENDAT.\r\n\r\n      lv_header_text = |{ lv_header_text } { &lt;ls_line&gt;-tdline }|.\r\n    ENDLOOP.\r\n  ENDIF.\r\n\r\n  WRITE lv_header_text.<\/pre>\n<p>If the text is found, the result is returned in the TABLES parameter <em>lines<\/em>.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>If you need to read a text out of an invoice, you use standard function module READ_TEXT.\u00a0But it might be a challenge to identify the correct input parameters for this FM as invoice can contain quite a lot of texts.<\/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,484],"tags":[485,486],"class_list":["post-1563","post","type-post","status-publish","format-standard","hentry","category-abap","category-finance","tag-read_text","tag-vf03"],"jetpack_publicize_connections":[],"jetpack_featured_media_url":"","jetpack_sharing_enabled":true,"jetpack_shortlink":"https:\/\/wp.me\/p3nYbe-pd","jetpack-related-posts":[],"_links":{"self":[{"href":"https:\/\/oprsteny.cz\/index.php?rest_route=\/wp\/v2\/posts\/1563","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=1563"}],"version-history":[{"count":1,"href":"https:\/\/oprsteny.cz\/index.php?rest_route=\/wp\/v2\/posts\/1563\/revisions"}],"predecessor-version":[{"id":1567,"href":"https:\/\/oprsteny.cz\/index.php?rest_route=\/wp\/v2\/posts\/1563\/revisions\/1567"}],"wp:attachment":[{"href":"https:\/\/oprsteny.cz\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=1563"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/oprsteny.cz\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=1563"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/oprsteny.cz\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=1563"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}