3

I am new to ABAP and I want to make a program with multiple screens and an initial home screen where one can see the list of all program screens. I understand that I can hardcode them but there should be a better way.

If there is any what kind of field/area do I need to make this list clickable (to go to screen). So far I have made an initial screen and when the GO button is pressed it leads to the next screen

REPORT Z_UZD_1_LOCAL.
CALL SCREEN 1001.
MODULE STATUS_1000 OUTPUT.
*  SET PF-STATUS 'ZMENU'.
*  SET TITLEBAR 'ZMENU_PAINTER'.
CASE SY-UCOMM.
    WHEN 'EXIT'.
      LEAVE PROGRAM.
    WHEN 'BACK'.
      LEAVE PROGRAM.
     WHEN 'GO'.
      CALL SCREEN 1001.
  ENDCASE.
ENDMODULE.

MODULE STATUS_1001 OUTPUT.
*  SET PF-STATUS 'ZMENU'.
*  SET TITLEBAR 'ZMENU_PAINTER'.
CASE SY-UCOMM.
      WHEN 'GO2'.
      CALL SCREEN 1000.
  ENDCASE.
 ENDMODULE.

It looks like this:

screenshot

Go to Personas button leads to the next screen, and I would like to have a list of all the screens under the find button.

Sandra Rossi
  • 11,934
  • 5
  • 22
  • 48
Hārdža
  • 75
  • 2
  • 10
  • Why? What is the business reason for this? It sounds like you're trying to build something unnecessarily complicated. – vwegert Feb 10 '16 at 13:20
  • There is no business logic behind it, im the new guy who needs to train and this is what i got. :( – Hārdža Feb 10 '16 at 13:58
  • And what would the proper training be? – Hārdža Feb 10 '16 at 14:56
  • 2
    Maybe the best advice I can give you is to begin to walk before running, in other words; start learning the basics of SAP (what it is and what problems it targets) and then, with the help of ABAP, you may try functional and realistic solutions for business issues. It's true that ABAP is a language like any other with its traits but it is used to handle situations especifically related to the ERP, so it's better to get the 'feeling' of SAP first and then move on in this career. Please consider this approach. Hope it helps. – Nelson Miranda Feb 10 '16 at 17:05
  • 1
    @HardijsĶirsis Take a look at https://training.sap.com/de/en/, there's a curriculum available. Also, trying to solve arbitrary (sorry: silly) programming questions will not be helpful. This is like trying to lean Java by starting off with byte code weaving. – vwegert Feb 10 '16 at 18:55

1 Answers1

1

You can read the table D020S and its text-table D020T with the key program = sy-repid, which should give you all dynpros which belongs to this program (sy-repid is your actual program).

Is this what you want?

Suncatcher
  • 10,355
  • 10
  • 52
  • 90
icbytes
  • 1,831
  • 1
  • 17
  • 27
  • Given the fact that the OP is only just starting their ABAP education, this will probably not be very helpful. – vwegert Feb 10 '16 at 18:52
  • I disagree. Especially in terms of getting started with system tables and internal representation of everything in the repo, which is also saved in tables. For me a very important basic info. – icbytes Feb 10 '16 at 20:14
  • 2
    "For me a very important basic info", you know? maybe it is for you, however, considering the OP background it's more important to guide newbies rather than throwing them these answers because actually you aren't helping them. You are teaching them to follow shortcuts and encouraging them to ignore basic issues and best practices in SAP. Without a good orientation in SAP, an eager and unexperienced programmer in this ERP could make disasters in the system. Please don't take it personal. Best regards. – Nelson Miranda Feb 10 '16 at 20:51
  • I disagree. I answered his question, without a doubt instead of interpreting, how he might be bad, what is not suitable and what might be the proper way to do "whatever You think, might be better for him." And that is, what SO is about. Answering questions. If the op will have more questions, i would add comments. But I would not be that arrogant to advise him what to do next, without the answer itself. – icbytes Feb 10 '16 at 20:57
  • 2
    @icbytes, you answered about 10% of his question. The rest is an interesting exercise of generating a dynamic list of clickable links to all the screens. Which I guess he could do with an ALV with buttons or hyperlinks. – Gert Beukema Feb 10 '16 at 23:19
  • Read his question agai, please. – icbytes Feb 10 '16 at 23:20