Application Development 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: 

Get Tabname during runtime

former_member194669
Active Contributor
0 Kudos

Hi all,

I am writing a module pool program with 1 main screen with 5 subscreens

Within the each tab there may be 52 inputs fields declared. My requirement is

while saving input, i need to generate log saying that the fields in tab(Tabname) is not filled.

For example.

In tab <b>SALES AREA DETAILS</b> field <b>Area Name</b> not filled

My question is how find the tab name are runtime.

Thanks

aRs

4 REPLIES 4

uwe_schieferstein
Active Contributor
0 Kudos

Hello aRs

I do not really see where the problem is.How are the dynpro fields typed? If they are typed with the corresponding table fields then you have the requested information already. If not, then you should have this information at least when it comes to saving the input.

I guess your problem is to find out the fieldnames for the different tables. In this case there is a simple solution around:

DATA: 
  ls_struc      TYPE <your table/structure>,
  lt_dfies       TYPE ddfields,
  ls_dfies      TYPE dfies.
 
FIELD-SYMBOLS:
  <ld_fld>     TYPE any.
 
  CALL FUNCTION 'DDIF_FIELDINFO_GET'
    EXPORTING
      tabname              = <name of table/structure>
    TABLES
      DFIES_TAB            = lt_dfies
    EXCEPTIONS
      NOT_FOUND            = 1
      INTERNAL_ERROR       = 2
      OTHERS               = 3.
  IF sy-subrc <> 0.
* MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
*         WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
  ENDIF.
  
 
  LOOP AT lt_dfies INTO ls_dfies.
    ASSIGN COMPONENT (ls_dfies-fieldname) OF STRUCTURE ls_struc TO <ld_fld>.
 
   IF ( <ld_fld> IS INITIAL ).
*   log that the field is empty...
  ENDIF.
  ENDLOOP.

If you do not use all fields of a table on a screen then you can read the dynpro fields (using function module <b>RS_IMPORT_DYNPRO</b>) and restrict the logic to these fields.

Regards

Uwe

Clemenss
Active Contributor
0 Kudos

Hi,

when in screen processing, DYNPRO field are available in LOOP AT SCREEN. You can assign SCREEN-NAME to <fieldsymbols> and the check if it is initial.

Try event AT SELECTION-SCREEN. It is processed wenn the screen processing is finished.

Regards,

Clemens

former_member194669
Active Contributor
0 Kudos

Hi Uwe,

My requirement is before save the document, I am calling a custom function module to generate the log. For this function module i am passing the subscreen entered values as internal table . Then within the function module i want to know input fields are in which screen?

Thanks

aRs

0 Kudos

Hello aRs

How do you collect the values entered in a subscreen into the internal table? Which structure does this itab have?

Regards

Uwe