├── .abapgit.xml ├── LICENSE ├── README.md └── code ├── dummy.txt ├── package.devc.xml ├── zcl_stralv_constants.clas.abap ├── zcl_stralv_constants.clas.xml ├── zcl_stralv_field.clas.abap ├── zcl_stralv_field.clas.locals_def.abap ├── zcl_stralv_field.clas.xml ├── zcl_stralv_fields.clas.abap ├── zcl_stralv_fields.clas.locals_def.abap ├── zcl_stralv_fields.clas.xml ├── zcl_stralv_main.clas.abap ├── zcl_stralv_main.clas.locals_def.abap ├── zcl_stralv_main.clas.macros.abap ├── zcl_stralv_main.clas.xml ├── zcl_stralv_output_table.clas.abap ├── zcl_stralv_output_table.clas.locals_def.abap ├── zcl_stralv_output_table.clas.macros.abap ├── zcl_stralv_output_table.clas.xml ├── zcl_stralv_settings.clas.abap ├── zcl_stralv_settings.clas.xml ├── zcl_stralv_types.clas.abap ├── zcl_stralv_types.clas.xml ├── zcx_stralv_data_create.clas.abap ├── zcx_stralv_data_create.clas.xml ├── zcx_stralv_error.clas.abap ├── zcx_stralv_error.clas.xml ├── zcx_stralv_input_error.clas.abap ├── zcx_stralv_input_error.clas.xml ├── zcx_stralv_invalid_para.clas.abap ├── zcx_stralv_invalid_para.clas.xml ├── zcx_stralv_not_initialized.clas.abap ├── zcx_stralv_not_initialized.clas.xml ├── zcx_stralv_program_error.clas.abap ├── zcx_stralv_program_error.clas.xml ├── zcx_stralv_too_many_lines.clas.abap ├── zcx_stralv_too_many_lines.clas.xml ├── zcx_stralv_unknown_field.clas.abap ├── zcx_stralv_unknown_field.clas.xml ├── zif_stralv_main.intf.abap ├── zif_stralv_main.intf.xml ├── zst_stralv_demo.tabl.xml ├── zst_stralv_tab_line.tabl.xml ├── zstralv_demo01.prog.abap ├── zstralv_demo01.prog.xml ├── zstralv_demo02.prog.abap ├── zstralv_demo02.prog.xml ├── zstralv_demo03.prog.abap ├── zstralv_demo03.prog.xml ├── zstralv_demo04.prog.abap ├── zstralv_demo04.prog.xml ├── zstralv_demo05.prog.abap └── zstralv_demo05.prog.xml /.abapgit.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | E 6 | /code/ 7 | PREFIX 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | GNU GENERAL PUBLIC LICENSE 2 | Version 3, 29 June 2007 3 | 4 | Copyright (C) 2007 Free Software Foundation, Inc. 5 | Everyone is permitted to copy and distribute verbatim copies 6 | of this license document, but changing it is not allowed. 7 | 8 | Preamble 9 | 10 | The GNU General Public License is a free, copyleft license for 11 | software and other kinds of works. 12 | 13 | The licenses for most software and other practical works are designed 14 | to take away your freedom to share and change the works. By contrast, 15 | the GNU General Public License is intended to guarantee your freedom to 16 | share and change all versions of a program--to make sure it remains free 17 | software for all its users. We, the Free Software Foundation, use the 18 | GNU General Public License for most of our software; it applies also to 19 | any other work released this way by its authors. You can apply it to 20 | your programs, too. 21 | 22 | When we speak of free software, we are referring to freedom, not 23 | price. Our General Public Licenses are designed to make sure that you 24 | have the freedom to distribute copies of free software (and charge for 25 | them if you wish), that you receive source code or can get it if you 26 | want it, that you can change the software or use pieces of it in new 27 | free programs, and that you know you can do these things. 28 | 29 | To protect your rights, we need to prevent others from denying you 30 | these rights or asking you to surrender the rights. Therefore, you have 31 | certain responsibilities if you distribute copies of the software, or if 32 | you modify it: responsibilities to respect the freedom of others. 33 | 34 | For example, if you distribute copies of such a program, whether 35 | gratis or for a fee, you must pass on to the recipients the same 36 | freedoms that you received. You must make sure that they, too, receive 37 | or can get the source code. And you must show them these terms so they 38 | know their rights. 39 | 40 | Developers that use the GNU GPL protect your rights with two steps: 41 | (1) assert copyright on the software, and (2) offer you this License 42 | giving you legal permission to copy, distribute and/or modify it. 43 | 44 | For the developers' and authors' protection, the GPL clearly explains 45 | that there is no warranty for this free software. For both users' and 46 | authors' sake, the GPL requires that modified versions be marked as 47 | changed, so that their problems will not be attributed erroneously to 48 | authors of previous versions. 49 | 50 | Some devices are designed to deny users access to install or run 51 | modified versions of the software inside them, although the manufacturer 52 | can do so. This is fundamentally incompatible with the aim of 53 | protecting users' freedom to change the software. The systematic 54 | pattern of such abuse occurs in the area of products for individuals to 55 | use, which is precisely where it is most unacceptable. Therefore, we 56 | have designed this version of the GPL to prohibit the practice for those 57 | products. If such problems arise substantially in other domains, we 58 | stand ready to extend this provision to those domains in future versions 59 | of the GPL, as needed to protect the freedom of users. 60 | 61 | Finally, every program is threatened constantly by software patents. 62 | States should not allow patents to restrict development and use of 63 | software on general-purpose computers, but in those that do, we wish to 64 | avoid the special danger that patents applied to a free program could 65 | make it effectively proprietary. To prevent this, the GPL assures that 66 | patents cannot be used to render the program non-free. 67 | 68 | The precise terms and conditions for copying, distribution and 69 | modification follow. 70 | 71 | TERMS AND CONDITIONS 72 | 73 | 0. Definitions. 74 | 75 | "This License" refers to version 3 of the GNU General Public License. 76 | 77 | "Copyright" also means copyright-like laws that apply to other kinds of 78 | works, such as semiconductor masks. 79 | 80 | "The Program" refers to any copyrightable work licensed under this 81 | License. Each licensee is addressed as "you". "Licensees" and 82 | "recipients" may be individuals or organizations. 83 | 84 | To "modify" a work means to copy from or adapt all or part of the work 85 | in a fashion requiring copyright permission, other than the making of an 86 | exact copy. The resulting work is called a "modified version" of the 87 | earlier work or a work "based on" the earlier work. 88 | 89 | A "covered work" means either the unmodified Program or a work based 90 | on the Program. 91 | 92 | To "propagate" a work means to do anything with it that, without 93 | permission, would make you directly or secondarily liable for 94 | infringement under applicable copyright law, except executing it on a 95 | computer or modifying a private copy. Propagation includes copying, 96 | distribution (with or without modification), making available to the 97 | public, and in some countries other activities as well. 98 | 99 | To "convey" a work means any kind of propagation that enables other 100 | parties to make or receive copies. Mere interaction with a user through 101 | a computer network, with no transfer of a copy, is not conveying. 102 | 103 | An interactive user interface displays "Appropriate Legal Notices" 104 | to the extent that it includes a convenient and prominently visible 105 | feature that (1) displays an appropriate copyright notice, and (2) 106 | tells the user that there is no warranty for the work (except to the 107 | extent that warranties are provided), that licensees may convey the 108 | work under this License, and how to view a copy of this License. If 109 | the interface presents a list of user commands or options, such as a 110 | menu, a prominent item in the list meets this criterion. 111 | 112 | 1. Source Code. 113 | 114 | The "source code" for a work means the preferred form of the work 115 | for making modifications to it. "Object code" means any non-source 116 | form of a work. 117 | 118 | A "Standard Interface" means an interface that either is an official 119 | standard defined by a recognized standards body, or, in the case of 120 | interfaces specified for a particular programming language, one that 121 | is widely used among developers working in that language. 122 | 123 | The "System Libraries" of an executable work include anything, other 124 | than the work as a whole, that (a) is included in the normal form of 125 | packaging a Major Component, but which is not part of that Major 126 | Component, and (b) serves only to enable use of the work with that 127 | Major Component, or to implement a Standard Interface for which an 128 | implementation is available to the public in source code form. A 129 | "Major Component", in this context, means a major essential component 130 | (kernel, window system, and so on) of the specific operating system 131 | (if any) on which the executable work runs, or a compiler used to 132 | produce the work, or an object code interpreter used to run it. 133 | 134 | The "Corresponding Source" for a work in object code form means all 135 | the source code needed to generate, install, and (for an executable 136 | work) run the object code and to modify the work, including scripts to 137 | control those activities. However, it does not include the work's 138 | System Libraries, or general-purpose tools or generally available free 139 | programs which are used unmodified in performing those activities but 140 | which are not part of the work. For example, Corresponding Source 141 | includes interface definition files associated with source files for 142 | the work, and the source code for shared libraries and dynamically 143 | linked subprograms that the work is specifically designed to require, 144 | such as by intimate data communication or control flow between those 145 | subprograms and other parts of the work. 146 | 147 | The Corresponding Source need not include anything that users 148 | can regenerate automatically from other parts of the Corresponding 149 | Source. 150 | 151 | The Corresponding Source for a work in source code form is that 152 | same work. 153 | 154 | 2. Basic Permissions. 155 | 156 | All rights granted under this License are granted for the term of 157 | copyright on the Program, and are irrevocable provided the stated 158 | conditions are met. This License explicitly affirms your unlimited 159 | permission to run the unmodified Program. The output from running a 160 | covered work is covered by this License only if the output, given its 161 | content, constitutes a covered work. This License acknowledges your 162 | rights of fair use or other equivalent, as provided by copyright law. 163 | 164 | You may make, run and propagate covered works that you do not 165 | convey, without conditions so long as your license otherwise remains 166 | in force. You may convey covered works to others for the sole purpose 167 | of having them make modifications exclusively for you, or provide you 168 | with facilities for running those works, provided that you comply with 169 | the terms of this License in conveying all material for which you do 170 | not control copyright. Those thus making or running the covered works 171 | for you must do so exclusively on your behalf, under your direction 172 | and control, on terms that prohibit them from making any copies of 173 | your copyrighted material outside their relationship with you. 174 | 175 | Conveying under any other circumstances is permitted solely under 176 | the conditions stated below. Sublicensing is not allowed; section 10 177 | makes it unnecessary. 178 | 179 | 3. Protecting Users' Legal Rights From Anti-Circumvention Law. 180 | 181 | No covered work shall be deemed part of an effective technological 182 | measure under any applicable law fulfilling obligations under article 183 | 11 of the WIPO copyright treaty adopted on 20 December 1996, or 184 | similar laws prohibiting or restricting circumvention of such 185 | measures. 186 | 187 | When you convey a covered work, you waive any legal power to forbid 188 | circumvention of technological measures to the extent such circumvention 189 | is effected by exercising rights under this License with respect to 190 | the covered work, and you disclaim any intention to limit operation or 191 | modification of the work as a means of enforcing, against the work's 192 | users, your or third parties' legal rights to forbid circumvention of 193 | technological measures. 194 | 195 | 4. Conveying Verbatim Copies. 196 | 197 | You may convey verbatim copies of the Program's source code as you 198 | receive it, in any medium, provided that you conspicuously and 199 | appropriately publish on each copy an appropriate copyright notice; 200 | keep intact all notices stating that this License and any 201 | non-permissive terms added in accord with section 7 apply to the code; 202 | keep intact all notices of the absence of any warranty; and give all 203 | recipients a copy of this License along with the Program. 204 | 205 | You may charge any price or no price for each copy that you convey, 206 | and you may offer support or warranty protection for a fee. 207 | 208 | 5. Conveying Modified Source Versions. 209 | 210 | You may convey a work based on the Program, or the modifications to 211 | produce it from the Program, in the form of source code under the 212 | terms of section 4, provided that you also meet all of these conditions: 213 | 214 | a) The work must carry prominent notices stating that you modified 215 | it, and giving a relevant date. 216 | 217 | b) The work must carry prominent notices stating that it is 218 | released under this License and any conditions added under section 219 | 7. This requirement modifies the requirement in section 4 to 220 | "keep intact all notices". 221 | 222 | c) You must license the entire work, as a whole, under this 223 | License to anyone who comes into possession of a copy. This 224 | License will therefore apply, along with any applicable section 7 225 | additional terms, to the whole of the work, and all its parts, 226 | regardless of how they are packaged. This License gives no 227 | permission to license the work in any other way, but it does not 228 | invalidate such permission if you have separately received it. 229 | 230 | d) If the work has interactive user interfaces, each must display 231 | Appropriate Legal Notices; however, if the Program has interactive 232 | interfaces that do not display Appropriate Legal Notices, your 233 | work need not make them do so. 234 | 235 | A compilation of a covered work with other separate and independent 236 | works, which are not by their nature extensions of the covered work, 237 | and which are not combined with it such as to form a larger program, 238 | in or on a volume of a storage or distribution medium, is called an 239 | "aggregate" if the compilation and its resulting copyright are not 240 | used to limit the access or legal rights of the compilation's users 241 | beyond what the individual works permit. Inclusion of a covered work 242 | in an aggregate does not cause this License to apply to the other 243 | parts of the aggregate. 244 | 245 | 6. Conveying Non-Source Forms. 246 | 247 | You may convey a covered work in object code form under the terms 248 | of sections 4 and 5, provided that you also convey the 249 | machine-readable Corresponding Source under the terms of this License, 250 | in one of these ways: 251 | 252 | a) Convey the object code in, or embodied in, a physical product 253 | (including a physical distribution medium), accompanied by the 254 | Corresponding Source fixed on a durable physical medium 255 | customarily used for software interchange. 256 | 257 | b) Convey the object code in, or embodied in, a physical product 258 | (including a physical distribution medium), accompanied by a 259 | written offer, valid for at least three years and valid for as 260 | long as you offer spare parts or customer support for that product 261 | model, to give anyone who possesses the object code either (1) a 262 | copy of the Corresponding Source for all the software in the 263 | product that is covered by this License, on a durable physical 264 | medium customarily used for software interchange, for a price no 265 | more than your reasonable cost of physically performing this 266 | conveying of source, or (2) access to copy the 267 | Corresponding Source from a network server at no charge. 268 | 269 | c) Convey individual copies of the object code with a copy of the 270 | written offer to provide the Corresponding Source. This 271 | alternative is allowed only occasionally and noncommercially, and 272 | only if you received the object code with such an offer, in accord 273 | with subsection 6b. 274 | 275 | d) Convey the object code by offering access from a designated 276 | place (gratis or for a charge), and offer equivalent access to the 277 | Corresponding Source in the same way through the same place at no 278 | further charge. You need not require recipients to copy the 279 | Corresponding Source along with the object code. If the place to 280 | copy the object code is a network server, the Corresponding Source 281 | may be on a different server (operated by you or a third party) 282 | that supports equivalent copying facilities, provided you maintain 283 | clear directions next to the object code saying where to find the 284 | Corresponding Source. Regardless of what server hosts the 285 | Corresponding Source, you remain obligated to ensure that it is 286 | available for as long as needed to satisfy these requirements. 287 | 288 | e) Convey the object code using peer-to-peer transmission, provided 289 | you inform other peers where the object code and Corresponding 290 | Source of the work are being offered to the general public at no 291 | charge under subsection 6d. 292 | 293 | A separable portion of the object code, whose source code is excluded 294 | from the Corresponding Source as a System Library, need not be 295 | included in conveying the object code work. 296 | 297 | A "User Product" is either (1) a "consumer product", which means any 298 | tangible personal property which is normally used for personal, family, 299 | or household purposes, or (2) anything designed or sold for incorporation 300 | into a dwelling. In determining whether a product is a consumer product, 301 | doubtful cases shall be resolved in favor of coverage. For a particular 302 | product received by a particular user, "normally used" refers to a 303 | typical or common use of that class of product, regardless of the status 304 | of the particular user or of the way in which the particular user 305 | actually uses, or expects or is expected to use, the product. A product 306 | is a consumer product regardless of whether the product has substantial 307 | commercial, industrial or non-consumer uses, unless such uses represent 308 | the only significant mode of use of the product. 309 | 310 | "Installation Information" for a User Product means any methods, 311 | procedures, authorization keys, or other information required to install 312 | and execute modified versions of a covered work in that User Product from 313 | a modified version of its Corresponding Source. The information must 314 | suffice to ensure that the continued functioning of the modified object 315 | code is in no case prevented or interfered with solely because 316 | modification has been made. 317 | 318 | If you convey an object code work under this section in, or with, or 319 | specifically for use in, a User Product, and the conveying occurs as 320 | part of a transaction in which the right of possession and use of the 321 | User Product is transferred to the recipient in perpetuity or for a 322 | fixed term (regardless of how the transaction is characterized), the 323 | Corresponding Source conveyed under this section must be accompanied 324 | by the Installation Information. But this requirement does not apply 325 | if neither you nor any third party retains the ability to install 326 | modified object code on the User Product (for example, the work has 327 | been installed in ROM). 328 | 329 | The requirement to provide Installation Information does not include a 330 | requirement to continue to provide support service, warranty, or updates 331 | for a work that has been modified or installed by the recipient, or for 332 | the User Product in which it has been modified or installed. Access to a 333 | network may be denied when the modification itself materially and 334 | adversely affects the operation of the network or violates the rules and 335 | protocols for communication across the network. 336 | 337 | Corresponding Source conveyed, and Installation Information provided, 338 | in accord with this section must be in a format that is publicly 339 | documented (and with an implementation available to the public in 340 | source code form), and must require no special password or key for 341 | unpacking, reading or copying. 342 | 343 | 7. Additional Terms. 344 | 345 | "Additional permissions" are terms that supplement the terms of this 346 | License by making exceptions from one or more of its conditions. 347 | Additional permissions that are applicable to the entire Program shall 348 | be treated as though they were included in this License, to the extent 349 | that they are valid under applicable law. If additional permissions 350 | apply only to part of the Program, that part may be used separately 351 | under those permissions, but the entire Program remains governed by 352 | this License without regard to the additional permissions. 353 | 354 | When you convey a copy of a covered work, you may at your option 355 | remove any additional permissions from that copy, or from any part of 356 | it. (Additional permissions may be written to require their own 357 | removal in certain cases when you modify the work.) You may place 358 | additional permissions on material, added by you to a covered work, 359 | for which you have or can give appropriate copyright permission. 360 | 361 | Notwithstanding any other provision of this License, for material you 362 | add to a covered work, you may (if authorized by the copyright holders of 363 | that material) supplement the terms of this License with terms: 364 | 365 | a) Disclaiming warranty or limiting liability differently from the 366 | terms of sections 15 and 16 of this License; or 367 | 368 | b) Requiring preservation of specified reasonable legal notices or 369 | author attributions in that material or in the Appropriate Legal 370 | Notices displayed by works containing it; or 371 | 372 | c) Prohibiting misrepresentation of the origin of that material, or 373 | requiring that modified versions of such material be marked in 374 | reasonable ways as different from the original version; or 375 | 376 | d) Limiting the use for publicity purposes of names of licensors or 377 | authors of the material; or 378 | 379 | e) Declining to grant rights under trademark law for use of some 380 | trade names, trademarks, or service marks; or 381 | 382 | f) Requiring indemnification of licensors and authors of that 383 | material by anyone who conveys the material (or modified versions of 384 | it) with contractual assumptions of liability to the recipient, for 385 | any liability that these contractual assumptions directly impose on 386 | those licensors and authors. 387 | 388 | All other non-permissive additional terms are considered "further 389 | restrictions" within the meaning of section 10. If the Program as you 390 | received it, or any part of it, contains a notice stating that it is 391 | governed by this License along with a term that is a further 392 | restriction, you may remove that term. If a license document contains 393 | a further restriction but permits relicensing or conveying under this 394 | License, you may add to a covered work material governed by the terms 395 | of that license document, provided that the further restriction does 396 | not survive such relicensing or conveying. 397 | 398 | If you add terms to a covered work in accord with this section, you 399 | must place, in the relevant source files, a statement of the 400 | additional terms that apply to those files, or a notice indicating 401 | where to find the applicable terms. 402 | 403 | Additional terms, permissive or non-permissive, may be stated in the 404 | form of a separately written license, or stated as exceptions; 405 | the above requirements apply either way. 406 | 407 | 8. Termination. 408 | 409 | You may not propagate or modify a covered work except as expressly 410 | provided under this License. Any attempt otherwise to propagate or 411 | modify it is void, and will automatically terminate your rights under 412 | this License (including any patent licenses granted under the third 413 | paragraph of section 11). 414 | 415 | However, if you cease all violation of this License, then your 416 | license from a particular copyright holder is reinstated (a) 417 | provisionally, unless and until the copyright holder explicitly and 418 | finally terminates your license, and (b) permanently, if the copyright 419 | holder fails to notify you of the violation by some reasonable means 420 | prior to 60 days after the cessation. 421 | 422 | Moreover, your license from a particular copyright holder is 423 | reinstated permanently if the copyright holder notifies you of the 424 | violation by some reasonable means, this is the first time you have 425 | received notice of violation of this License (for any work) from that 426 | copyright holder, and you cure the violation prior to 30 days after 427 | your receipt of the notice. 428 | 429 | Termination of your rights under this section does not terminate the 430 | licenses of parties who have received copies or rights from you under 431 | this License. If your rights have been terminated and not permanently 432 | reinstated, you do not qualify to receive new licenses for the same 433 | material under section 10. 434 | 435 | 9. Acceptance Not Required for Having Copies. 436 | 437 | You are not required to accept this License in order to receive or 438 | run a copy of the Program. Ancillary propagation of a covered work 439 | occurring solely as a consequence of using peer-to-peer transmission 440 | to receive a copy likewise does not require acceptance. However, 441 | nothing other than this License grants you permission to propagate or 442 | modify any covered work. These actions infringe copyright if you do 443 | not accept this License. Therefore, by modifying or propagating a 444 | covered work, you indicate your acceptance of this License to do so. 445 | 446 | 10. Automatic Licensing of Downstream Recipients. 447 | 448 | Each time you convey a covered work, the recipient automatically 449 | receives a license from the original licensors, to run, modify and 450 | propagate that work, subject to this License. You are not responsible 451 | for enforcing compliance by third parties with this License. 452 | 453 | An "entity transaction" is a transaction transferring control of an 454 | organization, or substantially all assets of one, or subdividing an 455 | organization, or merging organizations. If propagation of a covered 456 | work results from an entity transaction, each party to that 457 | transaction who receives a copy of the work also receives whatever 458 | licenses to the work the party's predecessor in interest had or could 459 | give under the previous paragraph, plus a right to possession of the 460 | Corresponding Source of the work from the predecessor in interest, if 461 | the predecessor has it or can get it with reasonable efforts. 462 | 463 | You may not impose any further restrictions on the exercise of the 464 | rights granted or affirmed under this License. For example, you may 465 | not impose a license fee, royalty, or other charge for exercise of 466 | rights granted under this License, and you may not initiate litigation 467 | (including a cross-claim or counterclaim in a lawsuit) alleging that 468 | any patent claim is infringed by making, using, selling, offering for 469 | sale, or importing the Program or any portion of it. 470 | 471 | 11. Patents. 472 | 473 | A "contributor" is a copyright holder who authorizes use under this 474 | License of the Program or a work on which the Program is based. The 475 | work thus licensed is called the contributor's "contributor version". 476 | 477 | A contributor's "essential patent claims" are all patent claims 478 | owned or controlled by the contributor, whether already acquired or 479 | hereafter acquired, that would be infringed by some manner, permitted 480 | by this License, of making, using, or selling its contributor version, 481 | but do not include claims that would be infringed only as a 482 | consequence of further modification of the contributor version. For 483 | purposes of this definition, "control" includes the right to grant 484 | patent sublicenses in a manner consistent with the requirements of 485 | this License. 486 | 487 | Each contributor grants you a non-exclusive, worldwide, royalty-free 488 | patent license under the contributor's essential patent claims, to 489 | make, use, sell, offer for sale, import and otherwise run, modify and 490 | propagate the contents of its contributor version. 491 | 492 | In the following three paragraphs, a "patent license" is any express 493 | agreement or commitment, however denominated, not to enforce a patent 494 | (such as an express permission to practice a patent or covenant not to 495 | sue for patent infringement). To "grant" such a patent license to a 496 | party means to make such an agreement or commitment not to enforce a 497 | patent against the party. 498 | 499 | If you convey a covered work, knowingly relying on a patent license, 500 | and the Corresponding Source of the work is not available for anyone 501 | to copy, free of charge and under the terms of this License, through a 502 | publicly available network server or other readily accessible means, 503 | then you must either (1) cause the Corresponding Source to be so 504 | available, or (2) arrange to deprive yourself of the benefit of the 505 | patent license for this particular work, or (3) arrange, in a manner 506 | consistent with the requirements of this License, to extend the patent 507 | license to downstream recipients. "Knowingly relying" means you have 508 | actual knowledge that, but for the patent license, your conveying the 509 | covered work in a country, or your recipient's use of the covered work 510 | in a country, would infringe one or more identifiable patents in that 511 | country that you have reason to believe are valid. 512 | 513 | If, pursuant to or in connection with a single transaction or 514 | arrangement, you convey, or propagate by procuring conveyance of, a 515 | covered work, and grant a patent license to some of the parties 516 | receiving the covered work authorizing them to use, propagate, modify 517 | or convey a specific copy of the covered work, then the patent license 518 | you grant is automatically extended to all recipients of the covered 519 | work and works based on it. 520 | 521 | A patent license is "discriminatory" if it does not include within 522 | the scope of its coverage, prohibits the exercise of, or is 523 | conditioned on the non-exercise of one or more of the rights that are 524 | specifically granted under this License. You may not convey a covered 525 | work if you are a party to an arrangement with a third party that is 526 | in the business of distributing software, under which you make payment 527 | to the third party based on the extent of your activity of conveying 528 | the work, and under which the third party grants, to any of the 529 | parties who would receive the covered work from you, a discriminatory 530 | patent license (a) in connection with copies of the covered work 531 | conveyed by you (or copies made from those copies), or (b) primarily 532 | for and in connection with specific products or compilations that 533 | contain the covered work, unless you entered into that arrangement, 534 | or that patent license was granted, prior to 28 March 2007. 535 | 536 | Nothing in this License shall be construed as excluding or limiting 537 | any implied license or other defenses to infringement that may 538 | otherwise be available to you under applicable patent law. 539 | 540 | 12. No Surrender of Others' Freedom. 541 | 542 | If conditions are imposed on you (whether by court order, agreement or 543 | otherwise) that contradict the conditions of this License, they do not 544 | excuse you from the conditions of this License. If you cannot convey a 545 | covered work so as to satisfy simultaneously your obligations under this 546 | License and any other pertinent obligations, then as a consequence you may 547 | not convey it at all. For example, if you agree to terms that obligate you 548 | to collect a royalty for further conveying from those to whom you convey 549 | the Program, the only way you could satisfy both those terms and this 550 | License would be to refrain entirely from conveying the Program. 551 | 552 | 13. Use with the GNU Affero General Public License. 553 | 554 | Notwithstanding any other provision of this License, you have 555 | permission to link or combine any covered work with a work licensed 556 | under version 3 of the GNU Affero General Public License into a single 557 | combined work, and to convey the resulting work. The terms of this 558 | License will continue to apply to the part which is the covered work, 559 | but the special requirements of the GNU Affero General Public License, 560 | section 13, concerning interaction through a network will apply to the 561 | combination as such. 562 | 563 | 14. Revised Versions of this License. 564 | 565 | The Free Software Foundation may publish revised and/or new versions of 566 | the GNU General Public License from time to time. Such new versions will 567 | be similar in spirit to the present version, but may differ in detail to 568 | address new problems or concerns. 569 | 570 | Each version is given a distinguishing version number. If the 571 | Program specifies that a certain numbered version of the GNU General 572 | Public License "or any later version" applies to it, you have the 573 | option of following the terms and conditions either of that numbered 574 | version or of any later version published by the Free Software 575 | Foundation. If the Program does not specify a version number of the 576 | GNU General Public License, you may choose any version ever published 577 | by the Free Software Foundation. 578 | 579 | If the Program specifies that a proxy can decide which future 580 | versions of the GNU General Public License can be used, that proxy's 581 | public statement of acceptance of a version permanently authorizes you 582 | to choose that version for the Program. 583 | 584 | Later license versions may give you additional or different 585 | permissions. However, no additional obligations are imposed on any 586 | author or copyright holder as a result of your choosing to follow a 587 | later version. 588 | 589 | 15. Disclaimer of Warranty. 590 | 591 | THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY 592 | APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT 593 | HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY 594 | OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, 595 | THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 596 | PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM 597 | IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF 598 | ALL NECESSARY SERVICING, REPAIR OR CORRECTION. 599 | 600 | 16. Limitation of Liability. 601 | 602 | IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING 603 | WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS 604 | THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY 605 | GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE 606 | USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF 607 | DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD 608 | PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), 609 | EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF 610 | SUCH DAMAGES. 611 | 612 | 17. Interpretation of Sections 15 and 16. 613 | 614 | If the disclaimer of warranty and limitation of liability provided 615 | above cannot be given local legal effect according to their terms, 616 | reviewing courts shall apply local law that most closely approximates 617 | an absolute waiver of all civil liability in connection with the 618 | Program, unless a warranty or assumption of liability accompanies a 619 | copy of the Program in return for a fee. 620 | 621 | END OF TERMS AND CONDITIONS 622 | 623 | How to Apply These Terms to Your New Programs 624 | 625 | If you develop a new program, and you want it to be of the greatest 626 | possible use to the public, the best way to achieve this is to make it 627 | free software which everyone can redistribute and change under these terms. 628 | 629 | To do so, attach the following notices to the program. It is safest 630 | to attach them to the start of each source file to most effectively 631 | state the exclusion of warranty; and each file should have at least 632 | the "copyright" line and a pointer to where the full notice is found. 633 | 634 | 635 | Copyright (C) 636 | 637 | This program is free software: you can redistribute it and/or modify 638 | it under the terms of the GNU General Public License as published by 639 | the Free Software Foundation, either version 3 of the License, or 640 | (at your option) any later version. 641 | 642 | This program is distributed in the hope that it will be useful, 643 | but WITHOUT ANY WARRANTY; without even the implied warranty of 644 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 645 | GNU General Public License for more details. 646 | 647 | You should have received a copy of the GNU General Public License 648 | along with this program. If not, see . 649 | 650 | Also add information on how to contact you by electronic and paper mail. 651 | 652 | If the program does terminal interaction, make it output a short 653 | notice like this when it starts in an interactive mode: 654 | 655 | Copyright (C) 656 | This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'. 657 | This is free software, and you are welcome to redistribute it 658 | under certain conditions; type `show c' for details. 659 | 660 | The hypothetical commands `show w' and `show c' should show the appropriate 661 | parts of the General Public License. Of course, your program's commands 662 | might be different; for a GUI interface, you would use an "about box". 663 | 664 | You should also get your employer (if you work as a programmer) or school, 665 | if any, to sign a "copyright disclaimer" for the program, if necessary. 666 | For more information on this, and how to apply and follow the GNU GPL, see 667 | . 668 | 669 | The GNU General Public License does not permit incorporating your program 670 | into proprietary programs. If your program is a subroutine library, you 671 | may consider it more useful to permit linking proprietary applications with 672 | the library. If this is what you want to do, use the GNU Lesser General 673 | Public License instead of this License. But first, please read 674 | . 675 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # abap-alv-struc-viewer 2 | ABAP: View and edit fields of a structure in an ALV control 3 | 4 | This tool generates a table view using ALV out of a DDIC structure. It can be used in control-driven SAPGUI front ends for a replacement of classic dynpro fields. 5 | 6 | It includes the following features: 7 | * Automatic search help: Just as in a dynpro field, search help is provided from definitions in the DDIC structure field 8 | * Input validation: all inputs are checked for syntax and data validity using the check tables 9 | * Output format: data entered will be formatted as defined for the data type (respecting conversion exits) 10 | * Display attributes: hotspot, colors, check box and more can be used on selected fields 11 | * Value description: If a description can be found usign a text table, it can be shown besides the value 12 | * Special value description: When no text table is available, you can also choose a field from the check table to be shown (for instance the name of the customer from KNA1) 13 | 14 | To learn more about the usage, explore the demo reports. 15 | 16 | ## 2023-08-17 added toolbar support 17 | With this update, it is possible to use events TOOLBAR and USER_COMMAND just like in CL_GUI_ALV_GRID 18 | -------------------------------------------------------------------------------- /code/dummy.txt: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /code/package.devc.xml: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | ALV structure viewer for community 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /code/zcl_stralv_constants.clas.abap: -------------------------------------------------------------------------------- 1 | class zcl_stralv_constants definition 2 | public 3 | abstract 4 | create public . 5 | 6 | public section. 7 | 8 | constants: 9 | begin of fieldname, 10 | value type fieldname value 'FIELDVALUE', 11 | label type fieldname value 'FIELDLABEL', 12 | description type fieldname value 'FIELDDESCR', 13 | ref_field type lvc_fname value 'REF_FIELD', 14 | ref_table type lvc_fname value 'REF_TABLE', 15 | maxlen type lvc_fname value 'MAXLEN ', 16 | t_styles type lvc_fname value 'T_STYLES ', 17 | t_colors type lvc_fname value 'T_COLORS ', 18 | end of fieldname. 19 | 20 | constants struct_name type ddobjname value 'ZST_STRALV_TAB_LINE'. 21 | 22 | constants: 23 | begin of metrics, 24 | output_length type i value 15, 25 | end of metrics. 26 | 27 | constants: 28 | begin of datatype, 29 | currency type datatype_d value 'CUKY', 30 | unit type datatype_d value 'UNIT', 31 | end of datatype. 32 | protected section. 33 | private section. 34 | endclass. 35 | 36 | 37 | 38 | class zcl_stralv_constants implementation. 39 | endclass. 40 | -------------------------------------------------------------------------------- /code/zcl_stralv_constants.clas.xml: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | ZCL_STRALV_CONSTANTS 7 | E 8 | Constants 9 | 1 10 | X 11 | X 12 | X 13 | 14 | 15 | 16 | 17 | -------------------------------------------------------------------------------- /code/zcl_stralv_field.clas.abap: -------------------------------------------------------------------------------- 1 | class zcl_stralv_field definition 2 | public 3 | final 4 | create public . 5 | 6 | public section. 7 | types self type ref to zcl_stralv_field. 8 | methods constructor 9 | importing 10 | i_name type lvc_fname. 11 | 12 | methods: 13 | set_checkbox 14 | importing 15 | in type abap_bool default abap_true 16 | returning 17 | value(result) type self, 18 | set_hotspot 19 | importing 20 | in type lvc_hotspt default abap_true 21 | returning 22 | value(result) type self, 23 | set_readonly 24 | importing 25 | in type abap_bool default abap_true 26 | returning 27 | value(result) type self, 28 | set_description_field 29 | importing 30 | in type lvc_fname 31 | returning 32 | value(result) type self, 33 | set_struc_descr_field 34 | importing 35 | in type lvc_fname 36 | returning 37 | value(result) type self, 38 | set_radio_group 39 | importing 40 | in type char3 41 | returning 42 | value(result) type self, 43 | set_no_display 44 | importing 45 | in type abap_bool default abap_true 46 | returning 47 | value(result) type self, 48 | set_no_label 49 | importing 50 | in type abap_bool default abap_true 51 | returning 52 | value(result) type self, 53 | set_f4_exit 54 | importing 55 | in type abap_bool default abap_true 56 | returning 57 | value(result) type self, 58 | set_color 59 | importing 60 | in type lvc_s_colo 61 | returning 62 | value(result) type self, 63 | get_attributes 64 | returning 65 | value(result) type zcl_stralv_types=>field_attr. 66 | 67 | protected section. 68 | private section. 69 | data attributes type types=>field_attr. 70 | ENDCLASS. 71 | 72 | 73 | 74 | CLASS ZCL_STRALV_FIELD IMPLEMENTATION. 75 | 76 | 77 | method constructor. 78 | attributes-fieldname = i_name. 79 | endmethod. 80 | 81 | 82 | method get_attributes. 83 | result = me->attributes. 84 | endmethod. 85 | 86 | 87 | method set_checkbox. 88 | attributes-checkbox = in. 89 | result = me. 90 | endmethod. 91 | 92 | 93 | method set_color. 94 | attributes-color = in. 95 | result = me. 96 | endmethod. 97 | 98 | 99 | method set_description_field. 100 | attributes-description_field = in. 101 | result = me. 102 | endmethod. 103 | 104 | 105 | method set_f4_exit. 106 | attributes-f4_exit = in. 107 | result = me. 108 | endmethod. 109 | 110 | 111 | method set_hotspot. 112 | attributes-hotspot = in. 113 | result = me. 114 | endmethod. 115 | 116 | 117 | method set_no_display. 118 | attributes-no_display = in. 119 | result = me. 120 | endmethod. 121 | 122 | 123 | method set_no_label. 124 | attributes-no_label = in. 125 | result = me. 126 | endmethod. 127 | 128 | 129 | method set_radio_group. 130 | attributes-radio_group = in. 131 | result = me. 132 | endmethod. 133 | 134 | 135 | method set_readonly. 136 | attributes-readonly = in. 137 | result = me. 138 | endmethod. 139 | 140 | 141 | method set_struc_descr_field. 142 | attributes-struc_descr_field = in. 143 | result = me. 144 | endmethod. 145 | ENDCLASS. 146 | -------------------------------------------------------------------------------- /code/zcl_stralv_field.clas.locals_def.abap: -------------------------------------------------------------------------------- 1 | class types definition inheriting from zcl_stralv_types abstract. 2 | endclass. 3 | class constants definition inheriting from zcl_stralv_constants abstract. 4 | endclass. 5 | -------------------------------------------------------------------------------- /code/zcl_stralv_field.clas.xml: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | ZCL_STRALV_FIELD 7 | E 8 | Field settings 9 | 1 10 | X 11 | X 12 | X 13 | 14 | 15 | 16 | 17 | -------------------------------------------------------------------------------- /code/zcl_stralv_fields.clas.abap: -------------------------------------------------------------------------------- 1 | class zcl_stralv_fields definition 2 | public 3 | final 4 | create public . 5 | 6 | public section. 7 | methods constructor 8 | importing 9 | data_ref type ref to data. 10 | methods get_field 11 | importing 12 | name type lvc_fname 13 | returning 14 | value(result) type ref to zcl_stralv_field 15 | raising zcx_stralv_unknown_field. 16 | 17 | methods is_description_field 18 | importing 19 | name type lvc_fname 20 | returning 21 | value(result) type abap_bool. 22 | 23 | protected section. 24 | private section. 25 | data field_objects type types=>field_objects. 26 | data data_ref type ref to data. 27 | 28 | methods add_field 29 | importing 30 | name type lvc_fname 31 | returning 32 | value(result) type ref to zcl_stralv_field 33 | raising 34 | zcx_stralv_unknown_field. 35 | endclass. 36 | 37 | 38 | 39 | class zcl_stralv_fields implementation. 40 | 41 | method constructor. 42 | me->data_ref = data_ref. 43 | endmethod. 44 | 45 | method get_field. 46 | try. 47 | result = field_objects[ name = name ]-object. 48 | catch cx_sy_itab_line_not_found. 49 | result = add_field( name ). 50 | endtry. 51 | 52 | endmethod. 53 | 54 | method add_field. 55 | field-symbols type any. 56 | field-symbols type any. 57 | " check if field is present 58 | assign data_ref->* to . 59 | assign component name of structure to . 60 | if sy-subrc <> 0. 61 | raise exception type zcx_stralv_unknown_field 62 | exporting 63 | name = name. 64 | endif. 65 | result = new #( name ). 66 | insert value #( name = name object = result ) 67 | into table field_objects. 68 | endmethod. 69 | 70 | 71 | method is_description_field. 72 | loop at field_objects into data(line). 73 | data(attr) = line-object->get_attributes( ). 74 | if attr-description_field = name. 75 | result = abap_true. 76 | return. 77 | endif. 78 | endloop. 79 | endmethod. 80 | 81 | endclass. 82 | -------------------------------------------------------------------------------- /code/zcl_stralv_fields.clas.locals_def.abap: -------------------------------------------------------------------------------- 1 | class types definition inheriting from zcl_stralv_types abstract. 2 | endclass. 3 | class constants definition inheriting from zcl_stralv_constants abstract. 4 | endclass. 5 | -------------------------------------------------------------------------------- /code/zcl_stralv_fields.clas.xml: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | ZCL_STRALV_FIELDS 7 | E 8 | All field settings 9 | 1 10 | X 11 | X 12 | X 13 | 14 | 15 | 16 | 17 | -------------------------------------------------------------------------------- /code/zcl_stralv_main.clas.abap: -------------------------------------------------------------------------------- 1 | class zcl_stralv_main definition 2 | public 3 | inheriting from cl_gui_alv_grid 4 | final 5 | create private . 6 | 7 | public section. 8 | interfaces zif_stralv_main. 9 | 10 | class-methods new 11 | importing 12 | settings type ref to zcl_stralv_settings 13 | returning 14 | value(result) type ref to zif_stralv_main 15 | raising 16 | zcx_stralv_error. 17 | 18 | methods constructor 19 | importing 20 | structure_name type ddobjname 21 | container type ref to cl_gui_container 22 | max_value_length type i 23 | readonly type flag 24 | max_description_length type i 25 | fields type ref to zcl_stralv_fields 26 | use_long_labels type abap_bool 27 | use_medium_labels type abap_bool 28 | use_short_labels type abap_bool 29 | raising 30 | zcx_stralv_error . 31 | protected section. 32 | private section. 33 | data output_table type ref to zcl_stralv_output_table. 34 | data cols_optimized type abap_bool . 35 | data gv_title type lvc_title . 36 | data small_title type abap_bool. 37 | 38 | methods on_refresh 39 | for event refresh of zcl_stralv_output_table. 40 | 41 | methods on_hotspot_clicked 42 | for event hotspot_click of zcl_stralv_main 43 | importing 44 | !es_row_no . 45 | 46 | methods on_f4 47 | for event onf4 of zcl_stralv_main 48 | importing 49 | !es_row_no 50 | !er_event_data . 51 | 52 | methods on_internal_double_click 53 | for event double_click of zcl_stralv_main 54 | importing 55 | !es_row_no . 56 | 57 | methods on_after_refresh 58 | for event after_refresh of zcl_stralv_main . 59 | 60 | methods on_internal_data_changed 61 | for event data_changed of zcl_stralv_main 62 | importing 63 | !er_data_changed. 64 | 65 | methods on_data_changed_late 66 | for event data_changed_finished of cl_gui_alv_grid 67 | importing 68 | !e_modified 69 | !et_good_cells . 70 | 71 | methods build_toolbar_exclude 72 | returning 73 | value(result) type ui_functions . 74 | 75 | methods on_data_changed 76 | for event data_has_changed of zcl_stralv_output_table. 77 | 78 | methods on_enter_pressed 79 | for event enter_pressed of zcl_stralv_output_table. 80 | 81 | methods on_toolbar 82 | for event toolbar of zcl_stralv_main 83 | importing sender 84 | e_object 85 | e_interactive. 86 | 87 | methods on_user_command 88 | for event user_command of zcl_stralv_main 89 | importing sender 90 | e_ucomm. 91 | 92 | 93 | methods put_log_dch 94 | importing 95 | io_data_changed type ref to cl_alv_changed_data_protocol 96 | exception type ref to zcx_stralv_input_error. 97 | 98 | methods build_layout 99 | importing 100 | iv_optimized type abap_bool 101 | returning 102 | value(rs_layout) type lvc_s_layo. 103 | endclass. 104 | 105 | 106 | 107 | class zcl_stralv_main implementation. 108 | 109 | 110 | method constructor. 111 | super->constructor( container ). 112 | 113 | output_table = new #( structure_name ). 114 | 115 | set handler on_data_changed for output_table. 116 | set handler on_enter_pressed for output_table. 117 | set handler on_refresh for output_table. 118 | 119 | register_f4_for_fields( 120 | value #( 121 | ( fieldname = constants=>fieldname-value 122 | getbefore = abap_true 123 | register = abap_true 124 | chngeafter = abap_true ) ) ). 125 | me->register_edit_event( mc_evt_enter ). 126 | 127 | set handler on_internal_data_changed for me. 128 | set handler on_data_changed_late for me. 129 | set handler on_after_refresh for me. 130 | set handler on_internal_double_click for me. 131 | set handler on_hotspot_clicked for me. 132 | set handler on_f4 for me. 133 | set handler on_toolbar for me. 134 | set handler on_user_command for me. 135 | 136 | 137 | output_table->set_label_length( 138 | long = use_long_labels 139 | medium = use_medium_labels 140 | short = use_short_labels 141 | )->set_fields( fields 142 | )->set_readonly( readonly 143 | )->set_value_length( max_value_length 144 | )->set_descr_length( max_description_length 145 | )->build_fieldcatalog( 146 | )->create_input_table( ). 147 | endmethod. 148 | 149 | 150 | method on_after_refresh. 151 | * mt_data = output_table->set_style( mt_data ). 152 | **************** 153 | * set_data_table( 154 | * changing 155 | * data_table = mt_data ). 156 | * call method set_auto_redraw 157 | * exporting 158 | * enable = 1. 159 | 160 | endmethod. 161 | 162 | 163 | method build_toolbar_exclude. 164 | result = 165 | value #( 166 | ( cl_gui_alv_grid=>mc_fc_auf ) 167 | ( cl_gui_alv_grid=>mc_fc_average ) 168 | ( cl_gui_alv_grid=>mc_fc_back_classic ) 169 | ( cl_gui_alv_grid=>mc_fc_call_abc ) 170 | ( cl_gui_alv_grid=>mc_fc_call_chain ) 171 | ( cl_gui_alv_grid=>mc_fc_call_crbatch ) 172 | ( cl_gui_alv_grid=>mc_fc_call_crweb ) 173 | ( cl_gui_alv_grid=>mc_fc_call_lineitems ) 174 | ( cl_gui_alv_grid=>mc_fc_call_master_data ) 175 | ( cl_gui_alv_grid=>mc_fc_call_more ) 176 | ( cl_gui_alv_grid=>mc_fc_call_report ) 177 | ( cl_gui_alv_grid=>mc_fc_call_xint ) 178 | ( cl_gui_alv_grid=>mc_fc_call_xxl ) 179 | ( cl_gui_alv_grid=>mc_fc_check ) 180 | ( cl_gui_alv_grid=>mc_fc_col_invisible ) 181 | ( cl_gui_alv_grid=>mc_fc_col_optimize ) 182 | ( cl_gui_alv_grid=>mc_fc_count ) 183 | ( cl_gui_alv_grid=>mc_fc_current_variant ) 184 | ( cl_gui_alv_grid=>mc_fc_data_save ) 185 | ( cl_gui_alv_grid=>mc_fc_delete_filter ) 186 | ( cl_gui_alv_grid=>mc_fc_deselect_all ) 187 | ( cl_gui_alv_grid=>mc_fc_detail ) 188 | ( cl_gui_alv_grid=>mc_fc_excl_all ) 189 | ( cl_gui_alv_grid=>mc_fc_expcrdata ) 190 | ( cl_gui_alv_grid=>mc_fc_expcrdesig ) 191 | ( cl_gui_alv_grid=>mc_fc_expcrtempl ) 192 | ( cl_gui_alv_grid=>mc_fc_expmdb ) 193 | ( cl_gui_alv_grid=>mc_fc_extend ) 194 | ( cl_gui_alv_grid=>mc_fc_f4 ) 195 | ( cl_gui_alv_grid=>mc_fc_filter ) 196 | ( cl_gui_alv_grid=>mc_fc_find ) 197 | ( cl_gui_alv_grid=>mc_fc_fix_columns ) 198 | ( cl_gui_alv_grid=>mc_fc_graph ) 199 | ( cl_gui_alv_grid=>mc_fc_help ) 200 | ( cl_gui_alv_grid=>mc_fc_html ) 201 | ( cl_gui_alv_grid=>mc_fc_info ) 202 | ( cl_gui_alv_grid=>mc_fc_load_variant ) 203 | ( cl_gui_alv_grid=>mc_fc_loc_append_row ) 204 | ( cl_gui_alv_grid=>mc_fc_loc_copy ) 205 | ( cl_gui_alv_grid=>mc_fc_loc_copy_row ) 206 | ( cl_gui_alv_grid=>mc_fc_loc_cut ) 207 | ( cl_gui_alv_grid=>mc_fc_loc_delete_row ) 208 | ( cl_gui_alv_grid=>mc_fc_loc_insert_row ) 209 | ( cl_gui_alv_grid=>mc_fc_loc_move_row ) 210 | ( cl_gui_alv_grid=>mc_fc_loc_paste ) 211 | ( cl_gui_alv_grid=>mc_fc_loc_paste_new_row ) 212 | ( cl_gui_alv_grid=>mc_fc_loc_undo ) 213 | ( cl_gui_alv_grid=>mc_fc_maintain_variant ) 214 | ( cl_gui_alv_grid=>mc_fc_maximum ) 215 | ( cl_gui_alv_grid=>mc_fc_minimum ) 216 | ( cl_gui_alv_grid=>mc_fc_pc_file ) 217 | ( cl_gui_alv_grid=>mc_fc_print ) 218 | ( cl_gui_alv_grid=>mc_fc_print_back ) 219 | ( cl_gui_alv_grid=>mc_fc_print_prev ) 220 | ( cl_gui_alv_grid=>mc_fc_refresh ) 221 | ( cl_gui_alv_grid=>mc_fc_reprep ) 222 | ( cl_gui_alv_grid=>mc_fc_save_variant ) 223 | ( cl_gui_alv_grid=>mc_fc_select_all ) 224 | ( cl_gui_alv_grid=>mc_fc_send ) 225 | ( cl_gui_alv_grid=>mc_fc_separator ) 226 | ( cl_gui_alv_grid=>mc_fc_sort ) 227 | ( cl_gui_alv_grid=>mc_fc_sort_asc ) 228 | ( cl_gui_alv_grid=>mc_fc_sort_dsc ) 229 | ( cl_gui_alv_grid=>mc_fc_subtot ) 230 | ( cl_gui_alv_grid=>mc_fc_sum ) 231 | ( cl_gui_alv_grid=>mc_fc_to_office ) 232 | ( cl_gui_alv_grid=>mc_fc_to_rep_tree ) 233 | ( cl_gui_alv_grid=>mc_fc_unfix_columns ) 234 | ( cl_gui_alv_grid=>mc_fc_url_copy_to_clipboard ) 235 | ( cl_gui_alv_grid=>mc_fc_variant_admin ) 236 | ( cl_gui_alv_grid=>mc_fc_views ) 237 | ( cl_gui_alv_grid=>mc_fc_view_crystal ) 238 | ( cl_gui_alv_grid=>mc_fc_view_excel ) 239 | ( cl_gui_alv_grid=>mc_fc_view_grid ) 240 | ( cl_gui_alv_grid=>mc_fc_view_lotus ) 241 | ( cl_gui_alv_grid=>mc_fc_word_processor ) ). 242 | 243 | 244 | endmethod. 245 | 246 | 247 | 248 | method on_internal_data_changed. 249 | try. 250 | output_table->process_data_changed( er_data_changed ). 251 | catch zcx_stralv_input_error into data(e). 252 | put_log_dch( 253 | io_data_changed = er_data_changed 254 | exception = e ). 255 | er_data_changed->display_protocol( ). 256 | endtry. 257 | endmethod. 258 | 259 | method put_log_dch. 260 | data(message) = exception->if_t100_message~t100key. 261 | 262 | io_data_changed->add_protocol_entry( 263 | i_msgid = message-msgid 264 | i_msgty = 'E' 265 | i_msgno = message-msgno 266 | i_msgv1 = exception->if_t100_dyn_msg~msgv1 267 | i_msgv2 = exception->if_t100_dyn_msg~msgv2 268 | i_msgv3 = exception->if_t100_dyn_msg~msgv3 269 | i_msgv4 = exception->if_t100_dyn_msg~msgv4 270 | i_fieldname = 'FIELDVALUE' 271 | i_row_id = exception->cell-row_id ). 272 | endmethod. 273 | 274 | method on_data_changed. 275 | raise event zif_stralv_main~data_has_changed. 276 | clear m_eventid. 277 | endmethod. 278 | 279 | method on_enter_pressed. 280 | if m_eventid = evt_enter. 281 | cl_gui_control=>get_focus( 282 | importing 283 | control = data(control) 284 | exceptions 285 | cntl_error = 1 286 | cntl_system_error = 2 287 | others = 3 ). 288 | if sy-subrc = 0 and 289 | control = me. 290 | raise event zif_stralv_main~enter_pressed. 291 | endif. 292 | endif. 293 | endmethod. 294 | 295 | method on_data_changed_late. 296 | output_table->process_data_changed_late( e_modified ). 297 | endmethod. 298 | 299 | 300 | 301 | method zif_stralv_main~display. 302 | 303 | cols_optimized = iv_optimized. 304 | 305 | output_table->create_input_table( 306 | )->map_struc_to_screen( abap_false ). 307 | 308 | set_table_for_first_display( 309 | exporting 310 | is_layout = build_layout( iv_optimized ) 311 | it_toolbar_excluding = build_toolbar_exclude( ) 312 | changing 313 | it_outtab = output_table->inputs 314 | it_fieldcatalog = output_table->fieldcat 315 | exceptions 316 | invalid_parameter_combination = 1 317 | program_error = 2 318 | too_many_lines = 3 ). 319 | case sy-subrc. 320 | when 1. 321 | raise exception type zcx_stralv_invalid_para. 322 | when 2. 323 | raise exception type zcx_stralv_program_error. 324 | when 3. 325 | raise exception type zcx_stralv_too_many_lines. 326 | endcase. 327 | endmethod. 328 | 329 | method build_layout. 330 | 331 | rs_layout = 332 | value #( 333 | stylefname = constants=>fieldname-t_styles 334 | no_headers = abap_true 335 | sel_mode = 'A' 336 | no_rowins = abap_true 337 | no_rowmark = abap_true 338 | grid_title = gv_title 339 | smalltitle = small_title 340 | ctab_fname = constants=>fieldname-t_colors 341 | cwidth_opt = iv_optimized ). 342 | 343 | endmethod. 344 | 345 | method on_internal_double_click. 346 | _get_structure_ref. 347 | try. 348 | data(input) = output_table->inputs[ es_row_no-row_id ]. 349 | _get_field_ref input. 350 | if sy-subrc = 0. 351 | raise event zif_stralv_main~double_clicked exporting 352 | ev_fieldname = input-ref_field 353 | ev_value = . 354 | endif. 355 | catch cx_sy_itab_line_not_found ##no_handler. 356 | endtry. 357 | endmethod. 358 | 359 | 360 | method on_f4. 361 | output_table->process_f4( 362 | row = es_row_no-row_id 363 | event = er_event_data ). 364 | endmethod. 365 | 366 | 367 | 368 | method zif_stralv_main~get_data. 369 | rr_res = output_table->screendata. 370 | endmethod. 371 | 372 | 373 | method zif_stralv_main~get_display_tab. 374 | rt_res = output_table->inputs. 375 | endmethod. 376 | 377 | method zif_stralv_main~get_label. 378 | rv_res = output_table->inputs[ ref_field = iv_fieldname ]-fieldlabel. 379 | "strip icon, if present 380 | if rv_res(1) = '@'. 381 | rv_res = condense( segment( val = rv_res index = 3 sep = '@' ) ). 382 | endif. 383 | endmethod. 384 | 385 | 386 | method zif_stralv_main~get_read_only. 387 | rv_res = output_table->is_readonly( ). 388 | endmethod. 389 | 390 | 391 | method on_hotspot_clicked. 392 | data(field) = output_table->process_hotspot_click( 393 | row = es_row_no-row_id ). 394 | 395 | if field is not initial. 396 | raise event zif_stralv_main~link_clicked exporting 397 | ev_fieldname = field-ddic-fieldname 398 | ev_value = field-value. 399 | endif. 400 | endmethod. 401 | 402 | 403 | 404 | method zif_stralv_main~refresh. 405 | output_table->create_input_table( ). 406 | output_table->map_struc_to_screen( ). 407 | refresh_table_display( ). 408 | endmethod. 409 | 410 | 411 | method on_refresh. 412 | if cols_optimized = abap_true. 413 | 414 | get_frontend_layout( 415 | importing 416 | es_layout = data(ls_layo) ). 417 | 418 | ls_layo-cwidth_opt = abap_true. 419 | 420 | set_frontend_layout( ls_layo ). 421 | endif. 422 | refresh_table_display( 423 | is_stable = value #( row = abap_true col = abap_true ) 424 | i_soft_refresh = abap_true ). 425 | endmethod. 426 | 427 | 428 | method zif_stralv_main~set_data_by_ref. 429 | output_table->set_data( data ). 430 | endmethod. 431 | 432 | 433 | method zif_stralv_main~set_display_tab. 434 | output_table->inputs = it_in. 435 | endmethod. 436 | 437 | 438 | 439 | method zif_stralv_main~set_label. 440 | output_table->inputs[ ref_field = iv_fieldname ]-fieldlabel = iv_label. 441 | endmethod. 442 | 443 | 444 | method zif_stralv_main~set_readonly. 445 | output_table->set_readonly( iv_readonly ). 446 | 447 | zif_stralv_main~display( ). 448 | endmethod. 449 | 450 | 451 | 452 | 453 | method zif_stralv_main~set_title. 454 | gv_title = iv_title. 455 | small_title = small. 456 | endmethod. 457 | 458 | method new. 459 | result = 460 | new zcl_stralv_main( 461 | structure_name = settings->structure_name 462 | container = settings->container 463 | max_value_length = settings->value_width 464 | readonly = settings->readonly 465 | max_description_length = settings->max_description_length 466 | fields = settings->fields 467 | use_long_labels = settings->use_long_labels 468 | use_medium_labels = settings->use_medium_labels 469 | use_short_labels = settings->use_short_labels ). 470 | 471 | result->set_data_by_ref( settings->data_ref ). 472 | endmethod. 473 | 474 | method zif_stralv_main~field. 475 | result = output_table->fields->get_field( in ). 476 | endmethod. 477 | 478 | method on_toolbar. 479 | raise event zif_stralv_main~toolbar 480 | exporting 481 | e_object = e_object 482 | e_interactive = e_interactive. 483 | endmethod. 484 | 485 | method on_user_command. 486 | raise event zif_stralv_main~user_command 487 | exporting 488 | e_ucomm = e_ucomm. 489 | 490 | endmethod. 491 | 492 | endclass. 493 | -------------------------------------------------------------------------------- /code/zcl_stralv_main.clas.locals_def.abap: -------------------------------------------------------------------------------- 1 | class types definition inheriting from zcl_stralv_types abstract. 2 | endclass. 3 | class constants definition inheriting from zcl_stralv_constants abstract. 4 | endclass. 5 | -------------------------------------------------------------------------------- /code/zcl_stralv_main.clas.macros.abap: -------------------------------------------------------------------------------- 1 | define _get_structure_ref. 2 | field-symbols type any. 3 | assign output_table->screendata->* to . 4 | end-of-definition. 5 | 6 | define _get_field_ref. 7 | field-symbols type any. 8 | assign component &1-ref_field of structure to . 9 | end-of-definition. 10 | -------------------------------------------------------------------------------- /code/zcl_stralv_main.clas.xml: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | ZCL_STRALV_MAIN 7 | E 8 | Klasse für ALV-basierte Eingabemaske 9 | 1 10 | X 11 | X 12 | X 13 | 14 | 15 | 16 | CONSTRUCTOR 17 | E 18 | CONSTRUCTOR 19 | 20 | 21 | 22 | 23 | 24 | -------------------------------------------------------------------------------- /code/zcl_stralv_output_table.clas.abap: -------------------------------------------------------------------------------- 1 | class zcl_stralv_output_table definition 2 | public 3 | final 4 | create public . 5 | 6 | public section. 7 | types self type ref to zcl_stralv_output_table. 8 | data fieldcat type lvc_t_fcat. 9 | data inputs type zcl_stralv_types=>alv_table_lines. 10 | data screendata type ref to data read-only. 11 | data fields type ref to zcl_stralv_fields read-only. 12 | 13 | events data_has_changed. 14 | 15 | events enter_pressed. 16 | 17 | events refresh. 18 | 19 | methods constructor 20 | importing 21 | struc_name type ddobjname 22 | raising 23 | zcx_stralv_error. 24 | 25 | methods set_label_length 26 | importing 27 | long type abap_bool 28 | medium type abap_bool 29 | short type abap_bool 30 | returning 31 | value(result) type self. 32 | 33 | methods set_value_length 34 | importing 35 | in type i 36 | returning 37 | value(result) type self. 38 | 39 | methods set_descr_length 40 | importing 41 | in type i 42 | returning 43 | value(result) type self. 44 | 45 | 46 | 47 | methods process_data_changed 48 | importing 49 | er_data_changed type ref to cl_alv_changed_data_protocol 50 | raising 51 | zcx_stralv_input_error. 52 | 53 | methods process_data_changed_late 54 | importing 55 | e_modified type char01. 56 | 57 | methods map_struc_to_screen 58 | importing 59 | iv_refresh type abap_bool default abap_true . 60 | 61 | methods is_readonly 62 | returning 63 | value(result) type abap_bool. 64 | methods create_input_table 65 | returning 66 | value(result) type self 67 | raising 68 | zcx_stralv_data_create. 69 | 70 | methods set_fields 71 | importing 72 | in type ref to zcl_stralv_fields 73 | returning 74 | value(result) type self 75 | raising 76 | zcx_stralv_data_create. 77 | 78 | 79 | 80 | methods set_data 81 | importing 82 | in type ref to data. 83 | 84 | methods set_readonly 85 | importing 86 | in type abap_bool 87 | returning 88 | value(result) type self 89 | raising 90 | zcx_stralv_error. 91 | 92 | methods build_fieldcatalog 93 | returning 94 | value(result) type self 95 | raising 96 | zcx_stralv_data_create. 97 | 98 | 99 | 100 | methods process_hotspot_click 101 | importing 102 | row type i 103 | returning 104 | value(result) type zcl_stralv_types=>field. 105 | 106 | methods process_f4 107 | importing 108 | row type i 109 | event type ref to cl_alv_event_data. 110 | 111 | protected section. 112 | private section. 113 | data readonly type flag . 114 | data long_descr type abap_bool value abap_true. 115 | data medium_descr type abap_bool . 116 | data short_descr type abap_bool . 117 | data max_outputlen type i . 118 | data max_outputlen_d type i . 119 | data structure_name type ddobjname . 120 | data structure_fields type standard table of dd03p. 121 | 122 | methods analyze_foreign_key 123 | importing 124 | field type types=>field 125 | returning 126 | value(result) type types=>foreign_key_result. 127 | 128 | methods read_structure_fields 129 | returning 130 | value(result) type types=>structure_fields 131 | raising 132 | zcx_stralv_data_create. 133 | 134 | methods set_field_styles 135 | importing 136 | field type types=>field 137 | returning 138 | value(result) type lvc_t_styl. 139 | 140 | methods get_field_units 141 | importing 142 | is_field type dd03p 143 | returning 144 | value(result) type types=>units. 145 | 146 | methods convert_input 147 | importing 148 | field type types=>field 149 | cell type lvc_s_modi 150 | raising 151 | zcx_stralv_input_error. 152 | 153 | methods check_input 154 | importing 155 | field type types=>field 156 | cell type lvc_s_modi 157 | raising 158 | zcx_stralv_input_error. 159 | 160 | methods convert_output 161 | importing 162 | field type types=>field 163 | value type any 164 | returning 165 | value(result) type text128 . 166 | 167 | methods description_fill 168 | importing 169 | field type types=>field 170 | returning 171 | value(result) type text128. 172 | 173 | methods fill_description_special 174 | importing 175 | field type types=>field 176 | returning 177 | value(result) type text128 . 178 | 179 | methods fill_description_from_field 180 | importing 181 | field type types=>field 182 | returning 183 | value(result) type text128 . 184 | 185 | methods read_fieldcatalog 186 | returning 187 | value(result) type lvc_t_fcat 188 | raising 189 | zcx_stralv_data_create. 190 | 191 | methods create_input_table_low 192 | importing 193 | old_inputs type types=>alv_table_lines 194 | returning 195 | value(result) type types=>alv_table_lines. 196 | 197 | methods get_fieldlabel 198 | importing 199 | field type zcl_stralv_types=>field 200 | returning 201 | value(result) type string. 202 | 203 | methods has_search_help 204 | importing 205 | field type types=>field 206 | returning 207 | value(result) type abap_bool. 208 | 209 | methods has_dom_values 210 | importing 211 | field type types=>field 212 | returning 213 | value(result) type abap_bool. 214 | methods set_field_colors 215 | importing 216 | field type types=>field 217 | returning 218 | value(result) type lvc_t_scol. 219 | 220 | methods add_checkboxes 221 | importing 222 | in type ref to zcl_stralv_fields 223 | returning 224 | value(result) type ref to zcl_stralv_fields. 225 | 226 | methods refresh_input_table. 227 | 228 | methods re_build_fieldcatalog 229 | raising 230 | zcx_stralv_data_create. 231 | 232 | methods map_struc_field_to_line 233 | importing 234 | line type zst_stralv_tab_line 235 | returning 236 | value(result) type zst_stralv_tab_line. 237 | 238 | 239 | 240 | methods build_field 241 | importing 242 | line type zst_stralv_tab_line 243 | returning 244 | value(result) type zcl_stralv_types=>field. 245 | 246 | methods read_from_checktable 247 | importing 248 | field type types=>field 249 | sel_lines type string_table 250 | returning 251 | value(result) type text128. 252 | 253 | methods show_search_help 254 | importing 255 | field type zcl_stralv_types=>field 256 | returning 257 | value(result) type types=>search_help_return. 258 | 259 | methods use_selected_field 260 | importing 261 | i_row type i 262 | i_event type ref to cl_alv_event_data 263 | it_return type types=>search_help_return. 264 | methods get_field_attribute 265 | importing 266 | name type dd03p-fieldname 267 | returning 268 | value(result) type zcl_stralv_types=>field_attr. 269 | 270 | 271 | 272 | endclass. 273 | 274 | 275 | 276 | class zcl_stralv_output_table implementation. 277 | 278 | 279 | method add_checkboxes. 280 | result = in. 281 | try. 282 | loop at structure_fields into data(f) where domname = 'XFELD'. 283 | result->get_field( f-fieldname )->set_checkbox( ). 284 | endloop. 285 | catch zcx_stralv_error ##no_handler. 286 | endtry. 287 | endmethod. 288 | 289 | 290 | method analyze_foreign_key. 291 | 292 | _get_structure_ref. 293 | 294 | call function 'DDUT_FORKEY_CHECK' 295 | exporting 296 | tabname = field-ddic-tabname 297 | fieldname = field-ddic-fieldname 298 | value_list = 299 | tables 300 | cond_tab = result-conditions 301 | failure_tab = result-failures. 302 | 303 | endmethod. 304 | 305 | 306 | method build_field. 307 | result = 308 | value #( 309 | let struc = structure_fields[ fieldname = line-ref_field ] in 310 | ddic = struc 311 | attribute = get_field_attribute( line-ref_field ) 312 | units = get_field_units( struc ) 313 | value = line-fieldvalue ). 314 | endmethod. 315 | 316 | 317 | method build_fieldcatalog. 318 | fieldcat = read_fieldcatalog( ). 319 | data(ref) = ref #( fieldcat[ fieldname = constants=>fieldname-label ] ). 320 | ref->outputlen = constants=>metrics-output_length. 321 | ref->key = abap_true. 322 | ref->edit = abap_false. 323 | 324 | ref = ref #( fieldcat[ fieldname = constants=>fieldname-value ] ). 325 | ref->outputlen = max_outputlen. 326 | ref->edit = xsdbool( readonly = abap_false ). 327 | ref->key = abap_true. 328 | 329 | ref = ref #( fieldcat[ fieldname = 'FIELDDESCR' ] ). 330 | if max_outputlen_d > 0. 331 | ref->outputlen = max_outputlen_d. 332 | ref->edit = abap_false. 333 | else. 334 | ref->tech = abap_true. 335 | endif. 336 | fieldcat[ fieldname = 'REF_FIELD' ]-tech = abap_true. 337 | fieldcat[ fieldname = 'REF_TABLE' ]-tech = abap_true. 338 | fieldcat[ fieldname = 'MAXLEN' ]-tech = abap_true. 339 | 340 | result = me. 341 | endmethod. 342 | 343 | 344 | method check_input. 345 | _get_structure_ref. 346 | _get_field_ref field. 347 | data(lv_fn) = conv fnam_____4( field-ddic-fieldname ). 348 | call function 'DDUT_INPUT_CHECK' 349 | exporting 350 | tabname = field-ddic-tabname 351 | fieldname = lv_fn 352 | value_list = 353 | value = 354 | importing 355 | msgid = sy-msgid 356 | msgty = sy-msgty 357 | msgno = sy-msgno 358 | msgv1 = sy-msgv1 359 | msgv2 = sy-msgv2 360 | msgv3 = sy-msgv3 361 | msgv4 = sy-msgv4 362 | value_internal = 363 | exceptions 364 | others = 4. 365 | 366 | if sy-subrc <> 0 or sy-msgty ca 'EAF'. 367 | raise exception type zcx_stralv_input_error 368 | message id sy-msgid type sy-msgty number sy-msgno 369 | with sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4 370 | exporting 371 | cell = cell. 372 | endif. 373 | 374 | endmethod. 375 | 376 | 377 | method constructor. 378 | structure_name = struc_name. 379 | structure_fields = read_structure_fields( ). 380 | endmethod. 381 | 382 | 383 | method convert_input. 384 | _get_structure_ref. 385 | _get_field_ref field. 386 | 387 | data(tabfield) = 388 | value tabfield( 389 | tabname = structure_name 390 | fieldname = field-ddic-fieldname ). 391 | 392 | call function 'RS_CONV_EX_2_IN' 393 | exporting 394 | input_external = cell-value 395 | table_field = tabfield 396 | currency = field-units-currency 397 | importing 398 | output_internal = 399 | exceptions 400 | input_not_numerical = 1 401 | too_many_decimals = 2 402 | more_than_one_sign = 3 403 | ill_thousand_separator_dist = 4 404 | too_many_digits = 5 405 | sign_for_unsigned = 6 406 | too_large = 7 407 | too_small = 8 408 | invalid_date_format = 9 409 | invalid_date = 10 410 | invalid_time_format = 11 411 | invalid_time = 12 412 | invalid_hex_digit = 13 413 | unexpected_error = 14 414 | invalid_fieldname = 15 415 | field_and_descr_incompatible = 16 416 | input_too_long = 17 417 | no_decimals = 18 418 | invalid_float = 19 419 | conversion_exit_error = 20 420 | others = 21. 421 | if sy-subrc <> 0. 422 | raise exception type zcx_stralv_input_error 423 | message id sy-msgid type sy-msgty number sy-msgno 424 | with sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4 425 | exporting 426 | cell = cell. 427 | endif. 428 | endmethod. 429 | 430 | 431 | method convert_output. 432 | if field-units-currency is not initial. 433 | write value to result currency field-units-currency. 434 | elseif field-units-qty_unit is not initial. 435 | write value to result unit field-units-qty_unit. 436 | else. 437 | write value to result. 438 | endif. 439 | result = condense( result ). 440 | endmethod. 441 | 442 | method create_input_table. 443 | inputs = create_input_table_low( inputs ). 444 | result = me. 445 | endmethod. 446 | 447 | 448 | method create_input_table_low. 449 | 450 | loop at structure_fields into data(f). 451 | data(field) = value types=>field( 452 | ddic = f 453 | attribute = get_field_attribute( f-fieldname ) 454 | value = value #( old_inputs[ ref_field = f-fieldname ]-fieldvalue optional ) ). 455 | if field-attribute-no_display = abap_true or 456 | fields->is_description_field( field-ddic-fieldname ). 457 | exit. 458 | endif. 459 | insert 460 | value zst_stralv_tab_line( 461 | fieldlabel = get_fieldlabel( field ) 462 | fieldvalue = field-value 463 | ref_field = field-ddic-fieldname 464 | ref_table = field-ddic-tabname 465 | t_styles = set_field_styles( field ) 466 | t_colors = set_field_colors( field ) ) 467 | into table result. 468 | 469 | if field-ddic-outputlen > max_outputlen. 470 | max_outputlen = field-ddic-outputlen. 471 | endif. 472 | 473 | endloop. 474 | 475 | endmethod. 476 | 477 | 478 | method description_fill. 479 | _get_structure_ref. 480 | _get_field_ref field. 481 | data(fnam) = conv fnam_____4( field-ddic-fieldname ). 482 | data(text) = ``. 483 | call function 'DDUT_TEXT_FOR_VALUE' 484 | exporting 485 | tabname = structure_name 486 | fieldname = fnam 487 | value = 488 | importing 489 | text = text 490 | exceptions 491 | others = 0. 492 | result = text. 493 | endmethod. 494 | 495 | 496 | method fill_description_from_field. 497 | field-symbols type any. 498 | _get_structure_ref. 499 | 500 | assign component field-attribute-struc_descr_field of structure to . 501 | if sy-subrc = 0. 502 | result = conv string( ). 503 | endif. 504 | 505 | endmethod. 506 | 507 | 508 | method fill_description_special. 509 | 510 | if field-ddic-checktable is not initial and 511 | field-value is not initial. 512 | 513 | data(analysis) = analyze_foreign_key( field ). 514 | 515 | if analysis-failures is initial. 516 | data(tabs) = value string_table( 517 | for groups tab of line in analysis-conditions 518 | group by line-checktable 519 | ( conv #( tab ) ) ). 520 | if lines( tabs ) = 1. 521 | result = 522 | read_from_checktable( 523 | field = field 524 | sel_lines = 525 | value #( 526 | for l in analysis-conditions 527 | ( conv #( l-line ) ) ) ). 528 | endif. 529 | endif. 530 | endif. 531 | endmethod. 532 | 533 | 534 | method get_fieldlabel. 535 | result = 536 | cond #( 537 | when field-attribute-no_label = abap_false 538 | then 539 | cond #( 540 | when long_descr = abap_true 541 | then cond #( 542 | when field-ddic-scrtext_l is not initial 543 | then field-ddic-scrtext_l 544 | when field-ddic-scrtext_m is not initial 545 | then field-ddic-scrtext_m 546 | else field-ddic-scrtext_s ) 547 | when short_descr = abap_true 548 | then cond #( 549 | when field-ddic-scrtext_s is not initial 550 | then field-ddic-scrtext_s 551 | when field-ddic-scrtext_m is not initial 552 | then field-ddic-scrtext_m 553 | else field-ddic-scrtext_l ) 554 | when medium_descr = abap_true 555 | then cond #( 556 | when field-ddic-scrtext_m is not initial 557 | then field-ddic-scrtext_m 558 | when field-ddic-scrtext_s is not initial 559 | then field-ddic-scrtext_s 560 | else field-ddic-scrtext_l ) ) ). 561 | endmethod. 562 | 563 | 564 | method get_field_attribute. 565 | try. 566 | result = fields->get_field( name )->get_attributes( ). 567 | catch zcx_stralv_error ##no_handler. 568 | endtry. 569 | endmethod. 570 | 571 | 572 | method get_field_units. 573 | field-symbols type c. 574 | _get_structure_ref. 575 | 576 | if is_field-reftable = is_field-tabname and 577 | is_field-reffield is not initial. 578 | data(ref_field) = structure_fields[ fieldname = is_field-reffield ]. 579 | assign component ref_field-fieldname of structure to . 580 | if sy-subrc = 0. 581 | if ref_field-datatype = constants=>datatype-currency. 582 | result-currency = . 583 | elseif ref_field-datatype = constants=>datatype-unit. 584 | result-qty_unit = . 585 | endif. 586 | endif. 587 | endif. 588 | endmethod. 589 | 590 | 591 | method has_dom_values. 592 | data lt_domvalues type standard table of dd07v. 593 | 594 | call function 'DDUT_DOMVALUES_GET' 595 | exporting 596 | name = field-ddic-domname 597 | langu = sy-langu 598 | texts_only = abap_false 599 | tables 600 | dd07v_tab = lt_domvalues 601 | exceptions 602 | illegal_input = 1 603 | others = 2. 604 | result = xsdbool( lt_domvalues is not initial ). 605 | endmethod. 606 | 607 | 608 | method has_search_help. 609 | result = 610 | xsdbool( 611 | field-ddic-domname <> 'XFELD' and 612 | ( field-ddic-shlpname is not initial or 613 | field-ddic-checktable is not initial or 614 | field-ddic-datatype = 'DATS' or 615 | field-ddic-datatype = 'TIMS' or 616 | has_dom_values( field ) ) ). 617 | endmethod. 618 | 619 | 620 | method is_readonly. 621 | result = readonly. 622 | endmethod. 623 | 624 | 625 | method map_struc_field_to_line. 626 | field-symbols: 627 | type any. 628 | 629 | result = line. 630 | _get_structure_ref. 631 | 632 | data field type types=>field. 633 | field = build_field( result ). 634 | 635 | assign component line-ref_field of structure to . 636 | if sy-subrc <> 0. 637 | return. 638 | endif. 639 | 640 | result-fieldvalue = convert_output( 641 | field = field 642 | value = ). 643 | field-value = result-fieldvalue. 644 | result-t_styles = set_field_styles( field ). 645 | 646 | if max_outputlen_d > 0 and 647 | field-attribute-checkbox = abap_false and 648 | field-value is not initial. 649 | 650 | result-fielddescr = 651 | cond #( 652 | when field-attribute-description_field is not initial 653 | then fill_description_special( field ) 654 | when field-attribute-struc_descr_field is not initial 655 | then fill_description_from_field( field ) 656 | else description_fill( field ) ). 657 | endif. 658 | endmethod. 659 | 660 | 661 | method map_struc_to_screen. 662 | 663 | loop at inputs into data(line). 664 | line = map_struc_field_to_line( line ). 665 | modify inputs from line. 666 | endloop. 667 | 668 | if iv_refresh = abap_true. 669 | raise event refresh. 670 | endif. 671 | endmethod. 672 | 673 | 674 | method process_data_changed. 675 | _get_structure_ref. 676 | 677 | loop at er_data_changed->mt_good_cells into data(ls_good). 678 | data(field) = build_field( inputs[ ls_good-row_id ] ). 679 | _get_field_ref field. 680 | 681 | convert_input( 682 | field = field 683 | cell = ls_good ). 684 | 685 | check_input( 686 | field = field 687 | cell = ls_good ). 688 | endloop. 689 | 690 | endmethod. 691 | 692 | 693 | method process_data_changed_late. 694 | 695 | if e_modified = abap_true. 696 | 697 | map_struc_to_screen( abap_false ). 698 | raise event refresh. 699 | raise event data_has_changed. 700 | 701 | else. 702 | raise event enter_pressed. 703 | endif. 704 | endmethod. 705 | 706 | 707 | method process_hotspot_click. 708 | _get_structure_ref. 709 | try. 710 | data(field) = build_field( inputs[ row ] ). 711 | _get_field_ref field. 712 | if field-attribute-checkbox = abap_true. 713 | = xsdbool( = abap_false ). 714 | map_struc_to_screen( ). 715 | raise event data_has_changed. 716 | else. 717 | result = value #( base field value = ). 718 | endif. 719 | catch cx_sy_itab_line_not_found ##no_handler. 720 | endtry. 721 | 722 | endmethod. 723 | 724 | 725 | method read_fieldcatalog. 726 | call function 'LVC_FIELDCATALOG_MERGE' 727 | exporting 728 | i_structure_name = constants=>struct_name 729 | changing 730 | ct_fieldcat = result 731 | exceptions 732 | inconsistent_interface = 1 733 | program_error = 2 734 | others = 3. 735 | if sy-subrc <> 0. 736 | raise exception type zcx_stralv_data_create. 737 | endif. 738 | 739 | endmethod. 740 | 741 | 742 | method read_from_checktable. 743 | data lr_data type ref to data. 744 | field-symbols type any. 745 | field-symbols type any. 746 | 747 | create data lr_data type (field-ddic-checktable). 748 | assign lr_data->* to . 749 | 750 | select single from (field-ddic-checktable) 751 | fields * 752 | where (sel_lines) 753 | into @. 754 | 755 | assign component field-attribute-description_field of structure 756 | to . 757 | if sy-subrc = 0. 758 | result = . 759 | endif. 760 | endmethod. 761 | 762 | 763 | method read_structure_fields. 764 | call function 'DDIF_TABL_GET' 765 | exporting 766 | name = structure_name 767 | state = 'A' 768 | langu = sy-langu 769 | tables 770 | dd03p_tab = result 771 | exceptions 772 | illegal_input = 1 773 | others = 2. 774 | if sy-subrc <> 0. 775 | raise exception type zcx_stralv_data_create. 776 | endif. 777 | endmethod. 778 | 779 | 780 | method refresh_input_table. 781 | if inputs is not initial. 782 | inputs = create_input_table_low( inputs ). 783 | endif. 784 | endmethod. 785 | 786 | 787 | method re_build_fieldcatalog. 788 | if fieldcat is not initial. 789 | build_fieldcatalog( ). 790 | endif. 791 | endmethod. 792 | 793 | 794 | method set_data. 795 | screendata = in. 796 | endmethod. 797 | 798 | 799 | method set_descr_length. 800 | if in is not initial. 801 | max_outputlen_d = in. 802 | endif. 803 | result = me. 804 | endmethod. 805 | 806 | 807 | method set_fields. 808 | fields = add_checkboxes( in ). 809 | refresh_input_table( ). 810 | result = me. 811 | endmethod. 812 | 813 | 814 | method set_field_colors. 815 | result = 816 | value #( 817 | ( fname = constants=>fieldname-label 818 | color-col = 819 | cond #( 820 | when readonly = abap_true 821 | then col_key 822 | else col_background ) ) ). 823 | if field-attribute-readonly = abap_true or readonly = abap_true. 824 | result = 825 | value #( 826 | base result 827 | ( fname = constants=>fieldname-value 828 | color = 829 | cond #( 830 | when field-attribute-color is not initial 831 | then field-attribute-color 832 | else value #( col = col_normal ) ) ) ). 833 | endif. 834 | endmethod. 835 | 836 | 837 | method set_field_styles. 838 | include . 839 | result = 840 | value #( 841 | ( 842 | fieldname = constants=>fieldname-value 843 | style = 844 | cond #( when field-attribute-hotspot = abap_true or 845 | field-attribute-checkbox = abap_true then cl_gui_alv_grid=>mc_style_hotspot ) + 846 | cond #( when field-attribute-readonly = abap_true or 847 | field-attribute-checkbox = abap_true then cl_gui_alv_grid=>mc_style_disabled ) + 848 | cond raw4( when field-attribute-checkbox = abap_true then 849 | cond #( 850 | when field-value = 'X' then alv_style_checkbox_checked 851 | else alv_style_checkbox_not_checked ) ) + 852 | cond #( when has_search_help( field ) then cl_gui_alv_grid=>mc_style_f4 ) ) ). 853 | endmethod. 854 | 855 | 856 | method set_label_length. 857 | if long && medium && short <> space. 858 | long_descr = long. 859 | medium_descr = medium. 860 | short_descr = short. 861 | endif. 862 | result = me. 863 | endmethod. 864 | 865 | 866 | method set_readonly. 867 | readonly = in. 868 | re_build_fieldcatalog( ). 869 | refresh_input_table( ). 870 | result = me. 871 | endmethod. 872 | 873 | 874 | method set_value_length. 875 | if in is not initial. 876 | max_outputlen = in. 877 | endif. 878 | result = me. 879 | endmethod. 880 | 881 | method process_f4. 882 | if line_exists( inputs[ row ] ). 883 | data(field) = build_field( inputs[ row ] ). 884 | if field-attribute-f4_exit = abap_false. 885 | 886 | use_selected_field( 887 | i_row = row 888 | i_event = event 889 | it_return = show_search_help( field ) ). 890 | 891 | event->m_event_handled = abap_true. 892 | endif. 893 | endif. 894 | endmethod. 895 | 896 | method use_selected_field. 897 | 898 | if it_return is not initial. 899 | field-symbols type lvc_t_modi. 900 | assign i_event->m_data->* to . 901 | insert value #( row_id = i_row 902 | fieldname = constants=>fieldname-value 903 | value = it_return[ 1 ]-fieldval ) into table . 904 | endif. 905 | 906 | endmethod. 907 | 908 | 909 | 910 | 911 | method show_search_help. 912 | call function 'F4IF_FIELD_VALUE_REQUEST' 913 | exporting 914 | tabname = field-ddic-tabname 915 | fieldname = field-ddic-fieldname 916 | tables 917 | return_tab = result 918 | exceptions 919 | others = 0. 920 | endmethod. 921 | 922 | endclass. 923 | -------------------------------------------------------------------------------- /code/zcl_stralv_output_table.clas.locals_def.abap: -------------------------------------------------------------------------------- 1 | class types definition inheriting from zcl_stralv_types abstract. 2 | endclass. 3 | class constants definition inheriting from zcl_stralv_constants abstract. 4 | endclass. 5 | -------------------------------------------------------------------------------- /code/zcl_stralv_output_table.clas.macros.abap: -------------------------------------------------------------------------------- 1 | define _get_structure_ref. 2 | field-symbols type any. 3 | assign screendata->* to . 4 | end-of-definition. 5 | 6 | define _get_field_ref. 7 | field-symbols type any. 8 | assign component &1-ddic-fieldname of structure to . 9 | if sy-subrc <> 0. 10 | return. 11 | endif. 12 | end-of-definition. 13 | -------------------------------------------------------------------------------- /code/zcl_stralv_output_table.clas.xml: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | ZCL_STRALV_OUTPUT_TABLE 7 | E 8 | Assembling the output table 9 | 1 10 | X 11 | X 12 | X 13 | 14 | 15 | 16 | 17 | -------------------------------------------------------------------------------- /code/zcl_stralv_settings.clas.abap: -------------------------------------------------------------------------------- 1 | class zcl_stralv_settings definition 2 | public 3 | final 4 | create public . 5 | 6 | public section. 7 | types self type ref to zcl_stralv_settings. 8 | data: 9 | structure_name type ddobjname, 10 | container type ref to cl_gui_container, 11 | value_width type i, 12 | readonly type flag, 13 | max_description_length type i, 14 | use_long_labels type abap_bool, 15 | use_medium_labels type abap_bool, 16 | use_short_labels type abap_bool, 17 | data_ref type ref to data, 18 | fields type ref to zcl_stralv_fields. 19 | methods: 20 | constructor, 21 | 22 | field 23 | importing 24 | name type lvc_fname 25 | returning 26 | value(result) type ref to zcl_stralv_field 27 | RAISING 28 | zcx_stralv_error, 29 | 30 | set_data 31 | importing 32 | in type ref to data 33 | returning 34 | value(result) type self, 35 | 36 | set_container 37 | importing 38 | in type ref to cl_gui_container 39 | returning 40 | value(result) type self, 41 | 42 | set_value_width 43 | importing 44 | in type i 45 | returning 46 | value(result) type self, 47 | 48 | set_readonly 49 | importing 50 | in type abap_bool default abap_true 51 | returning 52 | value(result) type self, 53 | 54 | set_description_width 55 | importing 56 | in type i 57 | returning 58 | value(result) type self, 59 | 60 | set_use_long_labels 61 | importing 62 | in type abap_bool 63 | returning 64 | value(result) type self, 65 | 66 | set_use_medium_labels 67 | importing 68 | in type abap_bool 69 | returning 70 | value(result) type self, 71 | 72 | set_use_short_labels 73 | importing 74 | in type abap_bool 75 | returning 76 | value(result) type self. 77 | protected section. 78 | private section. 79 | endclass. 80 | 81 | 82 | 83 | class zcl_stralv_settings implementation. 84 | 85 | method constructor. 86 | value_width = 20. 87 | endmethod. 88 | 89 | method set_data. 90 | structure_name = cl_abap_typedescr=>describe_by_data_ref( in )->get_relative_name( ). 91 | data_ref = in. 92 | fields = new #( in ). 93 | result = me. 94 | endmethod. 95 | 96 | method set_container. 97 | me->container = in. 98 | result = me. 99 | endmethod. 100 | 101 | method set_value_width. 102 | me->value_width = in. 103 | result = me. 104 | endmethod. 105 | 106 | method set_readonly. 107 | me->readonly = in. 108 | result = me. 109 | endmethod. 110 | 111 | method set_description_width. 112 | me->max_description_length = in. 113 | result = me. 114 | endmethod. 115 | 116 | method set_use_long_labels. 117 | me->use_long_labels = in. 118 | result = me. 119 | endmethod. 120 | 121 | method set_use_medium_labels. 122 | me->use_medium_labels = in. 123 | result = me. 124 | endmethod. 125 | 126 | method set_use_short_labels. 127 | me->use_short_labels = in. 128 | result = me. 129 | endmethod. 130 | 131 | 132 | method field. 133 | if fields is not bound. 134 | raise exception type zcx_stralv_not_initialized. 135 | endif. 136 | result = fields->get_field( name ). 137 | endmethod. 138 | 139 | 140 | 141 | endclass. 142 | -------------------------------------------------------------------------------- /code/zcl_stralv_settings.clas.xml: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | ZCL_STRALV_SETTINGS 7 | E 8 | Settings for STRALV 9 | 1 10 | X 11 | X 12 | X 13 | 14 | 15 | 16 | 17 | -------------------------------------------------------------------------------- /code/zcl_stralv_types.clas.abap: -------------------------------------------------------------------------------- 1 | class zcl_stralv_types definition 2 | public 3 | abstract 4 | create public . 5 | 6 | public section. 7 | types: 8 | begin of field_attr, 9 | fieldname type lvc_fname, 10 | checkbox type abap_bool, 11 | hotspot type lvc_hotspt, 12 | readonly type abap_bool, 13 | description_field type lvc_fname, 14 | struc_descr_field type lvc_fname, 15 | radio_group type char3, 16 | no_display type abap_bool, 17 | no_label type abap_bool, 18 | f4_exit type abap_bool, 19 | color type lvc_s_colo, 20 | end of field_attr, 21 | field_attributes type standard table of field_attr with empty key. 22 | 23 | 24 | types alv_table_lines type standard table of zst_stralv_tab_line with default key. 25 | 26 | types: 27 | begin of field_object, 28 | name type lvc_fname, 29 | object type ref to zcl_stralv_field, 30 | end of field_object, 31 | field_objects type standard table of field_object with empty key. 32 | 33 | types label type c length 128. 34 | types structure_fields type standard table of dd03p with default key. 35 | 36 | types: 37 | begin of units, 38 | qty_unit type meinh, 39 | currency type waers, 40 | end of units. 41 | 42 | types: 43 | begin of field, 44 | ddic type dd03p, 45 | attribute type field_attr, 46 | units type units, 47 | value type string, 48 | end of field. 49 | 50 | types: 51 | begin of foreign_key_result, 52 | failures type standard table of ddfkeyrc with default key, 53 | conditions type standard table of ddwherecnd with empty key, 54 | end of foreign_key_result. 55 | 56 | types search_help_return type standard table of ddshretval with default key. 57 | protected section. 58 | private section. 59 | endclass. 60 | 61 | 62 | 63 | class zcl_stralv_types implementation. 64 | endclass. 65 | -------------------------------------------------------------------------------- /code/zcl_stralv_types.clas.xml: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | ZCL_STRALV_TYPES 7 | E 8 | Types 9 | 1 10 | X 11 | X 12 | X 13 | 14 | 15 | 16 | 17 | -------------------------------------------------------------------------------- /code/zcx_stralv_data_create.clas.abap: -------------------------------------------------------------------------------- 1 | class ZCX_STRALV_DATA_CREATE definition 2 | public 3 | inheriting from ZCX_STRALV_ERROR 4 | create public . 5 | 6 | public section. 7 | 8 | constants ZCX_STRALV_DATA_CREATE type SOTR_CONC value '005056B16FE81EEE8ECBB5CF9C18D582' ##NO_TEXT. 9 | 10 | methods CONSTRUCTOR 11 | importing 12 | !TEXTID like TEXTID optional 13 | !PREVIOUS like PREVIOUS optional . 14 | protected section. 15 | private section. 16 | ENDCLASS. 17 | 18 | 19 | 20 | CLASS ZCX_STRALV_DATA_CREATE IMPLEMENTATION. 21 | 22 | 23 | method CONSTRUCTOR. 24 | CALL METHOD SUPER->CONSTRUCTOR 25 | EXPORTING 26 | TEXTID = TEXTID 27 | PREVIOUS = PREVIOUS 28 | . 29 | IF textid IS INITIAL. 30 | me->textid = ZCX_STRALV_DATA_CREATE . 31 | ENDIF. 32 | endmethod. 33 | ENDCLASS. 34 | -------------------------------------------------------------------------------- /code/zcx_stralv_data_create.clas.xml: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | ZCX_STRALV_DATA_CREATE 7 | E 8 | Error in data creation 9 | 40 10 | 1 11 | X 12 | X 13 | X 14 | 15 | 16 | 17 |
18 | 005056B16FE81EEE8ECBB5CF9C18D582 19 | E 20 | 1 21 | CA== 22 |
23 | 24 | 25 | 005056B16FE81EEE8ECBB5CF9C18D582 26 | E 27 | 0001 28 | X 29 | R 30 | 255 31 | Error creating data for structure 32 | 33 | 34 |
35 |
36 | 37 | 38 | LIMU 39 | CPUB 40 | ZCX_STRALV_DATA_CREATE 41 | 005056B16FE81EEE8ECBB5CF9C18D582 42 | 0001 43 | 44 | 45 | 46 | 47 | LIMU 48 | CPUB 49 | ZCX_STRALV_DATA_CREATE 50 | 0001 51 | 52 | 53 | 54 | 55 | CONSTRUCTOR 56 | E 57 | CONSTRUCTOR 58 | 59 | 60 |
61 |
62 |
63 | -------------------------------------------------------------------------------- /code/zcx_stralv_error.clas.abap: -------------------------------------------------------------------------------- 1 | class ZCX_STRALV_ERROR definition 2 | public 3 | inheriting from CX_STATIC_CHECK 4 | create public . 5 | 6 | public section. 7 | 8 | methods CONSTRUCTOR 9 | importing 10 | !TEXTID like TEXTID optional 11 | !PREVIOUS like PREVIOUS optional . 12 | protected section. 13 | private section. 14 | ENDCLASS. 15 | 16 | 17 | 18 | CLASS ZCX_STRALV_ERROR IMPLEMENTATION. 19 | 20 | 21 | method CONSTRUCTOR. 22 | CALL METHOD SUPER->CONSTRUCTOR 23 | EXPORTING 24 | TEXTID = TEXTID 25 | PREVIOUS = PREVIOUS 26 | . 27 | endmethod. 28 | ENDCLASS. 29 | -------------------------------------------------------------------------------- /code/zcx_stralv_error.clas.xml: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | ZCX_STRALV_ERROR 7 | E 8 | Generic 9 | 40 10 | 1 11 | X 12 | X 13 | X 14 | 15 | 16 | 17 | CONSTRUCTOR 18 | E 19 | CONSTRUCTOR 20 | 21 | 22 | 23 | 24 | 25 | -------------------------------------------------------------------------------- /code/zcx_stralv_input_error.clas.abap: -------------------------------------------------------------------------------- 1 | class ZCX_STRALV_INPUT_ERROR definition 2 | public 3 | inheriting from ZCX_STRALV_ERROR 4 | final 5 | create public . 6 | 7 | public section. 8 | 9 | interfaces IF_T100_DYN_MSG . 10 | interfaces IF_T100_MESSAGE . 11 | 12 | data CELL type LVC_S_MODI . 13 | 14 | methods CONSTRUCTOR 15 | importing 16 | !TEXTID like IF_T100_MESSAGE=>T100KEY optional 17 | !PREVIOUS like PREVIOUS optional 18 | !CELL type LVC_S_MODI optional . 19 | protected section. 20 | private section. 21 | ENDCLASS. 22 | 23 | 24 | 25 | CLASS ZCX_STRALV_INPUT_ERROR IMPLEMENTATION. 26 | 27 | 28 | method CONSTRUCTOR. 29 | CALL METHOD SUPER->CONSTRUCTOR 30 | EXPORTING 31 | PREVIOUS = PREVIOUS 32 | . 33 | me->CELL = CELL . 34 | clear me->textid. 35 | if textid is initial. 36 | IF_T100_MESSAGE~T100KEY = IF_T100_MESSAGE=>DEFAULT_TEXTID. 37 | else. 38 | IF_T100_MESSAGE~T100KEY = TEXTID. 39 | endif. 40 | endmethod. 41 | ENDCLASS. 42 | -------------------------------------------------------------------------------- /code/zcx_stralv_input_error.clas.xml: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | ZCX_STRALV_INPUT_ERROR 7 | E 8 | Error in input 9 | 40 10 | 1 11 | X 12 | X 13 | X 14 | 15 | 16 | 17 | CELL 18 | E 19 | ALV control: Modified cells for application 20 | 21 | 22 | CONSTRUCTOR 23 | E 24 | CONSTRUCTOR 25 | 26 | 27 | 28 | 29 | 30 | -------------------------------------------------------------------------------- /code/zcx_stralv_invalid_para.clas.abap: -------------------------------------------------------------------------------- 1 | class ZCX_STRALV_INVALID_PARA definition 2 | public 3 | inheriting from ZCX_STRALV_ERROR 4 | create public . 5 | 6 | public section. 7 | 8 | constants ZCX_STRALV_INVALID_PARA type SOTR_CONC value '005056B16FE81EEE8ECD6148AF6D1825' ##NO_TEXT. 9 | 10 | methods CONSTRUCTOR 11 | importing 12 | !TEXTID like TEXTID optional 13 | !PREVIOUS like PREVIOUS optional . 14 | protected section. 15 | private section. 16 | ENDCLASS. 17 | 18 | 19 | 20 | CLASS ZCX_STRALV_INVALID_PARA IMPLEMENTATION. 21 | 22 | 23 | method CONSTRUCTOR. 24 | CALL METHOD SUPER->CONSTRUCTOR 25 | EXPORTING 26 | TEXTID = TEXTID 27 | PREVIOUS = PREVIOUS 28 | . 29 | IF textid IS INITIAL. 30 | me->textid = ZCX_STRALV_INVALID_PARA . 31 | ENDIF. 32 | endmethod. 33 | ENDCLASS. 34 | -------------------------------------------------------------------------------- /code/zcx_stralv_invalid_para.clas.xml: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | ZCX_STRALV_INVALID_PARA 7 | E 8 | Too many parameters 9 | 40 10 | 1 11 | X 12 | X 13 | X 14 | 15 | 16 | 17 |
18 | 005056B16FE81EEE8ECD6148AF6D1825 19 | E 20 | 1 21 | CA== 22 |
23 | 24 | 25 | 005056B16FE81EEE8ECD6148AF6D1825 26 | E 27 | 0001 28 | X 29 | R 30 | 255 31 | Invalid parameters in ALV call 32 | 33 | 34 |
35 |
36 | 37 | 38 | LIMU 39 | CPUB 40 | ZCX_STRALV_INVALID_PARA 41 | 005056B16FE81EEE8ECD6148AF6D1825 42 | 0001 43 | 44 | 45 | 46 | 47 | LIMU 48 | CPUB 49 | ZCX_STRALV_INVALID_PARA 50 | 0001 51 | 52 | 53 | 54 | 55 | CONSTRUCTOR 56 | E 57 | CONSTRUCTOR 58 | 59 | 60 |
61 |
62 |
63 | -------------------------------------------------------------------------------- /code/zcx_stralv_not_initialized.clas.abap: -------------------------------------------------------------------------------- 1 | class ZCX_STRALV_NOT_INITIALIZED definition 2 | public 3 | inheriting from ZCX_STRALV_ERROR 4 | final 5 | create public . 6 | 7 | public section. 8 | 9 | constants ZCX_STRALV_NOT_INITIALIZED type SOTR_CONC value '005056B16FE81EDE8ED66FBF88226656' ##NO_TEXT. 10 | 11 | methods CONSTRUCTOR 12 | importing 13 | !TEXTID like TEXTID optional 14 | !PREVIOUS like PREVIOUS optional . 15 | protected section. 16 | private section. 17 | ENDCLASS. 18 | 19 | 20 | 21 | CLASS ZCX_STRALV_NOT_INITIALIZED IMPLEMENTATION. 22 | 23 | 24 | method CONSTRUCTOR. 25 | CALL METHOD SUPER->CONSTRUCTOR 26 | EXPORTING 27 | TEXTID = TEXTID 28 | PREVIOUS = PREVIOUS 29 | . 30 | IF textid IS INITIAL. 31 | me->textid = ZCX_STRALV_NOT_INITIALIZED . 32 | ENDIF. 33 | endmethod. 34 | ENDCLASS. 35 | -------------------------------------------------------------------------------- /code/zcx_stralv_not_initialized.clas.xml: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | ZCX_STRALV_NOT_INITIALIZED 7 | E 8 | Data ref is not initialized 9 | 40 10 | 1 11 | X 12 | X 13 | X 14 | 15 | 16 | 17 |
18 | 005056B16FE81EDE8ED66FBF88226656 19 | E 20 | 1 21 | CA== 22 |
23 | 24 | 25 | 005056B16FE81EDE8ED66FBF88226656 26 | E 27 | 0001 28 | X 29 | R 30 | 255 31 | Class has not been initialized 32 | 33 | 34 |
35 |
36 | 37 | 38 | LIMU 39 | CPUB 40 | ZCX_STRALV_NOT_INITIALIZED 41 | 005056B16FE81EDE8ED66FBF88226656 42 | 0001 43 | 44 | 45 | 46 | 47 | LIMU 48 | CPUB 49 | ZCX_STRALV_NOT_INITIALIZED 50 | 0001 51 | 52 | 53 | 54 | 55 | CONSTRUCTOR 56 | E 57 | CONSTRUCTOR 58 | 59 | 60 |
61 |
62 |
63 | -------------------------------------------------------------------------------- /code/zcx_stralv_program_error.clas.abap: -------------------------------------------------------------------------------- 1 | class ZCX_STRALV_PROGRAM_ERROR definition 2 | public 3 | inheriting from ZCX_STRALV_ERROR 4 | create public . 5 | 6 | public section. 7 | 8 | constants ZCX_STRALV_PROGRAM_ERROR type SOTR_CONC value '005056B16FE81EEE8ECD695192381829' ##NO_TEXT. 9 | 10 | methods CONSTRUCTOR 11 | importing 12 | !TEXTID like TEXTID optional 13 | !PREVIOUS like PREVIOUS optional . 14 | protected section. 15 | private section. 16 | ENDCLASS. 17 | 18 | 19 | 20 | CLASS ZCX_STRALV_PROGRAM_ERROR IMPLEMENTATION. 21 | 22 | 23 | method CONSTRUCTOR. 24 | CALL METHOD SUPER->CONSTRUCTOR 25 | EXPORTING 26 | TEXTID = TEXTID 27 | PREVIOUS = PREVIOUS 28 | . 29 | IF textid IS INITIAL. 30 | me->textid = ZCX_STRALV_PROGRAM_ERROR . 31 | ENDIF. 32 | endmethod. 33 | ENDCLASS. 34 | -------------------------------------------------------------------------------- /code/zcx_stralv_program_error.clas.xml: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | ZCX_STRALV_PROGRAM_ERROR 7 | E 8 | Too many parameters 9 | 40 10 | 1 11 | X 12 | X 13 | X 14 | 15 | 16 | 17 |
18 | 005056B16FE81EEE8ECD695192381829 19 | E 20 | 1 21 | CA== 22 |
23 | 24 | 25 | 005056B16FE81EEE8ECD695192381829 26 | E 27 | 0001 28 | X 29 | R 30 | 255 31 | Program error calling ALV 32 | 33 | 34 |
35 |
36 | 37 | 38 | LIMU 39 | CPUB 40 | ZCX_STRALV_PROGRAM_ERROR 41 | 005056B16FE81EEE8ECD695192381829 42 | 0001 43 | 44 | 45 | 46 | 47 | LIMU 48 | CPUB 49 | ZCX_STRALV_PROGRAM_ERROR 50 | 0001 51 | 52 | 53 | 54 | 55 | CONSTRUCTOR 56 | E 57 | CONSTRUCTOR 58 | 59 | 60 |
61 |
62 |
63 | -------------------------------------------------------------------------------- /code/zcx_stralv_too_many_lines.clas.abap: -------------------------------------------------------------------------------- 1 | class ZCX_STRALV_TOO_MANY_LINES definition 2 | public 3 | inheriting from ZCX_STRALV_ERROR 4 | create public . 5 | 6 | public section. 7 | 8 | constants ZCX_STRALV_TOO_MANY_LINES type SOTR_CONC value '005056B16FE81EEE8ECD65DC6F291828' ##NO_TEXT. 9 | 10 | methods CONSTRUCTOR 11 | importing 12 | !TEXTID like TEXTID optional 13 | !PREVIOUS like PREVIOUS optional . 14 | protected section. 15 | private section. 16 | ENDCLASS. 17 | 18 | 19 | 20 | CLASS ZCX_STRALV_TOO_MANY_LINES IMPLEMENTATION. 21 | 22 | 23 | method CONSTRUCTOR. 24 | CALL METHOD SUPER->CONSTRUCTOR 25 | EXPORTING 26 | TEXTID = TEXTID 27 | PREVIOUS = PREVIOUS 28 | . 29 | IF textid IS INITIAL. 30 | me->textid = ZCX_STRALV_TOO_MANY_LINES . 31 | ENDIF. 32 | endmethod. 33 | ENDCLASS. 34 | -------------------------------------------------------------------------------- /code/zcx_stralv_too_many_lines.clas.xml: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | ZCX_STRALV_TOO_MANY_LINES 7 | E 8 | Too many parameters 9 | 40 10 | 1 11 | X 12 | X 13 | X 14 | 15 | 16 | 17 |
18 | 005056B16FE81EEE8ECD65DC6F291828 19 | E 20 | 1 21 | CA== 22 |
23 | 24 | 25 | 005056B16FE81EEE8ECD65DC6F291828 26 | E 27 | 0001 28 | X 29 | R 30 | 255 31 | Too many lines 32 | 33 | 34 |
35 |
36 | 37 | 38 | LIMU 39 | CPUB 40 | ZCX_STRALV_TOO_MANY_LINES 41 | 005056B16FE81EEE8ECD65DC6F291828 42 | 0001 43 | 44 | 45 | 46 | 47 | LIMU 48 | CPUB 49 | ZCX_STRALV_TOO_MANY_LINES 50 | 0001 51 | 52 | 53 | 54 | 55 | CONSTRUCTOR 56 | E 57 | CONSTRUCTOR 58 | 59 | 60 |
61 |
62 |
63 | -------------------------------------------------------------------------------- /code/zcx_stralv_unknown_field.clas.abap: -------------------------------------------------------------------------------- 1 | class ZCX_STRALV_UNKNOWN_FIELD definition 2 | public 3 | inheriting from ZCX_STRALV_ERROR 4 | create public . 5 | 6 | public section. 7 | 8 | constants ZCX_STRALV_UNKNOWN_FIELD type SOTR_CONC value '005056B16FE81EDE8ED5BA3713780530' ##NO_TEXT. 9 | data NAME type LVC_FNAME . 10 | 11 | methods CONSTRUCTOR 12 | importing 13 | !TEXTID like TEXTID optional 14 | !PREVIOUS like PREVIOUS optional 15 | !NAME type LVC_FNAME optional . 16 | protected section. 17 | private section. 18 | ENDCLASS. 19 | 20 | 21 | 22 | CLASS ZCX_STRALV_UNKNOWN_FIELD IMPLEMENTATION. 23 | 24 | 25 | method CONSTRUCTOR. 26 | CALL METHOD SUPER->CONSTRUCTOR 27 | EXPORTING 28 | TEXTID = TEXTID 29 | PREVIOUS = PREVIOUS 30 | . 31 | IF textid IS INITIAL. 32 | me->textid = ZCX_STRALV_UNKNOWN_FIELD . 33 | ENDIF. 34 | me->NAME = NAME . 35 | endmethod. 36 | ENDCLASS. 37 | -------------------------------------------------------------------------------- /code/zcx_stralv_unknown_field.clas.xml: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | ZCX_STRALV_UNKNOWN_FIELD 7 | E 8 | Unknown field addressed 9 | 40 10 | 1 11 | X 12 | X 13 | X 14 | 15 | 16 | 17 |
18 | 005056B16FE81EDE8ED5BA3713780530 19 | E 20 | 1 21 | CA== 22 |
23 | 24 | 25 | 005056B16FE81EDE8ED5BA3713780530 26 | E 27 | 0001 28 | X 29 | R 30 | 255 31 | Unknown field addressed 32 | 33 | 34 |
35 |
36 | 37 | 38 | LIMU 39 | CPUB 40 | ZCX_STRALV_UNKNOWN_FIELD 41 | 005056B16FE81EDE8ED5BA3713780530 42 | 0001 43 | 44 | 45 | 46 | 47 | LIMU 48 | CPUB 49 | ZCX_STRALV_UNKNOWN_FIELD 50 | 0001 51 | 52 | 53 | 54 | 55 | CONSTRUCTOR 56 | E 57 | CONSTRUCTOR 58 | 59 | 60 | NAME 61 | E 62 | ALV control: Field name of internal table field 63 | 64 | 65 |
66 |
67 |
68 | -------------------------------------------------------------------------------- /code/zif_stralv_main.intf.abap: -------------------------------------------------------------------------------- 1 | interface zif_stralv_main 2 | public . 3 | *"* public components of class ZCL_DV01_ALV 4 | *"* do not include other source files here!!! 5 | events enter_pressed . 6 | 7 | events data_has_changed . 8 | 9 | events toolbar 10 | exporting 11 | value(e_object) type ref to cl_alv_event_toolbar_set optional 12 | value(e_interactive) type char01 optional. 13 | 14 | events user_command 15 | exporting 16 | value(e_ucomm) type ui_func. 17 | 18 | 19 | events link_clicked 20 | exporting 21 | value(ev_fieldname) type lvc_fname 22 | value(ev_value) type any . 23 | 24 | events double_clicked 25 | exporting 26 | value(ev_fieldname) type lvc_fname 27 | value(ev_value) type any . 28 | 29 | methods field 30 | importing 31 | in type lvc_fname 32 | returning 33 | value(result) type ref to zcl_stralv_field 34 | raising 35 | zcx_stralv_error. 36 | 37 | methods set_display_tab 38 | importing 39 | it_in type zcl_stralv_types=>alv_table_lines . 40 | 41 | methods set_title 42 | importing 43 | iv_title type c 44 | small type abap_bool default abap_true. 45 | 46 | methods set_data_by_ref 47 | importing 48 | data type ref to data . 49 | 50 | methods refresh 51 | raising 52 | zcx_stralv_data_create . 53 | 54 | methods set_label 55 | importing 56 | iv_fieldname type lvc_fname 57 | iv_label type zcl_stralv_types=>label . 58 | 59 | methods set_readonly 60 | importing 61 | iv_readonly type abap_bool 62 | raising 63 | zcx_stralv_error . 64 | 65 | methods get_read_only 66 | returning 67 | value(rv_res) type abap_bool . 68 | 69 | methods get_label 70 | importing 71 | iv_fieldname type lvc_fname 72 | returning 73 | value(rv_res) type zcl_stralv_types=>label. 74 | 75 | methods get_display_tab 76 | returning 77 | value(rt_res) type zcl_stralv_types=>alv_table_lines . 78 | 79 | methods display 80 | importing 81 | iv_optimized type abap_bool optional 82 | raising 83 | zcx_stralv_error . 84 | 85 | methods get_data 86 | returning 87 | value(rr_res) type ref to data . 88 | 89 | endinterface. 90 | -------------------------------------------------------------------------------- /code/zif_stralv_main.intf.xml: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | ZIF_STRALV_MAIN 7 | E 8 | ALV for structures 9 | 2 10 | 1 11 | X 12 | 13 | 14 | 15 | 16 | -------------------------------------------------------------------------------- /code/zst_stralv_demo.tabl.xml: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | ZST_STRALV_DEMO 7 | E 8 | INTTAB 9 | For demo programs 10 | E 11 | 1 12 | 13 | 14 | 15 | MATNR 16 | MATNR 17 | MARA 18 | 0 19 | P 20 | S_MAT1 21 | MATNR 22 | E 23 | 24 | 25 | YESNO 26 | DOKU_SLCT 27 | 0 28 | X 29 | F 30 | E 31 | 32 | 33 | LONG_TEXT 34 | TEXT132 35 | 0 36 | E 37 | 38 | 39 | VBTYP 40 | VBTYP 41 | 0 42 | X 43 | F 44 | E 45 | 46 | 47 | MENGE 48 | MENGV13 49 | 0 50 | ZST_STRALV_DEMO 51 | MEINS 52 | E 53 | 54 | 55 | MEINS 56 | MEINH 57 | 0 58 | E 59 | 60 | 61 | WERKS 62 | WERKS_D 63 | T001W 64 | 0 65 | P 66 | H_T001W_C 67 | WERKS 68 | E 69 | 70 | 71 | 72 | 73 | MATNR 74 | SYST 75 | MANDT 76 | MARA 77 | MANDT 78 | 0001 79 | MANDT 80 | CLNT 81 | 82 | 83 | MATNR 84 | ZST_STRALV_DEMO 85 | MATNR 86 | MARA 87 | MATNR 88 | 0002 89 | MATNR 90 | CHAR 91 | 92 | 93 | WERKS 94 | SYST 95 | MANDT 96 | T001W 97 | MANDT 98 | 0001 99 | MANDT 100 | CLNT 101 | 102 | 103 | WERKS 104 | ZST_STRALV_DEMO 105 | WERKS 106 | T001W 107 | WERKS 108 | 0002 109 | WERKS 110 | CHAR 111 | 112 | 113 | 114 | 115 | MATNR 116 | MARA 117 | 118 | 119 | WERKS 120 | T001W 121 | 122 | 123 | 124 | 125 | 126 | -------------------------------------------------------------------------------- /code/zst_stralv_tab_line.tabl.xml: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | ZST_STRALV_TAB_LINE 7 | INTTAB 8 | D 9 | 1 10 | 11 | 12 | 13 | FIELDLABEL 14 | SCRTEXT_L 15 | 0 16 | E 17 | 18 | 19 | FIELDVALUE 20 | TEXT128 21 | 0 22 | E 23 | 24 | 25 | FIELDDESCR 26 | TEXT128 27 | 0 28 | E 29 | 30 | 31 | REF_FIELD 32 | LVC_RFNAME 33 | 0 34 | E 35 | 36 | 37 | REF_TABLE 38 | LVC_RTNAME 39 | 0 40 | E 41 | 42 | 43 | MAXLEN 44 | INT4 45 | 0 46 | E 47 | 48 | 49 | T_STYLES 50 | LVC_T_STYL 51 | 0 52 | TTYP 53 | TTYPL 54 | L 55 | 56 | 57 | T_COLORS 58 | LVC_T_SCOL 59 | 0 60 | TTYP 61 | TTYPL 62 | L 63 | 64 | 65 | 66 | D 67 | R 68 | 69 | 70 | 71 | D 72 | Struktur für ALV-basierte Eingabe 73 | 74 | 75 | R 76 | Struktur für ALV-basierte Eingabe 77 | 78 | 79 | 80 | 81 | 82 | -------------------------------------------------------------------------------- /code/zstralv_demo01.prog.abap: -------------------------------------------------------------------------------- 1 | *&---------------------------------------------------------------------* 2 | *& Report zstralv_demo01 3 | *&---------------------------------------------------------------------* 4 | *& Demo for display values of a structure in an ALV table 5 | *& where one line is shown for each component 6 | *& Demo case: simple call for displaying 7 | *&---------------------------------------------------------------------* 8 | report zstralv_demo01. 9 | 10 | data okcode type syucomm. 11 | tables zst_stralv_demo. 12 | 13 | class application definition. 14 | public section. 15 | methods pbo. 16 | 17 | private section. 18 | data screen_data type zst_stralv_demo. 19 | data stralv type ref to zif_stralv_main. 20 | 21 | methods create_a_container 22 | returning 23 | value(result) type ref to cl_gui_custom_container. 24 | 25 | methods get_settings 26 | returning 27 | value(result) type zcl_stralv_settings=>self 28 | raising 29 | zcx_stralv_error. 30 | endclass. 31 | 32 | class application implementation. 33 | 34 | method pbo. 35 | if stralv is not bound. 36 | screen_data = zst_stralv_demo. 37 | try. 38 | stralv = zcl_stralv_main=>new( get_settings( ) ). 39 | stralv->display( ). 40 | catch zcx_stralv_error into data(e). 41 | message e type 'I' display like 'E'. 42 | endtry. 43 | endif. 44 | endmethod. 45 | 46 | method get_settings. 47 | " set_container and set_data are obligatory 48 | " furthermore, we set the control to display only 49 | result = new zcl_stralv_settings( 50 | )->set_container( create_a_container( ) 51 | )->set_data( ref #( screen_data ) 52 | )->set_readonly( ). 53 | 54 | endmethod. 55 | 56 | method create_a_container. 57 | result = new cl_gui_custom_container( 'VIEWPORT' ). 58 | endmethod. 59 | 60 | 61 | endclass. 62 | 63 | data app type ref to application. 64 | 65 | start-of-selection. 66 | zst_stralv_demo = 67 | value #( 68 | long_text = 'Sample data' 69 | menge = 1 70 | meins = 'ST' ). 71 | app = new #( ). 72 | call screen 1. 73 | 74 | *&---------------------------------------------------------------------* 75 | *& Module STATUS_0001 OUTPUT 76 | *&---------------------------------------------------------------------* 77 | * text 78 | *----------------------------------------------------------------------* 79 | module status_0001 output. 80 | set pf-status '1'. 81 | set titlebar '1'. 82 | app->pbo( ). 83 | endmodule. 84 | *&---------------------------------------------------------------------* 85 | *& Module USER_COMMAND_0001 INPUT 86 | *&---------------------------------------------------------------------* 87 | * text 88 | *----------------------------------------------------------------------* 89 | module user_command_0001 input. 90 | if okcode = 'EXIT'. 91 | set screen 0. 92 | endif. 93 | endmodule. 94 | -------------------------------------------------------------------------------- /code/zstralv_demo01.prog.xml: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | ZSTRALV_DEMO01 7 | S 8 | 1 9 | X 10 | D$S 11 | X 12 | 13 | 14 | 15 |
16 | ZSTRALV_DEMO01 17 | 0001 18 | E 19 | Demo dynpro 20 | N 21 | 0001 22 | 027 23 | 122 24 |
25 | 26 | 27 | SCREEN 28 | SCREEN 29 | 30 | 31 | CUST_CTRL 32 | VIEWPORT 33 | SCREEN 34 | 001 35 | 001 36 | 067 37 | 017 38 | 39 | 40 | 41 | 42 | SCREEN 43 | SCREEN 44 | TEXT 45 | %#AUTOTEXT001 46 | Structured_ALV_Demo 47 | 001 48 | 073 49 | 019 50 | 019 51 | 001 52 | CHAR 53 | N 54 | 55 | 56 | SCREEN 57 | SCREEN 58 | TEXT 59 | %#AUTOTEXT002 60 | Demo_case:_simple_call 61 | 002 62 | 073 63 | 022 64 | 022 65 | 001 66 | CHAR 67 | N 68 | 69 | 70 | SCREEN 71 | SCREEN 72 | OKCODE 73 | OKCODE 74 | ____________________ 75 | 020 76 | 020 77 | 001 78 | CHAR 79 | X 80 | 81 | 82 | 83 | 84 | PROCESS BEFORE OUTPUT. 85 | 86 | 87 | MODULE STATUS_0001. 88 | 89 | 90 | * 91 | 92 | 93 | PROCESS AFTER INPUT. 94 | 95 | 96 | MODULE USER_COMMAND_0001. 97 | 98 | 99 |
100 |
101 | 102 | 103 | 000001 104 | 000001 105 | 106 | 107 | 108 | 1 109 | D 110 | 000001 111 | 000001 112 | 0001 113 | Main 114 | 115 | 116 | 117 | 118 | EXIT 119 | 001 120 | S 121 | Exit 122 | 123 | 124 | EXIT 125 | 002 126 | S 127 | ICON_CANCEL 128 | @0W@ 129 | Cancel 130 | 131 | 132 | 133 | 134 | 000001 135 | 12 136 | EXIT 137 | 002 138 | 139 | 140 | 000001 141 | 15 142 | EXIT 143 | 001 144 | 145 | 146 | 147 | 148 | 1 149 | EXIT 150 | 151 | 152 | 153 | 154 | A 155 | 000001 156 | D 157 | Main 158 | 159 | 160 | P 161 | 000001 162 | D 163 | Main 164 | 165 | 166 | B 167 | 000001 168 | 0001 169 | D 170 | Main 171 | 172 | 173 | 174 | 175 | 1 176 | Structured ALV - simple call 177 | 178 | 179 | 180 | 181 | 182 | R 183 | Simple call 184 | 11 185 | 186 | 187 |
188 |
189 |
190 | -------------------------------------------------------------------------------- /code/zstralv_demo02.prog.abap: -------------------------------------------------------------------------------- 1 | *&---------------------------------------------------------------------* 2 | *& Report zstralv_demo02 3 | *&---------------------------------------------------------------------* 4 | *& Demo for maintaining values of a structure in an ALV table 5 | *& where one line is shown for each component 6 | *& Demo case: call for maintenance, usage of event DATA_HAS_CHANGED 7 | *&---------------------------------------------------------------------* 8 | report zstralv_demo02. 9 | 10 | data okcode type syucomm. 11 | tables zst_stralv_demo. 12 | 13 | class application definition. 14 | public section. 15 | methods pbo. 16 | 17 | private section. 18 | data screen_data type zst_stralv_demo. 19 | data stralv type ref to zif_stralv_main. 20 | 21 | methods create_a_container 22 | returning 23 | value(result) type ref to cl_gui_custom_container. 24 | 25 | methods get_settings 26 | returning 27 | value(result) type zcl_stralv_settings=>self 28 | raising 29 | zcx_stralv_error. 30 | 31 | methods on_data_changed 32 | for event data_has_changed of zif_stralv_main. 33 | endclass. 34 | 35 | class application implementation. 36 | 37 | method pbo. 38 | if stralv is not bound. 39 | try. 40 | screen_data = zst_stralv_demo. 41 | stralv = zcl_stralv_main=>new( get_settings( ) ). 42 | set handler on_data_changed for stralv. 43 | stralv->display( ). 44 | catch zcx_stralv_error into data(e). 45 | message e type 'I' display like 'E'. 46 | endtry. 47 | endif. 48 | endmethod. 49 | 50 | method get_settings. 51 | " set_container and set_data are obligatory 52 | result = new zcl_stralv_settings( 53 | )->set_container( create_a_container( ) 54 | )->set_data( ref #( screen_data ) ). 55 | 56 | endmethod. 57 | 58 | method create_a_container. 59 | result = new cl_gui_custom_container( 'VIEWPORT' ). 60 | endmethod. 61 | 62 | method on_data_changed. 63 | " pass control data to the classic dynpro 64 | zst_stralv_demo = screen_data. 65 | " provocate a pai - pbo turn to refresh the screen 66 | cl_gui_cfw=>set_new_ok_code( 'ENTER' ). 67 | endmethod. 68 | 69 | endclass. 70 | 71 | data app type ref to application. 72 | 73 | start-of-selection. 74 | zst_stralv_demo = value #( long_text = 'Sample data ' ). 75 | app = new #( ). 76 | call screen 1. 77 | 78 | *&---------------------------------------------------------------------* 79 | *& Module STATUS_0001 OUTPUT 80 | *&---------------------------------------------------------------------* 81 | * text 82 | *----------------------------------------------------------------------* 83 | module status_0001 output. 84 | set pf-status '1'. 85 | set titlebar '1'. 86 | app->pbo( ). 87 | endmodule. 88 | *&---------------------------------------------------------------------* 89 | *& Module USER_COMMAND_0001 INPUT 90 | *&---------------------------------------------------------------------* 91 | * text 92 | *----------------------------------------------------------------------* 93 | module user_command_0001 input. 94 | if okcode = 'EXIT'. 95 | set screen 0. 96 | endif. 97 | endmodule. 98 | -------------------------------------------------------------------------------- /code/zstralv_demo02.prog.xml: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | ZSTRALV_DEMO02 7 | S 8 | 1 9 | E 10 | X 11 | D$S 12 | X 13 | 14 | 15 | 16 |
17 | ZSTRALV_DEMO02 18 | 0001 19 | E 20 | Demo dynpro 21 | N 22 | 0001 23 | 027 24 | 124 25 |
26 | 27 | 28 | SCREEN 29 | SCREEN 30 | 31 | 32 | CUST_CTRL 33 | VIEWPORT 34 | SCREEN 35 | 001 36 | 001 37 | 067 38 | 017 39 | 40 | 41 | 42 | 43 | SCREEN 44 | SCREEN 45 | TEXT 46 | %#AUTOTEXT001 47 | Structured_ALV_Demo 48 | 001 49 | 073 50 | 019 51 | 019 52 | 001 53 | CHAR 54 | N 55 | 56 | 57 | SCREEN 58 | SCREEN 59 | TEXT 60 | %#AUTOTEXT002 61 | Demo_case:_maintain_call 62 | 002 63 | 073 64 | 024 65 | 024 66 | 001 67 | CHAR 68 | N 69 | 70 | 71 | SCREEN 72 | SCREEN 73 | TEXT 74 | %#AUTOTEXT003 75 | On_ENTER,_the_values_are_being_transferred_to_ 76 | 003 77 | 073 78 | 046 79 | 046 80 | 001 81 | CHAR 82 | N 83 | 84 | 85 | SCREEN 86 | SCREEN 87 | TEXT 88 | %#AUTOTEXT004 89 | the_dynpro_structure 90 | 004 91 | 073 92 | 020 93 | 020 94 | 001 95 | CHAR 96 | N 97 | 98 | 99 | SCREEN 100 | SCREEN 101 | TEXT 102 | ZST_STRALV_DEMO-MATNR 103 | 006 104 | 073 105 | 015 106 | 015 107 | 001 108 | CHAR 109 | X 110 | 2 111 | N 112 | X 113 | 114 | 115 | SCREEN 116 | SCREEN 117 | TEMPLATE 118 | ZST_STRALV_DEMO-MATNR 119 | 006 120 | 089 121 | 018 122 | 018 123 | 001 124 | CHAR 125 | X 126 | MATN1 127 | MAT 128 | X 129 | N 130 | X 131 | 132 | 133 | SCREEN 134 | SCREEN 135 | CHECK 136 | ZST_STRALV_DEMO-YESNO 137 | 007 138 | 073 139 | 017 140 | 017 141 | 001 142 | CHAR 143 | X 144 | 2 145 | X 146 | N 147 | X 148 | 149 | 150 | SCREEN 151 | SCREEN 152 | TEXT 153 | ZST_STRALV_DEMO-LONG_TEXT 154 | 008 155 | 073 156 | 015 157 | 015 158 | 001 159 | CHAR 160 | X 161 | 2 162 | X 163 | N 164 | X 165 | 166 | 167 | SCREEN 168 | SCREEN 169 | TEMPLATE 170 | ZST_STRALV_DEMO-LONG_TEXT 171 | ____________________________________________________________________________________________________________________________________ 172 | X 173 | 008 174 | 089 175 | 132 176 | 033 177 | 001 178 | CHAR 179 | X 180 | X 181 | X 182 | X 183 | N 184 | 185 | 186 | SCREEN 187 | SCREEN 188 | TEXT 189 | ZST_STRALV_DEMO-VBTYP 190 | 009 191 | 073 192 | 015 193 | 015 194 | 001 195 | CHAR 196 | X 197 | 2 198 | X 199 | N 200 | X 201 | X 202 | 203 | 204 | SCREEN 205 | SCREEN 206 | TEMPLATE 207 | ZST_STRALV_DEMO-VBTYP 208 | 009 209 | 089 210 | 001 211 | 001 212 | 001 213 | CHAR 214 | X 215 | X 216 | X 217 | N 218 | X 219 | 220 | 221 | SCREEN 222 | SCREEN 223 | TEXT 224 | ZST_STRALV_DEMO-MENGE 225 | 010 226 | 073 227 | 015 228 | 015 229 | 001 230 | CHAR 231 | X 232 | 2 233 | N 234 | X 235 | 236 | 237 | SCREEN 238 | SCREEN 239 | TEMPLATE 240 | ZST_STRALV_DEMO-MENGE 241 | 010 242 | 089 243 | 018 244 | 018 245 | 001 246 | QUAN 247 | X 248 | X 249 | N 250 | ZST_STRALV_DEMO-MEINS 251 | X 252 | 253 | 254 | SCREEN 255 | SCREEN 256 | TEXT 257 | ZST_STRALV_DEMO-MEINS 258 | 011 259 | 073 260 | 015 261 | 015 262 | 001 263 | CHAR 264 | X 265 | 2 266 | X 267 | N 268 | X 269 | 270 | 271 | SCREEN 272 | SCREEN 273 | TEMPLATE 274 | ZST_STRALV_DEMO-MEINS 275 | 011 276 | 089 277 | 003 278 | 003 279 | 001 280 | UNIT 281 | X 282 | CUNIT 283 | X 284 | X 285 | N 286 | 287 | 288 | SCREEN 289 | SCREEN 290 | TEXT 291 | ZST_STRALV_DEMO-WERKS 292 | 012 293 | 073 294 | 015 295 | 015 296 | 001 297 | CHAR 298 | X 299 | 2 300 | X 301 | N 302 | X 303 | X 304 | 305 | 306 | SCREEN 307 | SCREEN 308 | TEMPLATE 309 | ZST_STRALV_DEMO-WERKS 310 | 012 311 | 089 312 | 004 313 | 004 314 | 001 315 | CHAR 316 | X 317 | WRK 318 | X 319 | X 320 | N 321 | X 322 | 323 | 324 | SCREEN 325 | SCREEN 326 | TEXT 327 | %#AUTOTEXT005 328 | Input_values_are_being_checked._Try_to_enter 329 | 014 330 | 073 331 | 044 332 | 044 333 | 001 334 | CHAR 335 | N 336 | 337 | 338 | SCREEN 339 | SCREEN 340 | TEXT 341 | %#AUTOTEXT006 342 | a_non-numeric_value_in_the_quantity! 343 | 015 344 | 073 345 | 036 346 | 036 347 | 001 348 | CHAR 349 | N 350 | 351 | 352 | SCREEN 353 | SCREEN 354 | TEXT 355 | %#AUTOTEXT007 356 | All_inputs_are_being_formatted_according_to_ 357 | 017 358 | 073 359 | 044 360 | 044 361 | 001 362 | CHAR 363 | N 364 | 365 | 366 | SCREEN 367 | SCREEN 368 | TEXT 369 | %#AUTOTEXT008 370 | the_settings_in_DDIC 371 | 018 372 | 073 373 | 020 374 | 020 375 | 001 376 | CHAR 377 | N 378 | 379 | 380 | SCREEN 381 | SCREEN 382 | TEXT 383 | %#AUTOTEXT009 384 | Fields_with_domain_XFELD_appear_as_checkboxes. 385 | 020 386 | 073 387 | 046 388 | 046 389 | 001 390 | CHAR 391 | N 392 | 393 | 394 | SCREEN 395 | SCREEN 396 | OKCODE 397 | OKCODE 398 | ____________________ 399 | 020 400 | 020 401 | 001 402 | CHAR 403 | X 404 | 405 | 406 | 407 | 408 | PROCESS BEFORE OUTPUT. 409 | 410 | 411 | MODULE STATUS_0001. 412 | 413 | 414 | * 415 | 416 | 417 | PROCESS AFTER INPUT. 418 | 419 | 420 | MODULE USER_COMMAND_0001. 421 | 422 | 423 |
424 |
425 | 426 | 427 | 000001 428 | 000001 429 | 430 | 431 | 432 | 1 433 | D 434 | 000001 435 | 000001 436 | 0001 437 | Main 438 | 439 | 440 | 441 | 442 | EXIT 443 | 001 444 | S 445 | Exit 446 | 447 | 448 | EXIT 449 | 002 450 | S 451 | ICON_CANCEL 452 | @0W@ 453 | Cancel 454 | 455 | 456 | 457 | 458 | 000001 459 | 12 460 | EXIT 461 | 002 462 | 463 | 464 | 000001 465 | 15 466 | EXIT 467 | 001 468 | 469 | 470 | 471 | 472 | 1 473 | EXIT 474 | 475 | 476 | 477 | 478 | A 479 | 000001 480 | D 481 | Main 482 | 483 | 484 | P 485 | 000001 486 | D 487 | Main 488 | 489 | 490 | B 491 | 000001 492 | 0001 493 | D 494 | Main 495 | 496 | 497 | 498 | 499 | 1 500 | Structured ALV - simple call 501 | 502 | 503 | 504 | 505 | 506 | R 507 | Maintain data 508 | 13 509 | 510 | 511 |
512 |
513 |
514 | -------------------------------------------------------------------------------- /code/zstralv_demo03.prog.abap: -------------------------------------------------------------------------------- 1 | *&---------------------------------------------------------------------* 2 | *& Report zstralv_demo03 3 | *&---------------------------------------------------------------------* 4 | *& Demo for maintaining values of a structure in an ALV table 5 | *& where one line is shown for each component 6 | *& Demo case: usage of field attributes and hotspot click 7 | *&---------------------------------------------------------------------* 8 | report zstralv_demo03. 9 | 10 | data okcode type syucomm. 11 | tables zst_stralv_demo. 12 | 13 | class application definition. 14 | public section. 15 | methods pbo. 16 | methods reset_field_attributes 17 | importing 18 | command type sy-ucomm. 19 | 20 | private section. 21 | data screen_data type zst_stralv_demo. 22 | data stralv type ref to zif_stralv_main. 23 | " Flags for toggling field attributes: 24 | data hotspot type abap_bool value abap_true. 25 | data readonly type abap_bool value abap_true. 26 | data color type abap_bool. 27 | 28 | methods create_a_container 29 | returning 30 | value(result) type ref to cl_gui_custom_container. 31 | 32 | methods get_settings 33 | returning 34 | value(result) type zcl_stralv_settings=>self 35 | raising 36 | zcx_stralv_error. 37 | 38 | methods on_data_changed 39 | for event data_has_changed of zif_stralv_main. 40 | 41 | methods on_hotspot_clicked 42 | for event link_clicked of zif_stralv_main. 43 | endclass. 44 | 45 | class application implementation. 46 | 47 | method pbo. 48 | 49 | if stralv is not bound. 50 | try. 51 | screen_data = zst_stralv_demo. 52 | stralv = zcl_stralv_main=>new( get_settings( ) ). 53 | set handler on_data_changed for stralv. 54 | set handler on_hotspot_clicked for stralv. 55 | stralv->display( ). 56 | catch zcx_stralv_error into data(e). 57 | message e type 'I' display like 'E'. 58 | endtry. 59 | endif. 60 | endmethod. 61 | 62 | method get_settings. 63 | " set_container and set_data are obligatory 64 | result = new zcl_stralv_settings( 65 | )->set_container( create_a_container( ) 66 | )->set_data( ref #( screen_data ) ). 67 | " set initial attributes of field LONG_TEXT 68 | result->field( 'LONG_TEXT' )->set_readonly( )->set_hotspot( )->set_color( value #( col = col_total ) ). 69 | 70 | endmethod. 71 | 72 | method create_a_container. 73 | result = new cl_gui_custom_container( 'VIEWPORT' ). 74 | endmethod. 75 | 76 | method on_data_changed. 77 | " pass control data to the classic dynpro 78 | zst_stralv_demo = screen_data. 79 | " provocate a pai - pbo turn to refresh the screen 80 | cl_gui_cfw=>set_new_ok_code( 'ENTER' ). 81 | endmethod. 82 | 83 | 84 | method reset_field_attributes. 85 | " Dynamically change field settings 86 | try. 87 | case okcode. 88 | when 'RDONLY'. 89 | " toggle readonly flag 90 | readonly = xsdbool( readonly = abap_false ). 91 | stralv->field( 'LONG_TEXT' )->set_readonly( readonly ). 92 | stralv->refresh( ). 93 | when 'HOTSPOT'. 94 | hotspot = xsdbool( hotspot = abap_false ). 95 | stralv->field( 'LONG_TEXT' )->set_hotspot( hotspot ). 96 | stralv->refresh( ). 97 | when 'COLOR'. 98 | color = xsdbool( color = abap_false ). 99 | if color = abap_true. 100 | stralv->field( 'LONG_TEXT' )->set_color( value #( ) ). 101 | else. 102 | stralv->field( 'LONG_TEXT' )->set_color( value #( col = col_total ) ). 103 | endif. 104 | stralv->refresh( ). 105 | endcase. 106 | catch zcx_stralv_error. 107 | endtry. 108 | endmethod. 109 | 110 | method on_hotspot_clicked. 111 | message 'Link has been clicked' type 'I'. 112 | endmethod. 113 | 114 | endclass. 115 | 116 | data app type ref to application. 117 | 118 | start-of-selection. 119 | zst_stralv_demo = value #( long_text = 'Sample data' 120 | yesno = abap_true ). 121 | app = new #( ). 122 | call screen 2. 123 | 124 | *&---------------------------------------------------------------------* 125 | *& Module STATUS_0001 OUTPUT 126 | *&---------------------------------------------------------------------* 127 | * text 128 | *----------------------------------------------------------------------* 129 | module status_0001 output. 130 | set pf-status '1'. 131 | set titlebar '1'. 132 | app->pbo( ). 133 | endmodule. 134 | *&---------------------------------------------------------------------* 135 | *& Module USER_COMMAND_0001 INPUT 136 | *&---------------------------------------------------------------------* 137 | * text 138 | *----------------------------------------------------------------------* 139 | module user_command_0001 input. 140 | if okcode = 'EXIT'. 141 | set screen 0. 142 | endif. 143 | app->reset_field_attributes( okcode ). 144 | endmodule. 145 | -------------------------------------------------------------------------------- /code/zstralv_demo03.prog.xml: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | ZSTRALV_DEMO03 7 | S 8 | 1 9 | E 10 | X 11 | D$S 12 | X 13 | 14 | 15 | 16 |
17 | ZSTRALV_DEMO03 18 | 0001 19 | E 20 | Demo dynpro 21 | N 22 | 0001 23 | 027 24 | 126 25 |
26 | 27 | 28 | SCREEN 29 | SCREEN 30 | 31 | 32 | CUST_CTRL 33 | VIEWPORT 34 | SCREEN 35 | 001 36 | 001 37 | 067 38 | 017 39 | 40 | 41 | 42 | 43 | SCREEN 44 | SCREEN 45 | TEXT 46 | %#AUTOTEXT001 47 | Structured_ALV_Demo 48 | 001 49 | 073 50 | 019 51 | 019 52 | 001 53 | CHAR 54 | N 55 | 56 | 57 | SCREEN 58 | SCREEN 59 | TEXT 60 | %#AUTOTEXT002 61 | Demo_case:_description_column 62 | 002 63 | 073 64 | 029 65 | 029 66 | 001 67 | CHAR 68 | N 69 | 70 | 71 | SCREEN 72 | SCREEN 73 | TEXT 74 | %#AUTOTEXT003 75 | The_width_of_the_description_column_is_>_0 76 | 003 77 | 073 78 | 042 79 | 042 80 | 001 81 | CHAR 82 | N 83 | 84 | 85 | SCREEN 86 | SCREEN 87 | TEXT 88 | %#AUTOTEXT004 89 | So_descriptions_of_the_values_will_show_up 90 | 004 91 | 073 92 | 042 93 | 042 94 | 001 95 | CHAR 96 | N 97 | 98 | 99 | SCREEN 100 | SCREEN 101 | TEXT 102 | ZST_STRALV_DEMO-MATNR 103 | 006 104 | 073 105 | 015 106 | 015 107 | 001 108 | CHAR 109 | X 110 | 2 111 | N 112 | X 113 | 114 | 115 | SCREEN 116 | SCREEN 117 | TEMPLATE 118 | ZST_STRALV_DEMO-MATNR 119 | 006 120 | 089 121 | 018 122 | 018 123 | 001 124 | CHAR 125 | X 126 | MATN1 127 | MAT 128 | X 129 | N 130 | X 131 | 132 | 133 | SCREEN 134 | SCREEN 135 | CHECK 136 | ZST_STRALV_DEMO-YESNO 137 | 007 138 | 073 139 | 017 140 | 017 141 | 001 142 | CHAR 143 | X 144 | 2 145 | X 146 | N 147 | X 148 | 149 | 150 | SCREEN 151 | SCREEN 152 | TEXT 153 | ZST_STRALV_DEMO-LONG_TEXT 154 | 008 155 | 073 156 | 015 157 | 015 158 | 001 159 | CHAR 160 | X 161 | 2 162 | X 163 | N 164 | X 165 | 166 | 167 | SCREEN 168 | SCREEN 169 | TEMPLATE 170 | ZST_STRALV_DEMO-LONG_TEXT 171 | ____________________________________________________________________________________________________________________________________ 172 | X 173 | 008 174 | 089 175 | 132 176 | 036 177 | 001 178 | CHAR 179 | X 180 | X 181 | X 182 | X 183 | N 184 | 185 | 186 | SCREEN 187 | SCREEN 188 | TEXT 189 | ZST_STRALV_DEMO-VBTYP 190 | 009 191 | 073 192 | 015 193 | 015 194 | 001 195 | CHAR 196 | X 197 | 2 198 | X 199 | N 200 | X 201 | X 202 | 203 | 204 | SCREEN 205 | SCREEN 206 | TEMPLATE 207 | ZST_STRALV_DEMO-VBTYP 208 | 009 209 | 089 210 | 001 211 | 001 212 | 001 213 | CHAR 214 | X 215 | X 216 | X 217 | N 218 | X 219 | 220 | 221 | SCREEN 222 | SCREEN 223 | OKCODE 224 | OKCODE 225 | ____________________ 226 | 020 227 | 020 228 | 001 229 | CHAR 230 | X 231 | 232 | 233 | 234 | 235 | PROCESS BEFORE OUTPUT. 236 | 237 | 238 | MODULE STATUS_0001. 239 | 240 | 241 | * 242 | 243 | 244 | PROCESS AFTER INPUT. 245 | 246 | 247 | MODULE USER_COMMAND_0001. 248 | 249 | 250 |
251 | 252 |
253 | ZSTRALV_DEMO03 254 | 0002 255 | E 256 | Demo dynpro 257 | N 258 | 0002 259 | 027 260 | 126 261 |
262 | 263 | 264 | SCREEN 265 | SCREEN 266 | 267 | 268 | CUST_CTRL 269 | VIEWPORT 270 | SCREEN 271 | 001 272 | 001 273 | 067 274 | 017 275 | 276 | 277 | 278 | 279 | SCREEN 280 | SCREEN 281 | TEXT 282 | %#AUTOTEXT001 283 | Structured_ALV_Demo 284 | 001 285 | 073 286 | 019 287 | 019 288 | 001 289 | CHAR 290 | N 291 | 292 | 293 | SCREEN 294 | SCREEN 295 | TEXT 296 | %#AUTOTEXT002 297 | Demo_case:_field_attributes 298 | 002 299 | 073 300 | 027 301 | 027 302 | 001 303 | CHAR 304 | N 305 | 306 | 307 | SCREEN 308 | SCREEN 309 | TEXT 310 | %#AUTOTEXT003 311 | The_field_mealnumber_has_been_set_to_hotspot 312 | 003 313 | 073 314 | 044 315 | 044 316 | 001 317 | CHAR 318 | N 319 | 320 | 321 | SCREEN 322 | SCREEN 323 | TEXT 324 | %#AUTOTEXT004 325 | and_readonly._Use_the_buttons_to_change. 326 | 004 327 | 073 328 | 040 329 | 040 330 | 001 331 | CHAR 332 | N 333 | 334 | 335 | SCREEN 336 | SCREEN 337 | TEXT 338 | ZST_STRALV_DEMO-MATNR 339 | 006 340 | 073 341 | 015 342 | 015 343 | 001 344 | CHAR 345 | X 346 | 2 347 | N 348 | X 349 | 350 | 351 | SCREEN 352 | SCREEN 353 | TEMPLATE 354 | ZST_STRALV_DEMO-MATNR 355 | 006 356 | 089 357 | 018 358 | 018 359 | 001 360 | CHAR 361 | X 362 | MATN1 363 | MAT 364 | X 365 | N 366 | X 367 | 368 | 369 | SCREEN 370 | SCREEN 371 | CHECK 372 | ZST_STRALV_DEMO-YESNO 373 | 007 374 | 073 375 | 017 376 | 017 377 | 001 378 | CHAR 379 | X 380 | 2 381 | X 382 | N 383 | X 384 | 385 | 386 | SCREEN 387 | SCREEN 388 | TEXT 389 | ZST_STRALV_DEMO-LONG_TEXT 390 | 008 391 | 073 392 | 015 393 | 015 394 | 001 395 | CHAR 396 | X 397 | 2 398 | X 399 | N 400 | X 401 | 402 | 403 | SCREEN 404 | SCREEN 405 | TEMPLATE 406 | ZST_STRALV_DEMO-LONG_TEXT 407 | ____________________________________________________________________________________________________________________________________ 408 | X 409 | 008 410 | 089 411 | 132 412 | 036 413 | 001 414 | CHAR 415 | X 416 | X 417 | X 418 | X 419 | N 420 | 421 | 422 | SCREEN 423 | SCREEN 424 | TEXT 425 | ZST_STRALV_DEMO-VBTYP 426 | 009 427 | 073 428 | 015 429 | 015 430 | 001 431 | CHAR 432 | X 433 | 2 434 | X 435 | N 436 | X 437 | X 438 | 439 | 440 | SCREEN 441 | SCREEN 442 | TEMPLATE 443 | ZST_STRALV_DEMO-VBTYP 444 | 009 445 | 089 446 | 001 447 | 001 448 | 001 449 | CHAR 450 | X 451 | X 452 | X 453 | N 454 | X 455 | 456 | 457 | SCREEN 458 | SCREEN 459 | PUSH 460 | READONLY 461 | toggle_read-only 462 | 011 463 | 073 464 | 016 465 | 016 466 | 001 467 | RDONLY 468 | CHAR 469 | N 470 | 471 | 472 | SCREEN 473 | SCREEN 474 | PUSH 475 | HOTSPOT 476 | Toggle_hotspot__ 477 | 012 478 | 073 479 | 016 480 | 016 481 | 001 482 | HOTSPOT 483 | CHAR 484 | N 485 | 486 | 487 | SCREEN 488 | SCREEN 489 | PUSH 490 | COLOR 491 | Toggle_color____ 492 | 013 493 | 073 494 | 016 495 | 016 496 | 001 497 | COLOR 498 | CHAR 499 | N 500 | 501 | 502 | SCREEN 503 | SCREEN 504 | OKCODE 505 | OKCODE 506 | ____________________ 507 | 020 508 | 020 509 | 001 510 | CHAR 511 | X 512 | 513 | 514 | 515 | 516 | PROCESS BEFORE OUTPUT. 517 | 518 | 519 | MODULE STATUS_0001. 520 | 521 | 522 | * 523 | 524 | 525 | PROCESS AFTER INPUT. 526 | 527 | 528 | MODULE USER_COMMAND_0001. 529 | 530 | 531 |
532 |
533 | 534 | 535 | 000001 536 | 000001 537 | 538 | 539 | 540 | 1 541 | D 542 | 000001 543 | 000001 544 | 0001 545 | Main 546 | 547 | 548 | 549 | 550 | EXIT 551 | 001 552 | S 553 | Exit 554 | 555 | 556 | EXIT 557 | 002 558 | S 559 | ICON_CANCEL 560 | @0W@ 561 | Cancel 562 | 563 | 564 | 565 | 566 | 000001 567 | 12 568 | EXIT 569 | 002 570 | 571 | 572 | 000001 573 | 15 574 | EXIT 575 | 001 576 | 577 | 578 | 579 | 580 | 1 581 | EXIT 582 | 583 | 584 | 585 | 586 | A 587 | 000001 588 | D 589 | Main 590 | 591 | 592 | P 593 | 000001 594 | D 595 | Main 596 | 597 | 598 | B 599 | 000001 600 | 0001 601 | D 602 | Main 603 | 604 | 605 | 606 | 607 | 1 608 | Structured ALV - simple call 609 | 610 | 611 | 612 | 613 | 614 | R 615 | Demo on field attributes 616 | 24 617 | 618 | 619 |
620 |
621 |
622 | -------------------------------------------------------------------------------- /code/zstralv_demo04.prog.abap: -------------------------------------------------------------------------------- 1 | *&---------------------------------------------------------------------* 2 | *& Report zstralv_demo04 3 | *&---------------------------------------------------------------------* 4 | *& Demo for maintaining values of a structure in an ALV table 5 | *& where one line is shown for each component 6 | *& Demo case: usage of the description column 7 | *&---------------------------------------------------------------------* 8 | report zstralv_demo04. 9 | 10 | data okcode type syucomm. 11 | tables zst_stralv_demo. 12 | 13 | class application definition. 14 | public section. 15 | methods pbo. 16 | 17 | 18 | private section. 19 | data screen_data type zst_stralv_demo. 20 | data stralv type ref to zif_stralv_main. 21 | data hotspot type abap_bool value abap_true. 22 | data readonly type abap_bool value abap_true. 23 | 24 | methods create_a_container 25 | returning 26 | value(result) type ref to cl_gui_custom_container. 27 | 28 | methods get_settings 29 | returning 30 | value(result) type zcl_stralv_settings=>self 31 | raising 32 | zcx_stralv_error. 33 | 34 | methods on_data_changed 35 | for event data_has_changed of zif_stralv_main. 36 | endclass. 37 | 38 | class application implementation. 39 | 40 | method pbo. 41 | if stralv is not bound. 42 | try. 43 | " screen_data is referenced by the ALV control. 44 | screen_data = zst_stralv_demo. 45 | stralv = zcl_stralv_main=>new( get_settings( ) ). 46 | " Here we react on an input 47 | set handler on_data_changed for stralv. 48 | stralv->display( ). 49 | catch zcx_stralv_error into data(e). 50 | message e type 'I' display like 'E'. 51 | endtry. 52 | endif. 53 | endmethod. 54 | 55 | method get_settings. 56 | " set_container and set_data are obligatory 57 | " furthermore, we hide the client 58 | result = new zcl_stralv_settings( 59 | )->set_container( create_a_container( ) 60 | )->set_data( ref #( screen_data ) 61 | )->set_description_width( 30 ). 62 | " set source for description field for WERKS 63 | result->field( 'WERKS' )->set_description_field( 'NAME1' ). 64 | 65 | endmethod. 66 | 67 | method create_a_container. 68 | result = new cl_gui_custom_container( 'VIEWPORT' ). 69 | endmethod. 70 | 71 | method on_data_changed. 72 | " pass data from the control to the classic dynpro 73 | zst_stralv_demo = screen_data. 74 | " provocate a pai - pbo turn to refresh the screen 75 | cl_gui_cfw=>set_new_ok_code( 'ENTER' ). 76 | endmethod. 77 | 78 | endclass. 79 | 80 | data app type ref to application. 81 | 82 | start-of-selection. 83 | " preset data to show 84 | zst_stralv_demo = value #( long_text = 'Sample data' 85 | yesno = abap_true ). 86 | app = new #( ). 87 | call screen 2. 88 | 89 | *&---------------------------------------------------------------------* 90 | *& Module STATUS_0001 OUTPUT 91 | *&---------------------------------------------------------------------* 92 | * text 93 | *----------------------------------------------------------------------* 94 | module status_0001 output. 95 | set pf-status '1'. 96 | set titlebar '1'. 97 | app->pbo( ). 98 | endmodule. 99 | *&---------------------------------------------------------------------* 100 | *& Module USER_COMMAND_0001 INPUT 101 | *&---------------------------------------------------------------------* 102 | * text 103 | *----------------------------------------------------------------------* 104 | module user_command_0001 input. 105 | if okcode = 'EXIT'. 106 | set screen 0. 107 | endif. 108 | endmodule. 109 | -------------------------------------------------------------------------------- /code/zstralv_demo04.prog.xml: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | ZSTRALV_DEMO04 7 | S 8 | 1 9 | E 10 | X 11 | D$S 12 | X 13 | 14 | 15 | 16 |
17 | ZSTRALV_DEMO04 18 | 0002 19 | E 20 | Demo dynpro 21 | N 22 | 0002 23 | 027 24 | 127 25 |
26 | 27 | 28 | SCREEN 29 | SCREEN 30 | 31 | 32 | CUST_CTRL 33 | VIEWPORT 34 | SCREEN 35 | 001 36 | 001 37 | 067 38 | 017 39 | 40 | 41 | 42 | 43 | SCREEN 44 | SCREEN 45 | TEXT 46 | %#AUTOTEXT001 47 | Structured_ALV_Demo 48 | 001 49 | 073 50 | 019 51 | 019 52 | 001 53 | CHAR 54 | N 55 | 56 | 57 | SCREEN 58 | SCREEN 59 | TEXT 60 | %#AUTOTEXT002 61 | Demo_case:_description_column 62 | 002 63 | 073 64 | 029 65 | 029 66 | 001 67 | CHAR 68 | N 69 | 70 | 71 | SCREEN 72 | SCREEN 73 | TEXT 74 | %#AUTOTEXT003 75 | The_width_of_the_description_column_is_>_0 76 | 003 77 | 073 78 | 042 79 | 042 80 | 001 81 | CHAR 82 | N 83 | 84 | 85 | SCREEN 86 | SCREEN 87 | TEXT 88 | %#AUTOTEXT004 89 | So_descriptions_of_the_values_will_show_up 90 | 004 91 | 073 92 | 042 93 | 042 94 | 001 95 | CHAR 96 | N 97 | 98 | 99 | SCREEN 100 | SCREEN 101 | TEXT 102 | %#AUTOTEXT005 103 | The_description_for_MATNR_is_determined_via 104 | 006 105 | 073 106 | 043 107 | 043 108 | 001 109 | CHAR 110 | N 111 | 112 | 113 | SCREEN 114 | SCREEN 115 | TEXT 116 | %#AUTOTEXT006 117 | normal_text_table_relations 118 | 007 119 | 073 120 | 027 121 | 027 122 | 001 123 | CHAR 124 | N 125 | 126 | 127 | SCREEN 128 | SCREEN 129 | TEXT 130 | %#AUTOTEXT007 131 | For_WERKS,_there_is_no_text_table._The_text 132 | 009 133 | 073 134 | 043 135 | 043 136 | 001 137 | CHAR 138 | N 139 | 140 | 141 | SCREEN 142 | SCREEN 143 | TEXT 144 | %#AUTOTEXT008 145 | comes_from_a_given_field_in_the_check_table_(name1) 146 | 010 147 | 073 148 | 051 149 | 051 150 | 001 151 | CHAR 152 | N 153 | 154 | 155 | SCREEN 156 | SCREEN 157 | OKCODE 158 | OKCODE 159 | ____________________ 160 | 020 161 | 020 162 | 001 163 | CHAR 164 | X 165 | 166 | 167 | 168 | 169 | PROCESS BEFORE OUTPUT. 170 | 171 | 172 | MODULE STATUS_0001. 173 | 174 | 175 | * 176 | 177 | 178 | PROCESS AFTER INPUT. 179 | 180 | 181 | MODULE USER_COMMAND_0001. 182 | 183 | 184 |
185 |
186 | 187 | 188 | 000001 189 | 000001 190 | 191 | 192 | 193 | 1 194 | D 195 | 000001 196 | 000001 197 | 0001 198 | Main 199 | 200 | 201 | 202 | 203 | EXIT 204 | 001 205 | S 206 | Exit 207 | 208 | 209 | EXIT 210 | 002 211 | S 212 | ICON_CANCEL 213 | @0W@ 214 | Cancel 215 | 216 | 217 | 218 | 219 | 000001 220 | 12 221 | EXIT 222 | 002 223 | 224 | 225 | 000001 226 | 15 227 | EXIT 228 | 001 229 | 230 | 231 | 232 | 233 | 1 234 | EXIT 235 | 236 | 237 | 238 | 239 | A 240 | 000001 241 | D 242 | Main 243 | 244 | 245 | P 246 | 000001 247 | D 248 | Main 249 | 250 | 251 | B 252 | 000001 253 | 0001 254 | D 255 | Main 256 | 257 | 258 | 259 | 260 | 1 261 | Structured ALV - simple call 262 | 263 | 264 | 265 | 266 | 267 | R 268 | Demo on field attributes 269 | 24 270 | 271 | 272 |
273 |
274 |
275 | -------------------------------------------------------------------------------- /code/zstralv_demo05.prog.abap: -------------------------------------------------------------------------------- 1 | *&---------------------------------------------------------------------* 2 | *& Report zstralv_demo05 3 | *&---------------------------------------------------------------------* 4 | *& Demo for maintaining values of a structure in an ALV table 5 | *& where one line is shown for each component 6 | *& Demo case: usage of the toolbar 7 | *&---------------------------------------------------------------------* 8 | report zstralv_demo05. 9 | 10 | data okcode type syucomm. 11 | tables zst_stralv_demo. 12 | 13 | class application definition. 14 | public section. 15 | methods pbo. 16 | 17 | 18 | private section. 19 | data screen_data type zst_stralv_demo. 20 | data stralv type ref to zif_stralv_main. 21 | data hotspot type abap_bool value abap_true. 22 | data readonly type abap_bool value abap_true. 23 | 24 | methods create_a_container 25 | returning 26 | value(result) type ref to cl_gui_custom_container. 27 | 28 | methods get_settings 29 | returning 30 | value(result) type zcl_stralv_settings=>self 31 | raising 32 | zcx_stralv_error. 33 | 34 | methods on_data_changed 35 | for event data_has_changed of zif_stralv_main. 36 | 37 | methods on_toolbar 38 | for event toolbar of zif_stralv_main 39 | importing e_object. 40 | 41 | methods on_user_command 42 | for event user_command of zif_stralv_main 43 | importing e_ucomm. 44 | 45 | endclass. 46 | 47 | class application implementation. 48 | 49 | method pbo. 50 | if stralv is not bound. 51 | try. 52 | " screen_data is referenced by the ALV control. 53 | screen_data = zst_stralv_demo. 54 | stralv = zcl_stralv_main=>new( get_settings( ) ). 55 | " Here we react on an input 56 | set handler on_data_changed for stralv. 57 | set handler on_toolbar for stralv. 58 | set handler on_user_command for stralv. 59 | stralv->display( ). 60 | catch zcx_stralv_error into data(e). 61 | message e type 'I' display like 'E'. 62 | endtry. 63 | endif. 64 | endmethod. 65 | 66 | method get_settings. 67 | " set_container and set_data are obligatory 68 | " furthermore, we hide the client 69 | result = new zcl_stralv_settings( 70 | )->set_container( create_a_container( ) 71 | )->set_data( ref #( screen_data ) ). 72 | 73 | endmethod. 74 | 75 | method create_a_container. 76 | result = new cl_gui_custom_container( 'VIEWPORT' ). 77 | endmethod. 78 | 79 | method on_data_changed. 80 | " pass data from the control to the classic dynpro 81 | zst_stralv_demo = screen_data. 82 | " provocate a pai - pbo turn to refresh the screen 83 | cl_gui_cfw=>set_new_ok_code( 'ENTER' ). 84 | endmethod. 85 | 86 | method on_toolbar. 87 | insert value #( 88 | function = 'MYFUNC' 89 | text = 'My function' 90 | ) into table e_object->mt_toolbar. 91 | endmethod. 92 | 93 | method on_user_command. 94 | if e_ucomm = 'MYFUNC'. 95 | message 'Function clicked' type 'I'. 96 | endif. 97 | endmethod. 98 | 99 | endclass. 100 | 101 | data app type ref to application. 102 | 103 | start-of-selection. 104 | " preset data to show 105 | zst_stralv_demo = value #( long_text = 'Sample data' 106 | yesno = abap_true ). 107 | app = new #( ). 108 | call screen 2. 109 | 110 | *&---------------------------------------------------------------------* 111 | *& Module STATUS_0001 OUTPUT 112 | *&---------------------------------------------------------------------* 113 | * text 114 | *----------------------------------------------------------------------* 115 | module status_0001 output. 116 | set pf-status '1'. 117 | set titlebar '1'. 118 | app->pbo( ). 119 | endmodule. 120 | *&---------------------------------------------------------------------* 121 | *& Module USER_COMMAND_0001 INPUT 122 | *&---------------------------------------------------------------------* 123 | * text 124 | *----------------------------------------------------------------------* 125 | module user_command_0001 input. 126 | if okcode = 'EXIT'. 127 | set screen 0. 128 | endif. 129 | endmodule. 130 | -------------------------------------------------------------------------------- /code/zstralv_demo05.prog.xml: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | ZSTRALV_DEMO05 7 | S 8 | 1 9 | E 10 | X 11 | D$S 12 | X 13 | 14 | 15 | 16 |
17 | ZSTRALV_DEMO05 18 | 0002 19 | E 20 | Demo dynpro 21 | N 22 | 0002 23 | 027 24 | 128 25 |
26 | 27 | 28 | SCREEN 29 | SCREEN 30 | 31 | 32 | CUST_CTRL 33 | VIEWPORT 34 | SCREEN 35 | 001 36 | 001 37 | 067 38 | 017 39 | 40 | 41 | 42 | 43 | SCREEN 44 | SCREEN 45 | TEXT 46 | %#AUTOTEXT001 47 | Structured_ALV_Demo 48 | 001 49 | 073 50 | 019 51 | 019 52 | 001 53 | CHAR 54 | N 55 | 56 | 57 | SCREEN 58 | SCREEN 59 | TEXT 60 | %#AUTOTEXT002 61 | Demo_case:_Use_of_the_toolbar 62 | 002 63 | 073 64 | 029 65 | 029 66 | 001 67 | CHAR 68 | N 69 | 70 | 71 | SCREEN 72 | SCREEN 73 | TEXT 74 | %#AUTOTEXT003 75 | The_interface_has_two_events: 76 | 003 77 | 073 78 | 029 79 | 029 80 | 001 81 | CHAR 82 | N 83 | 84 | 85 | SCREEN 86 | SCREEN 87 | TEXT 88 | %#AUTOTEXT004 89 | toolbar:_add_buttons_to_the_toolbar 90 | 004 91 | 073 92 | 035 93 | 035 94 | 001 95 | CHAR 96 | N 97 | 98 | 99 | SCREEN 100 | SCREEN 101 | TEXT 102 | %#AUTOTEXT005 103 | user_command:_react_on_button_click 104 | 005 105 | 073 106 | 035 107 | 035 108 | 001 109 | CHAR 110 | N 111 | 112 | 113 | SCREEN 114 | SCREEN 115 | TEXT 116 | %#AUTOTEXT006 117 | they_work_identically_to_the_events_of_ 118 | 007 119 | 073 120 | 039 121 | 039 122 | 001 123 | CHAR 124 | N 125 | 126 | 127 | SCREEN 128 | SCREEN 129 | TEXT 130 | %#AUTOTEXT007 131 | CL_GUI_ALV_GRID 132 | 008 133 | 073 134 | 015 135 | 015 136 | 001 137 | CHAR 138 | N 139 | 140 | 141 | SCREEN 142 | SCREEN 143 | OKCODE 144 | OKCODE 145 | ____________________ 146 | 020 147 | 020 148 | 001 149 | CHAR 150 | X 151 | 152 | 153 | 154 | 155 | PROCESS BEFORE OUTPUT. 156 | 157 | 158 | MODULE STATUS_0001. 159 | 160 | 161 | * 162 | 163 | 164 | PROCESS AFTER INPUT. 165 | 166 | 167 | MODULE USER_COMMAND_0001. 168 | 169 | 170 |
171 |
172 | 173 | 174 | 000001 175 | 000001 176 | 177 | 178 | 179 | 1 180 | D 181 | 000001 182 | 000001 183 | 0001 184 | Main 185 | 186 | 187 | 188 | 189 | EXIT 190 | 001 191 | S 192 | Exit 193 | 194 | 195 | EXIT 196 | 002 197 | S 198 | ICON_CANCEL 199 | @0W@ 200 | Cancel 201 | 202 | 203 | 204 | 205 | 000001 206 | 12 207 | EXIT 208 | 002 209 | 210 | 211 | 000001 212 | 15 213 | EXIT 214 | 001 215 | 216 | 217 | 218 | 219 | 1 220 | EXIT 221 | 222 | 223 | 224 | 225 | A 226 | 000001 227 | D 228 | Main 229 | 230 | 231 | P 232 | 000001 233 | D 234 | Main 235 | 236 | 237 | B 238 | 000001 239 | 0001 240 | D 241 | Main 242 | 243 | 244 | 245 | 246 | 1 247 | Structured ALV - simple call 248 | 249 | 250 | 251 | 252 | 253 | R 254 | Demo on field attributes 255 | 24 256 | 257 | 258 |
259 |
260 |
261 | --------------------------------------------------------------------------------