• 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...

Battleships game (two players)

Details
Łukasz Pęgiel
How to...
10 January 2015
Hits: 19194
Tags: CL_GUI_TIMER , GAME , BATTLESHIPS , CL_GUI_ALV_GRID , CL_GUI_HTML_VIEWER
I was playing a bit with CL_GUI_TIMER some time ago and I thought that this would be good to use it somewhere to have idea how it works. So I've created then a small game Battleships, which you for sure know from analog version. 

Game is very simple, firstly you have to build your own map with ships. Just to remind you, there are 2 submarines, 2 destroyers, 1 cruiser, 1 battleship and 1 aircraft carrier. Map is created with CL_GUI_ALV_GRID. Once you click on status button to add one of the ships, map will show you in which place you can start ship. When you'll select position of the start it will show you possible fields for end.
After you build your map hit Join Game button and wait for second player to join you. 
Add a comment
Read more ...

Popup with multi-select ALV

Details
Łukasz Pęgiel
How to...
30 April 2014
Hits: 49671
Tags: SET_TABLE_FOR_FIRST_DISPLAY , SET_READY_FOR_INPUT , GET_SELECTED_ROWS , POPUP , ALV POPUP
If you imported NUGG file from previous article you could be surprised that there is one additional FM available called Z_AB_POPUP_GRID_MULTI_SEL. This FM can be used to call a popup with ALV grid which allows multiple row selects. 
1) In order to prepare such popup you'll need to firstly define some global variables in FG which you can find bellow:

constants: c_ccname_grid_popup type scrfname value 'CC_GRID_POPUP'.
data: go_popup_custom_cont      type ref to cl_gui_custom_container.
data: go_popup_grid             type ref to cl_gui_alv_grid.
data: gs_popup_layout           type lvc_s_layo.
data: gs_popup_variant          type disvariant.
data: gt_popup_fcat             type lvc_t_fcat.
data: g_popup_question          type char70.
field-symbols: <gt_popup_outtab> type standard table.

2) Then you need to create GUI status with Cancel and Enter Buttons
Add a comment
Read more ...

EWB Components allocation to routing operation (multilevel BOM)

Details
Łukasz Pęgiel
How to...
18 April 2014
Hits: 47518
Tags: CP_CC_S_LOAD_COMPLEX_BY_TSK , CP_CC_S_LOAD_COMPLEX_BY_BOM , CP_CC_S_PROVIDE_ITM_BY_AS_PATH , CP_CC_S_PROVIDE_COM_BY_OPR , CP_CL_P_OPR_ALLOCATION_PROVIDE , CM_CL_P_COM_DELETE , CP_CC_S_SAVE , CP_CC_S_OPR_PROVIDE_BY_MTK , CP_CC_S_CREATE_COM
This topic was raised many times, I always found it's not possible to (or at least to hard to try) to update components allocation for routing operations. Fortunately I had to do it somehow and I manage to do it in two ways : 
1) with BDC (yeah I know, creepy but possible)
2) using EWB FM's basing on the SAP note 488765 - "Do it yourself EWB programming".
Today I will present program which is using EWB, in future I will post an example of doing this by BDC.
 
 
This program reads data from Excel file with proper structure (you can find Excel template in attachment). After reading data it collects all routings which needs to be updated to be sure that each routing is updated only once. Then the most important part is done in following way:
1) We need to load each routing and connected BOM to memory with CP_CC_S_LOAD_COMPLEX_BY_TSK and CP_CC_S_LOAD_COMPLEX_BY_BOM,
2) Next step is to get the BOM into internal table using CP_CC_S_PROVIDE_ITM_BY_AS_PATH.  BOM table contains also a explosion of sub-assemblies which are not phantoms which at the beginning seem to be useless, but after a while you'll notice that we need all levels of multilevel BOM in order to calculate Path (PLMZ-KANTE) and order level (PLMZ-STLST).  If you have to do components allocation for single level BOM then reworking the table is not needed, but in my example I did it as I needed to allocate components from multi-level BOM. You'll find here a form ITEM_CHECK which do the manipulation of the table. 
3) After it's done we need load operation data (CP_CC_S_PROVIDE_COM_BY_OPR) and current allocation of components (CP_CL_P_OPR_ALLOCATION_PROVIDE). We need to do it in order to delete current allocation.
4) Deletion is done with CM_CL_P_COM_DELETE and saved with CP_CC_S_SAVE. Deletion is committed as in other case there is no possibility to create new allocation.
5) Allocation is deleted, so we can now recreate it with new values. Firstly we need to reload again operation data to memory with CP_CC_S_OPR_PROVIDE_BY_MTK and then create allocation with  CP_CC_S_CREATE_COM. Again we need to save allocation with CP_CC_S_SAVE.
 
Bellow you'll find the code of the program. You can download also NUGG file for it!.
 
Program works in two steps, firstly it displays reading log, if it is ok you have to press first button on the toolbar  to create allocation.
Add a comment
Read more ...

Reset rejection of Purchase Requisition

Details
Łukasz Pęgiel
How to...
24 March 2014
Hits: 18887
Tags: IF_PURCHASE_REQUISITION , IF_RELEASABLE_MM , MEPO_DOCUMENT , MEREQ_GET_FACTORY , IF_PURCHASE_REQ_FACTORY , IS_RESET_REJ_ALLOWED
As promised today I'll put code for a method to reset the rejection of the Purchase requisition. Most of the code is the same like in the check method, in fact even the code is repeated again so you can use this one without checking if reset of rejection can be done or not.
 
Importing:

I_BANFN TYPE EBAN-BANFN -> Purchase Requistion number

Changing:

C_FACTORY TYPE REF TO IF_PURCHASE_REQ_FACTORY -> Purchase requisition factory

Exporting:

E_RESET TYPE FLAG -> Reset was successful

Exceptions:

HEADER_COULDNT_BE_CREATED
ERROR_DURING_RESET
CANNOT_RESET

Add a comment
Read more ...

Other checks on purchase requisition state

Details
Łukasz Pęgiel
How to...
22 March 2014
Hits: 5865
Tags: IF_RELEASABLE_MM , IS_REJECTION_ALLOWED , IS_RELEASE_ALLOWED , IS_RESET_REL_ALLOWED
In the previous article I've shown how to check if we can reset the rejection of the purchase requisition. In the same way you can check if rejection is allowed or if release is allowed or if reset of release is allowed. To do that you'll have to replace  following piece of code from previous example fo_releasable->is_reset_rej_allowed( )
 with one of the following:
  • fo_releasable->is_rejection_allowed( ) 
  • fo_releasable->is_release_allowed( )
  • fo_releasable->is_reset_rel_allowed( ) 
 
In next article I will show you how to reset the rejection of PR .
Add a comment

How to check if for purchase requisition rejection can be reset?

Details
Łukasz Pęgiel
How to...
18 March 2014
Hits: 11295
Tags: IF_PURCHASE_REQUISITION , IF_RELEASABLE_MM , MEPO_DOCUMENT , MEREQ_GET_FACTORY , IF_PURCHASE_REQ_FACTORY , IS_RESET_REJ_ALLOWED
Working with Purchase Requisitions in ABAP is quite pleasant job, but sometimes it's not so easy like with other documents types. You cannot easily say if Requisition is rejected and can be reset by checking EBAN table. You have to use OO PR objects to be able to do so. Bellow you can find a method how to check if you can reset the rejection of the requisition done in the WF. 
 
Importing:

I_BANFN TYPE EBAN-BANFN ->Purchase Requisition Number

Exporting:

E_RESETABLE TYPE FLAG -> If rejection can be reset this parameter will be set to 'X'

Changing:

CO_FACTORY TYPE REF TO IF_PURCHASE_REQ_FACTORY -> Purchase requisition factory

Exception:

HEADER_COULDNT_BE_CREATED

Add a comment
Read more ...

Characteristic's own input screen - Part 8 - example of use

Details
Łukasz Pęgiel
How to...
17 November 2013
Hits: 7364
We got all needed functions, so I'll give you an example how to call the methods correctly to get characteristics update window like this:
 
Program bellow is reading firstly the info about stored values in given characteristic and then throws an update screen. After exiting from the screen it's saving data to database.
Add a comment
Read more ...

Characteristic's own input screen - Part 7 - save characteristic value to database

Details
Łukasz Pęgiel
How to...
17 November 2013
Hits: 14654
Tags: BAPI_OBJCL_CHANGE , BAPI_OBJCL_GETDETAIL
Now it's time to save the values entered into database. I will use here previously created method to move data from reference structure to BAPI tables, then I will read values from database to see if something has changed with BAPI_OBJCL_GETDETAIL, then save the values with BAPI_OBJCL_CHANGE. Just one remark, you have to pass all values always to that FM!
 
Importing:

I_DATA TYPE DATA OPTIONAL
value( I_CHANGE_NUMBER ) TYPE BAPI1003_KEY-CHANGENUMBER OPTIONAL -> Change Number 

Exception:

NO_DATA  

Add a comment
Read more ...

More Articles ...

  1. Characteristic's own input screen - Part 6 - move reference data to bapi structures
  2. Characteristic's own input screen - Part 5 - show characteristic's own update screen
  3. Characteristic's own input screen - Part 4 - Move screen values to reference data
  4. Characteristic's own input screen - Part 3 - Move reference data values to screen
  5. Characteristic's own input screen - Part 2 - Clear Initial Line
  6. Characteristic's own input screen - Part 1 - Convert Values To Float
  7. Scan program for authority-check
  8. Call standard F4 search help with customized parameters
  9. Classifications - Part 4 - example of use
  10. Classifications - Part 3 - get all objects assigned to class
  11. Classifications - Part 2 - Get Object Details
  12. Classifications - Part 1 - prepare structure for class data
  13. Create a nice looking chart with CL_GUI_CHART_ENGINE - Part 3 - Chart Data and render
  14. Create a nice looking chart with CL_GUI_CHART_ENGINE - Part 2 - Customization
  15. Create a nice looking chart with CL_GUI_CHART_ENGINE - Part 1 - Chart Designer
  16. Load variant to single subscreen (selection screen)
  17. F4 Help for external date
  18. Save variant for single selection screen subscreen
  19. Delete Routing - piece of cake
  20. Creating editor for dynamic code (SE38 like)
  21. Download CV01N/2N/3N documents to PC
  22. ZIP a file using ABAP
  23. Get filename and extension from full path
  24. Convert date to and from external date type
Page 3 of 6
  • Start
  • Prev
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • Next
  • End


Łukasz Pęgiel
ALV GRID IN THE NUTSHELL CTMS DDB SET VAL FROM OBJECT GUI ALV GRID LVC FCAT ALV Grid in the nutshell Field catalog - seltext ALV GRID DYNAMIC GUI STATUS AiE CHAR VALUE CHANGE2 SAP DEVELOPMENT TOOLS FOR ECLIPSE OUT ZDEMO FALV02 - Full screen with redefinitions FIELDCATALOG SALV CONTROLLER METADATA GTGET QM ATTACHMENTS ABAP DEVELOPMENTS TOOLS DELETE USER SETTINGS REFRESH TABLE DISPLAY Delete Routing - piece of cake PURCHASE REQ FACTORY SIGN BATTLESHIPS ADT MB51 POPUP XML ALINK CONNECTION READ OBJECTS EMPHASIZE CSRF token validation failed Popup with multi-select ALV SAPGUI FUNCTIONCODE CVAPI DOC GETDETAIL KKEK CONVERT FLOAT CURR IXML OSTREAM RM07DOCS SYM SAVE ESRUO - MM settings table - Part 2 LOWER CASE PROGRESS INDICATOR Enhanced MB51 Part 6 - ZMB51 program RELEASABLE FALV01 - Standard full screen FALV Download CV01N 3N documents to PC F4IF GET SHLP DESCR ABAP TYPEDESCR SELECTED ROWS CREATE COM ZIP REQUISITION TSK UPPER CASE Selection Screen - Part1 - Parameters SELSCREEN STATUS AGGREGATIONS FALV EXTEND PROGRAM RUNTIME Enhanced MB51 Part 1 - Goal and prerequisites GUI STATUS OUTPUTLEN
  • 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.