• Home
  • About me
  • FALV
  • ALV Grid in the nutshell
    • Basic Information
    • Field catalog
  • Articles
    • Tricks
    • FALV (Fast ALV Grid)
    • ALV Grid in the nutshell
    • Tips
    • How to...
    • For beginners
    • Thoughts
  • By Topic
    • ALV
    • ALV OO
    • SALV
    • GOS
    • Selection screen
    • Purchase Requisitions
    • Purchase Orders
    • Attachments
    • Others
    • Characteristics
    • Sample Programs
    • ZIP
    • OLE
    • Mails
    • Routings
    • EWB
    • Excel
  • Keywords
  • RSS
  • Download
  • Home
  • Articles
  • How to...

Classifications - Part 4 - example of use

Details
Łukasz Pęgiel
How to...
26 May 2013
Hits: 9622
Tags: GET_OBJECTS_OF_CLASS , CL_ABAP_STRUCTDESCR
As I promised I will show how to use the methods we've prepared in previous parts of this tread. I will write simple program that calls the method get_objects_of_class and then loops through the results of it. But before I'll prepare program I need to have classification with some characteristics and an object to which I will add classification. So lets start with CL01 to create our test classification. I'll name it ECM_CLASS1, and I'll add one characteristic for each data type so NUM, CURR, CHAR, DATE and TIME.
 
 
Then I'll classify change number in CC02 for two change numbers available there (of course we can do it for how many objects we want) .
Add a comment
Read more ...

Classifications - Part 3 - get all objects assigned to class

Details
Łukasz Pęgiel
How to...
18 May 2013
Hits: 16085
Tags: CLAF_OBJECTS_OF_CLASS
In previous article ( Classifications - Part 2 - Get Object Details ) I've created a method to get characteristics values for an object to our dynamic structure, in this part I will show how to use this method and FM CLAF_OBJECTS_OF_CLASS  to get the characteristics values for all of objects that are classified by given class. I will firstly read all assignments to the class, then I will loop through all returned objects and I will get all characteristics values to dynamic structure.
 
Importing:

i_class type klah-class -> class number
i_classtype type klah-klart -> class type
i_key_date type sy-datum  default sy-datum -> key date for classification

Exporting:

value( et_objects ) type standard table of clobjekte -> table of objects assigned to class
et_data type ref to data -> table with characteristics data for all objects assigned to class
e_tablestr type ref to cl_abap_tabledescr  -> table type structure
e_structure type ref to cl_abap_structdescr -> structure

Exceptions:

fetch_values_error
structure_error

Implementation:
Add a comment
Read more ...

Classifications - Part 2 - Get Object Details

Details
Łukasz Pęgiel
How to...
18 May 2013
Hits: 27329
Tags: BAPI_OBJCL_GETDETAIL , KKEK_CONVERT_FLOAT_TO_CURR , CL_ABAP_TYPEDESCR
 
In the first part I show how to create a structure on a base of class characteristics, now I will describe how to get the characteristics values for a object and how to fill the structure we've created in part 1. To get the characteristics values for an object I will use FM BAPI_OBJCL_GETDETAIL, then using field-symbols I will move the data from its result tables to our structure. I will use also cl_abap_typedescr to get the type of the field (needed for proper conversion) and FM KKEK_CONVERT_FLOAT_TO_CURR to convert currency values stored as float on database into currency fields.
 
Importing:

i_object type bapi1003_key-object -> key of object to be classified
i_class type klah-class -> class number
i_classtype type klah-klart -> class type
i_objecttable type bapi1003_key-objecttable optional -> name of database table for object
i_key_date type sy-datum  default sy-datum -> key date for classification
i_structure type ref to cl_abap_structdescr optional -> structure

Exporting:

et_objvaluesnum  type tt_bapi1003_alloc_values_num -> table with num characteristics
et_objvalueschar type tt_bapi1003_alloc_values_char -> table with char characteristics
et_objvaluescurr type tt_bapi1003_alloc_values_curr -> table with curr characteristics
e_data type ref to data -> filled structure for object with all characteristics

Exceptions:

fetch_values_error -> error while trying to receive object characteristics value
structure_error -> structure has wrong fields

Implementation:
Add a comment
Read more ...

Classifications - Part 1 - prepare structure for class data

Details
Łukasz Pęgiel
How to...
17 May 2013
Hits: 16097
Tags: BAPI_CLASS_READ , BAPI_CHARACT_GETDETAIL , CL_ABAP_ELEMDESCR , CL_ABAP_STRUCTDESCR , CL_ABAP_TABLEDESCR
Today I'll start to show you how you can prepare some methods to be able to read classification data without carrying each time about the kind of characteristics. If you follow my suggestions then you'll be able to use this methods each time you deal with classifications. In this part I will show you how to prepare a method to create a structure and table for classification data. I know that some of you can say we can create such structure manually with data or types statement directly in each of our development, but one day you'll see that sometimes it's easier to prepare a function or method which will do it for you so you can keep the logic in each of your program without doing maual work.
 
To create the structure of the class I will use FM BAPI_CLASS_READ  to read class data, then I will use FM BAPI_CHARACT_GETDETAIL to read the characteristics and in each step I'll be using classes cl_abap_elemdescr, cl_abap_structdescr and cl_abap_tabledescr to create the structure I need.
 
Import:

i_classtype klah-class-> class number
i_classtypetype klah-klart ->class type
i_key_datetype sy-datum  default sy-datum-> key date for class

Export:

e_structuretype ref to cl_abap_structdescr-> structure for our class
et_datatype ref to data -> table created on a base of class structure
e_tabletype ref to cl_abap_tabledescr-> table type for our class

Exceptions:

class_classtype_fetch_error
error_creating_table
characteristics_error

Implementation of method:
Add a comment
Read more ...

Create a nice looking chart with CL_GUI_CHART_ENGINE - Part 3 - Chart Data and render

Details
Łukasz Pęgiel
How to...
06 May 2013
Hits: 59929
Tags: CL_GUI_CUSTOM_CONTAINER , CL_GUI_CHART_ENGINE , IF_XML , IF_IXML_STREAM_FACTORY , IF_IXML_DOCUMENT , IF_IXML_OSTREAM , IF_IXML_ENCODING , IF_IXML_ELEMENT
We know already how to use chart designer and we're able to save/read it's result to/from standard texts. So let's go for most interesting part - rendering the chart. Of course we will need some data but I will use dummy one just to show you how to create the chart, you can replace this part with loop on your internal table or even better change it in the way that you'll pass internal table.
In the method provided bellow I firstly create custom container object (cl_gui_custom_container) to place the chart in it, then I create chart engine (cl_gui_chart_engine), then using if_xml I create an xml data container which in fact can be written using simple concatenate statement but it's not nice to change and easy to mess.

So after we receive an xml with data then I will pass it to chart engine, then I will run the method prepared in previous part (Create a nice looking chart with CL_GUI_CHART_ENGINE - Part 2 - Customization ) to read the customization of the chart and I will pass it also to engine. Finally I will render the chart.
Add a comment
Read more ...

Create a nice looking chart with CL_GUI_CHART_ENGINE - Part 2 - Customization

Details
Łukasz Pęgiel
How to...
04 May 2013
Hits: 33646
Tags: READ_TEXT , IF_IXML_STREAM_FACTORY , IF_IXML_ISTREAM , IF_IXML_DOCUMENT , IF_IXML_PARSER , IF_IXML_OSTREAM , SCMS_STRING_TO_XSTRING , SCMS_XSTRING_TO_BINARY , CL_GUI_CHART_ENGINE
In part one for this tutorial I quickly shown you how to create a chart customizing using Chart Designer, in this part I will show how I store and use such customizing. For the beginning I'll tell you that there are many ways to store the customizing, you can keep it in GOS, or in APP server or load it directly from PC, but my favorite one is to keep the customizing in standard texts (SO10) and read it from there. It's easy to do changes there and it can be restricted in authorizations who can do changes for such text.
So I'll go to SO10 and create new text for customization there:
Add a comment
Read more ...

Create a nice looking chart with CL_GUI_CHART_ENGINE - Part 1 - Chart Designer

Details
Łukasz Pęgiel
How to...
03 May 2013
Hits: 34998
Tags: CL_GUI_CHART_ENGINE , chart designer
At the beginning of my work with SAP I was disappointed with the charts that was available in standard transactions. In fact I am still :) But when I have to create own program with nice looking chart then it's no longer a problem as we can use CL_GUI_CHART_ENGINE together with chart designer provided by SAP. Chart designer is a tool which allows you to create a customizing for your chart and save it in XML file which can be used in ABAP after.

So first of all we need to download chart designer from SDN so you can google "sap chart designer" to get it. After you'll have it just run one of the versions available there (640 or 700) depending on your GUI version. All files which you'll find in the package are shown below, XML Format.pdf file will tell you how to prepare chart data depending on chart type.
 

Add a comment
Read more ...

Load variant to single subscreen (selection screen)

Details
Łukasz Pęgiel
How to...
02 May 2013
Hits: 21104
Tags: RS_VARIANT_CATALOG , RS_VARIANT_CONTENTS , RS_ISOLATE_1_SELSCREEN
In article Save variant for single selection screen subscreen I've shown you how to save a variant for single selection-screen subscreen with a little help of FM RS_ISOLATE_1_SELSCREEN & RS_CREATE_VARIANT. If you use method shown there it may happen that when you're loading a variant to a screen it overrides also values from other fields. To avoid that I've prepared a method to fill only fields from one subscreen. I will use here FM RS_VARIANT_CATALOG to allow user to select variant for subscreen, FM RS_VARIANT_CONTENTS to read it's content, FM RS_ISOLATE_1_SELSCREEN to get the fields of subscreen and field-symbols to put them on place. So let's start.
 
As input parameter I will use only subscreen number:

i_dynnr type sy-dynnr  -> subscreen number

Add a comment
Read more ...

More Articles ...

  1. F4 Help for external date
  2. Save variant for single selection screen subscreen
  3. Delete Routing - piece of cake
  4. Creating editor for dynamic code (SE38 like)
  5. Download CV01N/2N/3N documents to PC
  6. ZIP a file using ABAP
  7. Get filename and extension from full path
  8. Convert date to and from external date type
Page 5 of 6
  • Start
  • Prev
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • Next
  • End


Łukasz Pęgiel
GROUP COMPONENTS UPDATE PREPARE SAP Fiori - HTTP request failed403 SET READY FOR INPUT ABAP TYPEDESCR FALV MAT BOM CREATE COPY ALV Grid in the nutshell Field catalog - cfieldname ALV GRID VARIANT CATALOG GUI HTML EDITOR RELEASE ALLOWED Field catalog FIELDCATALOG Create a nice looking chart with CL GUI CHART ENGINE - Part 2 - Customization ALV GRID IN THE NUTSHELL Basic Information ESRUO - MM settings table - Part 1 IXML ENCODING REFRESH FROM SELECTOPTIONS ALV GRID Custom selection-screen fields for MD07 MS07 TABNAME Reset rejection of Purchase Requisition ICON SLIN Retro ASCII symbols in ALV Grid table AiE ADT dark theme settings GOS - Link Business Documents from PR to PO MB51 NOLIST SALV CONTROLLER METADATA ALV POPUP JSON OSTREAM TIMER FALV Fast ALV Grid GOS SERVICE TOOLS LOAD COMPLEX LVC FCAT TABLE Create XLSX MHTML file from internal table in background ABAP EXTENSIONS DATE Field catalog - no convext Why I like to code in ABAP in Eclipse ACR SCAN ABAP-SOURCE SCMS DOC READ MAINTAIN EXTENSION Field catalog - icon MB51 ENHANCEMENT AiE ZDEMO FALV11 - Editable Grid settings KKEK CONVERT FLOAT CURR GTMOVE LINKED OBJECTS PURCHASE REQUISITION ALINK CONNECTION
  • Laserowe usuwanie blizn Tychy
  • Laserowe usuwanie zmarszczek Tychy
  • Salon Kosmetyczny Tychy
  • Trycholog Tychy
  • Wypadanie włosów Tychy
Tweets by abapblog

Eclipse Plugins for ABAP

ABAP Favorites

Drag to your running Eclipse* workspace. *Requires Eclipse Marketplace Client

ABAP ADT Extensions

Drag to your running Eclipse* workspace. *Requires Eclipse Marketplace Client

ABAP Quick Fixes

Drag to your running Eclipse* workspace. *Requires Eclipse Marketplace Client

 

Latest Articles

  • ABAP in Eclipse - Install, Configure, Use, and Enhance Your ADT
  • ALV Grid in the nutshell: Field catalog - col_id - ALV control: Column ID
  • ALV Grid in the nutshell: Field catalog - dfieldname – Fieldname for column group
  • ALV Grid in the nutshell: Field catalog - Hotspot - ALV control: SingleClick-sensitive
  • ALV Grid in the nutshell: Field catalog - sp_group - Group key
  • ALV Grid in the nutshell: Field catalog - domname - Domain name
  • ALV Grid in the nutshell: Field catalog - reprep - ALV control: Value is selection criterion for rep./rep.intf.
  • ALV Grid in the nutshell: Field catalog - reptext – Heading
  • ALV Grid in the nutshell: Field catalog - lowercase - Lowercase letters allowed/not allowed
  • ALV Grid in the nutshell: Field catalog - intlen - Internal Length in Bytes
  • Downloading Exchange Rates from NBP (National Bank of Poland)
  • Downloading Exchange Rates from Central Bank of Turkey
  • ABAP Extensions - Automatic Logon
  • ALV Grid in the nutshell: Field catalog - inttype - ABAP data type (C,D,N,...)
  • ALV Grid in the nutshell: Field catalog - datatype

Most Read

  • Create XLSX/MHTML file from internal table in background
  • Refresh ALV GRID and keep position and current cell
  • Create XLSX file from internal table in background v2
  • FALV (Fast ALV Grid)
  • ATC Pseudo Comments list
  • Call standard F4 search help with customized parameters
  • Dynamic GUI STATUS & TITLE with ABAP code
  • Create fieldcatalog from internal table
  • Link Attachments of Purchase Requisition to Purchase Order
  • GOS - How to add business documents at creation of object
  • Endless loop in BADI ME_PROCESS_PO_CUST
  • Create a nice looking chart with CL_GUI_CHART_ENGINE - Part 3 - Chart Data and render
  • How to access private or protected data and methods of CL_GUI_ALV_GRID
  • Subtotal lines of ALV GRID OO as content separator
  • Popup with multi-select ALV
feed-image Feed Entries

Latest Comments

ABAP code and articles provided on http://abapblog.com, if it is not statet otherwise, were created by Łukasz Pęgiel. You can use the code in your SAP instance for commercial and non-commercial use without any warranty from side of the author. You cannot sell the code as a full program or a part of it.
Replicating of the articles and code is prohibited unless the agreement of the author is given to you. 

Bootstrap is a front-end framework of Twitter, Inc. Code licensed under MIT License. Font Awesome font licensed under SIL OFL 1.1.