Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

Field Exit

Former Member
0 Likes
538

Can we access global screen values in field exit. Say, if we are creating a field exit for posting date then can we access other data such as plant material displayed on the screen inside the field exit.

PLZ HELP!

Can we access global screen values in field exit. Say, if we are creating a field exit for posting date then can we access other data such as plant material displayed on the screen inside the field exit.

PLZ HELP!

3 REPLIES 3
Read only

Former Member
0 Likes
504

Hi,

You can read the screen values by using Function Module: DYNP_VALUES_READ. You have to populate Screen number, name and internal table with Screen Field for which you need values.

Cheers,

Ashok

Read only

Former Member
0 Likes
504

hi,

You can very well do that for that you got to identify the program name and the screen number and call the FM


  T_DYNPREAD-FIELDNAME = 'AFVGD-ARBPL'.      "Maintenance item Flow
  APPEND T_DYNPREAD.
  T_DYNPREAD-FIELDNAME = 'AFVGD-WERKS'.      "Maintenance item Flow
  APPEND T_DYNPREAD.

  W_PROG = 'SAPLCOIH'.
  W_DNUM = '3800'.


   CALL FUNCTION 'DYNP_VALUES_READ'
        EXPORTING
             DYNAME                   = W_PROG"     
             DYNUMB                   = W_DNUM
*            TRANSLATE_TO_UPPER       = ' '
*            REQUEST                  = ' '
*            PERFORM_CONVERSION_EXITS = ' '
*            PERFORM_INPUT_CONVERSION = ' '
*            DETERMINE_LOOP_INDEX     = ' '
        TABLES
             DYNPFIELDS               = T_DYNPREAD
        EXCEPTIONS
             INVALID_ABAPWORKAREA     = 1
             INVALID_DYNPROFIELD      = 2
             INVALID_DYNPRONAME       = 3
             INVALID_DYNPRONUMMER     = 4
             INVALID_REQUEST          = 5
             NO_FIELDDESCRIPTION      = 6
             INVALID_PARAMETER        = 7
             UNDEFIND_ERROR           = 8
             DOUBLE_CONVERSION        = 9
             STEPL_NOT_FOUND          = 10
             OTHERS                   = 11.
    IF SY-SUBRC IS INITIAL.
      READ TABLE T_DYNPREAD WITH KEY FIELDNAME = 'AFVGD-WERKS'.
      IF SY-SUBRC IS INITIAL.
        CLEAR: OUTPUT.
        CONCATENATE T_DYNPREAD-FIELDVALUE ' / ' INTO OUTPUT.
      ENDIF.
      READ TABLE T_DYNPREAD WITH KEY FIELDNAME = 'AFVGD-ARBPL'.
      IF SY-SUBRC IS INITIAL.
        CONCATENATE OUTPUT T_DYNPREAD-FIELDVALUE INTO OUTPUT
                            SEPARATED BY SPACE.
      ENDIF.
    ENDIF. 

or do this way ...


   OUTPUT = INPUT.
 FIELD-SYMBOLS : <FS>.
 DATA: ASSIGNFIELD(21) TYPE C,
       L_LINE LIKE SY-STEPL,
       V_BANFN LIKE EBAN-BANFN,
       V_IDATE(10),
       V_ODATE(10),
       V_KDATE LIKE EKKO-KDATE,
       V_BNFPO LIKE EBAN-BNFPO.

 DATA: WA_ZMP19 LIKE ZMP19 OCCURS 0 WITH HEADER LINE.

 GET CURSOR LINE L_LINE.
 IF SY-STEPL NE L_LINE.
   EXIT.
 ENDIF.

 V_IDATE = OUTPUT.
 CONCATENATE V_IDATE+6(4) V_IDATE+3(2) V_IDATE+0(2) INTO V_ODATE.
*  message e000(zz) with v_odate.
 ASSIGNFIELD = '(SAPMM06B)AEBAN-BANFN'.
 ASSIGN (ASSIGNFIELD) TO <FS>.
 IF SY-SUBRC = 0.
   MOVE <FS> TO V_BANFN.
 ENDIF.
 V_BNFPO = SY-STEPL.

 

Read only

Former Member
0 Likes
504

Hi,

Yes. We can access global values in field exits.

Check OSS Note 29377 (FAQ on Field Exits)

Here is something interesting:

u201CIn principle, every field exit can store its value in the global variables of the function group (TOP) and make them available to other field exits.u201D

All the values stored in the TOP include of the function group can be accessed in other field exits.

Thanks.