{"id":13698967,"url":"https://github.com/victorizbitskiy/zspool_pdf","last_synced_at":"2025-03-18T22:31:21.595Z","repository":{"id":51354556,"uuid":"365030484","full_name":"victorizbitskiy/zspool_pdf","owner":"victorizbitskiy","description":"Submitting a report to the spool and receiving PDF","archived":false,"fork":false,"pushed_at":"2025-02-14T20:05:39.000Z","size":159,"stargazers_count":19,"open_issues_count":0,"forks_count":5,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-17T00:34:01.104Z","etag":null,"topics":["abap","pdf","spool"],"latest_commit_sha":null,"homepage":"","language":"ABAP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/victorizbitskiy.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null}},"created_at":"2021-05-06T20:32:18.000Z","updated_at":"2025-02-14T20:13:28.000Z","dependencies_parsed_at":"2024-04-08T03:09:09.537Z","dependency_job_id":"829f1541-ad8a-42e1-b0b9-64abd8af036b","html_url":"https://github.com/victorizbitskiy/zspool_pdf","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/victorizbitskiy%2Fzspool_pdf","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/victorizbitskiy%2Fzspool_pdf/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/victorizbitskiy%2Fzspool_pdf/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/victorizbitskiy%2Fzspool_pdf/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/victorizbitskiy","download_url":"https://codeload.github.com/victorizbitskiy/zspool_pdf/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244318634,"owners_count":20433947,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["abap","pdf","spool"],"created_at":"2024-08-02T19:00:55.350Z","updated_at":"2025-03-18T22:31:21.365Z","avatar_url":"https://github.com/victorizbitskiy.png","language":"ABAP","funding_links":[],"categories":["Categories"],"sub_categories":["🧰 Generic Utilities"],"readme":"\u003cimg src=\"https://github.com/victorizbitskiy/zspool_pdf/blob/main/logo/logo.svg\" height=\"100px\"/\u003e\n\n[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://github.com/victorizbitskiy/zspool_pdf/blob/main/LICENSE)\n![ABAP 7.40sp08+](https://img.shields.io/badge/ABAP-7.40sp08+-brightgreen)\n[![Code Statistics](https://img.shields.io/badge/CodeStatistics-abaplint-blue)](https://abaplint.app/stats/victorizbitskiy/zspool_pdf)\n\nTranslations:\n- [:ru: На русском языке](https://github.com/victorizbitskiy/zspool_pdf/tree/main/translations/ru) \n\n## `SAP Spool PDF`\n\nSubmitting a report to the spool and receiving PDF.\n\n# Table of contents\n1. [What it is?](#what-it-is)\n2. [What is this for?](#what-is-this-for)\n3. [Installation](#installation)\n4. [Using](#using)\n5. [Diagrams](#diagrams)\n6. [How to contribute](#how-to-contribute)\n7. [Got questions](#Got-questions)\n8. [Logo](#logo)\n\n## What it is?\n\n`SAP Spool PDF` is a few classes to help you submit a report to spool and get PDF file easily.\n\n## What is this for?\n\nIt is often necessary to get a PDF in *xstring* or *binary* format. To do this, you can send a report to the sap-spool (in the background), and then read PDF by the spool ID. This way of getting the file is more preferable, because there is no need to do the enhancement in standard code.\n\nThe **cl_bp_abap_job** class exists in ABAP to run reports in the background. But this class only supports passing report parameters via variant (let me know if I'm wrong).\nThis is not always convenient, since a variant must either be created before the report is run, or it must be created at runtime.  \n\n`SAP Spool PDF` allows you to run any report generating PDF in the background. Report parameters can be passed directly and/or via a variant.  \n\nThe laconic API allows you to literally get a file in the form of *xstring* in one line, save, show, or send it.\n\n## Installation\n\nInstallation is done with [abapGit](http://www.abapgit.org).\n\n## Using\n\n\u003cdetails open\u003e\n\u003cbase target=\"_blank\"\u003e\n\u003csummary\u003eExample\u003c/summary\u003e\n   \n```abap\n   TYPES ty_pernr TYPE n LENGTH 8.\n    DATA lt_pernr TYPE RANGE OF ty_pernr.\n\n    \" This is an example of generating a 2-NDFL certificate (HCM module).\n    \" All PDF documents will be merged into one.\n\n    DATA(lv_year) = '2021'.\n    lt_pernr = VALUE #( sign = 'I' option = 'EQ' ( low = 00000001 ) ).\n    DATA(lv_filename) = `C:\\TEMP\\spdf_merged_test.pdf`.\n\n    TRY.\n        DATA(lo_report) = NEW zcl_spdf_report( iv_name    = 'HRULNDFL'\n                                               iv_variant = 'T1' ).\n\n        lo_report-\u003eadd_param( iv_name = 'PNPPERNR'\n                              ia_data = lt_pernr ).\n\n        lo_report-\u003eadd_param( iv_name = 'P_YEAR'\n                              ia_data = lv_year ).\n\n        \" Cases:\n        \" 1) Getting xstring\n        DATA(lv_pdf) = lo_report-\u003esubmit_to_sap_spool( )-\u003eget_merged_pdf( )-\u003eto_xstring( ).\n        \n        \" 2) Save and show PDF\n        lo_report-\u003eget_merged_pdf( )-\u003esave_local( lv_filename )-\u003eshow( ).\n   \n        \" 3) Send email\n        lo_report-\u003eget_merged_pdf( )-\u003esend( iv_email    = 'test@test.com'\n                                            iv_filename = lv_filename\n                                            iv_subject  = 'This is an email with a PDF attachment' ).\n      CATCH zcx_spdf_exception\n            cx_rspo_spoolid_to_pdf INTO DATA(lx_e).\n        WRITE lx_e-\u003eget_text( ).\n    ENDTRY.\n```\n\u003c/details\u003e\n\n## Diagrams\n\u003cdetails open\u003e\n  \u003csummary\u003eUML Class Diagram\u003c/summary\u003e\n   \u003cp\u003e\u003ca target=\"_blank\" rel=\"noopener noreferrer\" href=\"https://github.com/victorizbitskiy/zspool_pdf/blob/main/docs/img/Class%20Diagram.svg\"\u003e\u003cimg src=\"https://github.com/victorizbitskiy/zspool_pdf/blob/main/docs/img/Class%20Diagram.svg\" alt=\"UML Class Diagram\" style=\"max-width:100%;\"\u003e\u003c/a\u003e\u003c/p\u003e\n\u003c/details\u003e\n\n## How to contribute\n[This instruction](https://docs.abapgit.org/guide-contributing.html) will help you.\n  \n## Got questions?\nIf you have questions or general suggestions, don't hesitate to submit a new [(GitHub issue)](https://github.com/victorizbitskiy/zspool_pdf/issues/new).\n  \n## Logo\nProject logo \u003ca href=\"https://www.flaticon.com/ru/authors/pixel-buddha\"\u003edesigned by pixel-buddha\u003c/a\u003e\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvictorizbitskiy%2Fzspool_pdf","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fvictorizbitskiy%2Fzspool_pdf","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvictorizbitskiy%2Fzspool_pdf/lists"}