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

F4 with 2 tabs

Former Member
0 Likes
1,524

Hi,

I need F4 for a field in which the F4 pop up contains 2 tabs; first tab displaying User IDs, and second tab displaying distribution list.

Any guidance on the above for me? Thanks in advance

Rgds,

ET

Hi,

I need F4 for a field in which the F4 pop up contains 2 tabs; first tab displaying User IDs, and second tab displaying distribution list.

Any guidance on the above for me? Thanks in advance

Rgds,

ET

11 REPLIES 11
Read only

Former Member
0 Likes
1,446

You can Create Search Helps in SE11 and futher attach that to your field to get F4.

Cheers,

Thomas.

Please mark points if useful.

Read only

Former Member
0 Likes
1,446

You can use the FM: POPUP_WITH_TABLE_DISPLAY

Read only

former_member480923
Active Contributor
0 Likes
1,446

Hi,

try using the follwoing code to your purporse

report zdemo_f4.


tables: dd03l.


types: begin of values ,
*         carrid TYPE spfli-carrid,
*         connid TYPE spfli-connid,
*          tab(30) type c,
          tab like dd03l-tabname,
*matnr like mara-matnr,
       end of values.
data:tab like dd03l-tabname.
data: carrier(3) type c,
      connection(4) type c.

data: progname type sy-repid,
      dynnum   type sy-dynnr,
      dynpro_values type table of dynpread,
      dynpro_values1 type table of dynpread,
      field_value like line of dynpro_values,
      field_value1 like line of dynpro_values1,
      values_tab type table of values.

data:v_field_value like line of dynpro_values.


data: begin of itab occurs 0,
*        tab(30) type c,
          tab like dd03l-tabname,

      end of itab.

data: return_tab type table of  ddshretval.
data: v_return_value like line of return_tab.

call screen 100.

module init output.
  progname = sy-repid.
  dynnum   = sy-dynnr.
  clear: field_value, dynpro_values.
*  field_value-fieldname = 'CARRIER'.
  field_value-fieldname = 'TAB'.

  append field_value to dynpro_values.
endmodule.

module cancel input.
  leave program.
endmodule.

*MODULE value_carrier INPUT.
*
*  CALL FUNCTION 'F4IF_FIELD_VALUE_REQUEST'
*       EXPORTING
*            tabname     = 'DEMOF4HELP'
*            fieldname   = 'CARRIER1'
*            dynpprog    = progname
*            dynpnr      = dynnum
*            dynprofield = 'CARRIER'.
*
*ENDMODULE.
*
module value_connection input.

*v_field_value-fieldname = 'I_TAB-TAB'.
*  append v_field_value to dynpro_values.
*
*
*  call function 'DYNP_VALUES_READ'
*       exporting
*            dyname             = 'ZDEMO_F4'
*            dynumb             = '100'
*            translate_to_upper = 'X'
*       tables
*            dynpfields         = dynpro_values.
*
*  READ TABLE dynpro_values INDEX 1 INTO field_value.
*
*  SELECT  carrid connid
*    FROM  spfli
*    INTO  CORRESPONDING FIELDS OF TABLE values_tab
*    WHERE carrid = field_value-fieldvalue.

*  SELECT  matnr
*    FROM  mara
*    INTO  CORRESPONDING FIELDS OF TABLE values_tab.
**    WHERE carrid = field_value-fieldvalue.
*

itab-tab = 'MARA'.
append itab.

itab-tab = 'MAKT'.
append itab.

itab-tab = 'MSEG'.
append itab.

loop at itab.
*values_tab-tab = itab-tab.
insert itab into table values_tab.


endloop.

  call function 'F4IF_INT_TABLE_VALUE_REQUEST'
       exporting
            retfield    = 'TAB'
            dynpprog    = progname
            dynpnr      = dynnum
            dynprofield = 'TAB'
            value_org   = 'S'
       tables
            value_tab   = values_tab
            return_tab  = return_tab.

read table return_tab index 1 into v_return_value.


endmodule.

hope this helps

Anirban

Read only

Former Member
0 Likes
1,446

Hello ET,

What you are looking for is Collective search helps. You will need to create individual (Elementary)search helps for each of the tabs you require, and then attach the same to a Collective search help, which is what should be called during F4 on your field.

Hope this helps.

Sudha

Read only

Former Member
0 Likes
1,446

Hi,

You can use the FM <b>F4IF_INT_TABLE_VALUE_REQUEST</b>,

pass itab which is join of user id's and distribution list name.

and call this fm at selection-screen on value request for field event.

you need to join the two tables and get the data to itab and pass it to Fm.

Regards

vijay

Read only

Former Member
0 Likes
1,446

Hai Pei Wan Tang

Try with the following Code

DATA: L_IND LIKE SY-INDEX.

DATA: L_T_RETURN TYPE STANDARD TABLE OF DDSHRETVAL WITH HEADER LINE,

L_RETURN TYPE DDSHRETVAL-FIELDVAL.

DATA: BEGIN OF IT_TEXT OCCURS 0,

MATNR LIKE MARA-MATNR,

MTART LIKE MARA-MTART,

IND LIKE SY-TABIX,

END OF IT_TEXT.

DATA: LI_FIELDS LIKE STANDARD TABLE OF HELP_VALUE.

DATA: BEGIN OF I_T_TEXT OCCURS 0,

MATNR LIKE MARA-MATNR,

MTART LIKE MARA-MTART,

END OF I_T_TEXT.

DATA:

L_RETFIELD TYPE DFIES-FIELDNAME,

L_DYNPROG TYPE SY-REPID,

L_DYNPNR TYPE SY-DYNNR,

L_DYNPROFIELD TYPE HELP_INFO-DYNPROFLD,

L_VALUE_ORG TYPE DDBOOL_D.

PARAMETERS:P_MATNR LIKE MARA-MATNR.

AT SELECTION-SCREEN ON VALUE-REQUEST FOR P_MATNR.

SELECT MATNR MTART FROM MARA INTO TABLE I_T_TEXT UP TO 10 ROWS.

LOOP AT I_T_TEXT.

IT_TEXT-MATNR = I_T_TEXT-MATNR.

IT_TEXT-MTART = I_T_TEXT-MTART.

IT_TEXT-IND = SY-TABIX.

APPEND IT_TEXT.

CLEAR IT_TEXT.

ENDLOOP.

L_RETFIELD = 'IND'.

L_DYNPROG = SY-REPID.

L_DYNPNR = SY-DYNNR.

L_DYNPROFIELD = 'P_MATNR'.

L_VALUE_ORG = 'S'.

CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'

EXPORTING

RETFIELD = L_RETFIELD

DYNPPROG = L_DYNPROG

DYNPNR = L_DYNPNR

DYNPROFIELD = L_DYNPROFIELD

VALUE_ORG = 'S'

TABLES

VALUE_TAB = IT_TEXT

RETURN_TAB = L_T_RETURN

EXCEPTIONS

PARAMETER_ERROR = 1

NO_VALUES_FOUND = 2

OTHERS = 3 .

if sy-subrc = 0.

READ TABLE L_T_RETURN INDEX 1 TRANSPORTING FIELDVAL.

MOVE L_T_RETURN-FIELDVAL TO L_IND.

READ TABLE IT_TEXT WITH KEY IND = L_IND.

MOVE IT_TEXT-MATNR TO L_RETFIELD.

endif.

Thanks & Regards

Sreenivasulu P

Read only

Former Member
0 Likes
1,446

Thanks all, but I dont mean tab=table. I mean tab, I need 2 tabs in the F4 pop up. Default is tab 1 for user ID listing, but users can choose tab 2 for distribution list.

Rgds,

ET

Read only

0 Likes
1,446

ET,

Please refer back to my reply regarding Collective search helps.

Hope this helps.

Sudha

Read only

0 Likes
1,446

Hi,

as suggested by Sudha you need to use collective search helps. then only tabs will come.

Regards

vijay

Read only

0 Likes
1,446

Hi,

Thanks all for your feedback. I have follow up question in regards of the collective search help.

Actually, I need Tab 1 for 'User ID' and Tab 2 for 'Distribution List Name'. Both should be returning the 12 char input (either User ID or Distribution List Name). When I create the collective search help, do I always need a common search help parameter for both the elementary search help? At the moment, I have only tested a collective search help with a common parameter for both the elementary search help.

Rgds,

ET

Read only

0 Likes
1,446

Hi ET,

Not sure if I got your question right, in any case, the following example from SAP Help should be able to clarify. Scroll down to see the example for collective search help.

http://help.sap.com/saphelp_47x200/helpdata/en/c9/83eb02be4c11d1950200a0c929b3c3/frameset.htm

Hope this helps.

Sudha