2012 Apr 02 6:19 AM
I have created a Z-report program which calls a Z-screen (9000) using call screen. On this screen I have to display dynamic number of graphs and lists for which I have created a container. I have added two buttons NEXT and PREV using SET PF status. My requirement is that if the number of graphs to be displayed can fit into just one screen then both the buttons NEXT and PREV shouldnt appear on the screen. I have fixed the number of graphs to two per screen and have a variable graph_no which will store the total number of graphs that the report is going to display.
To achieve this hiding I am using LOOP AT SCREEN in the PBO module of the screen 9000. However when I see the code in the debug mode I see that the debuggers comes to the LOOP AT SCREEN statement but doesnt enter into the loop. Directly from LOOP AT SCREEN statement on pressing F5 it goes to the next line after the ENDLOOP statement and I am totally clueless as to why this should happen? Can anyone please help?
2012 Apr 02 7:09 AM
Hi,.
Is the Screen table initial?
If so the program isnot able to capture the screen fields.In that case check if ok)code has been defines in the program and in screen elements.
2012 Apr 02 6:30 AM
Hi,
Please make sure that you have provide OK_CODE Into Element list Of the Screen 9000.
Regards
Ajit
2012 Apr 02 6:57 AM
The requirement is to check if all the graphs can be fit in the screen and based on that control the display of NEXT and PREV buttons.
If my understanding is correct, then we can control this with PF-STATUS.
Define a PF-STATUS with NEXT and PREV button and another PF-STATUS with only NEXT button etc.
In PBO, do necessary checking and accordingly set the required PF-STATUS.
For ex,
In PBO,
IF LV_INDEX = 1.
SET PF-STATUS 'PF'.
ELSEIF LV_INDEX = 2.
SET PF-STATUS 'PF1'.
ENDIF.
2012 Apr 02 7:09 AM
Hi,.
Is the Screen table initial?
If so the program isnot able to capture the screen fields.In that case check if ok)code has been defines in the program and in screen elements.
2012 Apr 02 7:24 AM
I am not sure if I understand what do you mean by if OK_CODE is defined. I have not defined OK_CODE but plan to use SY_UCOMM. However Let me tell you that the custom screen contains nothing but a custom container. This container I have splitted into 5 parts latter in the logic using the splitter.
One is for Top of Page, the second part will contain the ALV of values for which I am drawing the line Graph in the 3rd part, Again the 4th for ALV of values of second Graph and then the Second Graph in the 5th Part.
What I am assuming is that even if the screen container is not detected in the LOOP AT SCREEN, the PF buttons should at least be detected and I should be able to hide/unhide them even before creating the containers.
2012 Apr 02 7:28 AM
Hi Ankur,
Please Double click on screen 9000. Then Click on Element List.Please check Name Field And check whether There is OK_CODE or not.If not then Enter OK_Code there.
Regards
Ajit
2012 Apr 02 7:43 AM
If you looking for disabling buttons in the application tool bar, then like i said earlier you can do it through PF status.
You can also set PF-STATUS with excluding option as said in the link http://scn.sap.com/thread/138023
2012 Apr 02 7:43 AM
If you looking for disabling buttons in the application tool bar, then like i said earlier you can do it through PF status.
You can also set PF-STATUS with excluding option as said in the link http://scn.sap.com/thread/138023
2012 Apr 02 8:21 AM
Problem Solved! Thanks...All I had to do was give the OK_CODE in the screen element list.