Skip to Content
author's profile photo Former Member
Former Member

Function module screens

Hello experts,

I have a function module which can call 4 screens (via CALL SCREEN statement). Each one of the screens has some fields. The user passes to the FM the list of fields, which he wants to make editable. The problem is, that I need to dynamically check which fields are on which screens and call only the desired one(s).

For example:

screen 1 contains fields f1, f2, f3

screen 2 contains fields f4, f5, f6

screen 3 contains fields f7, f8. f9

User wants to make fields f1 and f4 editable. So I need to call screens 1 and 2.

I cannot do this on PBO - I can't just use LOOP AT SCREEN, because I don't know which screens I will need. I have to check this first and then show only the desired screens.

So my questions - where (in which tables) can I find:

1. information about the assignment between screen and Function module?

2. assignment between screen and screen elements?

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

2 Answers

  • Best Answer
    Posted on Jul 21, 2011 at 05:57 AM

    You could do that in PBO. Suggestion : call the three screens in sequence and in the PBO of each screen, during the LOOP AT SCREEN, set the requested fields input-able, and memorize that a field was set for input, at the end of the LOOP, if no field was set use a SUPPRESS DIALOG that triggers PAI and go for next screen.

    FUNCTION z_xxxx.
    *"*"Lokale Schnittstelle:
      CALL SCREEN 100.
      CALL SCREEN 101.
      CALL SCREEN 102.
    MODULE common_pbo OUTPUT.
      perfom set_attributes.
    ENDMODULE.                    "COMMON_PBO
    *&      Form  SET_ATTRIBUTES
    FORM set_attributes.
      DATA field_found TYPE c LENGTH 1.
      CLEAR field_found.
        CHECK screen-group1 = 'INP'. 
        READ TABLE so_fields WITH KEY low = screen-name.
        IF sy-subrc EQ 0.
          screen-input = 1.
          field_found = c_x.
          screen_input = 0.
      IF field_found IS INITIAL.
    ENDFORM.                    "SET_ATTRIBUTES



    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Jul 20, 2011 at 12:27 PM

    Use this - EXPORT f1 f2 f3 TO MEMORY ID 'ID'. From the function module.

    And use - IMPORT f1 f2 f3 FROM MEMORY ID 'ID' in the PBO of whichever screen u want to use.

    Hope this helps.



    Add a comment
    10|10000 characters needed characters exceeded

    • Former Member

      The problem is, that I don't know (during FM runtime) which fields are on which screens. I have to check this first and then call appropriate screens.

      I need the SAP table in which the realtionship between FM and screen is stored.


      I have found the tables, that I have been looking for:

      1. Table which contains relationship between function module and screens is D020S (well between function group and screen to be exact).

      2. Table with screen elements for particualr screen (relationship function group-screen-screen element) is D021T.

      Edited by: piotrzym on Jul 21, 2011 7:37 AM

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.