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.
i_dynnr type sy-dynnr -> subscreen number
1st) Add empty line after each part you want to separate and color it differently;
Adding empty lines will force you to delete all of them each time you'll do changes inside table displayed in grid and you'll have to do the calculation of position again, that's why today I will show you the second option.
IM_DISPLAY TYPE CHAR1 - Display only? (no selection)
IM_ELPEI TYPE TPRG-PRGBZ (OPTIONAL) - External date type
EX_EEIND TYPE RVDAT-EXTDATUM - External date
EX_ELPEI TYPE TPRG-PRGBZ - External date type
I_DYNNR TYPE SY-DYNNR - Current Screen Number
I_VARNAME TYPE RSVAR-VARIANT - Variant Name
I_VARTEXT TYPE VARIT-VTEXT - Program variant short text
When you use CL_GUI_ALV_GRID in edit mode or you change your internal table used to display data on ALV grid it may happen that after refreshing the grid using refresh_table_display your cursor or scroll goes to the begining of the grid. Users feels little lost in such situation but there is an easy solution for that.
data: is_stable type lvc_s_stbl.
is_stable-row = 'X'.
is_stable-col = 'X'.
is_stable = 'XX'.
is_stable = is_stable " With Stable Rows/Columns
* i_soft_refresh = i_soft_refresh " Without Sort, Filter, etc.
finished = 1
others = 2
if sy-subrc <> 0.
* message id sy-msgid type sy-msgty number sy-msgno
* with sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
EDIT: Method of mine which can be found bellow doesn't have to be used to achieve your goal. To be honest I can't remember why I created separate version of it as only the cursor act a bit different than oryginal one. I must have had mind eclipse at the time :-) . Excuse me for that.
So to keep scroll position and current cell we will need to use following methods of CL_GUI_ALV_GRID:
get_scroll_info_via_id - gets current scroll information
get_current_cell - gets current cell, we will use that data to set the cursor at the end
get_selected_rows - gets selected rows
get_selected_cells_id - if we didn't select any rows, we check for the selected cell information
refresh_table_display - then simple refresh of grid
set_selected_cells_id - after refresh it's time to set back all information, so set selected cell
set_selected_rows - or set seleted rows (depanding what we received at the begining)
set_scroll_info_via_id - set scroll position back
set_current_cell_via_id - set cursor back.
There is no special coding here, just standard ALV grid methods used in proper order.
Method definition, Importing parameters:
I_SOFT TYPE CHAR01 DEFAULT 'X'
I_SET_CURRENT TYPE CHAR01 DEFAULT SPACE
I_SET_SELECTED TYPE CHAR01 DEFAULT SPACE
GRID TYPE REF TO CL_GUI_ALV_GRIDAdd a comment
Not once, not twice I've search for a solution to do changes in routings (task lists) in some wise way. I hate BDC but in this case I thought that there is no other solution. Fortunately I was wrong ! While reading one of the post asking about same thing one of the users has mention something really nice - SAPNote 488765 "Do-it-yourself EWB programming". This note shows how to use FM used in CEWB, so we can create/change/delete bom and routings. The example available in the note shows how to change an routing operation description. The rest you have to figure out alone but once you start to use the functions or you'll check "where used" then it became quite easy (but not less time consuming). When you find the function you're seeking then it's piece of cake.
It was like that also with delete routing function which I share with you today. There is no BAPI_ROUTING_DELETE (yet), so firsty we had to load the task to EWB memory with 'CP_CC_S_LOAD_COMPLEX_BY_TSK' ,then it's time to set deletion indicator in MAPL ('CP_CC_S_DELETE_BY_MTK') and in PLKO ('CP_CC_S_DELETE_BY_TSK'). At the end we have to save the changes with 'CP_CC_S_SAVE' and dequeue task with 'CP_CL_TSK_UNLOCK'. If you need you may also delete the operations but in my opinion this is not needed here.Add a comment
I had a thought one day to use a code saved in database table for easy change of some calculation rules and I've prepared code to run SE38 like editor for such code. Maybe some of you also had such need, so today I will explain briefly how to do this. I will use FM 'EDITOR_TABLE_WITH_STATUS' to display an editor which you know from SE38/SE80 , 'SAPGUI_SET_FUNCTIONCODE' for setting OK_CODE for editor, 'PRETTY_PRINTER' to make our code looks readable. I will also use one trick that allows you to assign data which is available in calling program but not in our function. But before we need to prepare our own GUI status with some basic buttons like 'Patern' or 'Pretty Printer'.
Add a comment