2014 Jun 11 3:51 PM
Hi all,
I searched around but did not found an answer so hopefully you can help me out!
I try to use the sap graphic CNET_GRAPHIC_NETWORK to display objects as nodes and links. I therefor used the example program netz_ocx2 and modified it only a little bit. This is working fine so far, but still its in its own report/program developed with global tables and variables.
When I tried to create my own program and use the sap class CL_GUI_NETCHART, which internally uses the function modules mentioned above, I can successfully display my network. The great problem ist about the interaction end evaluation of user actions and handling them.
I call the method graphic_pai in the PAI of my dynpro screen but it does not handle the user action. In the example program there is a global field 'gr_mes' which seams to store the action to handle after the call but I do not know how to get it there.
Here is my PAI module:
| call method LR_NETCHART->GRAPHIC_PAI |
* exporting
| * | INDXKEY | = |
| * | ACTIVATE_HELP | = 'X' |
| * | AT_CONTROL_DESTROY = | |
| importing | ||
| GR_MES | = LF_MES | |
| GR_MODE | = LF_MODE | |
| GR_SEL_FIELD | = LF_SEL_FIELD | |
| * | SETTINGS | = |
| changing | ||
| * | BOXES | = |
| * | BVALS | = |
| CLUSTERS | = GT_CLUSTR | |
| CVALS | = GT_CVALS | |
| * | DELETIONS | = |
| * | FRAMES | = |
| * | FVALS | = |
| LINES | = GT_LINES | |
| LVALS | = GT_LVALS | |
| NODES | = GT_NODES | |
| NVALS | = GT_NVALS | |
| * | POSITIONS | = |
| . |
| clear: ABAP_CMD, | |
| STATUS_TEXT. |
| STAT = NET_CONST-STAT_4. | "wait for input |
| case LF_MES. |
*----------------------------------------------------------------------*
| when NET_CONST-ASK_FOR_INSERT. | ||
| LG_MES = LF_MES. | ||
| ABAP_CMD = LF_MES. | ||
| STATUS_TEXT = TEXT-001. | "Knoten eingefügt |
*----------------------------------------------------------------------*
| when NET_CONST-ASK_FOR_DUPLICATE. | ||
| LG_MES = LF_MES. | ||
| ABAP_CMD = LF_MES. | ||
| STATUS_TEXT = TEXT-002. | "Knoten dupliziert |
*----------------------------------------------------------------------*
| when NET_CONST-ASK_FOR_DELETE. | ||
| LG_MES = LF_MES. | ||
| ABAP_CMD = LF_MES. | ||
| STATUS_TEXT = TEXT-003. | "Knoten / Kante gelöscht |
*----------------------------------------------------------------------*
| when NET_CONST-ASK_FOR_CONNECT. | ||
| LG_MES = LF_MES. | ||
| ABAP_CMD = LF_MES. | ||
| STATUS_TEXT = TEXT-004. | "Kante eingefügt |
*----------------------------------------------------------------------*
| when NET_CONST-ASK_FOR_MODIFY. | |
| LG_MES = LF_MES. | |
|
ABAP_CMD = LF_MES. "... |
Can someone give me a hint how to use the class in the correct way?
Thx and regards,
Andreas
2014 Jun 18 3:07 PM
OK, as no own seems to know something about it I finally got it working.
The main problem in understanding the usage of this class is in the way in stores and handles data. As you can see from my example you have to prepare two data objects of each data table, one for global overall storage for your data and one which is passed to the function modules.
As the method GRAPHIC_PAI( ) resets the table parameters and only fill the ones currently important (e.g. if you create a link only T_LINES and T_LVALS) are filled. So you have to take care to update your global tables, e.g. by calling the function module CNET_LOGIC_NETWORK and pass all parameters to it. Afterwards in your PBO you call the method GRAPHIC_NETWORK_PBO with your working copy tables.
Hope this helps someone when stuck with the graphic network component.
Regards,
Andreas
Hi all,
I searched around but did not found an answer so hopefully you can help me out!
I try to use the sap graphic CNET_GRAPHIC_NETWORK to display objects as nodes and links. I therefor used the example program netz_ocx2 and modified it only a little bit. This is working fine so far, but still its in its own report/program developed with global tables and variables.
When I tried to create my own program and use the sap class CL_GUI_NETCHART, which internally uses the function modules mentioned above, I can successfully display my network. The great problem ist about the interaction end evaluation of user actions and handling them.
I call the method graphic_pai in the PAI of my dynpro screen but it does not handle the user action. In the example program there is a global field 'gr_mes' which seams to store the action to handle after the call but I do not know how to get it there.
Here is my PAI module:
| call method LR_NETCHART->GRAPHIC_PAI |
* exporting
| * | INDXKEY | = |
| * | ACTIVATE_HELP | = 'X' |
| * | AT_CONTROL_DESTROY = | |
| importing | ||
| GR_MES | = LF_MES | |
| GR_MODE | = LF_MODE | |
| GR_SEL_FIELD | = LF_SEL_FIELD | |
| * | SETTINGS | = |
| changing | ||
| * | BOXES | = |
| * | BVALS | = |
| CLUSTERS | = GT_CLUSTR | |
| CVALS | = GT_CVALS | |
| * | DELETIONS | = |
| * | FRAMES | = |
| * | FVALS | = |
| LINES | = GT_LINES | |
| LVALS | = GT_LVALS | |
| NODES | = GT_NODES | |
| NVALS | = GT_NVALS | |
| * | POSITIONS | = |
| . |
| clear: ABAP_CMD, | |
| STATUS_TEXT. |
| STAT = NET_CONST-STAT_4. | "wait for input |
| case LF_MES. |
*----------------------------------------------------------------------*
| when NET_CONST-ASK_FOR_INSERT. | ||
| LG_MES = LF_MES. | ||
| ABAP_CMD = LF_MES. | ||
| STATUS_TEXT = TEXT-001. | "Knoten eingefügt |
*----------------------------------------------------------------------*
| when NET_CONST-ASK_FOR_DUPLICATE. | ||
| LG_MES = LF_MES. | ||
| ABAP_CMD = LF_MES. | ||
| STATUS_TEXT = TEXT-002. | "Knoten dupliziert |
*----------------------------------------------------------------------*
| when NET_CONST-ASK_FOR_DELETE. | ||
| LG_MES = LF_MES. | ||
| ABAP_CMD = LF_MES. | ||
| STATUS_TEXT = TEXT-003. | "Knoten / Kante gelöscht |
*----------------------------------------------------------------------*
| when NET_CONST-ASK_FOR_CONNECT. | ||
| LG_MES = LF_MES. | ||
| ABAP_CMD = LF_MES. | ||
| STATUS_TEXT = TEXT-004. | "Kante eingefügt |
*----------------------------------------------------------------------*
| when NET_CONST-ASK_FOR_MODIFY. | |
| LG_MES = LF_MES. | |
|
ABAP_CMD = LF_MES. "... |
Can someone give me a hint how to use the class in the correct way?
Thx and regards,
Andreas
2014 Jun 11 4:21 PM
OK, I got a little step further but still not finished.
I have inserted a method call to "SET_FUNCTION_CODE" of the cl_gui_netchart class directly before the call to GRAPHIC_PAI. Afterwards at least the correct LF_MES value is returned.
Still I do not know how to go on as after any action all items are disappering and my UI is empty 😞
Please help me out...
Regards,
Andreas
2014 Jun 18 3:07 PM
OK, as no own seems to know something about it I finally got it working.
The main problem in understanding the usage of this class is in the way in stores and handles data. As you can see from my example you have to prepare two data objects of each data table, one for global overall storage for your data and one which is passed to the function modules.
As the method GRAPHIC_PAI( ) resets the table parameters and only fill the ones currently important (e.g. if you create a link only T_LINES and T_LVALS) are filled. So you have to take care to update your global tables, e.g. by calling the function module CNET_LOGIC_NETWORK and pass all parameters to it. Afterwards in your PBO you call the method GRAPHIC_NETWORK_PBO with your working copy tables.
Hope this helps someone when stuck with the graphic network component.
Regards,
Andreas
| User | Count |
|---|---|
| 3 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |